Is there a way to save the contact binding on the reply? save("location") throws an error that says it cannot be used in reply blocks.<div><br></div><div>Thanks.</div><div><br></div><div>-Daniel</div><div><br></div>
<div>Nov 2 02:21:27 [61791] CRITICAL:core:yyerror: parse error in config file, line 417, column 10-11: Command cannot be used in the block</div><div><br></div><div><div>onreply_route[2]</div><div>{</div><div> if (status =~ "2[0-9][0-9]")</div>
<div> {</div><div> save("location");</div><div> };</div><div>}</div><div><br></div><div>If I can't use the save("location") in the onreply block, then how do I cache the contact binding? </div>
<div><br></div><div>Is there a way to do it from within a module? I might consider coding something up if that is the case. What module does the save command live in?</div><br><div class="gmail_quote">On Fri, Oct 31, 2008 at 1:47 AM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<div><div></div><div class="Wj3C7c"><br>
<br>
On 10/30/08 01:10, Daniel Corbe wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="Wj3C7c">
Guys,<br>
<br>
When attempting to pass REGISTER requests up stream I get the following error messages on the console (below). This also brings up the question of "what is the best way to simply pass REGISTER requests on to an upstream registrar?"<br>
<br>
Thanks for the help.<br>
<br>
-Daniel<br>
<br>
<br>
REGISTER: NATed client, enabling NAT<br>
Oct 29 18:03:58 [48175] ERROR:tm:t_forward_nonack: no branch for forwarding<br>
Oct 29 18:03:58 [48175] ERROR:tm:w_t_relay: t_forward_nonack failed<br>
Oct 29 18:03:58 [48175] ERROR:tm:t_forward_nonack: no branch for forwarding<br>
Oct 29 18:03:58 [48175] ERROR:tm:w_t_relay: t_forward_nonack failed<br>
Oct 29 18:03:59 [48175] CRITICAL:tm:t_should_relay_response: pick_branch failed (lowest==-1) for code 401<br>
<br>
Here's the relevant parts of my ser config;<br>
<br>
in route[1]<br>
<br>
route[1]<br>
{<br>
...<br>
if (method == "REGISTER")<br>
{<br>
route(2);<br>
}<br>
route(1);<br>
}<br>
<br>
route[2]<br>
{<br>
# Check to see if the UAC is trying to UNREGISTER. If not test<br>
# for NAT. If NAT is present, we mark it as such before we save()<br>
# the location, that way flag 6 is always set for NATed UAs.<br>
if (!search("^Contact:[ ]*\*") && nat_uac_test("19")) {<br>
xlog("L_NOTICE", "REGISTER: NATed client, enabling NAT\n");<br>
setflag(6);<br>
fix_nated_register();<br>
force_rport();<br>
};<br>
<br>
# We must handle replies for registrations, for caching and location<br>
# tracking purposes.<br>
t_on_reply("1");<br>
t_on_failure("1");<br>
<br>
# Check for digest<br>
#if (radius_www_authorize(""))<br>
#{<br>
# xlog("L_NOTICE", "REGISTER: No Digest, sending challenge\n");<br>
# www_challenge("", "0");<br>
# exit;<br>
#}<br>
<br>
# Digest was good if we get here<br>
#save("location");<br>
<br>
# Relay register to porta<br></div></div>
t_relay("<a href="http://216.151.143.69" target="_blank">216.151.143.69</a> <<a href="http://216.151.143.69" target="_blank">http://216.151.143.69</a>>");<div class="Ih2E3d"><br>
}<br>
<br>
onreply_route[2]<br>
{<br>
if (status =~ "2[0-9][0-9]")<br>
{<br>
# save("location");<br>
};<br>
}<br>
</div></blockquote>
you need a line with:<br>
<br>
exit;<br>
<br>
at the end of route[2]. Also, there seem to be looping in route[1] if you handle non-REGISTER.<br>
<br>
Cheers,<br>
Daniel<br><font color="#888888">
<br>
-- <br>
Daniel-Constantin Mierla<br>
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
<br>
</font></blockquote></div><br></div>