[Kamailio-Devel] t_on_failure() is not executed in TCP when t_relay() returns 1 ???

Juha Heinanen jh at tutpro.com
Tue Mar 24 07:06:53 CET 2009


Iñaki Baz Castillo writes:

 > 1) UDP:
 > -------------------------
 > $ru = "sip:123123 at non-responding-IP;transport=udp";
 > t_on_failure("1");
 > if !t_relay() {
 > 	xlog("L_WARN", "t_relay() returns negative value !!!\n");
 > 	sl_reply_error();
 > }
 > 
 > failure_route[1] {
 > 	xlog("L_INFO", "failure_route[|]: result: $T_reply_code\n");
 > }
 > -------------------------
 > In this case, t_relay() returns +1, and failure_route is executed.

i this case, i get the same (correct) result.

 > 1) TCP:
 > The same but changing the first line:
 > -------------------------
 > $ru = "sip:123123 at non-responding-IP;transport=tcp";
 > -------------------------
 > In this case, t_relay() returns **too** +1, but failure_route is NOT executed.

but this one i cannot reproduce.  i have

    xlog("L_INFO", "INFO: Routing initial $rm to <$ru> and <$bR>\n");
    if (!t_relay("0x01")) {
	xlog("L_INFO", "INFO: failure with code $retcode\n");
	exit;
    };
    xlog("L_INFO", "INFO: success\n");

if the address exists, but is not listening at port 5060, i get

Mar 24 07:54:11 taimen /usr/sbin/kamailio[6837]: INFO: Routing initial INVITE to <sip:jh at 87.95.22.182;transport=tcp> and <<null>>
Mar 24 07:54:11 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcp_blocking_connect: poll error: flags 18
Mar 24 07:54:11 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcp_blocking_connect: failed to retrieve SO_ERROR (111) Connection refused
Mar 24 07:54:11 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcpconn_connect: tcp_blocking_connect failed
Mar 24 07:54:11 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcp_send: connect failed
Mar 24 07:54:11 taimen /usr/sbin/kamailio[6837]: ERROR:tm:msg_send: tcp_send failed
Mar 24 07:54:11 taimen /usr/sbin/kamailio[6837]: ERROR:tm:t_forward_nonack: sending request failed
Mar 24 07:54:11 taimen /usr/sbin/kamailio[6837]: INFO: failure with code -6

if i try to an address that does not respond anything, i get

Mar 24 07:59:16 taimen /usr/sbin/kamailio[6837]: INFO: Routing initial INVITE to <sip:jh at 192.168.1.1;transport=tcp> and <<null>>
Mar 24 07:59:26 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcp_blocking_connect: timeout 10 s elapsed from 10 s
Mar 24 07:59:26 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcpconn_connect: tcp_blocking_connect failed
Mar 24 07:59:26 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcp_send: connect failed
Mar 24 07:59:26 taimen /usr/sbin/kamailio[6837]: ERROR:tm:msg_send: tcp_send failed
Mar 24 07:59:26 taimen /usr/sbin/kamailio[6837]: ERROR:tm:t_forward_nonack: sending request failed
Mar 24 07:59:26 taimen /usr/sbin/kamailio[6837]: INFO: failure with code -6

if i try to the same address, but without entry in route table, i get

<sip:jh at 192.168.1.1;transport=tcp> and <<null>>
Mar 24 08:01:10 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcp_blocking_connect: (101) Network is unreachable
Mar 24 08:01:10 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcpconn_connect: tcp_blocking_connect failed
Mar 24 08:01:10 taimen /usr/sbin/kamailio[6837]: ERROR:core:tcp_send: connect failed
Mar 24 08:01:10 taimen /usr/sbin/kamailio[6837]: ERROR:tm:msg_send: tcp_send failed
Mar 24 08:01:10 taimen /usr/sbin/kamailio[6837]: ERROR:tm:t_forward_nonack: sending request failed
Mar 24 08:01:10 taimen /usr/sbin/kamailio[6837]: INFO: failure with code -6

also, in case of udp, if there is no entry in routing table, i get

Mar 24 08:04:42 taimen /usr/sbin/kamailio[6837]: ERROR:core:udp_send: sendto(sock,0xb5419c30,1036,0,0xb541bdd8,16): Network is unreachable(101)
Mar 24 08:04:42 taimen /usr/sbin/kamailio[6837]: ERROR:tm:msg_send: udp_send failed
Mar 24 08:04:42 taimen /usr/sbin/kamailio[6837]: ERROR:tm:t_forward_nonack: sending request failed
Mar 24 08:04:42 taimen /usr/sbin/kamailio[6837]: INFO: failure with code -6

so in all cases, return code is -6 and failure route is not executed.

-- juha



More information about the Devel mailing list