[Asterisk-Users] ChanIsAvail() and SIP

Scott Maier scott at omnigroup.com
Wed Dec 14 18:21:25 MST 2005


On Dec 14, 2005, at 1:17 PM, Jose Solares wrote:

> According to this : http://bugs.digium.com/view.php?id=4506
>
> chanisavail is not intended to detect if a phone is in use or not  
> at all, it's only intended to check if asterisk could send the call  
> there.

Well, that would go against all of the documentation that I have seen  
which indicates that passing 's' as an option will "Consider the  
channel unavailable if the channel is in use at all".

<http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+ChanIsAvail>

Regardless, that still does not explain why the return code is 0 - I  
would expect 2 (in use) or 3 (busy) if the channel had an active call.

I think I will file a bug to try and get some clarification.

Thanks for the alternate suggestion, I will look in to that.

  - Scott


> I tried using call-limit and chanisavail, but it's broken in SIP.  
> inuse gets applied only to peers, and when it gets an incomming  
> call that is not answered it gets decremented and doesnt stay the  
> same, which is a bug.
>
> You should consider using groups, http://www.voip-info.org/wiki- 
> Asterisk+cmd+SetGroup
>
>
> On 12/14/05, Scott Maier <scott at omnigroup.com> wrote:
>
> Hi everyone,
>
>
> I have started trying to use ChanIsAvail() to detect when a phone is
> in use (on any call) and my results are disappointing.
>
> Here are some examples out output to the console followed by the
> meaning of the return status code based on what I have found in the
> comments on this page: <http://www.voip-info.org/wiki/index.php?
> page=Asterisk+cmd+ChanIsAvail>
>
>
> Test using a real extension (224) that I know is in use at the time
> of the test.  Calling from 227:
>
> -- Executing Playback("SIP/227-c825", "silence/1") in new stack
> -- Playing 'silence/1' (language 'en') 
> -- Executing ChanIsAvail("SIP/227-c825", "SIP/224|sj") in new stack
> -- Executing NoOp("SIP/227-c825", "SIP/224-08ce|SIP/224|0") in new  
> stack
> -- Executing Dial("SIP/227-c825", "SIP/224|10") in new stack 
> -- Called 224
> -- SIP/224-4fc4 is ringing
>
> /* 0 AST_DEVICE_UNKNOWN */ "Unknown", /* Valid, but unknown state */
>
>
> Test using a fake extension (333) that doesn't exist and is not
> defined anywhere.  Calling from 227:
>
> -- Executing Playback("SIP/227-e4d2", "sales") in new stack
> -- Playing 'sales' (language 'en')
> -- Executing ChanIsAvail("SIP/227-e4d2", "SIP/333|sj") in new stack
> -- Executing NoOp("SIP/227-e4d2", "||4") in new stack 
> -- Executing Hangup("SIP/227-e4d2", "") in new stack
>
> /* 4 AST_DEVICE_INVALID */ "Invalid", /* Invalid - not known to
> Asterisk */
>
>
> Test using a real extension (206) that is defined, but not
> registered.  Calling from 227:
>
> -- Executing Playback("SIP/227-8a76", "sales") in new stack
> -- Playing 'sales' (language 'en')
> -- Executing ChanIsAvail("SIP/227-8a76", "SIP/206|sj") in new stack 
> -- Executing NoOp("SIP/227-8a76", "||5") in new stack
> -- Executing Hangup("SIP/227-8a76", "") in new stack
>
> /* 5 AST_DEVICE_UNAVAILABLE */ "Unavailable", /* Unavailable (not
> registred) */
>
>
> This all seems to be fine, except for the 1st example where I am
> testing a known, registered, in use Polycom 501.
>
> Does anyone have any idea why Asterisk is returning 0 for that test?
> Is anyone else using ChanIsAvail() successfully?
>
> This is with Asterisk 1.2.0.
>
>
>   - Scott

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051214/479909ce/attachment.htm


More information about the asterisk-users mailing list