Hello all. Has anyone had any success using ChanIsAvail with only SIP channels? Is there another, better way to check if an extension is busy without dialing it? Thanks, B. J. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20040109/48ac2c3e/attachment.htm
B. J. Bomar wrote:> Hello all. Has anyone had any success using ChanIsAvail with only SIP > channels? Is there another, better way to check if an extension is busy > without dialing it?Well, SIP devices live their own life and should really handle this signalling themselves. That's why ChanIsAvail does not really work with SIP channels, Asterisk does not control what is happening out there in the wild. The SIP channel is really a compromise from a business PBX point of view, where you want to know what is happening out there, which lines are occupied etc etc. I think that you can use incominglimit and outgoinglimit to limit the number of calls asterisk place to a SIP device and force busy if there's already a call going on. Remember that this limits the number of connections to/from Asterisk, not necessarily the number of calls on the SIP device. /O
Hi!> > Hello all. Has anyone had any success using ChanIsAvail with only SIP > > channels? Is there another, better way to check if an extension is busy > > without dialing it? > > Well, SIP devices live their own life and should really handle this signalling > themselves. That's why ChanIsAvail does not really work with SIP channels, > Asterisk does not control what is happening out there in the wild.With the Manager API you have lots of options - probably "ExtensionState" could be one way for you to get closer to a solution. An easier solution might be to employ AGI and use "CHANNEL STATUS [<channelname>]", provided this works with SIP and not only Zap (I just don't know). But first you'd need to find out about the channel name though since SIP channels have this random numbering: A "show channels" or "sip show inuse" at the CLI can provide that, and you can issue those commands also remotely from any script using "asterisk -rx <command>" and parse the result. You could also use "database show SIP/Registry" on the CLI to see who is registered and who is not before attempting to place a call. I probably missed a million other ways (that could include your own little SIP protocol query sent to the desired destination, for example). Just keep in mind that the SIP client can be busy even though for Asterisk it is not. Cheers, Philipp
All, I was reading over the chanisavail command in the wiki and was wondering a couple things. First and foremost, what does this command do to determine if SIP is available? All I could tell from a debug is that it simply checks to see if the peer's port is open and doesn't run any callflows. Is this true? Second, I understand that running Cut on SIP may be a little difficult. Because the final destination becomes SIP/peer-XXXX .. XXXX = random characters, because they can be letters and numbers applying a range in Cut wouldn't be possible. Any suggestions on how to get by this? Is there any other var manipulation command?