Sure thing. Glad you got it working.<div><br><br><div class="gmail_quote">On Mon, Oct 12, 2009 at 11:53 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">Brett,</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">the problem was with 400… it was not 404 as I believed</span><span lang="EN-US" style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">L</span><span lang="EN-US" 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>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">thanks so much for the support, as it works fine now</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:41<br>
<b>To:</b> <a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a></span></p><div><div></div><div class="h5"><br>
<b>Subject:</b> Re: [OpenSIPS-Users] 404 automatic failover</div></div><p></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">Please keep this discussion on the list. Other's may benefit
from your questions!!</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<p class="MsoNormal">How do you know it isn't called.. stick an xlog in there:</p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">failure_route[1]
{</span></p>
<p class="MsoNormal"><span><span style="font-size:11.5pt">
xlog("L_INFO","****** In failure route 1!!\n");</span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
if (t_was_cancelled()) {</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
exit;</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
}</span></p>
<div>
<p class="MsoNormal"> </p>
</div>
<p class="MsoNormal">Also, be sure to add the 404 check in:</p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">if
(t_check_status("400|486|408<span><span style="background:#33FF33">|404</span></span>")) {</span></p>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">On Mon, Oct 12, 2009 at 11:36 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">I don’t understand what you
mean.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">The
</span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">if(uri=~"^sip:*@*")
{</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">rewritehostport("<a href="http://172.30.1.110:5060/" target="_blank"><span style="color:#147DBA">172.30.1.110:5060</span></a>");</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D"> }</span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#500050"> </span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Seems to work fine, as I get
calls on existing numbers.</span></p>
<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:11.0pt;color:#1F497D">My failure route is like
this:</span></p>
<div>
<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:11.0pt;font-family:"Courier New";color:#1F497D">failure_route[1]
{</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
if (t_was_cancelled()) {</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
exit;</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
}</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D"> </span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
# uncomment the following lines if you want to redirect the failed</span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
# calls to a different new destination</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">if
(t_check_status("400|486|408")) {</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
sethostport("<a href="http://172.30.7.54:5060" target="_blank">172.30.7.54:5060</a>");</span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">#
rewritehostport("<a href="http://172.30.7.54:5060" target="_blank">172.30.7.54:5060</a>");</span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
## # do not set the missed call flag again</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D"> xlog("L_ERR",</span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
"404 calls are redirected");</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
t_relay();</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">
}</span></p>
<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:11.0pt;color:#1F497D">But it looks like it is not
called</span></p>
<div>
<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: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></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:#1F497D">Via A.Volta, 3 - 26041 – Casalmaggiore -
CR</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></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></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></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:21<br>
<b>To:</b> OpenSIPS users mailling list</span></p>
<div>
<div>
<p class="MsoNormal"><br>
<b>Subject:</b> Re: [OpenSIPS-Users] 404 automatic failover</p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Your
config really needs some work. For starters:</p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">if(uri=~"^sip:*@*")
{</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">rewritehostport("<a href="http://172.30.1.110:5060/" target="_blank"><span style="color:#147DBA">172.30.1.110:5060</span></a>");</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> }</span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:#1F497D">(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></p>
<p class="MsoNormal"><span style="color:#500050"> </span></p>
<p class="MsoNormal"><span style="color:#500050"> </span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:#1F497D">So it might as well just be:</span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:#1F497D">rewritehostport("<a href="http://172.30.1.110:5060/" target="_blank"><span style="color:#147DBA">172.30.1.110:5060</span></a>");</span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:#1F497D">(without the IF statement around it).</span></p>
<p class="MsoNormal"><span style="color:#500050"> </span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:#1F497D">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></p>
<p class="MsoNormal"><span style="color:#500050"> </span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:#1F497D">Lastly, in the failure route, you should
add a check for the 404 in it:</span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:#1F497D">if (t_check_status("400|486|408<span style="background:#33FF33">|404</span>")) {</span></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> </p>
</div>
<div>
<p class="MsoNormal">See
where that gets you..</p>
</div>
<div>
<p class="MsoNormal">-Brett</p>
</div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">On
Mon, Oct 12, 2009 at 11:11 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">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>
<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></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:#1F497D">Via A.Volta, 3 - 26041 – Casalmaggiore -
CR</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></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></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></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>
<p class="MsoNormal"><br>
<b>Subject:</b> Re: [OpenSIPS-Users] 404 automatic failover</p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Pacho,</p>
<div>
<div>
<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>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">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></p>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"> </p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>