Hello, I have the following simple application... 1. Call is answered, and Dial() function is used with a macro to dial out to a number. 2. 'Called' party answers the phone, and hears a message (this is a function of the macro) At this point I'd like for the 'Called' Party to be able to make a decision and press 1 or 2 to hear some additional information before accepting the call. The problem is that any key pressed causes the call to be bridged. Is this the only behavior, or can someone help me with an example of a script that will allow the 'Called' party to do some things before the call is bridged. I have included my macro code below ************************************************************** [macro-acceptcall] exten => s,1,Answer() exten => s,2,Wait(1) exten => s,3,Background(makechoice) ;make a choice, press 1 or 2 exten => s,4,WaitExten(3) exten => s,5,Goto(s,3) exten => 1,1,Background(youchose1) exten => 2,1,Background(youchose2) *************************************************************** This is what I want to happen, but it just bridges the call immediately without playing the respective messages. Thanks for the help. Thanks! J
Jason Wolfe wrote:> Hello, > > I have the following simple application... > > > 1. Call is answered, and Dial() function is used with a macro to dial > out to a number. > 2. 'Called' party answers the phone, and hears a message (this is a > function of the macro) > > At this point I'd like for the 'Called' Party to be able to make a > decision and press 1 or 2 to hear some additional information before > accepting the call. > > The problem is that any key pressed causes the call to be bridged. > > Is this the only behavior, or can someone help me with an example of a > script that will allow the 'Called' party to do some things before the > call is bridged. > > I have included my macro code below > ************************************************************** > > [macro-acceptcall] > exten => s,1,Answer() > exten => s,2,Wait(1) > exten => s,3,Background(makechoice) ;make a choice, press 1 or 2 > exten => s,4,WaitExten(3) > exten => s,5,Goto(s,3) > > > exten => 1,1,Background(youchose1) > > exten => 2,1,Background(youchose2) > > *************************************************************** > > This is what I want to happen, but it just bridges the call immediately > without playing the respective messages. Thanks for the help. >[macro-acceptcall] exten=>s,1,Answer() exten=>s,2,Wait(1) exten=>s,3,Read(NameOfVarToSaveValueIn,makechoice) exten=>s,4,GotoIf($["${NameOfVarToSaveValueIn}" = "1"?5:6) exten=>s,5,Playback(youchose1) exten=>s,6,Playback(youchose2) I've not played with WaitExten(). Read() command could work though. -- Warm Regards, Lee
Hi Jason, Try to use NoOp, You can use it as printf or echo for the console but set the verbose level to 3 or higher. So that you will be able to check the value of the ${EXTEN}. You can also add GotoIf to add condition statements. [macro-acceptcall] exten => s,1,Answer() exten => s,2,Wait(1) exten => s,3,Background(makechoice) ;make a choice, press 1 or 2 exten => s,4,WaitExten(3) exten => s,5,NoOp(${EXTEN}) exten => s,6,GotoIf($["${EXTEN}" = "1"]?youchose1|1|1:youchose2|1|1) [youchose1] exten => 1,1,Background(youchose1) [youchose2] exten => 1,1,Background(youchose2) Hope that helps. Best Regards, Joanna Liza Mariazeta www.mariazeta.com On 2/15/07, Jason Wolfe <jason@clickforacall.com> wrote:> > Hello, > > I have the following simple application... > > > 1. Call is answered, and Dial() function is used with a macro to dial > out to a number. > 2. 'Called' party answers the phone, and hears a message (this is a > function of the macro) > > At this point I'd like for the 'Called' Party to be able to make a > decision and press 1 or 2 to hear some additional information before > accepting the call. > > The problem is that any key pressed causes the call to be bridged. > > Is this the only behavior, or can someone help me with an example of a > script that will allow the 'Called' party to do some things before the > call is bridged. > > I have included my macro code below > ************************************************************** > > [macro-acceptcall] > exten => s,1,Answer() > exten => s,2,Wait(1) > exten => s,3,Background(makechoice) ;make a choice, press 1 or 2 > exten => s,4,WaitExten(3) > exten => s,5,Goto(s,3) > > > exten => 1,1,Background(youchose1) > > exten => 2,1,Background(youchose2) > > *************************************************************** > > This is what I want to happen, but it just bridges the call immediately > without playing the respective messages. Thanks for the help. > > > Thanks! > > J > > > _______________________________________________ > --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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070214/c778ef6d/attachment.htm