[Asterisk-Users] How to get received digits from console channel

Jonathan k. Creasy jonathan at bluegrass.net
Tue Dec 20 10:34:13 MST 2005


I am going to step out on a limb and guess that you need to hangup the call when the digits are received which would move you on to the next priority where you could then enter your loop. This is an autoattendant I made at some point when I was playing around with how to do it. 

Maybe it will help you get what you want done. 

[funstuff]
Exten => s,1,Answer
Exten => s,2,Playback(you-are-caller-num)
Exten => s,3,SayNumber(9233,c)
Exten => s,4,DigitTimeout,25
Exten => s,5,ResponseTimeout,10
Exten => s,6,Background(press)
Exten => s,7,Background(digits/1)
Exten => s,8,Background(if-maint-contract-or-emergency)
Exten => s,9,Background(infuriate-tech-staff)
Exten => s,10,Background(digits/2)
Exten => s,11,Background(hear-odd-noise)
Exten => s,12,Background(digits/3)
exten => t,1,goto(s,4)
exten => i,1,Hangup

Exten => 2,1,Playback(why-no-answer-mystery)
Exten => 2,2,Playback(lines-complaining-customers)
Exten => 2,3,Playback(for-quality-purposes)
Exten => 2,4,Playback(gambling-drunk)
Exten => 2,5,Goto(s,4)

Exten => 3,1,Playback(you-sound-cute)
Exten => 3,2,Playback(what-are-you-wearing)
Exten => 3,3,Goto(s,4)

Exten => 6,1,Playback(because-paranoid)
Exten => 6,2,Playback(all-your-base)
Exten => 6,3,Playback(hang-on-a-second-angry)
exten => 6,4,Goto(s,4)

Exten => 4,1,Playback(asterisk-friend)
Exten => 4,2,Playback(computer-friend1)
Exten => 4,3,Goto(s,4)

Exten => 5,1,Playback(step-in-stream)
Exten => 5,2,Goto(s,4)

Exten => 1,1,Playback(go-away2)
Exten => 1,2,Goto(s,4)

Exten => 7,1,Playback(i-dont-understand3)
Exten => 7,2,Goto(s,4)

Exten => 8,1,Playback(could-lose-a-few-pounds)
Exten => 8,2,Goto(s,4)

> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-
> bounces at lists.digium.com] On Behalf Of Phuong Nguyen
> Sent: Tuesday, December 20, 2005 8:06 AM
> To: asterisk-users at lists.digium.com
> Subject: [Asterisk-Users] How to get received digits from console channel
> Importance: High
> 
> 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 +++
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list