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.
On Tue, 15 Mar 2011 14:54:53 +0100, Gilles <codecomplete at free.fr> wrote:> 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:It looks like neither Playback() nor Background() check for hangup and will simply play the file all the way to the end, so I simply replaced the long MoH with a short beep: =========exten => 8888,1,Wait(2) exten => 8888,n,Answer() ;exten => 8888,n,Playback(/var/tmp/manolo_camp-morning_coffee) ;exten => 8888,n,Read(key,/var/tmp/manolo_camp-morning_coffee,1,,10,2) ;exten => 8888,n,Background(/var/tmp/manolo_camp-morning_coffee) exten => 8888,n,Background(beep) exten => 8888,n,WaitExten(10) exten => 8888,n,Hangup ========= HTH,
On 11-03-15 09:54 AM, Gilles wrote:> 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? >Is this an analog line? If so, is your CO providing a disconnect tone? -- Paul Belanger Digium, Inc. | Software Developer twitter: pabelanger | IRC: pabelanger (Freenode) Check us out at: http://digium.com & http://asterisk.org
Hi There, i have the same problem but it doesnt always happen tho from the same caller. im using Asterisk 1.4 - maybe newer version updates have had bug fixes. maybe this could rectify it. Regards, On Tue, 2011-03-15 at 14:54 +0100, Gilles wrote:> 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. > > > -- > _____________________________________________________________________ > -- 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
On Tue, 15 Mar 2011 14:54:53 +0100, Gilles <codecomplete at free.fr> wrote:> 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:For those trying to do the same thing: Zaptel/Dahdi does detect that the remote party has hung up when using "busydetect=yes" in zapata.conf/chan_dahdi.conf.
Apparently Analagous Threads
- [1.6.2.5] Asterisk can't find MOH file
- application call to Gosub affects flow of control, and needs to be re-written using AEL
- moh reload not reloading/reading new musiconhold files
- moh reload not reloading/reading new musiconhold files
- moh reload not reloading/reading new musiconhold files