Hi, I've just a quick question regarding the loose_route function
We had a discussion earlier this year when the answer for loose_route was:
"by default, loose_route() function detects the pre-loaded route: if there is only one Route hdr pointing to the server, it will be consumed and loose_route() will return false. If more than one Route hdr is present, the routing will be done as usual - function will consume the Route and set the destination to the next Route - true is returned."
I just wonder about the "returning false" since I always see loose_route return true...is this due to the lr tag?
eks: My yyy.yyy.yyy.yyy receives a BYE message
BYE sip:67512391@10.46.11.132 SIP/2.0 Via: SIP/2.0/UDP xxx.xxx.xxx.xxx;branch=z9hG4bK84fb.7836a4d5.0 Via: SIP/2.0/UDP 10.46.11.101:5060;rport=5060;branch=z9hG4bK7cae83600f656a72 Route: sip:yyy.yyy.yyy.yyy:5060;lr
From the explaiantion I would guess if (loose_route()){ do-something}
should not do-something???
I hope Im not totally out of my head right now
br hw
Hi Helge,
as it is a BYE request , it is not a preloaded Route set case (request has a to-tag). In non-preloaded case, loose_route() returns true if the server's address was found in the topmost route hdr (for a loose routing scenario) or if an non-local route addr was used for routing further.
so, your message below, it will return true.
regards, bogdan
Helge Waastad wrote:
Hi, I've just a quick question regarding the loose_route function
We had a discussion earlier this year when the answer for loose_route was:
"by default, loose_route() function detects the pre-loaded route: if there is only one Route hdr pointing to the server, it will be consumed and loose_route() will return false. If more than one Route hdr is present, the routing will be done as usual - function will consume the Route and set the destination to the next Route - true is returned."
I just wonder about the "returning false" since I always see loose_route return true...is this due to the lr tag?
eks: My yyy.yyy.yyy.yyy receives a BYE message
BYE sip:67512391@10.46.11.132 SIP/2.0 Via: SIP/2.0/UDP xxx.xxx.xxx.xxx;branch=z9hG4bK84fb.7836a4d5.0 Via: SIP/2.0/UDP 10.46.11.101:5060;rport=5060;branch=z9hG4bK7cae83600f656a72 Route: sip:yyy.yyy.yyy.yyy:5060;lr
From the explaiantion I would guess if (loose_route()){ do-something}
should not do-something???
I hope Im not totally out of my head right now
br hw