<div dir="ltr">I found t_on_branch_failure() in 4.1.  Would that be the way to handle this?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 13, 2014 at 1:36 PM, Marc Soda <span dir="ltr"><<a href="mailto:msoda@coredial.com" target="_blank">msoda@coredial.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Can someone tell me how to handle a 401 from a 302 redirect?  I am attempting to register with the uac module.  Normally, I set a failure route for the 401 and call auc_auth().  In this case, I am receiving a 302, sending the register with get_redirects(), then getting a 401.  However, Kamailio seems to be ignoring the 401.  I see it in an onrely_route, but not a failure route.<div>

<p><font face="courier new, monospace">failure_route[REG_AUTH] {<br>  xlog("L_NOTICE","route[REG_AUTH]\n");<br><br>  # Handle redirects<br>  if ($T_reply_code == 302) {<br>    get_redirects("*", "Redirected");<br>

    t_on_failure("REG_AUTH");<br>    route(RELAY);<br>  } else if ($T_reply_code == 401) {<br>    uac_auth();<br>    t_on_reply("REG_REPLY");<br>    route(RELAY);<br> }<br>}<br><br>route[RELAY] {<br>  xlog("L_NOTICE","route[RELAY] ($rm)\n");<br>

<br>  if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) {<br>    if (!t_is_set("branch_route")) t_on_branch("MANAGE_BRANCH");<br>  }<br><br>  if (is_method("INVITE|SUBSCRIBE|UPDATE")) {<br>

    if (!t_is_set("onreply_route")) t_on_reply("MANAGE_REPLY");<br>  }<br><br>  if (is_method("INVITE")) {<br>    if (!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE");<br>

  }<br><br>  xlog("L_NOTICE","t_relay()'ing ($rm)\n");<br><br>  if (!t_relay()) {<br>    sl_reply_error();<br>  }<br>  exit;<br>}</font></p>Thanks!</div><span class="HOEnZb"><font color="#888888"><div>
<br></div><div>Marc</div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><br></div><div>Marc Soda, Sr. Systems Engineer</div><div><b><font color="#000099">CoreDial, LLC</font></b> | <a href="http://www.coredial.com" target="_blank">www.coredial.com</a></div>
<div><br></div><div>1787 Sentry Parkway West, Building 16, Suite 100, Blue Bell, PA 19422</div><div>Office: (215) 297-4400 x203 | Fax: (215) 297-4401 | Email: <a href="mailto:msoda@coredial.com" target="_blank">msoda@coredial.com</a></div>
<div><br></div><div>- - - - -</div><div><br></div><div>The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission,  dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.</div>

</div>