[asterisk-users] [1.4] Forcing Asterisk/Zaptel to wait until callee answers?

Gilles codecomplete at free.fr
Thu Mar 3 08:13:42 CST 2011


Hello

	I need to write a script that will dial a list of customers and play
a message.

I couldn't find a way to tell Asterisk/Zaptel to wait until the callee
has actually picked up the phone before proceeding with Playback():

============
;call made through Dial(): Doesn't proceed after off-hook/hangup
[internal]
exten => 8888,1,Dial(Zap/1/${IPPI})
exten => 8888,n,NoOp(We never get there)
exten => 8888,n,Hangup

============

;call made through callfile: Doesn't wait for off-hook
[callbacktest]
exten => start,1,NoOp(DialStatus is ${DIALSTATUS})
exten => start,n,NoOp(${CHANNEL(state)})
exten => start,n,Playback(tt-monkeysintro)
exten => start,n,Wait(2)
exten => start,n,Hangup

============

;tried this to force callfile to wait until off-hook
[callbacktest]
exten => start,1,Set(INDEX=0)

;Down, Rsrvd, OffHook, Dialing, Ring, Ringing, Up, Busy, Dialing
;Offhook, Pre-ring, Unknown

;Tried "Up", "OffHook", and "Rsrvd", to no avail
exten => start,n,While($["${CHANNEL(state)}" != "Up" & ${INDEX} < 10])

exten => start,n,NoOp(Channel still ringing: ${CHANNEL(state)})
exten => start,n,Wait(1)
exten => start,n,Set(INDEX=$[${INDEX} + 1])

exten => start,n,EndWhile()
============

If there are people who use an FXO to make outgoing calls to perform
this type of task, how do you get Asterisk/Zaptel to wait until the
remote phone is off-hook?

Thank you.




More information about the asterisk-users mailing list