[SR-Users] received parameter in route URI not used despite path use_received set to 1

Kristian Høgh kfh at uni-tel.dk
Fri Mar 19 07:52:56 CET 2021


Hi,

If your "almost the default one" config is like https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg[1], i guess it's the removal of route header at line 437/538.
# - remove preloaded route headers
remove_hf("Route");

loose_route() is only done in WITHINDLG, which checks for has_totag()

You should look at
https://kamailio.org/docs/modules/devel/modules/rr.html#rr.f.loose_route_preloaded[2] 

Regards,
Kristian.


On torsdag den 18. marts 2021 21.38.41 CET Easy Rider wrote:


Hi


I've run the test again with log level set to 4, and I don't see anything related to route header parsing, I don't see any trace of the received uri value
I've also tried with outbound module loaded, no change
I've also tried with WITH_NAT defined or not, no change


Cheers


Le jeu. 18 mars 2021 à 14:32, Daniel-Constantin Mierla <miconda at gmail.com[3]> a écrit :


Hello, 
try to run with debug=3 in kamailio.cfg and watch the logs, you may get some hints about what happens, maybe there is some error in processing or overwriting of destination address. 
Cheers,
Daniel


On 18.03.21 11:51, Easy Rider wrote:


Hi 


I'd like to make sure I've understood correctly how use_received in path module is supposed to work, because I don't get what I expected to get after reading the documentation 
I've got a little set up with a UAC behind a NAT registering to a kamailio registrar through a kamailio edge proxy (he UAC is a simple sipp script simulating a UAC behind a NAT)


path is enabled on both EP and registrar, and use_received is set to 1 on EP




the path, contact and via headers in the REGISTER going from the EP to the registrar are : 

Via: SIP/2.0/UDP 192.168.26.129;branch=z9hG4bK20da.9f4ab6ad25eae6acdd4bd4d655b320ce.0
Via: SIP/2.0/UDP 10.0.0.5:6060;received=192.168.26.1;rport=23456;branch=z9hG4bK-105-1-1
Contact: <sip:1000 at 10.0.0.5:6060[4]>;methods="INVITE, ACK, BYE, CANCEL, OPTIONS"  
Path: <sip:inside at 192.168.26.129[5];lr;received=sip:192.168.26.1:23456[6]>




where 192.168.26.129 is obviously the edge proxy 


then I place a call to the UAC through registrar 
the EP receiveds the following INVITE : 


INVITE sip:1000 at 10.0.0.5:6060[4] SIP/2.0
Record-Route: <sip:192.168.26.142;lr>
Via: SIP/2.0/UDP 192.168.26.142;branch=z9hG4bKdf25.142eebc72e940d07ad983a858c67f64e.0
Route: <sip:inside at 192.168.26.129[5];lr;received=sip:192.168.26.1:23456[6]>
Via: SIP/2.0/UDP 192.168.26.1:34567;received=192.168.26.1;rport=34567;branch=z9hG4bK-107-1-1
From: "1001" <sip:1001 at my-fake-domain.com[7]>;tag=107-1
To: <sip:1000 at my-fake-domain.com[8];user=phone>
CSeq: 1 INVITE
Call-ID: 1-107 at 192.168.26.1[9]
Contact: <sip:1001 at 192.168.26.1:34567[10]> 
...




The Route header is exactly what is expected, but the edge proxy still sends the request to the request-URI address (10.0.0.5:6060[11]) instead of sending the request to the received address set in the first Route header 
The path module documentation states : 
*/3.1. use_received (int)/* 
If set to 1, the “received” parameter of the first Route URI is evaluated and used as destination-URI if present. 


kamailio configuration on the EP is almost the default one (just added path support, and modified the REGISTRAR route to forward the request instead on saving the contact, so there is not even a mid registrar on the EP 


tried with kamailio 5.3.7 and 5.4.4 


thanks 


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org[12]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users[13] 
-- 
Daniel-Constantin Mierla -- www.asipto.com[14]
www.twitter.com/miconda[15] -- www.linkedin.com/in/miconda[16]
Funding: https://www.paypal.me/dcmierla[17] 



--------
[1] https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg
[2] https://kamailio.org/docs/modules/devel/modules/rr.html#rr.f.loose_route_preloaded
[3] mailto:miconda at gmail.com
[4] http://sip:1000@10.0.0.5:6060
[5] mailto:sip%3Ainside at 192.168.26.129
[6] http://192.168.26.1:23456
[7] mailto:sip%3A1001 at my-fake-domain.com
[8] mailto:sip%3A1000 at my-fake-domain.com
[9] mailto:1-107 at 192.168.26.1
[10] http://sip:1001@192.168.26.1:34567
[11] http://10.0.0.5:6060
[12] mailto:sr-users at lists.kamailio.org
[13] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[14] http://www.asipto.com
[15] http://www.twitter.com/miconda
[16] http://www.linkedin.com/in/miconda
[17] https://www.paypal.me/dcmierla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210319/7594478e/attachment.htm>


More information about the sr-users mailing list