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

Saúl Ibarra Corretgé saul at ag-projects.com
Wed Mar 21 09:43:12 CET 2012


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,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loose_route_gruu.diff
Type: application/octet-stream
Size: 639 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20120321/dcb415e1/attachment-0001.obj>
-------------- next part --------------


--
Saúl Ibarra Corretgé
AG Projects





More information about the Devel mailing list