<!--
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
we are using rtpengine with kamailio [KSR-LUA]. kamailio sending the rtpengine_offer to rtpengine. If kamailio didn't get the response from the rtpengine then it's not retrying . for rtpengine_answer and rtpengine_delete retry is working pretty good.
we are using following rtpengine configuration
# ----- rtpengine params -----
modparam("rtpengine", "db_url", DBURL)
modparam("rtpengine", "table_name" , "rtpengine")
modparam("rtpengine", "rtpengine_allow_op", 1)
modparam("rtpengine", "queried_nodes_limit", 4)
modparam("rtpengine", "rtpengine_retr", 2)
modparam("rtpengine", "rtp_inst_pvar", "$avp(RTP_INSTANCE)")
modparam("rtpengine", "setid_default", 1)
modparam("rtpengine", "rtpengine_tout_ms", 400)
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
This issue can be reproduced by above configuration. and need to use rtpengine_offer,rtpengine_answer and rtpengine_delete with ksr lua routing.
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### 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.
-->
```
(paste your debugging data here)
```
#### 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).
-->
```
(paste your log messages here)
```
#### 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).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.1.4 (x86_64/linux) a1df59
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: a1df59
compiled on 06:23:23 Oct 30 2018 with gcc 4.8.4
```
* **Operating System**:
<!--
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@ip-172-31-4-160:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
root@ip-172-31-4-160:~# uname -a
Linux ip-172-31-4-160 3.13.0-143-generic #192-Ubuntu SMP Tue Feb 27 10:45:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
```
--
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/1696
### Description
In a setup with 2 kamailios in active/passive with a virtual IP that failovers between them:
sbc01 (active) is handling calls.
sbc02 (passive) is started, and does an initial dialog sync via DMQ
```
root@sbc01:~# kamctl rpc stats.get_statistics all | grep dialog
"dialog:active_dialogs = 39",
"dialog:early_dialogs = 2",
"dialog:expired_dialogs = 0",
"dialog:failed_dialogs = 583",
"dialog:processed_dialogs = 2527",
root@sbc01:~#
```
```
root@sbc02:/etc/kamailio# kamctl rpc stats.get_statistics all | grep dialog
"dialog:active_dialogs = 39",
"dialog:early_dialogs = 0",
"dialog:expired_dialogs = 0",
"dialog:failed_dialogs = 0",
"dialog:processed_dialogs = 0",
root@sbc02:/etc/kamailio#
```
>From that point onwards, as long as sbc01 stays as active, sbc02 stays as passive, and no restarts occur anywhere, the values for `dialog` metrics in sbc02 will not change and remain as they are, in the previous example, active_dialogs would remain as 39.
### Troubleshooting
This was discovered during some tests from #1591
#### Reproduction
Setup 2 kamailio instances that replicate dialogs via DMQ.
1- On Kamailio1 put some traffic to have some active dialogs (must call `dlg_manage()` in routing script for these test calls)
2- Start Kamailio2
3- Compare output of: `kamcmd stats.get_statistics dialog:` on both nodes.
4- Alter the amount of active dialogs on Kamailio1 (either end some or create new ones).
5- Repeat step 3.
Kamailio1 --> Step5 will have different values from Step3.
Kamailio2 --> Step5 will have exactly the same values from Step3.
### Possible Solutions
`dialog:active_dialogs` should remain as 0 on Kamailio2, as technically there are no dialogs being handled by that server, it only has information of replicated dialogs and those stats are available in the `dlg.stats_active` metric.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
# kamailio -V
version: kamailio 5.2.0-pre1 (x86_64/linux) 2ecf60-dirty
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 2ecf60 -dirty
compiled with gcc 6.3.0
```
* **Operating System**:
<!--
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@sbc02:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch
root@sbc02:~# uname -a
Linux sbc02 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux
root@sbc02:~#
```
--
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/1692
### Description
SIP OPTION relayed using `t_forward_nonack()` not being URI decoded
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
register with PATH and use SIP OPTION keep alive
or simply send relay a SIP OPTIONS with a route.
#### 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.
-->
```#1 0x00007fa3067a998f in t_forward_nonack (t=0x7fa3246fce88,
p_msg=0x7fa3885aa1c0, proxy=0x0, proto=0) at t_fwd.c:1729
1729 raise(SIGSEGV);
(gdb) l
1724 ser_error=MIN_int(lowest_ret, E_CFG);
1725 return -1;
1726 }
1727 if(lowest_ret!=E_CFG) {
1728 LM_ERR("failure to add branches\n");
1729 raise(SIGSEGV); << raising exception to get the coredump
1730 }
1731 ser_error=lowest_ret;
1732 return lowest_ret;
1733 }
```
#### Log Messages
```
4(34) ERROR: tm [ut.h:245]: uri2dst2(): bad_uri: sip:247.25.169.51:52307%3Btransport%3Dtls
4(34) ERROR: tm [t_fwd.c:1728]: t_forward_nonack(): failure to add branches
```
### Possible Solutions
This patch can fix the problem from the routing script :
```
if (is_method("OPTIONS") && uri!=myself) {
$var(path_uri) = $(hdr(Route){re.subst,/<(.*)>/\1/});
if (defined $(var(path_uri){uri.params}) && $(var(path_uri){uri.params}{param.value,received}) != "") {
$var(received) = $(var(path_uri){uri.params}{param.value,received});
if ($var(received) =~ "sip:.*:.*") {
$du = $var(received);
$avp(received) = $(var(path_uri){uri.params}{param.value,received});
avp_subst("$avp(received)", "/%3Btransport%3Dtcp/;transport=tcp/ig");
if ($avp(received) =~ "sip:.*:.*") {
$du = $avp(received);
}
}
t_relay();
}
```
### Additional Information
tested on 5.3.2, something changed during 5.3.0.dev, I will try to pin point the commit
--
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/2255
It seems a good idea to support JWT as a new SIP authorization method. Wonder if anyone is interested? Think auth_db would be the best spot to add support for JWT.
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/29
I'm using set_contact_alias() to fix nat registrations, in this case with a Bria client.
Somehow Bria learns that I'm using this - probably through the Contact in the 200 OK reply of save(). Bria then adds this to the Contact when replying to incoming INVITE.
After some time, something happens in the network at client side and the connection gets a new port through the router. Bria does not notice and still sends the old alias-parameter with the port not used anymore. When I'm calling handle_ruri_alias(), Kamailio reads this instead of the actual port and the ACK to 200 OK is sent to a port not used anymore.
This can probably be solved by either, in preferred order:
- rewrite set_contact_alias() and add_contact_alias() to replace existing alias parameters
- regexp remove of alias parameter from Contact of all messages coming from clients
- regexp remove of alias parameter from Contact returned by save()
Br,
Morten
--
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/2308
#### Pre-Submission Checklist
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
If kamailio is behind a NAT only return connection if port matches. We observed this issue on an instance after ~10h of operation.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2307
-- Commit Summary --
* core: do not return connection if port does not match
-- File Changes --
M src/core/tcp_main.c (11)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2307.patchhttps://github.com/kamailio/kamailio/pull/2307.diff
--
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/pull/2307
### Description
Kamailio with TOPOS enabled acts as a proxy between SIP client and SBC.
When client sends "180 Ringing" without Contact header - kamailio does not forward it to SBC.
If Contact header exists in "180 Ringing" - all works as expected.
### Troubleshooting
#### Reproduction
Load and configure topos module
Make call with "180 Ringing" without Contact header - kamailio will not forward it.
#### Log Messages
```
ERROR: topos [tps_storage.c:340]: tps_storage_link_msg(): bad sip message or missing Contact hdr
```
#### SIP Traffic
```
SIP/2.0 180 Ringing
Via: SIP/2.0/TLS 1.2.3.4:5061;branch=z9hG4bKef45.8c75f0bae8a59dfaec6ff533ff0f3b2d.0
From: <sip:1111@1.2.3.4:5061>;tag=02000879948559
To: <sip:2.2.2.2@5.6.7.8:5061;transport=tls;user=phone>;tag=SDbsq8499-y2pMOVV
Call-ID: apdW7374315131g0bcGhEfDjFof
CSeq: 988207425 INVITE
User-Agent: agent
Supported: replaces, outbound
Content-Length: 0
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.1.6 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select
```
* **Operating System**:
```
Red Hat Enterprise Linux Server 7.3
3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
```
--
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/1720
**ld_fld.c:273** implicit-function-declaration
```
CC (gcc) [M db2_ldap.so] db2_ldap_mod.o
CC (gcc) [M db2_ldap.so] ld_cfg.o
CC (gcc) [M db2_ldap.so] ld_cmd.o
CC (gcc) [M db2_ldap.so] ld_con.o
CC (gcc) [M db2_ldap.so] ld_fld.o
ld_fld.c: In function 'ldap_gentime2db_datetime':
ld_fld.c:273:10: warning: implicit declaration of function 'timelocal' [-Wimplicit-function-declaration]
273 | *dst = timelocal(&time);
| ^~~~~~~~~
CC (gcc) [M db2_ldap.so] ld_res.o
CC (gcc) [M db2_ldap.so] ld_uri.o
make[3]: 'libsrdb2.so.1.0' is up to date.
```
**redis_table.c:586** maybe-uninitialized
```
CC (gcc) [M db_redis.so] db_redis_mod.o
CC (gcc) [M db_redis.so] redis_connection.o
CC (gcc) [M db_redis.so] redis_dbase.o
CC (gcc) [M db_redis.so] redis_table.o
redis_table.c: In function 'db_redis_parse_keys':
redis_table.c:586:38: warning: 'table' may be used uninitialized in this function [-Wmaybe-uninitialized]
586 | table->types = type_target = type;
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
make[3]: 'libsrdb2.so.1.0' is up to date.
make[3]: 'libsrdb1.so.1.0' is up to date.
LD (gcc) [M db_redis.so] db_redis.so
```
**app_python** strict-aliasing
```
CC (gcc) [M app_python.so] app_python_mod.o
CC (gcc) [M app_python.so] apy_kemi.o
In file included from /usr/include/python2.7/Python.h:83,
from apy_kemi.c:25:
apy_kemi.c: In function 'sr_kemi_apy_return_true':
/usr/include/python2.7/object.h:769:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
769 | ((PyObject*)(op))->ob_refcnt++)
| ~^~~~~~~~~~~~~~~~
apy_kemi.c:121:2: note: in expansion of macro 'Py_INCREF'
121 | Py_INCREF(Py_True);
| ^~~~~~~~~
apy_kemi.c: In function 'sr_kemi_apy_return_false':
/usr/include/python2.7/object.h:769:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
769 | ((PyObject*)(op))->ob_refcnt++)
| ~^~~~~~~~~~~~~~~~
apy_kemi.c:130:2: note: in expansion of macro 'Py_INCREF'
130 | Py_INCREF(Py_False);
| ^~~~~~~~~
CC (gcc) [M app_python.so] apy_kemi_export.o
CC (gcc) [M app_python.so] mod_Core.o
```
**pdb.c:348** address-of-packed-member]
```
LD (gcc) [M p_usrloc.so] p_usrloc.so
CC (gcc) [M path.so] path.o
CC (gcc) [M path.so] path_mod.o
LD (gcc) [M path.so] path.so
CC (gcc) [M pdb.so] pdb.o
pdb.c: In function 'pdb_query':
pdb.c:348:60: warning: taking address of packed member of 'struct pdb_msg' may result in an unaligned pointer value [-Waddress-of-packed-member]
348 | _id = (short int *)&(msg.bdy.payload[reqlen]); /* make gcc happy */
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
LD (gcc) [M pdb.so] pdb.so
CC (gcc) [M pdt.so] pdt.o
CC (gcc) [M pdt.so] pdtree.o
make[3]: 'libsrdb1.so.1.0' is up to date.
```
--
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/2298
### Description
I tried to set the `alias` configuration option using an ID set by `#!substdef` but this leads to `grep_sock_info()` to fail, falling back to `corex_check_self()` and failing altogether finally.
### Troubleshooting
#### Reproduction
The basic setup given `BASE_HOST=example.org`:
```
#!substdef "/BASE_HOST/$env(BASE_HOST)/"
alias="BASE_HOST"
listen=tcp:0.0.0.0:80
route[AUTH] {
# ...
if (from_uri!=myself && uri!=myself) {
sl_send_reply("403","Not relaying");
exit;
}
return;
}
```
With this, any properly authenticated `REGISTER` call leads to a `403 Not Relaying`.
However, this works perfectly fine if I use a static value instead:
```
alias=example.org
```
#### Log Messages
```
kamailio_1 | 12(17) DEBUG: <core> [core/socket_info.c:628]: grep_sock_info(): checking if host==us: 11==7 && [example.org] == [0.0.0.0]
kamailio_1 | 12(17) DEBUG: <core> [core/socket_info.c:635]: grep_sock_info(): checking if port 80 (advertise 0) matches port 5060
kamailio_1 | 12(17) DEBUG: <core> [core/forward.c:412]: check_self(): host != me
kamailio_1 | 12(17) DEBUG: corex [corex_lib.c:200]: corex_check_self(): check self for: 0:example.org:5060
kamailio_1 | 12(17) DEBUG: corex [corex_lib.c:227]: corex_check_self(): no match found
kamailio_1 | 12(17) DEBUG: <core> [core/socket_info.c:628]: grep_sock_info(): checking if host==us: 11==7 && [example.org] == [0.0.0.0]
kamailio_1 | 12(17) DEBUG: <core> [core/socket_info.c:635]: grep_sock_info(): checking if port 80 (advertise 0) matches port 5060
kamailio_1 | 12(17) DEBUG: <core> [core/forward.c:412]: check_self(): host != me
kamailio_1 | 12(17) DEBUG: corex [corex_lib.c:200]: corex_check_self(): check self for: 0:example.org:5060
kamailio_1 | 12(17) DEBUG: corex [corex_lib.c:227]: corex_check_self(): no match found
```
Output with the static value:
```
kamailio_1 | 11(16) DEBUG: <core> [core/socket_info.c:628]: grep_sock_info(): checking if host==us: 11==7 && [example.org] == [0.0.0.0]
kamailio_1 | 11(16) DEBUG: <core> [core/socket_info.c:635]: grep_sock_info(): checking if port 80 (advertise 0) matches port 5060
kamailio_1 | 11(16) DEBUG: <core> [core/socket_info.c:628]: grep_sock_info(): checking if host==us: 11==7 && [example.org] == [0.0.0.0]
kamailio_1 | 11(16) DEBUG: <core> [core/socket_info.c:635]: grep_sock_info(): checking if port 80 (advertise 0) matches port 5060
```
### Possible Solutions
Right now I need to work around this issue by including a separate `kamailio-aliases.cfg` file which must then be provided in each environment.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.3.3 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 5.3.1
```
* **Operating System**:
<!--
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`)
-->
Using the Docker image `kamailio/kamailio:5.3.3-xenial`. Info from the Docker host:
```
# uname -a
Linux ubuntu-s-1vcpu-1gb-fra1-01-sip 4.4.0-177-generic #207-Ubuntu SMP Mon Mar 16 01:16:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
```
--
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/2310
### Description
Segfault in Kamailio when using mysql (over ssl) and tls listeners.
We have a reproducible segfault with Kamailio on Ubuntu Xenial. The problems is revealed when two modules (db_mysql and tls) and both using the openssl library. The mysql module is using openssl indirectly, because the connection is encrypted by default when the server supports it.
### Troubleshooting
#### Reproduction
Install Kamailio with
- tls listeners enabled
- dispatcher module enabled, from mysql db
Example configuration attached:
In this case, reproduction with:
- start kamailio
- let dispatcher reload, for example via jsonrpc
- make connection on tls, for example with `openssl s_connect`
Kamailio will crash.
#### Debugging Data
Stack trace, with `libssl1.0.0-dbg` installed:
```
#0 0x0000000000000000 in ?? ()
#1 0x00007ff862d07b0d in getrn (lh=lh@entry=0x7ff8641eb7e8, data=data@entry=0x7ffe1f36e750, rhash=rhash@entry=0x7ffe1f36e6f0) at lhash.c:396
#2 0x00007ff862d0817a in lh_retrieve (lh=0x7ff8641eb7e8, data=data@entry=0x7ffe1f36e750) at lhash.c:248
#3 0x00007ff862d0a651 in int_thread_get_item (d=0x7ffe1f36e750) at err.c:500
#4 0x00007ff862d0b024 in ERR_get_state () at err.c:1023
#5 0x00007ff862d0b25f in ERR_clear_error () at err.c:743
#6 0x00007ff86305c67e in ssl23_accept (s=0x7ff864a282d0) at s23_srvr.c:157
#7 0x00007ff860b70d86 in tls_accept (c=0x7ff864af8810, error=0x7ffe1f36eb30) at tls_server.c:422
#8 0x00007ff860b7a486 in tls_read_f (c=0x7ff864af8810, flags=0x7ffe1f38eedc) at tls_server.c:1116
#9 0x0000000000625ac2 in tcp_read_headers (c=0x7ff864af8810, read_flags=0x7ffe1f38eedc) at core/tcp_read.c:469
#10 0x000000000062d05d in tcp_read_req (con=0x7ff864af8810, bytes_read=0x7ffe1f38eed8, read_flags=0x7ffe1f38eedc) at core/tcp_read.c:1496
#11 0x0000000000631c42 in handle_io (fm=0x7ff885734520, events=1, idx=-1) at core/tcp_read.c:1804
#12 0x0000000000620500 in io_wait_loop_epoll (h=0xae0200 <io_w>, t=2, repeat=0) at core/io_wait.h:1065
#13 0x0000000000633adb in tcp_receive_loop (unix_sock=26) at core/tcp_read.c:1974
#14 0x000000000051a9a1 in tcp_init_children () at core/tcp_main.c:4853
#15 0x000000000042620e in main_loop () at main.c:1745
#16 0x000000000042ca76 in main (argc=7, argv=0x7ffe1f38f578) at main.c:2696
```
#### Log Messages
```
2020-04-05T01:27:37.965778+02:00 nathancmp01 kernel: [432825.787355] kamailio[6296]: segfault at 0 ip (null) sp 00007ffe4cdaf248 error 14 in kamailio[400000+47b000]
```
#### SIP Traffic
No SIP traffic needed, just a TLS connection.
### Possible Solutions
Could not reproduce with Kamailio 5.3.3 on Ubuntu Bionic nor Debian Buster. Both are using openssl 1.1.x, so I guess that fixes the problem. But Xenial is still on 1.0.2g...
### Additional Information
Tested with Kamailio 5.2 and 5.3.3.
* **Operating System**:
Repro on:
- Ubuntu Xenial
No repro on:
- Ubuntu Bionic
- Debian Buster
--
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/2274