<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font face="Verdana,sans-serif" color="#000000">Thank you.<br id="FontBreak"></font><br><br><div>> To: sr-users@lists.sip-router.org<br>> From: abalashov@evaristesys.com<br>> Date: Mon, 28 Mar 2016 15:27:14 -0400<br>> Subject: Re: [SR-Users] Timeout Handling (update)<br>> <br>> Hello,<br>> <br>> You cannot handle SIP eventualities by checking the return value of <br>> t_relay(); a call to t_relay() will almost always succeed immediately, <br>> unless there is an a priori failure out of hand (e.g. cannot send from <br>> socket, DNS lookup failure, etc.).<br>> <br>> Instead, you must do this in a failure_route:<br>> <br>> route {<br>>     ...<br>>     t_on_failure("FAILURE_ROUTE");<br>> <br>>     if(!t_relay())<br>>        sl_reply_error();<br>> }<br>> <br>> failure_route[FAILURE_ROUTE] {<br>>     if(t_is_canceled())<br>>        exit;<br>> <br>>     if(t_branch_timeout()) {<br>>        # Handle your timeout case here.<br>> <br>>        $ru = new value etc.<br>> <br>>        t_relay();<br>>        exit;<br>>     }<br>> }<br>> <br>> <br>> -- <br>> Alex Balashov | Principal | Evariste Systems LLC<br>> 1447 Peachtree Street NE, Suite 700<br>> Atlanta, GA 30309<br>> United States<br>> <br>> Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)<br>> Web: http://www.evaristesys.com/, http://www.csrpswitch.com/<br>> <br>> _______________________________________________<br>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>> sr-users@lists.sip-router.org<br>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<br></div>                                           </div></body>
</html>