IVR

Asterisk Users 1 Comment

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

One thought on - IVR

  • 2011/6/28 Ezequiel Lovelle

    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)