Hello,
I notice that the function ChanIsAvail always returns result : 0
It does not matter if the realtime SIP peer is registered or not.
How come ??
My dialplan :
exten => s,n,ChanIsAvail(SIP/${SIPPEERNAME})
exten => s,n,NoOp(availstatus = ${AVAILSTATUS})
${SIPPEERNAME} = sip username from realtime Mysql database.
Kind regards,
Jonas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20121004/8127ff49/attachment.htm>
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens
Sent: Thursday, October 04, 2012 9:48 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] AVAILSTATUS always 0
Hello,
I notice that the function ChanIsAvail always returns result : 0
It does not matter if the realtime SIP peer is registered or not.
How come ??
My dialplan :
exten => s,n,ChanIsAvail(SIP/${SIPPEERNAME})
exten => s,n,NoOp(availstatus = ${AVAILSTATUS})
${SIPPEERNAME} = sip username from realtime Mysql database.
Kind regards,
Jonas.
Could be a realtime issue. What do the other 3 variables return?
-= Info about application 'ChanIsAvail' =-
[Synopsis]
Check channel availability
[Description]
This application will check to see if any of the specified channels are
available.
This application sets the following channel variables:
${AVAILCHAN}: The name of the available channel, if one exists
${AVAILORIGCHAN}: The canonical channel name that was used to create the
channel
${AVAILSTATUS}: The device state for the device
${AVAILCAUSECODE}: The cause code returned when requesting the channel
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20121004/1c3f0a0a/attachment.htm>
Jonas Kellens wrote:> Hello,Hola,> I notice that the function ChanIsAvail always returns result : 0 > > It does not matter if the realtime SIP peer is registered or not. > > How come ?? > > My dialplan : > > exten => s,n,ChanIsAvail(SIP/${SIPPEERNAME}) > exten => s,n,NoOp(availstatus = ${AVAILSTATUS})If you use the following: exten => s,n,ChanIsAvail(SIP/${SIPPEERNAME},s) ${AVAILSTATUS} will reflect the status according to the device state core. I have not tested this with the various realtime setups so I can't comment on how accurately it will reflect the state of the world, but I think it will work for you. Here's the list of states in case you need it: 0 = Unknown 1 = Not in use 2 = In use 3 = Busy 4 = Invalid 5 = Unavailable 6 = Ringing 7 = Ringing and in use 8 = On hold Cheers, -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: www.digium.com & www.asterisk.org
Jonas Kellens wrote:> Hello, > > I notice that the function ChanIsAvail always returns result : 0 > > It does not matter if the realtime SIP peer is registered or not. > > How come ?? > > My dialplan : > > exten => s,n,ChanIsAvail(SIP/${SIPPEERNAME}) > exten => s,n,NoOp(availstatus = ${AVAILSTATUS}) > > ${SIPPEERNAME} = sip username from realtime Mysql database.Additionally, Even without the 's' option if ${AVAILCHAN} contains a value it can be dialed, within the eyes of Asterisk. The remote side may choose to decline the call but that can only be determined by actually placing a call. Cheers, -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: www.digium.com & www.asterisk.org