Re: [asterisk-users] difference between playback and background?
Alternatively, if you don't have that extension defined anywhere, Asterisk will jump to the i extension, where you can then read the actual entered digits from the INVALID_EXTEN variable and jump back to the main part of the dialplan. Note that if they enter digits that *could* match a defined extension, Asterisk won't necessarily jump to the i extension until more digits are entered which may or may not cause no explicitly defined extensions to be matched. Cheers, Kingsley. On Mon, 2011-11-21 at 12:32 -0800, Steve Edwards wrote: > On Mon, 21 Nov 2011, Danny Nicholas wrote: > > > Option 2 > > Use WaitExten with Background > > [getnum] > > Exten => start,1,background(prompt) > > Exten => start,n,waitexten(2) > > Exten => ,1,noop(user pressed ) > > Exten => I,1,playback(invalid) > > > > For option 2 you have to define each valid 4 digit entry in the context. > > Or, (since the OP seems a bit newbish), read up on extension pattern > matching. > -- Cheers, Kingsley. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] difference between playback and background?
On Mon, 21 Nov 2011, Danny Nicholas wrote: Option 2 Use WaitExten with Background [getnum] Exten => start,1,background(prompt) Exten => start,n,waitexten(2) Exten => ,1,noop(user pressed ) Exten => I,1,playback(invalid) For option 2 you have to define each valid 4 digit entry in the context. Or, (since the OP seems a bit newbish), read up on extension pattern matching. -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] difference between playback and background?
First question - playback is not interruptable by DTMF, background is. You have two options here Option 1 Use Read [getnum] Exten => start,1,read(mydigit,prompt,4,skip,1,2) .. verification stuff Option 2 Use WaitExten with Background [getnum] Exten => start,1,background(prompt) Exten => start,n,waitexten(2) Exten => ,1,noop(user pressed ) Exten => I,1,playback(invalid) For option 2 you have to define each valid 4 digit entry in the context. Yes it can be maddening, but you get what you pay for. -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Edward de Jong Sent: Monday, November 21, 2011 11:51 AM To: asterisk-users@lists.digium.com Subject: [asterisk-users] difference between playback and background? In the dial plan language of asterisk, what is the difference between prompting the user with a Playback() command vs. a Background() command? I want in a part of my dial plan to ask the user a prompt, and wait for 4 digits to be typed in. I don't want the user to have to end the string with a pound or something, just wait 2 seconds after they stop typing. ANd I do want the prompt to be interruptible if the user is fast and knows already what to do. I need to do some tests on the number they entered. If i use background(), and say the prompt, and then follow with a WAIT command, how do i reference the number they just typed in? does asterisk set the ${EXTEN} variable when the user types something? What I find maddening about the asterisk documentation is a lack of clarity on the sequence of things, and what variables get set when? -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] difference between playback and background?
It sounds like you may want to use the READ command instead. This lets you hard-set the number of digits to expect and then sets a variable which you can use later in the dialplan. Generally you use the background command to let them dial an extension or automated attendant option. Playback plays without the option to interrupt it. On Mon, Nov 21, 2011 at 10:50 AM, Edward de Jong < edward.dej...@voicecarrier.com> wrote: > In the dial plan language of asterisk, what is the difference between > prompting the user with a Playback() command vs. a Background() command? I > want in a part of my dial plan to ask the user a prompt, and wait for 4 > digits to be typed in. I don't want the user to have to end the string with > a pound or something, just wait 2 seconds after they stop typing. ANd I do > want the prompt to be interruptible if the user is fast and knows already > what to do… > > I need to do some tests on the number they entered. If i use background(), > and say the prompt, and then follow with a WAIT command, how do i reference > the number they just typed in? does asterisk set the ${EXTEN} variable when > the user types something? > > What I find maddening about the asterisk documentation is a lack of > clarity on the sequence of things, and what variables get set when? > > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > -- Carlos Alvarez TelEvolve 602-889-3003 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] difference between playback and background?
In the dial plan language of asterisk, what is the difference between prompting the user with a Playback() command vs. a Background() command? I want in a part of my dial plan to ask the user a prompt, and wait for 4 digits to be typed in. I don't want the user to have to end the string with a pound or something, just wait 2 seconds after they stop typing. ANd I do want the prompt to be interruptible if the user is fast and knows already what to do… I need to do some tests on the number they entered. If i use background(), and say the prompt, and then follow with a WAIT command, how do i reference the number they just typed in? does asterisk set the ${EXTEN} variable when the user types something? What I find maddening about the asterisk documentation is a lack of clarity on the sequence of things, and what variables get set when? -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users