Hello All,
before I explain my problem, I assure you that I searched all over the forum a solution, but I were not able to find one. More precisely, I found a lot of post and articles about this matter, but no one has been useful for me.
My problem
I am developing an application which, basically, triggers a phone call to a specific number and, once the connection has been established, it send a numeric code using DTMF tones. If this operation would perform by a human being, we could describe it a following:
- Trigger call
- Wait for connection
- Press the keys in order to send the DTMF tones
I did not face any problem with the part of the application which triggers the phone call. The problem comes after this activity, in other word, once the communication channel has been established, the telephone does not send the DTMF tones. Below the application code.
N.B.: In this code, between the phone call and the send of DTMF tones there are 20 seconds. The function which sends the DTMF tones after the establishing of the communication channel, has not yet been implemented.
Code:
import telephone
def chiamata():telephone.dial(u'+393357628583')
import keypress
from key_codes import *
def tono1():keypress.simulate_key(EKey1, EScancode1)
def tono2():keypress.simulate_key(EKey2, EScancode2)
import e32
timer= e32.Ao_timer()
timer.after(5)
chiamata()
timer.after(20)
tono1()
timer.after(10)
tono2()
It is important to stress up that if I use my mobile phyton console with the following code:
Code:
>>> import keypress
>>> from key_codes import *
>>> keypress.simulate_key(EKey5, EScancode5)
It returns
This result means (if I am not wrong) that everything is working fine concerning the keypress simulation.
Can someone help me solving this problem?
Thanks.
Bye.