Module: kamailio
Branch: master
Commit: 703d6202e73e4e3778a2c66f4e29ae87dc6ac211
URL: https://github.com/kamailio/kamailio/commit/703d6202e73e4e3778a2c66f4e29ae8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-04-15T08:32:38+02:00
core: resolve - safety check for setting port
---
Modified: src/core/resolve.c
---
Diff: https://github.com/kamailio/kamailio/commit/703d6202e73e4e3778a2c66f4e29ae8…
Patch: https://github.com/kamailio/kamailio/commit/703d6202e73e4e3778a2c66f4e29ae8…
---
diff --git a/src/core/resolve.c b/src/core/resolve.c
index deb20a740c..c2ea36d9ec 100644
--- a/src/core/resolve.c
+++ b/src/core/resolve.c
@@ -1225,7 +1225,7 @@ int naptr_choose (struct naptr_rdata** crt, char* crt_proto,
* and *proto!=0 or port==0 && proto==0)
* when performing SRV lookup (*port==0) it will use *proto to look for
* tcp or udp hosts, otherwise proto is unused; if proto==0 => no SRV lookup
- * If zt is set, name will be assumed to be 0 terminated and some copy
+ * If zt is set, name will be assumed to be 0 terminated and some copy
* operations will be avoided.
* If is_srv is set it will assume name has the srv prefixes for sip already
* appended and it's already 0-term'ed; if not it will append them internally.
@@ -1313,7 +1313,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
do_srv:
/* try to find the SRV records inside previous ARs first*/
for (l=ars; l; l=l->next){
- if (l->type!=T_SRV) continue;
+ if (l->type!=T_SRV) continue;
srv=(struct srv_rdata*) l->rdata;
if (srv==0){
LM_CRIT("null rdata\n");
@@ -1325,7 +1325,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
/* we found it*/
LM_DBG("found SRV(%s) = %s:%d in AR\n",
srv_target, srv->name, srv->port);
- *port=srv->port;
+ if(port) *port=srv->port;
/* cleanup on exit */
goto end;
}
@@ -1344,7 +1344,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
/* we found it*/
LM_DBG("SRV(%s) = %s:%d\n",
srv_target, srv->name, srv->port);
- *port=srv->port;
+ if(port) *port=srv->port;
/* cleanup on exit */
goto end;
}
@@ -1356,7 +1356,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
goto end;
}
/* cleanup on exit */
- LM_DBG("no SRV record found for %.*s,"
+ LM_DBG("no SRV record found for %.*s,"
" trying 'normal' lookup...\n", name->len, name->s);
}
}
Hello,
I am considering to release Kamailio v5.4.5 sometime next week, likely
on Thursday, April 15, 2020. This is the usual heads up notification to
see if anyone is aware of issues not yet reported to bug tracker and if
yes, do it as soon as possible to give them a chance to be fixed.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Online
May 17-20, 2021 (Europe Timezone) -- June 7-10, 2021 (America Timezone)
* https://www.asipto.com/sw/kamailio-advanced-training-online/
Hello,
We are using the Kamailio(5.4.1) with python3 KEMI interpreter. Here I
noticed an issue on ksr_onsend_route with the reply messages. We did
"onsend_route_reply=1" on the kamailio.cfg. But ksr_onsend_route is not
triggered by any reply messages.
Tried to dig some code and found, in t_reply.c before calling "run_onsend"
it tested whether the onsend_rt list is empty or not by
onsend_route_enabled(file: onsend.h) method.
But presumably rt lists are always empty if we use a KEMI interpreter. We
have tried the same version of Kamailio without KEMI, then onsend_route
works fine.
If onsend_rt is not being used in case of KEMI then can we replace this
test with simply by testing only the onsend_route_reply flag?
Please advise if we are missing something.
Thank you,
Rubel