Hi, I am trying to re-route to a different $ru after timeout and right before Kamailio reply with a 408.I made the changes right before sl_reply_error(), however it does not work as I expected. Any help will be appreciated. Also, $rm represents the request message received by Kamailio. Is there a variable represents the messages leaving Kamailio?.
route[RELAY] { # enable additional event routes for forwarded requests # - serial forking, RTP relaying handling, a.s.o. if (is_method("INVITE|SUBSCRIBE")) { t_on_branch("MANAGE_BRANCH"); t_on_reply("MANAGE_REPLY"); } if (is_method("INVITE")) { t_on_failure("MANAGE_FAILURE"); } if (!t_relay()) { // re-route to a new $ru before sending 408 sl_reply_error(); } exit;} Thanks,AS
Hello,
You cannot handle SIP eventualities by checking the return value of t_relay(); a call to t_relay() will almost always succeed immediately, unless there is an a priori failure out of hand (e.g. cannot send from socket, DNS lookup failure, etc.).
Instead, you must do this in a failure_route:
route { ... t_on_failure("FAILURE_ROUTE");
if(!t_relay()) sl_reply_error(); }
failure_route[FAILURE_ROUTE] { if(t_is_canceled()) exit;
if(t_branch_timeout()) { # Handle your timeout case here.
$ru = new value etc.
t_relay(); exit; } }
Thank you.
To: sr-users@lists.sip-router.org From: abalashov@evaristesys.com Date: Mon, 28 Mar 2016 15:27:14 -0400 Subject: Re: [SR-Users] Timeout Handling (update)
Hello,
You cannot handle SIP eventualities by checking the return value of t_relay(); a call to t_relay() will almost always succeed immediately, unless there is an a priori failure out of hand (e.g. cannot send from socket, DNS lookup failure, etc.).
Instead, you must do this in a failure_route:
route { ... t_on_failure("FAILURE_ROUTE");
if(!t_relay()) sl_reply_error();
}
failure_route[FAILURE_ROUTE] { if(t_is_canceled()) exit;
if(t_branch_timeout()) { # Handle your timeout case here. $ru = new value etc. t_relay(); exit; }
}
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users