Chris Kairalla
2009-Aug-28 17:35 UTC
[asterisk-users] Help needed with getting a maxed-out Asterisk to gracefully deny calls.
Hello Asterisk List, My company is running a bunch of Asterisk servers behind a Kamailio (openSER) SIP proxy gateway. Calls come in from our PTSN to VOIP service to Kamailio, which then randomly chooses an Asterisk server to handle the call. All Asterisk servers are 1.6.0.9, but the issue I'm about to describe exists in 1.6.1.5-rc1 as well. Ultimately what I want to do is cap each Asterisk server at a maximum number of simultaneous calls. If the maximum number is hit, I want the call to get sent back to Kamailio which would then randomly send the call to another Asterisk server. The easiest way to accomplish this seems to be in the asterisk.conf file. In asterisk.conf is this line: maxcalls=100 ; Maximum amount of calls allowed This is great, and asterisk will deny calls once it hits this max number. OK, here's where I get stuck. Once that max is reached, Asterisk will send a "480 Temporarily Unavailable", which is great, and a "BYE" which is not great, as that gets passed along to the PTSN and hangs up the call. Kamailio properly sends the call to another Asterisk server, but the call no longer exists because of the BYE and the call eventually times out on the new Asterisk server. Is this BYE a bug in the way Asterisk handles SIP, or is this normal SIP behavior and I should find another way to gracefully deny the call back to Kamailio? Thanks list, Chris
Kevin P. Fleming
2009-Aug-28 18:58 UTC
[asterisk-users] Help needed with getting a maxed-out Asterisk to gracefully deny calls.
Chris Kairalla wrote:> This is great, and asterisk will deny calls once it hits this max > number. OK, here's where I get stuck. Once that max is reached, > Asterisk will send a "480 Temporarily Unavailable", which is great, > and a "BYE" which is not great, as that gets passed along to the PTSN > and hangs up the call. Kamailio properly sends the call to another > Asterisk server, but the call no longer exists because of the BYE and > the call eventually times out on the new Asterisk server. > > Is this BYE a bug in the way Asterisk handles SIP, or is this normal > SIP behavior and I should find another way to gracefully deny the call > back to Kamailio?That sounds like a bug; the 480 is a final response, Asterisk should not be sending any other responses for that call. -- Kevin P. Fleming Digium, Inc. | Director of Software Technologies 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA skype: kpfleming | jabber: kpfleming at digium.com Check us out at www.digium.com & www.asterisk.org