I need to make an IVR as follows: 1 an incoming call and run an AGI script to alert the database, everything perfect here. 2 Play a music on hold and executes a loop while searching the database for a change in a field when the field change, cut the music on hold and keep doing things. I can do this? I solved it by doing the following: exten => 4321,n,Answer() exten => 4321,n,AGI(script.agi,${UNIQUEID},WAITING) ;Plays music with duration of 5 seconds exten => 4321,n,Playback(waiting-bucle-audio) exten => 4321,n,AGI(script-test.agi,${UNIQUEID}) ;If script return variable ${state} with text "TRANSFERING" goto "call" exten => 4321,n,GotoIf($["${state}" = "TRANSFERING"]?call) exten => 4321,n,Goto(context,4321,3) exten => 4321,n(call),Dial(SIP/${sip},,20) exten => 4321,n,Hangup() anyone have any idea how I can run a script in a loop until I return what I want and cut the music on hold? any help is welcome -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110628/bb90ffd3/attachment.htm>
Waitexten is preferable to using the AGI method Exten => 4321,n,waitexten(5) - just wait 5 seconds Exten => 4321,n,waitexten(5,m) ? wait with music From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Ezequiel Lovelle Sent: Tuesday, June 28, 2011 2:35 PM To: asterisk-users at lists.digium.com Subject: [asterisk-users] IVR I need to make an IVR as follows: 1 an incoming call and run an AGI script to alert the database, everything perfect here. 2 Play a music on hold and executes a loop while searching the database for a change in a field when the field change, cut the music on hold and keep doing things. I can do this? I solved it by doing the following: exten => 4321,n,Answer() exten => 4321,n,AGI(script.agi,${UNIQUEID},WAITING) ;Plays music with duration of 5 seconds exten => 4321,n,Playback(waiting-bucle-audio) exten => 4321,n,AGI(script-test.agi,${UNIQUEID}) ;If script return variable ${state} with text ?TRANSFERING? goto ?call? exten => 4321,n,GotoIf($["${state}" = "TRANSFERING"]?call) exten => 4321,n,Goto(context,4321,3) exten => 4321,n(call),Dial(SIP/${sip},,20) exten => 4321,n,Hangup() anyone have any idea how I can run a script in a loop until I return what I want and cut the music on hold? any help is welcome -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110628/9adfceb5/attachment.htm>
2011/6/28 Ezequiel Lovelle <elovelle at dialdata.com.ar>> ** > > I need to make an IVR as follows: > > 1 an incoming call and run an AGI script to alert the database, everything > perfect here. > 2 Play a music on hold and executes a loop while searching the database for > a change in a field when the field change, cut the music on hold and keep > doing things. I can do this? > I solved it by doing the following: > > > > exten => 4321,n,Answer() > > exten => 4321,n,AGI(script.agi,${UNIQUEID},WAITING) > > ;Plays music with duration of 5 seconds > > exten => 4321,n,Playback(waiting-bucle-audio) > > exten => 4321,n,AGI(script-test.agi,${UNIQUEID}) > > ;If script return variable ${state} with text ?TRANSFERING? goto ?call? > > exten => 4321,n,GotoIf($["${state}" = "TRANSFERING"]?call) > > exten => 4321,n,Goto(context,4321,3) > > exten => 4321,n(call),Dial(SIP/${sip},,20) > > exten => 4321,n,Hangup() > > > > anyone have any idea how I can run a script in a loop until I return what I > want and cut the music on hold? > > any help is welcome > > > > -- > _____________________________________________________________________ > -- 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 >I would use Ringing exten => 4321,n,Answer() exten => 4321,n,Ringing() exten => 4321,n,AGI(script.agi,${UNIQUEID},WAITING) ;It is still Ringing exten => 4321,n,AGI(script-test.agi,${UNIQUEID}) ;If script return variable ${state} with text ?TRANSFERING? goto ?call? exten => 4321,n,GotoIf($["${state}" = "TRANSFERING"]?call) -- Jose Flores Galicia Tels: 238 1370314 Cel: 238 1057136 Skype: flojose.briefcode MSN: flojose at gmail.com <<FloJoSe at gmail.com>> BriefCode && Code Based Training -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110629/f1072843/attachment.htm>