[asterisk-users] [1.4] Asterisk doesn't hang up?

Gilles codecomplete at free.fr
Tue Mar 15 08:54:53 CDT 2011


Hello

	I'm trying to use ChanIsAvail() to check when the landline is back
to idle after a call, but for some reason, Asterisk doesn't detect
that the callee has hung up after listening to MoH for a few seconds:

========== extensions.conf
;Play MoH for a few seconds, hang up, and
;check ChanIsAvail() able to detect when line idle again
exten => 8888,1,Answer()
exten => 8888,n,Playback(/var/tmp/manolo_camp-morning_coffee)
exten => 8888,n,Hangup

========== CLI
;keep line engaged for a few seconds, and hang up from remote end

originate Zap/1/5551234 extension 8888 at internal

========== extensions.conf
;call from XLite to check line status

;Loop until Zap/1 is available
exten => 1111,1,Set(INDEX=0)
exten => 1111,n,While(1)
exten => 1111,n,ChanIsAvail(Zap/1)
exten => 1111,n,GotoIf($["${AVAILORIGCHAN}" != "" | ${INDEX} >
10]?exit)
exten => 1111,n,Wait(5)
exten => 1111,n,Set(INDEX=$[${INDEX} + 1])
exten => 1111,n,EndWhile()

;how did we exit loop?
exten => 1111,n(exit),GotoIf($["${AVAILORIGCHAN}" = ""]?na:ok)
exten => 1111,n(na),NoOp(Channel still N.A.)
exten => 1111,n,Goto(end)
exten => 1111,n(ok),NoOp(Channel OK)
exten => 1111,n(end),Hangup
========== 

Even after callee at 5551234 hangs up, Asterisk keeps looping in
extension 1111, and only runs 8888's Hangup after 1111 runs Hangup.

I also tried calling out through a callfile, same result.

Is there another instruction I should use in 8888 to have
Asterisk/Zaptel close the channel after the remote end has hung up?

Thank you.




More information about the asterisk-users mailing list