[SR-Users] REGISTER request and save() from onreply_route

Alex Balashov abalashov at evaristesys.com
Mon Jan 19 19:02:29 CET 2015


On 01/19/2015 12:56 PM, Dmitry Sytchev wrote:

> Is there a way to make save() use original request fields like
> T_req($ct), or some way to call save() with full set of custom params?

Yes; in fact, there are many standards-based reasons why it's desirable 
to store the original Contact binding provided by the registrant. Many 
devices (e.g. ATAs, various gateways, for instance) will not accept an 
INVITE with an incoming Request URI that does not correspond to the 
exact Contact URI that it sent in the REGISTER request.

This is why Kamailio's usrloc record provides a 'received' field in 
addition to a 'contact' field. Take a look at this:

http://kamailio.org/docs/modules/4.2.x/modules/registrar.html#registrar.p.received_param

In essence, what you want is for the external IP:port to be stored in 
the 'received' value while the original Contact is stored in the 
'contact' value. The 'received' value will be used as the destination 
set ($du) for inbound routing, while the Request URI will remain 
consistent with the Contact URI.

The issue of having two proxies is a separate and more complex one. 
Ultimately, to make it work, you're going to need to use Path, which is 
like Record-Route, but for REGISTERs:

http://kamailio.org/docs/modules/4.2.x/modules/registrar.html#registrar.p.path_mode

But, the first step to solving your problem is to realise that you 
should not actually be rewriting the Contact header as your NAT 
traversal strategy. You should add the received IP:port as parameters in 
one way or another to be passed onto the receiving registrar, as for 
example using Contact URI header parameters per the received_param doc I 
linked to above.

-- Alex

-- 
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States

Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/



More information about the sr-users mailing list