[SR-Users] Selective rport behaviour

Alex Balashov abalashov at evaristesys.com
Thu Sep 22 15:58:33 CEST 2016


Hi,

In some scenarios, it happens that a request is received with the 
following characteristics:

IP xxx.xxx.xxx.xxx:14000 -> server:5060
   Via: SIP/2.0/xxx.xxx.xxx.xxx:5060;branch=9hG4bKblah;rport

Normally, we just force_rport() on all incoming requests so that we 
reply to the real source port of the request, since most endpoints on 
this installation are NAT'd.

However, occasionally we run into a scenario where an ALG or 
misconfigured client incorrectly inserts an rport attribute into its 
topmost Via, and really expects to receive a response at the 
address/port indicated in the Via (i.e. 5060).

Does Kamailio offer a means of dealing with these on a selective basis? 
Would refraining from calling force_rport() be enough? Or would it be 
necessary to set reply_to_via=1 as well, thus breaking symmetrical 
behaviour for the vast majority of the NAT'd endpoints?

In other words, I'm not 100% clear on the following:

1) What impact does force_rport() have if an 'rport' attribute is sent 
by the client?

In this case, there should be nothing to "force"; I assume that if the 
'rport' attribute is placed by the client, then the proxy will return 
replies to the source port of the request even if force_rport() is not 
called, because that's the RFC 3581-compatible thing to do. Right?

2) Does reply_to_via=1 override the behaviour hypothesised in #1?

3) Does reply_to_via=1 override force_rport()?

Thanks!

-- Alex

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 (direct) / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list