Alvaro Parres
2007-Jun-25 21:41 UTC
[asterisk-users] Problems with ChanIsAvail always return status 0
Hi list: I'm having the next problem, it appear that the application ChanIsAvail is not working on Asterisk 1.4.5 always return me 0 in AVAILSTATUS. I add my dialplan and the output to the cli. THanks. In the example i'm dialing from extension SIP/112 My DialPlan Secction: [macro-callonlyiffree] exten => s,1,ChanIsAvail(${ARG1}|s) exten => s,n,NoOp(${AVAILCHAN}) exten => s,n,NoOp(${AVAILORIGCHAN}) exten => s,n,NoOp(${AVAILSTATUS}) exten => s,n,GoToIf($[${AVAILSTATUS} < 1]?autoanswer:fail) exten => s,n,NoOp() exten => s,n(autoanswer),Dial(${ARG1}||) exten => s,102(fail),Hangup [pruebas] exten => *99,1,Dial(Local/111 at inpuerta&Local/112 at inpuerta||r) [inpuerta] exten => _1XX,1,Macro(callonlyiffree,SIP/${EXTEN}) The Log: -- Executing [*99 at home:1] Dial("SIP/112-08236be8", "Local/111 at inpuerta&Local/112 at inpuerta||r") in new stack -- Called 111 at inpuerta -- Called 112 at inpuerta -- Executing [111 at inpuerta:1] Macro("Local/111 at inpuerta-b7a9,2", "callonlyiffree|SIP/111") in new stack -- Executing [s at macro-callonlyiffree:1] ChanIsAvail(" Local/111 at inpuerta-b7a9,2", "SIP/111|s") in new stack -- Executing [112 at inpuerta:1] Macro("Local/112 at inpuerta-cfe3,2", "callonlyiffree|SIP/112") in new stack -- Executing [s at macro-callonlyiffree:1] ChanIsAvail(" Local/112 at inpuerta-cfe3,2", "SIP/112|s") in new stack -- Executing [s at macro-callonlyiffree:2] NoOp("Local/111 at inpuerta-b7a9,2", "SIP/111-081f7d18") in new stack -- Executing [s at macro-callonlyiffree:3] NoOp("Local/111 at inpuerta-b7a9,2", "SIP/111") in new stack -- Executing [s at macro-callonlyiffree:4] NoOp("Local/111 at inpuerta-b7a9,2", "0") in new stack -- Executing [s at macro-callonlyiffree:5] GotoIf("Local/111 at inpuerta-b7a9,2", "1?autoanswer:fail") in new stack -- Goto (macro-callonlyiffree,s,7) -- Executing [s at macro-callonlyiffree:7] Dial("Local/111 at inpuerta-b7a9,2", "SIP/111||") in new stack -- Called 111 -- Executing [s at macro-callonlyiffree:2] NoOp("Local/112 at inpuerta-cfe3,2", "SIP/112-0822a4b8") in new stack -- Executing [s at macro-callonlyiffree:3] NoOp("Local/112 at inpuerta-cfe3,2", "SIP/112") in new stack -- Executing [s at macro-callonlyiffree:4] NoOp("Local/112 at inpuerta-cfe3,2", "0") in new stack -- Executing [s at macro-callonlyiffree:5] GotoIf("Local/112 at inpuerta-cfe3,2", "1?autoanswer:fail") in new stack -- Goto (macro-callonlyiffree,s,7) -- Executing [s at macro-callonlyiffree:7] Dial("Local/112 at inpuerta-cfe3,2", "SIP/112||") in new stack -- Called 112 -- SIP/111-08342ec0 is ringing -- Local/111 at inpuerta-b7a9,1 is ringing -- SIP/112-08346e28 is ringing -- Local/112 at inpuerta-cfe3,1 is ringing -- Alvaro I. Parres Peredo Director de IT Grupo Xmarts SA de CV Tel: +52 (33) 35 63 6261 Ext. 112 01 800 087 2260 Cel: +52 (33) 33 68 1087 alvaro.parres at xmarts.com.mx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070625/b4f09413/attachment.htm
Jared Smith
2007-Jun-26 02:00 UTC
[asterisk-users] Problems with ChanIsAvail always return status 0
On 6/25/07, Alvaro Parres <aparres at gmail.com> wrote:> I'm having the next problem, it appear that the application ChanIsAvail > is not working on Asterisk 1.4.5 always return me 0 in AVAILSTATUS. > I add my dialplan and the output to the cli.This isn't really a problem with ChanIsAvail... it's more of a misunderstanding of what's going on. In your case, it appears that your SIP device will accept multiple calls at the same time from Asterisk. So even if your phone is on a call, Asterisk will come along, try to make another call to it, and the phone says "Hey, go ahead! I don't mind!" You've got quite a few options to solve your problem. While none of them are exactly perfect, it's good to have lots of options: o Try using the 's' option to ChanIsAvail(). (You might have to turn on call limits in sip.conf to get this to work correctly. Last time I played with this, it seems that the limitonpeers setting had to be set to yes as well.) o Use the GROUP() dialplan function to assign calls to call groups, and then use the GROUP_COUNT() function to check to see if that phone is already on any calls. o Turn off call waiting on your IP phone, so that it'll only accept one call at a time o Simply get call limits in sip.conf working correctly. (This is probably the hardest to do, unfortunately.) Hopefully, one of those options will help you out. (I've placed them in the order I'd try... but your mileage may vary.) -Jared