From hugh.waite@acision.com Thu May 1 19:54:55 2014 From: "Waite, Hugh" To: sr-dev@lists.kamailio.org Subject: [sr-dev] Forcing TCP connection reuse doesn't use the failure_route when the connection has gone. Date: Thu, 01 May 2014 19:54:15 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1281783772==" --===============1281783772== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I have an edge-proxy which accepts TCP connections from clients. When I know = that the clients are behind NATs (for example), I use the set_forward_no_conn= ect() function to force connection reuse and avoid timeouts. In the case wher= e the connection has already gone, the system sends a "477 Unfortunately erro= r on sending to next hop occurred (477/TM)" response back to the registrar. These connections are using outbound, so I would like to convert this into a = "430 Flow Failed" response to the registrar, but the 477 response doesn't see= m to trigger the onreply_route or failure_route. Is there a way of trapping and handling this failure? If not, do we need more= flexibility in handling this particular tcp_send error (or other similar one= s)? Other systems may wish to try additional destinations from the failure ro= ute. Snippets of my cfg and logs are below. The con_reuse flag is checked in tcp_s= end at tcp_main.c:1846 Regards, Hugh route[RELAY] { xlog("L_INFO", "$rm: route[RELAY]\n"); loose_route(); $var(lr_ret) =3D $rc; if ($var(lr_ret) =3D=3D 2) { xlog("L_INFO", "$rm: loose route with outbound\n"); t_on_failure("FAIL_OUTBOUND"); set_forward_no_connect(); if (t_relay() < 0) { xlog("L_WARN", "$rm: loose route with outbou= nd failed\n"); sl_send_reply("500", "Something bad happened"= ); } exit; } . . . } May 1 17:01:08 kamailio-cep[28226]: INFO: