Hi,
Kamailio crashes when we handle a 302 redirect and the reply is a 404.
> # kamailio -v
> version: kamailio 4.4.4 (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.
> id: unknown
> compiled with gcc 4.9.2
root@14cn5:/home/joel/files#
This works:
> softphone1 > kamailio1 > server1 > 302 > kamailio1 > server2 > 200 OK
This crashes:
> softphone1 > kamailio1 > server1 > 302 > kamailio1 > server2 > 404 Not Found
I'm attaching debug logs, sip traces and the bt full from backtrace.
IPs:
> A.B.C.D = Kamailio IP
> E.F.G.H = Softphone IP
> I.J.K.L1 = dispatcher node1
> I.J.K.L2 = dispatcher node2
In the config we send INVITE requests to a dispatcher group (very simple config).
Then, in failure_route we have:
```
if (t_check_status("302")) {
xlog("L_NOTICE", "Redirecting to TestName: $T_rpl($ct) - M=$rm R=$ru ID=$ci\n");
get_redirects("*");
route(RELAY);
}
```
And call get redirected to the address of the contact in the 302.
If the new INVITE to that address gets a 200, all works, if that request gets a 404, Kamailio crashes.
Please let me know if you need more info, this is 100% reproducible on our platform.
Thank you!
Joel.
[backtrace.txt](https://github.com/kamailio/kamailio/files/623307/backtrace.…
[debug.txt](https://github.com/kamailio/kamailio/files/623308/debug.txt)
[sip.txt](https://github.com/kamailio/kamailio/files/623309/sip.txt)
--
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/875
http://kamailio.org/docs/modules/devel/modules/rabbitmq.html
Please do provide a URL to the rabbitmq library project in addition to the name of the package name of a Linux distro.
- Is the package name "librabbitmq-dev" the same for all major Linux distributions?
- Have you checked this on OpenBSD or FreeBSD?
We are multi-linux-distro and multi-platform :-)
--
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/903
MYIP = my server ip
MYDOMAIN = my domain name
syslog:
```
Jan 13 04:18:19 kaf kamailio[1153]: loading modules under config path: /usr/lib/x86_64-linux-gnu/kamailio/modules/
Jan 13 04:18:19 kaf kamailio[1153]: Listening on
Jan 13 04:18:19 kaf kamailio[1153]: udp: MYIP:5776
Jan 13 04:18:19 kaf kamailio[1153]: tcp: MYIP:5776
Jan 13 04:18:19 kaf kamailio[1153]: tls: MYIP:5777
Jan 13 04:18:19 kaf kamailio[1153]: Aliases:
Jan 13 04:18:19 kaf kamailio[1153]: tls: MYDOMAIN:5777
Jan 13 04:18:19 kaf kamailio[1153]: tcp: MYDOMAIN:5776
Jan 13 04:18:19 kaf kamailio[1153]: udp: MYDOMAIN:5776
Jan 13 04:18:20 kaf systemd[1]: kamailio.service: Control process exited, code=exited status=255
Jan 13 04:18:20 kaf systemd[1]: Failed to start Kamailio (OpenSER) - the Open Source SIP Server.
Jan 13 04:18:20 kaf systemd[1]: kamailio.service: Unit entered failed state.
Jan 13 04:18:20 kaf systemd[1]: kamailio.service: Failed with result 'exit-code'.
```
`/etc/init.d/mysql-kamailio start` works fine (kamailio starts)
`service kamailio start` - works fine
mysql start fine
kamailio.log:
```
Jan 13 04:18:19 kaf kamailio: INFO: tls [tls_init.c:403]: init_tls_compression(): tls: init_tls: disabling compression...
Jan 13 04:18:19 kaf kamailio: INFO: <core> [sctp_core.c:74]: sctp_core_check_support(): SCTP API not enabled - if you want to use it, load sctp module
Jan 13 04:18:19 kaf kamailio: INFO: <core> [tcp_main.c:4656]: init_tcp(): using epoll_lt as the io watch method (auto detected)
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: rr [../outbound/api.h:54]: ob_load_api(): Failed to import bind_ob
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: rr [rr_mod.c:174]: mod_init(): outbound module not available
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: usrloc [hslot.c:51]: ul_init_locks(): locks array size 1024
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: auth [auth_mod.c:333]: mod_init(): auth: qop set, but nonce-count (nc_enabled) support disabled
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: tls [tls_mod.c:362]: mod_init(): With ECDH-Support!
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: tls [tls_mod.c:365]: mod_init(): With Diffie Hellman
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: tls [tls_init.c:591]: init_tls_h(): tls: _init_tls_h: compiled with openssl version "OpenSSL 1.0.2g 1 Mar 2016" (0x1000207f), kerberos support: off, compression: on
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: tls [tls_init.c:599]: init_tls_h(): tls: init_tls_h: installed openssl library version "OpenSSL 1.0.2g 1 Mar 2016" (0x1000207f), kerberos support: off, zlib compression: off#012 compiler: cc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: WARNING: tls [tls_init.c:653]: init_tls_h(): tls: openssl bug #1491 (crash/mem leaks on low memory) workaround enabled (on low memory tls operations will fail preemptively) with free memory thresholds 7864320 and 3932160 bytes
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: <core> [cfg/cfg_ctx.c:608]: cfg_set_now(): INFO: cfg_set_now(): tls.low_mem_threshold1 has been changed to 7864320
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: <core> [cfg/cfg_ctx.c:608]: cfg_set_now(): INFO: cfg_set_now(): tls.low_mem_threshold2 has been changed to 3932160
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: ERROR: db_mysql [km_my_con.c:124]: db_mysql_new_connection(): driver error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: ERROR: <core> [db.c:318]: db_do_init2(): could not add connection to the pool
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: ERROR: usrloc [dlist.c:637]: register_udomain(): failed to open database connection
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: ERROR: registrar [reg_mod.c:561]: domain_fixup(): failed to register domain
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: ERROR: <core> [route.c:1153]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:676
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: ERROR: <core> [route.c:1153]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:678
Jan 13 04:18:20 kaf /usr/sbin/kamailio[1276]: INFO: <core> [sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
```
--
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/925
When registering to an upstream provider using the uac module, the source port of REGISTER messages alternates seemingly randomly between either 5060 or the lowest available port, e.g., 1024, 1025, 1026. All SIP providers that I tested send subsequent INVITEs of incoming calls to the originating ip/port of the prior REGISTER, which is problematic when kamilio is running behind a firewall.
I tested both the latest master (7c03340b4b486afaf00b14a6589c13b7165240a0) and 4.4 (df5ef6183350d99f77087dd83950ef35466e84a1) on Debian unstable/amd64.
#### /etc/kamailio/kamailio.cfg
```
#!KAMAILIO
debug=3
loadmodule "kex.so"
loadmodule "corex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "db_text.so"
loadmodule "dialog.so"
loadmodule "uac.so"
#!define DBURL "text:///etc/kamailio/dbtext"
modparam("rr", "append_fromtag", 1)
modparam("dialog", "dlg_flag", 4)
modparam("dialog", "track_cseq_updates", 1)
modparam("uac", "restore_dlg", 1)
modparam("uac", "reg_db_url", DBURL)
modparam("uac", "reg_timer_interval", 60)
modparam("uac", "reg_retry_interval", 60)
modparam("uac", "reg_contact_addr", "1.2.3.4:5060")
request_route {
exit;
}
```
#### /etc/kamailio/dbtext/uacreg
```
l_uuid(string) l_username(string) l_domain(string) r_username(string) r_domain(string) realm(string) auth_username(string) auth_password(string) auth_proxy(string) expires(int) flags(int) reg_delay(int)
12345678:user:domain.local:11111111:sip.example.org:sip.example.org:11111111:XXXXXXXXXXXXXXXX:sip\:sip.example.org:600:0:0
```
--
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/936
We have a crash in kamailio 4.4.4 after t_next_contacts() has been called from failure route, if at this very moment when kamailio is preparing new INVITE the caller sends a cancel.
#0 build_res_buf_from_sip_req (code=3186024432, code@entry=487, text=0x25, new_tag=0x7f8dcf5fb2b0 <tm_tag>, msg=0x7f8dbde6cf78,
returned_len=0xb7, bmark=0x4) at msg_translator.c:2395
#1 0x00007f8dcf35f7b2 in _reply (trans=0x7f8dbde70960, p_msg=0x7f8dbde6cf78, code=487, text=<optimized out>, lock=1) at t_reply.c:712
#2 0x00007f8dcf3b5e8b in e2e_cancel (cancel_msg=0x7f8dbde6dff0, cancel_msg@entry=0x7f8dd26bb750, t_cancel=0x25,
t_invite=0x7f8dbde70960) at t_fwd.c:1278
So the scheme is the following: proxy > INVITE < 486 > INVITE* < CANCEL
Victor has investigated this and found that the issue seems to be related to the reply lumps added by append_to_reply when processing initial invite. In order to reproduce this you need children>=2.
When first target replies 486 the proxy calls t_next_contacts() and starts preparing invite to the next target and at this time another process receives cancel and destroys the transaction, the process handling that invite message(*) gets crashed.
While we are investigating the possibility to move the append_to_reply calls to the branch route, would it be possible to avoid crash by some kind of lock mechanism? The thing is that it's not always possible to move append_to_reply to the branch route, e.g. our proxy is deployed behind stateless lb with multiple interfaces and proxy needs to tell lb which interface to use already in the 100 Trying reply it sends to lb as a first thing when receiving a message.
--
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/872
Instead of using the time2str routines that go through timezone
conversion in kamailio, let MySQL do it. This helps with the
sipcapture module in case the system time is CET but the database
is operated in UTC. In these cases the micro_ts and date columns
would be offseted by the timezone difference and look-ups fail
to work.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/957
-- Commit Summary --
* db_mysql: Let the database convert the timestamp
-- File Changes --
M src/modules/db_mysql/km_val.c (18)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/957.patchhttps://github.com/kamailio/kamailio/pull/957.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/957
This is for the people out there (me included) who don't want to install mysql to play with kamailio:
- comment out ``#!define WITH_DB_MYSQL`` (still used by default)
- set the right ``DB_TEXT_DIR``, to match ``kamailio_path/misc/examples/kemi/db_text`` (absolute path is needed; I tried with relative path and it did not work)
- add users/passwords by editing ``kamailio_path/misc/examples/kemi/db_text/subscriber`` file
Hope it's helpful. Enjoy!
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/930
-- Commit Summary --
* kamailio-basic-kemi.cfg: add WITH_DB_TEXT
-- File Changes --
A misc/examples/kemi/db_text/acc (1)
A misc/examples/kemi/db_text/address (1)
A misc/examples/kemi/db_text/bkp (1)
A misc/examples/kemi/db_text/missed_calls (1)
A misc/examples/kemi/db_text/subscriber (4)
A misc/examples/kemi/db_text/trusted (1)
A misc/examples/kemi/db_text/version (7)
M misc/examples/kemi/kamailio-basic-kemi.cfg (63)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/930.patchhttps://github.com/kamailio/kamailio/pull/930.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/930