Gavin Hamill
2007-Jan-24 02:11 UTC
[asterisk-users] ChanIsAvail kills dialplan processing when no Zap available on 1.2.14.
Hi, I'm trying to use ChanIsAvail to build a resilient 'dialout' macro. The logic is simple; try Zap/g1 (a group of two E1s), and if that fails, try locating a channel via DUNDi. Here's a massively cut down version to illustrate the problem I'm having. macro dialout ( dest ) { ChanIsAvail(Zap/g1); noop(Value of AVAILCHAN is ${AVAILCHAN}); Dial(Zap/G1/${dest}||H); }; Here's what happens when only the second bearer is connected: -- Executing Macro("SIP/1210-082a9768", "dialout|0800789456") in new stack -- Executing Set("SIP/1210-082a9768", "dest=0800789456") in new stack -- Executing ChanIsAvail("SIP/1210-082a9768", "Zap/g1") in new stack -- Hungup 'Zap/32-1' -- Executing NoOp("SIP/1210-082a9768", "Value of AVAILCHAN is Zap/32-1") in new stack -- Executing Dial("SIP/1210-082a9768", "Zap/G1/0800789456||H") in new stack -- Requested transfer capability: 0x00 - SPEECH -- Called G1/0800789456 -- Zap/62-1 is making progress passing it to SIP/1210-082a9768 -- Zap/62-1 answered SIP/1210-082a9768 -- Hungup 'Zap/62-1' == Spawn extension (macro-dialout, s, 4) exited non-zero on 'SIP/1210-082a9768' in macro 'dialout' == Spawn extension (macro-dialout, s, 4) exited non-zero on 'SIP/1210-082a9768' i.e. perfect - it picks the first available channel on the second bearer - Zap/32. If only the first bearer is connected, it picks Zap/1 as I'd expect. The killer is if /neither/ bearer is connected, I get this: -- Executing Macro("SIP/1210-08299328", "dialout|0800789456") in new stack -- Executing Set("SIP/1210-08299328", "dest=0800789456") in new stack -- Executing ChanIsAvail("SIP/1210-08299328", "Zap/g1") in new stack == Spawn extension (macro-dialout, s, 3) exited non-zero on 'SIP/1210-08299328' in macro 'dialout' == Spawn extension (macro-dialout, s, 3) exited non-zero on 'SIP/1210-08299328' Processing does not continue to the NoOp or Dial - what am I doing wrong? I've also tried with the 'j' option to 'jump to priority n+101' even though I'm using AEL, but it's made no difference. Cheers, Gavin.
Gavin Hamill
2007-Jan-24 09:19 UTC
[asterisk-users] ChanIsAvail kills dialplan processing when no Zap available on 1.2.14.
On Wed, 24 Jan 2007 09:11:20 +0000 Gavin Hamill <gdh@laterooms.com> wrote:> Processing does not continue to the NoOp or Dial - what am I doing > wrong? I've also tried with the 'j' option to 'jump to priority n+101' > even though I'm using AEL, but it's made no difference.For the benefit of the archive.... I got this working by using a 'catch h {...}' block at the bottom of the macro rather than switch'ing on the variables set by ChanIsAvail(). Cheers, Gavin.