[Asterisk-Users] ChanIsAvail() and SIP
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
Re: [Asterisk-Users] ChanIsAvail() and SIP
According to this : http://bugs.digium.com/view.php?id=4506chanisavail 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+SetGroupOn 12/14/05, Scott Maier [EMAIL PROTECTED] wrote: Hi everyone,I have started trying to use ChanIsAvail() to detect when a phone isin 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 thecomments 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 timeof 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 notdefined 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 toAsterisk */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 amtesting 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 listTo UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --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
Re: [Asterisk-Users] ChanIsAvail() and SIP
On Dec 14, 2005, at 1:17 PM, Jose Solares wrote:According to this : http://bugs.digium.com/view.php?id=4506chanisavail 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+ChanIsAvailRegardless, 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. - ScottI 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+SetGroupOn 12/14/05, Scott Maier [EMAIL PROTECTED] wrote: Hi everyone,I have started trying to use ChanIsAvail() to detect when a phone isin 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 thecomments 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 timeof 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 notdefined 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 toAsterisk */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 amtesting 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
Re: [Asterisk-Users] ChanIsAvail() and SIP
I know, but that's what they answered to that bug report. they should atleast state that it's not working with sip, OR how to make it work with sip if perhaps its tricky to use.BTW, you're not using qualify right, i saw the code trying to figure out why it wasnt working, and if qualify is not set for the device it'll return a 0, if it's set then it'll use a pbx builtin to see if the channel is in use, but that's broken for sip as far as i can tell. It should return in use if the sip device is in a call but can take another (if it hasnt met the call-limit), and busy if it has met call-limit. otherwise you'd have to rely on the return code from the phone when dialing, which in my case since turning off call waiting was indeed busy, but that messes up my PRI signalling since i send the busy with a no answer, instead of a termination. For me it never returned 2 or 3, it always returns 1 (Available), if you do file a bug post the url, i'd rather use this app than having to turn off call waiting on the sip phones ( that's what i did before i read about groups ) On 12/14/05, Scott Maier [EMAIL PROTECTED] wrote: On Dec 14, 2005, at 1:17 PM, Jose Solares wrote:According to this : http://bugs.digium.com/view.php?id=4506chanisavail 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 willConsiderthechannelunavailableifthechannelisinuseatall. 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 [EMAIL PROTECTED] 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 thecomments 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 notdefined 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 toAsterisk */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 amtesting 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 listTo UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --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
[Asterisk-Users] ChanIsAvail and SIP
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- .. = 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? ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] ChanIsAvail and SIP
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 ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] ChanIsAvail and SIP
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 ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[Asterisk-Users] ChanIsAvail and SIP
Title: Message 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.