[Asterisk-Users] How to get received digits from console channel
Phuong Nguyen
ducphuong at gmx.de
Tue Dec 20 06:05:30 MST 2005
Hi,
I need to develop a project in which the user can phone a number, say
something and the voice will be output to a speaker, if the user want to
select other actions, he could just press a number on the keypad, e.g.:
press "1".
I did it with the following:
1. make a incoming context, looks like:
[incoming]
exten => s,1,Answer()
exten => s,2,Background(/var/lib/asterisk/tgsounds/greeting)
exten => 1,1,Dial(console/dsp,10,G(loop^s^1))
[loop]
exten => s,1,Background(/var/lib/asterisk/tgsounds/waiting)
exten => s,2,Goto(loop,s,1)
exten => 2,1,Goto (othercontext,s,1)
After the Dial(console/dsp) command, the user speak and his voice is output
to the speaker as desired. However, it seems that the channel (Zap/4) with
the connected telephone line, did not go to the loop context.
Therefore, all the keypad input from the calling phone are just printed out
to the console like "Console received digits 2".
What I actually want to do is that; when the user press "2", I will shutdown
the console (so if the user speak to the phone, his sound will not output to
the speaker) and just go to another context (say: playing a music file). The
input are received by Asterisk as shown above, but I don't know how to get
this digits and redirect the Zap channel to other context (at that moment is
still connected with the console ).
Thanks in advance for any suggestion.
Regards,
Phil
--
10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail
+++ GMX - die erste Adresse für Mail, Message, More +++
More information about the asterisk-users
mailing list