[OpenSIPS-Devel] Fixing loose_route to work with GRUU in multi-proxy environments

Vlad Paiu vladpaiu at opensips.org
Wed Mar 21 12:04:43 CET 2012


Hi Saúl,

I do not think that this has any implications for strict routers, as if 
the previous hop was a strict router, the R-URI would not contain a ;gr 
parameter, as the current proxy would not have added the Record-Route 
header with a ;gr param, so I don't see any way that a prev. hop strict 
router can get treated as a loose router with the new patch.

About the other idea, with the adding of a new parameter to the rr 
module to disable strict routing support, I don't really see it as more 
generic, and frankly I cannot even see how it would work. Because what 
you want to accomplish here is to properly route requests that have in 
the R-URI a GRUU within your domain. So what would you do, always set 
that RR parameter ? Because at startup you can't know if you will 
generate any GRUUs or not.

Regards,

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com


On 03/21/2012 10:43 AM, Saúl Ibarra Corretgé wrote:
> Hi,
>
> On Mar 20, 2012, at 1:20 PM, Saúl Ibarra Corretgé wrote:
>
>> Hi,
>>
>> I've been testing and analyzing the GRUU implementation and I think we need to fix the loose_route function to properly accommodate GRUU support. Lets take the following simple case (proxy does record routing):
>>
>> - Alice calls Bob (both users of the same domain, same proxy)
>> - Bob replies with 200 OK and his public GRUU in the Contact header: "sip:bob at example.com;gr=foobar"
>> - Alice send a re-INVITE to put the call on hold
>>
>> At this point, Alice sent a SIP request with Bob's GRUU as the RURI and the Proxy IP in a Route header. Since it's a re-INVITE we'd call loose_route. However, loose_route will think that the previous hop was a strict router, because it will see it's own domain in the RURI and the route set is not preloaded because this is an in-dialog request.
>>
>> This can be fixed with the following configuration trick:
>>
>>     - Check if the RURI of an in-dialog request contains the ;gr parameter.
>>     - If it does, lookup the location
>>     - Do loose_route
>>
>> Now lets take another case: Alice and Bob are still on the same domain different proxies (Alice is at P1 and Bob at P2), and both proxies do record routing.
>>
>> - Alice calls Bob
>> - Bob replies with 200 OK and his public GRUU in the Contact header: "sip:bob at example.com;gr=foobar"
>> - Alice send a re-INVITE to put the call on hold
>>
>> When alice sends the re-INVITE, it will contain Bob's GRUU as the RURI and 2 Route headers, one pointing to P1 and another one pointing to P2. If P1 calls loose_route it will act as the previous hop was a strict router, but it wasn't, what needs to happen is that the request arrives at P2 with the RURI untouched and then P2 can lookup the location and route the request to Bob.
>>
>> The simple case can be solved with configuration, but the advanced one can't, so I propose that the loose_route function adds an extra check: if is_myself return true, check if the URI has the gr parameter. In such case, don't assume the previous hop was a strict router, but a loose router.
>>
>>
> After testing what I explained above the (minor) fix I propose seems to do the job, please find it attached. I _think_ it doesn't have any implications if strict routers are in the path, but I can't be 100% sure since I can't test that.
>
> Please have a look at the GRUU issues I mailed recently when time allows :-)
>
>
> Regards,
>
>
>
>
> --
> Saúl Ibarra Corretgé
> AG Projects
>
>
>
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20120321/65197528/attachment.htm>


More information about the Devel mailing list