[SR-Users] re-SUBSCRIBE and Record-Route

marius zbihlei marius.zbihlei at 1and1.ro
Fri Mar 4 15:25:56 CET 2011


Hello list,

An UAC sends a resubscribe in the form

SUBSCRIBE sip:Alice at example.com SIP/2.0
Route: <sip:sip.example.com;lr=on>
Route:<sip:sip.next-hop.example.com;lr=on>
....

The request has a to tag, from tag... Basic resubscribe(R-URI is the 
same as original SUBSCRIBE) The proxy that handles it is a Kamailio (1.5 
but this refers to 3.1 as well). The problem is that loose_route() 
treats this request as coming from a strict routing router, not from the 
UAC, so it applies the strict-to-loose rules and rewrites the request as:

SUBSCRIBE sip:sip.next-hop.example.com;lr=on SIP/2.0
Route: <sip:sip.example.com;lr=on>
....

The segment that handles this is pretty standard:

if (loose_route()) {
                 # sequential request withing a dialog should take the path
                 # determined by record-routing
                 if(has_totag()) {
                         forward();
                         exit;
}

It sees that message has Route set, it finds the to tag (so the routes 
were not a preset), and then , the important thing, sees that the domain 
from the RURI matches itself (kamailio has aliases configured for 
example.com), thus considering the request as coming from a strict 
router. Then it takes the bottom Route header and overwrites the RURI.

What is the best way to ensure that loose routing is applied to the 
resubscribe as described above?

Cheers,
Marius



More information about the sr-users mailing list