[OpenSIPS-Users] 404 automatic failover

Brett Nemeroff brett at nemeroff.com
Mon Oct 12 17:12:33 CEST 2009


This is not the right way to do it.
just set the initial hostport, then arm the failure route:
t_on_failure("1");

then t_relay() like normal.

Then setup a failure route:
failure_route[1] {

}

and perform your t_check_status and rewrite etc in there (perform a second
rewritehostport) then t_relay again..

This is pretty basic scripting stuff.. I'd encourage you to go over the
examples.

-Brett


On Mon, Oct 12, 2009 at 10:03 AM, Pacho Baratta [fabbricadigitale] <
P.Baratta at fabbricadigitale.it> wrote:

>
>
> Hi all, i need some help with an issue. i'm quite a newbie, so be patien,
> please. i need to redirect all calss to a different gateway when the 1st
> returns a sip404.
>
> my route is like this: if (is_method("INVITE")) {
>
> if(uri=~"^sip:*@*") {
>
> rewritehostport("172.30.1.110:5060");
>
> #
>
> if (t*check*status("404")) { sethostport("192.168.2.100:5060");
>
>           t_relay();
>
>     }
>
> #
>
> route(1);
>
> }
>
> but this doesn't seem to work.
>
> can yoi suggest me the right way to do it?
>
> thanks, Pacho
>
>
>
>
>
> fabbrica*digitale* srl
>
> *Pacho Baratta | Senior Systems Engineer *
>
> Tecnhology Engineering
>
> -----------------------------
>
> Via A.Volta, 3 - 26041 – Casalmaggiore - CR
>
> Phone +39 0375 284600
>
> Fax +39 02 57760002
>
> *mailto:p.baratta at fabbricadigitale.it <p.baratta at fabbricadigitale.it>
> *www.fabbricadigitale.it* *
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20091012/7e294d46/attachment.htm 


More information about the Users mailing list