According to this : <a href="http://bugs.digium.com/view.php?id=4506">http://bugs.digium.com/view.php?id=4506</a><br><br>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.
<br><br>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.
<br><br>You should consider using groups, <a href="http://www.voip-info.org/wiki-Asterisk+cmd+SetGroup">http://www.voip-info.org/wiki-Asterisk+cmd+SetGroup</a><br><br><br><div><span class="gmail_quote">On 12/14/05, <b class="gmail_sendername">
Scott Maier</b> <<a href="mailto:scott@omnigroup.com">scott@omnigroup.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi everyone,<br><br><br>I have started trying to use ChanIsAvail() to detect when a phone is<br>in use (on any call) and my results are disappointing.<br><br>Here are some examples out output to the console followed by the
<br>meaning of the return status code based on what I have found in the<br>comments on this page: <<a href="http://www.voip-info.org/wiki/index.php">http://www.voip-info.org/wiki/index.php</a>?<br>page=Asterisk+cmd+ChanIsAvail>
<br><br><br>Test using a real extension (224) that I know is in use at the time<br>of the test. Calling from 227:<br><br>-- Executing Playback("SIP/227-c825", "silence/1") in new stack<br>-- Playing 'silence/1' (language 'en')
<br>-- Executing ChanIsAvail("SIP/227-c825", "SIP/224|sj") in new stack<br>-- Executing NoOp("SIP/227-c825", "SIP/224-08ce|SIP/224|0") in new stack<br>-- Executing Dial("SIP/227-c825", "SIP/224|10") in new stack
<br>-- Called 224<br>-- SIP/224-4fc4 is ringing<br><br>/* 0 AST_DEVICE_UNKNOWN */ "Unknown", /* Valid, but unknown state */<br><br><br>Test using a fake extension (333) that doesn't exist and is not<br>defined anywhere. Calling from 227:
<br><br>-- Executing Playback("SIP/227-e4d2", "sales") in new stack<br>-- Playing 'sales' (language 'en')<br>-- Executing ChanIsAvail("SIP/227-e4d2", "SIP/333|sj") in new stack<br>-- Executing NoOp("SIP/227-e4d2", "||4") in new stack
<br>-- Executing Hangup("SIP/227-e4d2", "") in new stack<br><br>/* 4 AST_DEVICE_INVALID */ "Invalid", /* Invalid - not known to<br>Asterisk */<br><br><br>Test using a real extension (206) that is defined, but not
<br>registered. Calling from 227:<br><br>-- Executing Playback("SIP/227-8a76", "sales") in new stack<br>-- Playing 'sales' (language 'en')<br>-- Executing ChanIsAvail("SIP/227-8a76", "SIP/206|sj") in new stack
<br>-- Executing NoOp("SIP/227-8a76", "||5") in new stack<br>-- Executing Hangup("SIP/227-8a76", "") in new stack<br><br>/* 5 AST_DEVICE_UNAVAILABLE */ "Unavailable", /* Unavailable (not
<br>registred) */<br><br><br>This all seems to be fine, except for the 1st example where I am<br>testing a known, registered, in use Polycom 501.<br><br>Does anyone have any idea why Asterisk is returning 0 for that test?
<br>Is anyone else using ChanIsAvail() successfully?<br><br>This is with Asterisk 1.2.0.<br><br><br> - Scott<br><br><br>_______________________________________________<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">
Easynews.com</a> --<br><br>Asterisk-Users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users
</a><br></blockquote></div><br>