Hi,
I am observing the following sequence in kamailio 3.1.2 log files:
| ERROR: <core> [db.c:421]: invalid parameter value
| DEBUG: siptrace [siptrace.c:530]: storing info...
| ERROR: <core> [db_query.c:152]: invalid parameter value
| ERROR: siptrace [siptrace.c:532]: error storing trace
It happens after executing t_uac_dlg via mi_datagram.
The interesting part of the configuration file is:
| event_route[tm:local-request]{
| xlog("L_NOTICE", "event_route tm:local-request ...");
| sip_trace();
| }
Both use_table and insert first check for NULL values among their
parameters. The only common parameter to both functions is the db
connection. I verified that it is actually NULL as it arrives in
db_use_table (lib/srdb1/db.c).
So why should the db_con module level variable
(modules_k/siptrace/siptrace.c) be uninitialized? This question is
answered in the child_init function of the same file: The db_con is not
initialized if the passed rank is one out of PROC_INIT, PROC_MAIN and
PROC_TCP_MAIN.
Might be a good point to look at mi_datagram's child_init
(modules_k/mi_datagram/mi_datagram.c). Well yeah. It forks of a process
when rank is PROC_MAIN. And that process has no db_con in the siptrace
module. So logging from mi_datagram is doomed to fail.
An obvious idea is to open up a database connection for PROC_MAIN, too.
The db_con would then (with luck) be inherited to the mi_datagram module
and in fact this happens on my instance.
The sharing of a db_con with multiple processes is obviously not that a
brilliant idea. Nasty race conditions can occur later. So how to solve
this issue instead of working around the symptoms?
Helmut
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has been changed. The changes are listed below. For full information about what has changed, visit the URL and click the History tab.
FS#136 - tcp_connect_timeout has no effect
User who did this: Iñaki Baz Castillo (ibc)
Task details edited:
-------
It seems that tcp_connect_timeout has no effect at all. I set it to 3 seconds and try sending a request with RURI "sip:lalalala@91.121.79.216:7777;transport=tcp". The server 91.121.79.216 refuses the TCP connection (REJECT action in iptables rather than DROP), try yourself:
<pre><code>
~# telnet 91.121.79.216 7777
Trying 91.121.79.216...
telnet: Unable to connect to remote host: Connection refused
</code></pre>
However when my Kamailio tries to open a TCP connection with such destination, it produces a local 408 after 30 seconds (fr_timer = 30000)!
Since Kamailio should detect that the TCP connection is rejected, I expect that it should generate a local 503 for the client transaction as RFC 3261 states.
I attach a file kamailio-tcp-reject.log which shows the issue. It clearly shows that tcp connection attemp fails inmediately (due to TCP reject) but it does not terminate the client transaction and instead it takes 30 seconds until it generates local 408:
<pre><code>
Jun 15 12:40:51 kamailio[7275]: ERROR: <core> [tcp_main.c:4137]: connect 91.121.79.216:7777 failed
Jun 15 12:41:21 kamailio[7270]: DEBUG: tm [t_reply.c:1132]: ->>>>>>>>> T_code=100, new_code=408
</code></pre>
I've also tested sending a TCP INVITE to a host which is not reachable (1.2.3.4) so TCP timeouts occurs (after 5 seconds rather than 3 however...) but as in the other case, such TCP timeout does not terminate the client transaction and instead local 408 is generated after 30 seconds (I attach kamailio-tcp-timeout.log):
<pre><code>
Jun 15 12:42:23 kamailio[7338]: DEBUG: <core> [io_wait.h:390]: DBG: io_watch_add(0x890f60, 18, 2, 0x7fae6c97d278), fd_no=10
Jun 15 12:42:28 kamailio[7338]: DEBUG: <core> [tcp_main.c:4304]: tcp_main: entering timer for 0x7fae6c97d278 (ticks=1376168512, timeout=1376170384 (117 s), wr_timeout=1376168512 (0 s)), write queue: 940 bytes
Jun 15 12:42:28 kamailio[7338]: ERROR: <core> [tcp_main.c:4322]: connect 1.2.3.4:5060 failed (timeout)
Jun 15 12:42:28 kamailio[7338]: DEBUG: <core> [tcp_main.c:4346]: tcp_main: timeout for 0x7fae6c97d278
Jun 15 12:42:28 kamailio[7338]: DEBUG: <core> [io_wait.h:617]: DBG: io_watch_del (0x890f60, 18, -1, 0x10) fd_no=11 called
Jun 15 12:42:53 kamailio[7333]: DEBUG: tm [t_reply.c:1132]: ->>>>>>>>> T_code=100, new_code=408
</code></pre>
Kamailio info:
version: kamailio 3.2.0-dev5 (x86_64/linux) 552425
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, 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 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 552425
compiled on 09:46:21 Jun 15 2011 with gcc 4.5.2
-------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=136
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#129 - Segfault parsing STUN body
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
Additional comments about closing: I understood was fixed by Andrei's patches.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=129
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has been changed. The changes are listed below. For full information about what has changed, visit the URL and click the History tab.
FS#136 - tcp_connect_timeout has no effect
User who did this: Iñaki Baz Castillo (ibc)
Task details edited:
-------
It seems that tcp_connect_timeout has no effect at all. I set it to 3 seconds and try sending a request with RURI "sip:lalalala@91.121.79.216:7777;transport=tcp". The server 91.121.79.216 refuses the TCP connection (REJECT action in iptables rather than DROP), try yourself:
<code>
~# telnet 91.121.79.216 7777
Trying 91.121.79.216...
telnet: Unable to connect to remote host: Connection refused
</code>
However when my Kamailio tries to open a TCP connection with such destination, it produces a local 408 after 30 seconds (fr_timer = 30000)!
Since Kamailio should detect that the TCP connection is rejected, I expect that it should generate a local 503 for the client transaction as RFC 3261 states.
I attach a file kamailio-tcp-reject.log which shows the issue. It clearly shows that tcp connection attemp fails inmediately (due to TCP reject) but it does not terminate the client transaction and instead it takes 30 seconds until it generates local 408:
<code>
Jun 15 12:40:51 kamailio[7275]: ERROR: <core> [tcp_main.c:4137]: connect 91.121.79.216:7777 failed
Jun 15 12:41:21 kamailio[7270]: DEBUG: tm [t_reply.c:1132]: ->>>>>>>>> T_code=100, new_code=408
</code>
I've also tested sending a TCP INVITE to a host which is not reachable (1.2.3.4) so TCP timeouts occurs (after 5 seconds rather than 3 however...) but as in the other case, such TCP timeout does not terminate the client transaction and instead local 408 is generated after 30 seconds (I attach kamailio-tcp-timeout.log):
<code>
Jun 15 12:42:23 kamailio[7338]: DEBUG: <core> [io_wait.h:390]: DBG: io_watch_add(0x890f60, 18, 2, 0x7fae6c97d278), fd_no=10
Jun 15 12:42:28 kamailio[7338]: DEBUG: <core> [tcp_main.c:4304]: tcp_main: entering timer for 0x7fae6c97d278 (ticks=1376168512, timeout=1376170384 (117 s), wr_timeout=1376168512 (0 s)), write queue: 940 bytes
Jun 15 12:42:28 kamailio[7338]: ERROR: <core> [tcp_main.c:4322]: connect 1.2.3.4:5060 failed (timeout)
Jun 15 12:42:28 kamailio[7338]: DEBUG: <core> [tcp_main.c:4346]: tcp_main: timeout for 0x7fae6c97d278
Jun 15 12:42:28 kamailio[7338]: DEBUG: <core> [io_wait.h:617]: DBG: io_watch_del (0x890f60, 18, -1, 0x10) fd_no=11 called
Jun 15 12:42:53 kamailio[7333]: DEBUG: tm [t_reply.c:1132]: ->>>>>>>>> T_code=100, new_code=408
</code>
Kamailio info:
version: kamailio 3.2.0-dev5 (x86_64/linux) 552425
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, 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 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 552425
compiled on 09:46:21 Jun 15 2011 with gcc 4.5.2
-------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=136
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Hi,
I was wondering why t_reply_callid is not exported to MI. Since I needed
it, I wrote a patch to make it available via MI. It might be interesting
to others as well, so here goes the patch.
Helmut
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has been changed. The changes are listed below. For full information about what has changed, visit the URL and click the History tab.
FS#136 - tcp_connect_timeout has no effect
User who did this: Iñaki Baz Castillo (ibc)
Task details edited:
-------
It seems that tcp_connect_timeout has no effect at all. I set it to 3 seconds and try sending a request with RURI "sip:lalalala@91.121.79.216:7777;transport=tcp". The server 91.121.79.216 refuses the TCP connection (REJECT action in iptables rather than DROP), try yourself:
---------------
~# telnet 91.121.79.216 7777
Trying 91.121.79.216...
telnet: Unable to connect to remote host: Connection refused
---------------
However when my Kamailio tries to open a TCP connection with such destination, it produces a local 408 after 30 seconds (fr_timer = 30000)!
Since Kamailio should detect that the TCP connection is rejected, I expect that it should generate a local 503 for the client transaction as RFC 3261 states.
I attach a file kamailio-tcp-reject.log which shows the issue. It clearly shows that tcp connection attemp fails inmediately (due to TCP reject) but it does not terminate the client transaction and instead it takes 30 seconds until it generates local 408:
-----------------
Jun 15 12:40:51 kamailio[7275]: ERROR: <core> [tcp_main.c:4137]: connect 91.121.79.216:7777 failed
Jun 15 12:41:21 kamailio[7270]: DEBUG: tm [t_reply.c:1132]: ->>>>>>>>> T_code=100, new_code=408
-----------------
I've also tested sending a TCP INVITE to a host which is not reachable (1.2.3.4) so TCP timeouts occurs (after 5 seconds rather than 3 however...) but as in the other case, such TCP timeout does not terminate the client transaction and instead local 408 is generated after 30 seconds (I attach kamailio-tcp-timeout.log):
------------------
Jun 15 12:42:23 kamailio[7338]: DEBUG: <core> [io_wait.h:390]: DBG: io_watch_add(0x890f60, 18, 2, 0x7fae6c97d278), fd_no=10
Jun 15 12:42:28 kamailio[7338]: DEBUG: <core> [tcp_main.c:4304]: tcp_main: entering timer for 0x7fae6c97d278 (ticks=1376168512, timeout=1376170384 (117 s), wr_timeout=1376168512 (0 s)), write queue: 940 bytes
Jun 15 12:42:28 kamailio[7338]: ERROR: <core> [tcp_main.c:4322]: connect 1.2.3.4:5060 failed (timeout)
Jun 15 12:42:28 kamailio[7338]: DEBUG: <core> [tcp_main.c:4346]: tcp_main: timeout for 0x7fae6c97d278
Jun 15 12:42:28 kamailio[7338]: DEBUG: <core> [io_wait.h:617]: DBG: io_watch_del (0x890f60, 18, -1, 0x10) fd_no=11 called
Jun 15 12:42:53 kamailio[7333]: DEBUG: tm [t_reply.c:1132]: ->>>>>>>>> T_code=100, new_code=408
------------------
Kamailio info:
version: kamailio 3.2.0-dev5 (x86_64/linux) 552425
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, 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 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 552425
compiled on 09:46:21 Jun 15 2011 with gcc 4.5.2
-------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=136
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Iñaki Baz Castillo (ibc)
Attached to Project - sip-router
Summary - tcp_connect_timeout has no effect
Task Type - Bug Report
Category - tcp
Status - Assigned
Assigned To - Andrei Pelinescu-Onciul
Operating System - Linux
Severity - Low
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - It seems that tcp_connect_timeout has no effect at all. I set it to 3 seconds and try sending a request with RURI "sip:lalalala@91.121.79.216:7777;transport=tcp". The server 91.121.79.216 refuses the TCP connection (REJECT action in iptables rather than DROP), try yourself:
~# telnet 91.121.79.216 7777
Trying 91.121.79.216...
telnet: Unable to connect to remote host: Connection refused
However when my Kamailio tries to open a TCP connection with such destination, it produces a local 408 after 30 seconds (fr_timer = 30000)!
Since Kamailio should detect that the TCP connection is rejected, I expect that it should generate a local 503 for the client transaction as RFC 3261 states, am I wrong?
PS: I attach the log of a call to "sip:lalalala@91.121.79.216:7777;transport=tcp".
Kamailio info:
version: kamailio 3.2.0-dev5 (x86_64/linux) 552425
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, 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 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 552425
compiled on 09:46:21 Jun 15 2011 with gcc 4.5.2
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=136
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A user has added themself to the list of users assigned to this task.
FS#136 - tcp_connect_timeout has no effect
User who did this - Iñaki Baz Castillo (ibc)
http://sip-router.org/tracker/index.php?do=details&task_id=136
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.