Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
$route.underlimit method - specify response
Author Message
vinylmike
Brekeke Addict


Joined: 13 Dec 2012
Posts: 29
Location: Guilford, CT

PostPosted: Fri Jan 03, 2014 2:07 pm    Post subject: $route.underlimit method - specify response Reply with quote

1. Brekeke Product Name and Version:
3.2.4.3 Advanced

2. Java version:
1.6.0_45-b06

3. OS type and the version:
RHEL 5

4. UA (phone), gateway or other hardware/software involved:


5. Your problem:
Using the $route.underlimit method, when the limit is reached I see a "404 Not Found" is sent back to the UA. Is there a way to configure what failure response is sent back, i.e. like 503 Service Unavailable?

Matching Patterns
$request = ^INVITE
To = sip:(\+)(1203)(.+)
$route.underlimit( "%2", "2" ) = true
Deploy Patterns
$routename = %2
$continue = true

Thanks,
Mike
Back to top
View user's profile
james
Brekeke Master Guru


Joined: 10 Dec 2007
Posts: 494

PostPosted: Sun Jan 05, 2014 2:02 am    Post subject: Reply with quote


Matching Patterns
$request = ^INVITE
To = sip:(\+)(1203).+
$route.underlimit( "%2", "2" ) = false
Deploy Patterns
$response = 503
Back to top
View user's profile
vinylmike
Brekeke Addict


Joined: 13 Dec 2012
Posts: 29
Location: Guilford, CT

PostPosted: Tue Jan 07, 2014 12:49 pm    Post subject: Reply with quote

James,

Thanks, but when I use that plan false is never returned as a value, regardless of how many concurrent calls I make through the server, e.g. with 4 concurrent sessions the following is still returned:

Pattern: $route.underlimit( "%2", "2" ) = false
Input: $route.underlimit( "1203", "2" ) = true
Result: false

Thanks,
Mike
Back to top
View user's profile
hope
Brekeke Master Guru


Joined: 15 Jan 2008
Posts: 862

PostPosted: Tue Jan 07, 2014 1:15 pm    Post subject: Reply with quote

is the call applied rule with route.underlimit?
put reject rule under the rule with underlimit is true
Back to top
View user's profile
vinylmike
Brekeke Addict


Joined: 13 Dec 2012
Posts: 29
Location: Guilford, CT

PostPosted: Thu Jan 09, 2014 12:46 pm    Post subject: Reply with quote

Hope/James,

Thanks for the help. I was able to accomplish this using two dial plan entries:

1st

Matching Patterns
$request = ^INVITE
$addr = ^172\.16\.2\.
To = sip:(\+)(1203)(.+)
$route.underlimit( "outbound", "2" ) = true
Deploy Patterns
$routename = outbound
$continue = true

2nd

Matching Patterns
$request = ^INVITE
$addr = ^172\.16\.2\.
To = sip:(\+)(1203)(.+)
$if($route.underlimit( "outbound", "2" ), "true", "false") = false
Deploy Patterns
$routename = outbound
$action = 503

This works as expected, however if you can think of another way to do it, or by combining the two entries into one, I'm all ears.

Regards,
Mike
Back to top
View user's profile
janP
Brekeke Master Guru


Joined: 25 Nov 2007
Posts: 336

PostPosted: Thu Jan 09, 2014 12:58 pm    Post subject: Reply with quote

Changed a little.


Rule-1:
Matching Patterns
$request = ^INVITE
$addr = ^172\.16\.2\.
To = sip:\+1203.+
$route.underlimit("outbound","2") = false
Deploy Patterns
$response = 503


Rule-2:
Matching Patterns
$request = ^INVITE
$addr = ^172\.16\.2\.
To = sip:\+1203.+
Deploy Patterns
$routename = outbound
$continue = true
Back to top
View user's profile
vinylmike
Brekeke Addict


Joined: 13 Dec 2012
Posts: 29
Location: Guilford, CT

PostPosted: Mon Jan 13, 2014 8:55 am    Post subject: Reply with quote

Thanks JanP.

One more question -

When the concurrent call limit is reached and dial plan rule returns the 503 I don't see any evidence of that in the Brekeke server logs. I can can only see the SIP response when using a sniffer (wireshark / tcpdump). Is there a way to expose this so it's logged for later reviewing?

I noticed the same issue exists when also using the $sps method.

Thanks,
Mike
Back to top
View user's profile
hope
Brekeke Master Guru


Joined: 15 Jan 2008
Posts: 862

PostPosted: Mon Jan 13, 2014 11:52 am    Post subject: Reply with quote

is it in error log page?
Back to top
View user's profile
vinylmike
Brekeke Addict


Joined: 13 Dec 2012
Posts: 29
Location: Guilford, CT

PostPosted: Mon Jan 13, 2014 12:32 pm    Post subject: Reply with quote

Ahh, indeed it is Very Happy, on our >3.2.2.3 version hosts. That'll work, thanks!
Back to top
View user's profile
davi
Brekeke Addict


Joined: 26 Jan 2011
Posts: 34

PostPosted: Mon Jan 13, 2014 10:10 pm    Post subject: Reply with quote

If you use $log in Deploy Pattern, you can write own log message in sv.xxx.log file.

Find "$log" in the http://www.brekeke.com/doc/sip/sip_admin_v3.pdf

For example...
Deploy Patterns
$response = 503
$log = WARNING! Call limit is reached!! Return 503 to %{$addr}.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1