I don't entirely remember the way the arming of the flags works and how they persist across failure_routes. Maybe someone can comment on that?<div><br></div><div>Instead of using flags, call:</div> $avp(i:500) = 1; # Initialize counter of failed attempts<br>
<div><br></div><div>from your main route block, before failure route is called. <br><br></div><div>Let us know how that works for you..</div><div>-Brett</div><div><br><div class="gmail_quote">On Thu, May 28, 2009 at 7:34 AM, Andrew Pogrebennyk <span dir="ltr"><<a href="mailto:andrew.pogrebennyk@portaone.com">andrew.pogrebennyk@portaone.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Brett Nemeroff wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
You should be able to track this with avps. What version are you running? I<br>
know that in at least the newer versions of opensips, this<br>
is definitely supported:<a href="http://www.opensips.org/Resources/DocsCoreVar14" target="_blank">http://www.opensips.org/Resources/DocsCoreVar14</a><br>
"The AVPS will be visible in all routes where any message (reply or request)<br>
of the transaction will be processed - branch_route , failure_route,<br>
onreply_route (for this last route you need to enable the TM parameter *<br></div>
onreply_avp_mode*)."<br>
</blockquote>
<br>
Thanks. I don't have the config or the logs at hand at this moment but I tried something like this yesterday:<br>
<br>
failure_route[1] {<br>
if (!isflagset(31)) {<br>
$avp(i:500) = 1; # Initialize counter of failed attempts<br>
setflag(31);<br>
} else {<br>
$avp(i:500) = $avp(i:500) + 1; # OR:<br>
# avp_op("$avp(i:500)", "add/1");<br>
}<br>
if ($avp(i:500) > 2) {<br>
t_reply("503", "Couldn't complete the call");<br>
exit;<br>
}<br>
if (next_gw()) {<br>
t_on_failure("1");<br>
t_relay();<br>
} else {<br>
t_reply("503", "No gateways");<br>
exit;<br>
};<br>
}<br>
<br>
As a result of incrementing AVP variable, no matter which way, the OpenSIPS sends out some junk and then crashes... I'm using 1.4.4.<br>
<br>
-- <br>
Sincerely,<br>
Andrew Pogrebennyk<br>
PortaOne, Inc., QA Engineer<br>
<a href="mailto:andrew.pogrebennyk@portaone.com" target="_blank">andrew.pogrebennyk@portaone.com</a><br>
Tel: +1-866-SIP VOIP (+1 866 747 8647) ext. 7133<br>
<br>
Meet us on June 1-3 at ITW, Booth 802<br>
Marriott Wardman Park Hotel, Washington, DC<br>
<a href="http://www.internationaltelecomsweek.com/" target="_blank">http://www.internationaltelecomsweek.com/</a><br>
</blockquote></div><br></div>