[OpenSIPS-Users] loose_route()

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Nov 10 11:13:39 CET 2010


Hi Victor,

That is strict routing - in SIP you have 2 types of routing - Strict 
Routing (old one) and Loose Routing (new one).

Previous described is Loose Route. What you have here is Strict Routing 
and it is a different algorithm.

In Strict Routing, RURI points to the next hop and all the hops 
(including the end point) are added as Route. Each hop (when finding 
itself in RURI) takes the next Route and moves it in RURI (that is 
standard Strict to Strict Routing- previous and next hop are both strict 
routers)

But in your case, the previous hop is strict route (this is why you have 
opensips IP in RURI) and next hop (next Route) is a Loose Route (see the 
lr param). So OpenSIPS is doing a Strict to  Loose Routing conversion..

Lost you? :D

Regards,
Bogdan

Victor Gamov wrote:
> Thanks Bogdan!
>
> Now I have one more rr-question.
>
> ACK request received by opensips listen on X.X.X.X at port 5060
>
> ACK sip:74951000000 at X.X.X.X:5060 SIP/2.0.
> Max-Forwards: 10.
> Record-Route: <sip:Y.Y.Y.Y;lr=on;ftag=2204003977>
> Via: SIP/2.0/UDP Y.Y.Y.Y;branch=z9hG4bK9a79.79e07dd4.2
> Via: SIP/2.0/UDP 
> Z.Z.Z.Z:50072;rport=50072;branch=z9hG4bKc740505a77ff27fd47aeaded4f9c9287e3e68c732824a333ac632064bb1cc6d7 
>
> Call-id: 3749305934 at 192_168_100_114
> Cseq: 1 ACK
> From: <sip:22222 at domain-1.su>;tag=2204003977
> To: <sip:74951000000 at domain-2.ru>;tag=bd829e82ae5c473bdc4d5e71154c80a7
> Route: <sip:X.X.X.X;lr=on;ftag=2204003977>
> Route: <sip:X.X.X.X:50080;lr=on>
> Content-length: 0
>
> loose_route() called and return true.
> I expect then topmost Route-header
> Route: <sip:194.149.90.8;lr=on;ftag=2204003977>
>
> will be removed, then next (last) Route header will be inspected and 
> packet will be forwarded to X.X.X.X port 50080.
>
> But R-URI rewrited to
> sip:X.X.X.X:50080;lr=on
>
> and request forwarded to X.X.X.X port 5060
>
> log says:
>
> DBG:core:parse_headers: flags=200
> DBG:rr:is_preloaded: is_preloaded: No
> DBG:core:grep_sock_info: checking if host==us: 12==12 &&  [X.X.X.X] == 
> [X.X.X.X]
> DBG:core:grep_sock_info: checking if port 5060 matches port 50080
> DBG:core:grep_sock_info: checking if host==us: 12==12 &&  [X.X.X.X] == 
> [X.X.X.X]
> DBG:core:grep_sock_info: checking if port 5060 matches port 50080
> DBG:core:grep_sock_info: no match for: [X.X.X.X:50080]
> DBG:core:grep_aliases: no match for: [0:X.X.X.X:50080]
> DBG:core:check_self: host != me
> DBG:core:grep_sock_info: checking if host==us: 12==12 &&  [X.X.X.X] == 
> [X.X.X.X]
> DBG:core:grep_sock_info: checking if port 5060 matches port 5060
> DBG:core:grep_sock_info: match found for: [X.X.X.X:5060]
> DBG:core:check_self: host == me
> DBG:rr:after_loose: Topmost route URI: 
> 'sip:X.X.X.X;lr=on;ftag=2350422187' is me
> DBG:rr:after_loose: URI to be processed: 'sip:X.X.X.X:50080;lr=on'
> DBG:rr:after_loose: Next URI is a loose router
>
> before t_relay():
> METHOD=ACK;
> R-URI=sip:X.X.X.X:50080;lr=on;
> du=sip:X.X.X.X;lr=on;ftag=2204003977;
> dp=5060;
>
>
> Where I'm wrong?
>
>
> On 23.10.2010 16:07, Bogdan-Andrei Iancu wrote:
>> Victor Gamov wrote:
>>> Sorry for my mistake. Original packet is:
>>>
>>> -------
>>> ACK sip:5700207 at X.X.X.X SIP/2.0.
>>> Route:<sip:X.X.X.X;lr=on>
>>> To:<sip:5700207 at domain.com>;tag=4ded008d6ca9692485d1918f60c7da12
>>> -------
>> In this case the Route hdr is removed (as consumed) and the
>> loose_route() function true (Route driven). $du will not be set as the
>> only routing info in the request is the RURI, which is the default SIP
>> routing.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro




More information about the Users mailing list