<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
After upgrading kamailio from 5.4.4 to 5.4.5, the lcr module logs an error for outgoing calls. load_gws returns success (1), but does not populate the avps. Consequently, next_gw fails.
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
kamailio.cfg:
```
loadmodule "lcr.so"
...
modparam("lcr", "db_url", "cluster://cls1")
modparam("lcr", "gw_uri_avp", "$avp(i:709)")
modparam("lcr", "ruri_user_avp", "$avp(i:500)")
modparam("lcr", "tag_avp", "$avp(lcr_tag)")
modparam("lcr", "flags_avp", "$avp(i:712)")
modparam("lcr", "defunct_capability", 1)
modparam("lcr", "lcr_id_avp", "$avp(s:lcr_id_avp)")
modparam("lcr", "defunct_gw_avp", "$avp(s:defunct_gw_avp)")
modparam("lcr", "ping_interval", 60)
...
route[LCR] {
if(!($rU=~"^[+0-9]"))
return;
if(is_method("INVITE")) {
if (!($fU=~"^[+0-9]+$")) {
append_hf("P-Asserted-Identity: <sip:+49xxxxxxxxxxx@xxxxx.de>\n");
append_hf("Privacy: id\n");
$fn = "Anonymous";
$fu = "sip:+49xxxxxxxxxxx@xxxxx.de";
}
if(load_gws(1, $rU, $var(caller_uri)) != 1) {
xlog("L_ERROR", "Couldn't load gateways\n");
sl_send_reply("500", "Server Internal Error - Cannot load gateways");
exit;
} else {
xlog("L_INFO", "GW Selected '$avp(i:709)'\n");
xlog("L_INFO", "Domain of destination: $dd\n");
xlog("L_INFO", "To URI: $tu\n");
}
if(!next_gw()) {
xlog("L_WARN", "No gateway configured for $rU\n");
sl_send_reply("503", "Service not available, no gateways found");
exit;
} else {
xlog("L_INFO", "Calling the first matched gateway\n");
xlog("L_INFO", "ruri_user_avp: '$avp(i:500)'\n");
xlog("L_INFO", "To URI after next_gw: $tu\n");
xlog("L_INFO", "Request URI: $ru\n");
}
t_on_failure("MANAGE_FAILURE_LCR");
route(RELAY);
exit;
}
}
```
#### Debugging Data
<!--
If you got a core dump, use gdb to extract troubleshooting data - full backtrace,
local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile
bt full
info locals
list
If you are familiar with gdb, feel free to attach more of what you consider to
be relevant.
-->
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
Apr 15 20:59:27 x /usr/sbin/kamailio[879]: ERROR: <core> [core/usr_avp.c:152]: create_avp(): 0 ID or NULL NAME AVP!
Apr 15 20:59:27 x /usr/sbin/kamailio[879]: ERROR: <core> [core/usr_avp.c:152]: create_avp(): 0 ID or NULL NAME AVP!
Apr 15 20:59:27 x /usr/sbin/kamailio[879]: INFO: <script>: GW Selected '<null>'
Apr 15 20:59:27 x /usr/sbin/kamailio[879]: INFO: <script>: Domain of destination: <null>
Apr 15 20:59:27 x /usr/sbin/kamailio[879]: INFO: <script>: To URI: sip:+49177xxxxxxx@xx.xxx.x.xxx:5060
Apr 15 20:59:27 x /usr/sbin/kamailio[879]: WARNING: <script>: No gateway configured for +49177xxxxxxx
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
SIP request:
```
INVITE sip:+49177xxxxxxx@xx.xx.xx.xxx:5060 SIP/2.0
Via: SIP/2.0/UDP xxx.xx.xx.xxx:xxxxx;branch=z9hG4bK5d833a50
Max-Forwards: 70
From: <sip:+xxxxxxxxxxx@xxx.xx.xx.xxx:xxxxx>;tag=as18ff0d47
To: <sip:+49177xxxxxxx@xx.xx.xx.xxx:5060>
Contact: <sip:+xxxxxxxxxxx@xxx.xx.xx.xxx:xxxxx>
Call-ID: 7489c50703b43b2f03980574181a2f81@xxx.xx.xx.xxx:xxxxx
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.18.3~dfsg-1ubuntu4
Date: Thu, 15 Apr 2021 21:52:42 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 952
...
```
SIP reply:
```
SIP/2.0 503 Service not available, no gateways found
Via: SIP/2.0/UDP xxx.xx.xx.xxx:xxxxx;branch=z9hG4bK5d833a50;rport=50060;received=xx.xx.xx.xxx
From: <sip:+xxxxxxxxxxx@xxx.xx.xx.xxx:xxxxx>;tag=as18ff0d47
To: <sip:+49177xxxxxxx@xx.xx.xx.xxx:5060>;tag=6a823999ce344a0b461cf8d85d526103.51611a36
Call-ID: 7489c50703b43b2f03980574181a2f81@xxx.xx.xx.xxx:xxxxx
CSeq: 102 INVITE
Server: kamailio (5.4.5 (x86_64/linux))
Content-Length: 0
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
As a workaround, I downgraded to kamailio 5.3.8 because the previous Ubuntu release 5.4.4 is not available anymore at http://deb.kamailio.org/kamailio54/pool/main/k/kamailio/ (why actually?)
### Additional Information
* **Kamailio Version** 5.4.5
* **Operating System**: Ubuntu 18.04
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->
### Root Cause Assumption
https://github.com/kamailio/kamailio/commit/ca1821837dfe7dd6630f628d968ed4d… might be involved in the issue.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2709
I have created a pull request that allows the use of fresh GCC for the
FreeSwitch project.
https://github.com/signalwire/freeswitch/pull/1161
Think we can use the same approach to use fresh GCC for the Kamailio
project.
For RHEL based dist and old Debian dest.
Is it a useful approach to use fresh GCC to build a master branch?
Sergey
Hello,
Kamailio SIP Server v5.4.5 stable release is out.
This is a maintenance release of the latest stable branch, 5.4, that
includes fixes since the release of v5.4.4. There is no change to
database schema or configuration language structure that you have to do
on previous installations of v5.4.x. Deployments running previous v5.4.x
versions are strongly recommended to be upgraded to v5.4.5.
For more details about version 5.4.5 (including links and guidelines to
download the tarball or from GIT repository), visit:
 * https://www.kamailio.org/w/2021/04/kamailio-v5-4-5-released/
RPM, Debian/Ubuntu packages will be available soon as well.
Many thanks to all contributing and using Kamailio!
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Module: kamailio
Branch: 5.4
Commit: 1e6561f86d4a139834952ff21b74ecca0b508966
URL: https://github.com/kamailio/kamailio/commit/1e6561f86d4a139834952ff21b74ecc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-04-15T08:35:40+02:00
core: resolve - safety check for setting port
(cherry picked from commit 703d6202e73e4e3778a2c66f4e29ae87dc6ac211)
---
Modified: src/core/resolve.c
---
Diff: https://github.com/kamailio/kamailio/commit/1e6561f86d4a139834952ff21b74ecc…
Patch: https://github.com/kamailio/kamailio/commit/1e6561f86d4a139834952ff21b74ecc…
---
diff --git a/src/core/resolve.c b/src/core/resolve.c
index 3796f05ceb..cfed6b5e1d 100644
--- a/src/core/resolve.c
+++ b/src/core/resolve.c
@@ -1211,7 +1211,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.
@@ -1299,7 +1299,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");
@@ -1311,7 +1311,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;
}
@@ -1330,7 +1330,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;
}
@@ -1342,7 +1342,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);
}
}
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/