I did more tests and found that loose_route() does not find socket by name given in ;sn param:
Feb 12 10:40:59 lab /usr/bin/sip-proxy[16975]: WARNING: rr [loose.c:799]: rr_do_force_send_socket(): no socket found to match second RR (sip:tenantX.teams.tutpro.com:8007;transport=tls;r2=on;sn=ext_tls;lr;n1;savp=avp;pm=0)
In config I have defined:
listen=tls:192.x.x.x:8007 name "ext_tls"
-- Juha
Do you have the rr modparam related socket name mode set?
Cheers, Daniel
On 12.02.21 09:55, Juha Heinanen wrote:
I did more tests and found that loose_route() does not find socket by name given in ;sn param:
Feb 12 10:40:59 lab /usr/bin/sip-proxy[16975]: WARNING: rr [loose.c:799]: rr_do_force_send_socket(): no socket found to match second RR (sip:tenantX.teams.tutpro.com:8007;transport=tls;r2=on;sn=ext_tls;lr;n1;savp=avp;pm=0)
In config I have defined:
listen=tls:192.x.x.x:8007 name "ext_tls"
-- Juha
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla writes:
Do you have the rr modparam related socket name mode set?
Yes, sorry, forgot to mention it:
modparam("rr", "sockname_mode", 1)
I have added some debug to loose.c and some converted DBGs to INFOs in rr_do_force_send_socket() function:
if(rr_sockname_mode!=0 && puri->params.len>0) { s = puri->params; if(s.s[s.len-1]==';') { s.len--; } LM_INFO("Looking ;sn param from %.*s\n", s.len, s.s); ... LM_INFO("use of sockname parameter enabled, but failed to find it\n"); free_params(plist); }
This is what I got to syslog:
eb 12 14:53:07 lab /usr/bin/sip-proxy[8662]: INFO: rr [loose.c:759]: rr_do_force_send_socket(): Looking ;sn param from transport=tls;r2=on;sn=ext_tls;lr;n1;savp=avp;pm=0 Feb 12 14:53:07 lab /usr/bin/sip-proxy[8662]: INFO: rr [loose.c:783]: rr_do_force_send_socket(): use of sockname parameter enabled, but failed to find it Feb 12 14:53:07 lab /usr/bin/sip-proxy[8662]: WARNING: rr [loose.c:800]: rr_do_force_send_socket(): no socket found to match second RR (sip:tenantX.teams.tutpro.com:8007;transport=tls;r2=on;sn=ext_tls;lr;n1;savp=avp;pm=0)
So looks like some bug in the looking, since ;sn is there.
-- Juha
I think I found the bug:
./src/core/config.h:#define SOCKNAME_PARAM ";sn="
but in parse_params() result params are without ";".
-- Juha
On 12.02.21 15:20, Juha Heinanen wrote:
Juha Heinanen writes:
I think I found the bug:
./src/core/config.h:#define SOCKNAME_PARAM ";sn="
but in parse_params() result params are without ";".
Also, there is no "=". So instead of ";sn=", the code should look for "sn".
Indeed, I will push a fix for it.
Cheers, Daniel
On 12.02.21 15:24, Daniel-Constantin Mierla wrote:
On 12.02.21 15:20, Juha Heinanen wrote:
Juha Heinanen writes:
I think I found the bug:
./src/core/config.h:#define SOCKNAME_PARAM ";sn="
but in parse_params() result params are without ";".
Also, there is no "=". So instead of ";sn=", the code should look for "sn".
Indeed, I will push a fix for it.
See if works now with latest master.
Cheers, Daniel
Daniel-Constantin Mierla writes:
Also, there is no "=". So instead of ";sn=", the code should look for "sn".
Indeed, I will push a fix for it.
I also did one, but yours is cleaner than mine. Thanks. Tested and it works, no more warnings to syslog.
Looks like no-one had ever before used this socket name feature in R-R URIs.
-- Juha
On 12.02.21 15:44, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
Also, there is no "=". So instead of ";sn=", the code should look for "sn".
Indeed, I will push a fix for it.
I also did one, but yours is cleaner than mine. Thanks. Tested and it works, no more warnings to syslog.
Looks like no-one had ever before used this socket name feature in R-R URIs.
I added it for convenience, after building a configuration for an older kamailio version where I use check_rout_param() function to figure out what socket to force. But that deployment was not yet upgraded to use this new mode, it runs well with the old approach.
I tested to see if the sn parameter is added in Record-Route, not the callbacks on Route headers.
I will backport to 5.4.
Cheers, Daniel