Hi list,
my proxy (yy.yy.yy.yy) receives a message like this:
BYE sip:12345678@xx.xx.xx.xx SIP/2.0 Record-Route: sip:xx.xx.xx.xx;ftag=875188d2;lr=on Via: SIP/2.0/UDP xx.xx.xx.xx;branch=z9hG4bK07cb.466d8587.0 Via: SIP/2.0/UDP ww.ww.ww.ww:5060;branch=z9hG4bK875196bf Route: sip:xx.xx.xx.xx;ftag=1056999653;lr=on
My ruleset is something like this (with the REGISTER logic pulled out) :
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% route { if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }; if (msg:len >= 2048 ) { sl_send_reply("513", "Message too big"); exit; };
force_rport(); if (!method == "REGISTER") { record_route(); }; if (loose_route()) { route(1); }; loopkup("location"); route(1); }
route[1] { if (!t_relay()) { sl_reply_error(); }; exit; } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I would expect the packet to leave my router, back to xx.xx.xx.xx :
BYE sip:12345678@xx.xx.xx.xx SIP/2.0 Record-Route: sip:yy.yy.yy.yy;lr;ftag=2873864 Record-Route: sip:xx.xx.xx.xx;ftag=875188d2;lr=on Via: SIP/2.0/UDP yy.yy.yy.yy;branch=zu83fdhDB8d.67235676.0 Via: SIP/2.0/UDP xx.xx.xx.xx;branch=z9hG4bK07cb.466d8587.0 Via: SIP/2.0/UDP ww.ww.ww.ww:5060;branch=z9hG4bK875196bf Route: sip:xx.xx.xx.xx;ftag=1056999653;lr=on
But the outgoing packet is :
BYE sip:xx.xx.xx.xx;ftag=1056999653;lr=on SIP/2.0 Record-Route: sip:xx.xx.xx.xx;ftag=875188d2;lr=on Via: SIP/2.0/UDP yy.yy.yy.yy;branch=z9hG4bK07cb.02005244.0 Via: SIP/2.0/UDP xx.xx.xx.xx;rport=5060;branch=z9hG4bK07cb.466d8587.0 Via: SIP/2.0/UDP ww.ww.ww.ww:5060;branch=z9hG4bK875196bf
Do you have any idea about what is going on ?
Thank you. Best regards,
Hello,
is the IP/domain from R-URI (BYE sip:12345678@xx.xx.xx.xx SIP/2.0) a local one for OpenSER? If so, then the rr module interprets that is a strict routing and routes accordingly.
Cheers, Daniel
On 08/24/06 17:20, Jeremie Le Hen wrote:
Hi list,
my proxy (yy.yy.yy.yy) receives a message like this:
BYE sip:12345678@xx.xx.xx.xx SIP/2.0 Record-Route: sip:xx.xx.xx.xx;ftag=875188d2;lr=on Via: SIP/2.0/UDP xx.xx.xx.xx;branch=z9hG4bK07cb.466d8587.0 Via: SIP/2.0/UDP ww.ww.ww.ww:5060;branch=z9hG4bK875196bf Route: sip:xx.xx.xx.xx;ftag=1056999653;lr=on
My ruleset is something like this (with the REGISTER logic pulled out) :
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% route { if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }; if (msg:len >= 2048 ) { sl_send_reply("513", "Message too big"); exit; };
force_rport(); if (!method == "REGISTER") { record_route(); }; if (loose_route()) { route(1); };
loopkup("location"); route(1); }
route[1] { if (!t_relay()) { sl_reply_error(); }; exit; } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I would expect the packet to leave my router, back to xx.xx.xx.xx :
BYE sip:12345678@xx.xx.xx.xx SIP/2.0 Record-Route: sip:yy.yy.yy.yy;lr;ftag=2873864 Record-Route: sip:xx.xx.xx.xx;ftag=875188d2;lr=on Via: SIP/2.0/UDP yy.yy.yy.yy;branch=zu83fdhDB8d.67235676.0 Via: SIP/2.0/UDP xx.xx.xx.xx;branch=z9hG4bK07cb.466d8587.0 Via: SIP/2.0/UDP ww.ww.ww.ww:5060;branch=z9hG4bK875196bf Route: sip:xx.xx.xx.xx;ftag=1056999653;lr=on
But the outgoing packet is :
BYE sip:xx.xx.xx.xx;ftag=1056999653;lr=on SIP/2.0 Record-Route: sip:xx.xx.xx.xx;ftag=875188d2;lr=on Via: SIP/2.0/UDP yy.yy.yy.yy;branch=z9hG4bK07cb.02005244.0 Via: SIP/2.0/UDP xx.xx.xx.xx;rport=5060;branch=z9hG4bK07cb.466d8587.0 Via: SIP/2.0/UDP ww.ww.ww.ww:5060;branch=z9hG4bK875196bf
Do you have any idea about what is going on ?
Thank you. Best regards,
Hi Daniel-Constantin,
thank you for your quick reply.
On Thu, Aug 24, 2006 at 05:27:49PM +0300, Daniel-Constantin Mierla wrote:
is the IP/domain from R-URI (BYE sip:12345678@xx.xx.xx.xx SIP/2.0) a local one for OpenSER? If so, then the rr module interprets that is a strict routing and routes accordingly.
Indeed the incoming BYE request URI is a local one for my proxy. I made a mistake while dumping the lines manually in my previous mail. Good catch.
Actually, I had thought about this and I checked the RFC3261:
% If the copy contains a Route header field, the proxy MUST % inspect the URI in its first value. If that URI does not % contain an lr parameter, the proxy MUST modify the copy as % follows: % % - The proxy MUST place the Request-URI into the Route header % field as the last value. % % - The proxy MUST then place the first Route header field value % into the Request-URI and remove that value from the Route % header field.
But the original request is (yy.yy.yy.yy being my proxy):
BYE sip:12345678@yy.yy.yy.yy:SIP/2.0 Record-Route: sip:xx.xx.xx.xx;ftag=875188d2;lr=on Via: SIP/2.0/UDP xx.xx.xx.xx;branch=z9hG4bK07cb.466d8587.0 Via: SIP/2.0/UDP ww.ww.ww.ww:5060;branch=z9hG4bK875196bf Route: sip:xx.xx.xx.xx;ftag=1056999653;lr=on
As you can see, the Route header contains a "lr=on" parameter. And the outgoing request is nevertheless:
BYE sip:xx.xx.xx.xx;ftag=1056999653;lr=on SIP/2.0 Record-Route: sip:xx.xx.xx.xx;ftag=875188d2;lr=on Via: SIP/2.0/UDP yy.yy.yy.yy;branch=z9hG4bK07cb.02005244.0 Via: SIP/2.0/UDP xx.xx.xx.xx;rport=5060;branch=z9hG4bK07cb.466d8587.0 Via: SIP/2.0/UDP ww.ww.ww.ww:5060;branch=z9hG4bK875196bf
This is why I don't understand what's happening.
Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >