[Asterisk-Users] ChanIsAvail() and SIP

Scott Maier scott at omnigroup.com
Wed Dec 14 12:36:03 MST 2005


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





More information about the asterisk-users mailing list