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.
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@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
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20051214/1bb7a891/attachment.htm