Your config really needs some work. For starters:<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(80, 0, 80); "><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US" style="font-size: 11pt; color: rgb(31, 73, 125); ">if(uri=~"^sip:*@*") {</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US" style="font-size: 11pt; color: rgb(31, 73, 125); ">rewritehostport("<a href="http://172.30.1.110:5060/" target="_blank" style="color: rgb(20, 125, 186); ">172.30.1.110:5060</a>");</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US" style="font-size: 11pt; color: rgb(31, 73, 125); "> }</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;">(ie: if uri is properly formated then...) Of course, there are other cases you might be checking for here, but I don't think that was the intention..</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;"><br>
</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;"><br>
</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;">So it might as well just be:</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;">rewritehostport("<a href="http://172.30.1.110:5060/" target="_blank" style="color: rgb(20, 125, 186); ">172.30.1.110:5060</a>");</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;">(without the IF statement around it).</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;"><br>
</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;">Next, you do a whole bunch of stuff after that rewrite that might end up rewriting the message again.. do you really want that? What I'm suggesting is that your order (where you stuck the rewrite) is off.</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;"><br>
</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;">Lastly, in the failure route, you should add a check for the 404 in it:</span></font></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-style-span" style="color: rgb(31, 73, 125); font-size: 15px; ">if (t_check_status("400|486|408<span class="Apple-style-span" style="background-color: rgb(51, 255, 51);">|404</span>")) {</span></p>
</span><div><font class="Apple-style-span" color="#1F497D" face="arial, sans-serif" size="4"><span class="Apple-style-span" style="border-collapse: collapse; font-size: 15px;"><br></span></font><br></div><div>See where that gets you..</div>
<div>-Brett</div><div><br><div class="gmail_quote">On Mon, Oct 12, 2009 at 11:11 AM, Pacho Baratta [fabbricadigitale] <span dir="ltr"><<a href="mailto:P.Baratta@fabbricadigitale.it">P.Baratta@fabbricadigitale.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="IT" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">If a place a call to a number that does not exist, the gateway
returns a 404.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">I want to redirect this call to a different gateway</span></p><div class="im">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D">fabbrica<b>digitale</b> srl </span></p>
<p class="MsoNormal"><b><span lang="PT-BR" style="font-size:8.0pt;color:#E60000">Pacho Baratta | Senior Systems Engineer </span></b></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:#1F497D">Tecnhology Engineering</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:#1F497D">----------------------------- </span><span style="color:#1F497D"></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:#1F497D">Via A.Volta, 3 - 26041 – Casalmaggiore - CR</span><span style="font-size:11.0pt;color:#1F497D"></span></p>
<p class="MsoNormal"><span lang="FR" style="font-size:8.0pt;color:#1F497D">Phone +39 </span><span lang="EN-GB" style="font-size:8.0pt;color:#1F497D">0375 284600</span><span lang="EN-GB" style="font-size:11.0pt;color:#1F497D"></span></p>
<p class="MsoNormal"><span lang="FR" style="font-size:8.0pt;color:#1F497D">Fax +39 </span><span lang="EN-GB" style="font-size:8.0pt;color:#1F497D">02 57760002</span><span lang="EN-GB" style="font-size:11.0pt;color:#1F497D"></span></p>
<p class="MsoNormal"><u><span lang="FR" style="font-size:8.0pt;color:#1F497D"><a href="mailto:p.baratta@fabbricadigitale.it" target="_blank">mailto:p.baratta@fabbricadigitale.it</a><br>
</span></u><span style="font-size:11.0pt;color:#1F497D"><a href="http://www.fabbricadigitale.it/" title="http://www.fabbricadigitale.it/" target="_blank"><span lang="EN-GB" style="font-size:8.0pt">www.fabbricadigitale.it</span></a></span><u><span style="font-size:8.0pt;color:#1F497D"> </span></u><span lang="EN-GB" style="font-size:11.0pt;color:#1F497D"></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
</div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt">From:</span></b><span lang="EN-US" style="font-size:10.0pt"> <a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>
[mailto:<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>] <b>On Behalf Of </b>Brett Nemeroff<br>
<b>Sent:</b> lunedì 12 ottobre 2009 18:06<br>
<b>To:</b> Pacho Baratta [fabbricadigitale]<br>
<b>Cc:</b> OpenSIPS users mailling list</span></p><div class="im"><br>
<b>Subject:</b> Re: [OpenSIPS-Users] 404 automatic failover</div><p></p>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Pacho,</p><div><div></div><div class="h5">
<div>
<p class="MsoNormal">This is better than before. But you haven't mentioned what
the problem is this time.</p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> </p>
<div>
<p class="MsoNormal">On Mon, Oct 12, 2009 at 11:03 AM, Pacho Baratta
[fabbricadigitale] <<a href="mailto:P.Baratta@fabbricadigitale.it" target="_blank">P.Baratta@fabbricadigitale.it</a>>
wrote:</p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">As I said, I’m really a
newbie. So I tried to modify the default routing logic, but no success.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Can you please tell me what’s
wrong with this?</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Thanks all, pacho</span></p>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</div></div></div>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div></div>