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_connect() function to force connection reuse and avoid timeouts. In the case where the connection has already gone, the system sends a "477 Unfortunately error 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 seem 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 ones)? Other systems may wish to try additional destinations from the failure route. Snippets of my cfg and logs are below. The con_reuse flag is checked in tcp_send at tcp_main.c:1846
Regards, Hugh
route[RELAY] { xlog("L_INFO", "$rm: route[RELAY]\n"); loose_route(); $var(lr_ret) = $rc; if ($var(lr_ret) == 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 outbound failed\n"); sl_send_reply("500", "Something bad happened"); } exit; } . . . }
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: Routing logic starts here May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[REQINIT] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[INITIAL_REQUEST] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[RECORD_ROUTE] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[RELAY] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: loose route with outbound May 1 17:01:08 kamailio-cep[28226]: ERROR: tm [../../forward.h:219]: msg_send(): msg_send: ERROR: tcp_send failed May 1 17:01:08 kamailio-cep[28226]: ERROR: tm [t_fwd.c:1609]: t_send_branch(): ERROR: t_send_branch: sending request on branch 0 failed May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: ACK: Routing logic starts here May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: ACK: route[REQINIT]
________________________________ This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.
Hello,
there are two ways:
- handle the response code for t_relay() together with setting the flag for not sending responses internally - set http://kamailio.org/docs/modules/stable/modules/tm.html#tm.p.failure_exec_mo...
Cheers, Daniel
On 01/05/14 19:54, Waite, Hugh wrote:
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_connect() function to force connection reuse and avoid timeouts. In the case where the connection has already gone, the system sends a “477 Unfortunately error 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 seem 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 ones)? Other systems may wish to try additional destinations from the failure route.
Snippets of my cfg and logs are below. The con_reuse flag is checked in tcp_send at tcp_main.c:1846
Regards,
Hugh
route[RELAY] {
xlog("L_INFO", "$rm: route[RELAY]\n");
loose_route(); $var(lr_ret) = $rc; if ($var(lr_ret) == 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 outbound failed\n");
sl_send_reply("500", "Something bad happened");
} exit; } . . .
}
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: Routing logic starts here
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[REQINIT]
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[INITIAL_REQUEST]
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[RECORD_ROUTE]
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[RELAY]
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: loose route with outbound
May 1 17:01:08 kamailio-cep[28226]: ERROR: tm [../../forward.h:219]: msg_send(): msg_send: ERROR: tcp_send failed
May 1 17:01:08 kamailio-cep[28226]: ERROR: tm [t_fwd.c:1609]: t_send_branch(): ERROR: t_send_branch: sending request on branch 0 failed
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: ACK: Routing logic starts here
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: ACK: route[REQINIT]
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
On 05 May 2014, at 18:18, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
there are two ways:
- handle the response code for t_relay() together with setting the flag for not sending responses internally
t_relay() doesn't seem to accept any flags. Can you please expand on this option, since I'm missing something important here.
[...]
If not, do we need more flexibility in handling this particular tcp_send error (or other similar ones)? Other systems may wish to try additional destinations from the failure route.
We need to discuss how to manage persistent connections in a better way. This applies both to TCP and TCP+TLS.
/O
Snippets of my cfg and logs are below. The con_reuse flag is checked in tcp_send at tcp_main.c:1846
Regards, Hugh
route[RELAY] { xlog("L_INFO", "$rm: route[RELAY]\n"); loose_route(); $var(lr_ret) = $rc; if ($var(lr_ret) == 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 outbound failed\n"); sl_send_reply("500", "Something bad happened"); } exit; } . . . }
May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: Routing logic starts here May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[REQINIT] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[INITIAL_REQUEST] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[RECORD_ROUTE] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[RELAY] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: loose route with outbound May 1 17:01:08 kamailio-cep[28226]: ERROR: tm [../../forward.h:219]: msg_send(): msg_send: ERROR: tcp_send failed May 1 17:01:08 kamailio-cep[28226]: ERROR: tm [t_fwd.c:1609]: t_send_branch(): ERROR: t_send_branch: sending request on branch 0 failed May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: ACK: Routing logic starts here May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: ACK: route[REQINIT]
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
-- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda _______________________________________________ sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
On 06/05/14 09:02, Olle E. Johansson wrote:
On 05 May 2014, at 18:18, Daniel-Constantin Mierla <miconda@gmail.com mailto:miconda@gmail.com> wrote:
Hello,
there are two ways:
- handle the response code for t_relay() together with setting the
flag for not sending responses internally
t_relay() doesn't seem to accept any flags. Can you please expand on this option, since I'm missing something important here.
t_relay_to() has the flags: - http://kamailio.org/docs/modules/stable/modules/tm.html#tm.f.t_relay_to
Cheers, Daniel
[...]
If not, do we need more flexibility in handling this particular tcp_send error (or other similar ones)? Other systems may wish to try additional destinations from the failure route.
We need to discuss how to manage persistent connections in a better way. This applies both to TCP and TCP+TLS.
/O
Snippets of my cfg and logs are below. The con_reuse flag is checked in tcp_send at tcp_main.c:1846 Regards, Hugh route[RELAY] { xlog("L_INFO", "$rm: route[RELAY]\n"); loose_route(); $var(lr_ret) = $rc; if ($var(lr_ret) == 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 outbound failed\n"); sl_send_reply("500", "Something bad happened"); } exit; } . . . } May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: Routing logic starts here May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[REQINIT] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[INITIAL_REQUEST] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[RECORD_ROUTE] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: route[RELAY] May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: INVITE: loose route with outbound May 1 17:01:08 kamailio-cep[28226]: ERROR: tm [../../forward.h:219]: msg_send(): msg_send: ERROR: tcp_send failed May 1 17:01:08 kamailio-cep[28226]: ERROR: tm [t_fwd.c:1609]: t_send_branch(): ERROR: t_send_branch: sending request on branch 0 failed May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: ACK: Routing logic starts here May 1 17:01:08 kamailio-cep[28226]: INFO: <script>: ACK: route[REQINIT]
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
-- Daniel-Constantin Mierla -http://www.asipto.com http://twitter.com/#!/miconda -http://www.linkedin.com/in/miconda _______________________________________________ sr-dev mailing list sr-dev@lists.sip-router.org mailto:sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
On 06 May 2014, at 10:17, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 06/05/14 09:02, Olle E. Johansson wrote:
On 05 May 2014, at 18:18, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
there are two ways:
- handle the response code for t_relay() together with setting the flag for not sending responses internally
t_relay() doesn't seem to accept any flags. Can you please expand on this option, since I'm missing something important here.
t_relay_to() has the flags:
And the documentation is missing the return codes...
Thanks! /O