[OpenSIPS-Users] inbound "failoiver"

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Aug 18 11:14:28 CEST 2009


Hi Dmitri,

You can do this very simple with OpenSIPS/OpenSIP:

use the "registered" function ( see 
http://www.opensips.org/html/docs/modules/1.5.x/registrar.html#id271315) 
to check if the callee is registered with OpenSIPS or not.

Looking at the default OpenSIPS config file ( 
http://opensips.svn.sourceforge.net/viewvc/opensips/trunk/etc/opensips.cfg?revision=5795&view=markup) 
, before the lookup part (  if (!lookup("location","m")) {  ):

    # if callee 1020 and is not registered, forward to 1030
    if ( $rU=="1020" && !registered("location") )  {
          #rU = "1030" ;
    }

    # do lookup with method filtering
    if (!lookup("location","m")) {


Of course, you can do such kind of redirects based on rules in DB (and 
not static in the script), by using the AVPOPS module 
(http://www.opensips.org/html/docs/modules/devel/avpops.html)


Regards,
Bogdan

Dmitri G. wrote:
> Hello,
>
> I would like to implement some kind of failover for my Asterisk, let 
> me describe how I would like to see it.
>
>
> I registered 2 sip users with my Kamailio, 1020 at domain.com 
> <mailto:1020 at domain.com> and 1030 at domain.com <mailto:1030 at domain.com>.
> I have added aliases to 1020 (aliases from 1021 at domain com to 
> 1029 at domain.com <mailto:1029 at domain.com>).
>
> Right now calls to 1020-1029 goes well to 1020, it works fine.
>
> But I would like to do the following:
>
> If 1020 isn't registered with Kamailio (let's say if registration for 
> 1020 is down in Kamailio, so AOR not found for 1020), it is possible 
> to route calls to 1030?
> So route calls to 1030 only when registration for 1020 isn't active in 
> Kamailio.
>
> I have tried manipulating with faillure_route, but without any luck.
>
>
> I hope it is clear what I would like to do :)
>
>
> Any help would be much appreciated.
>
>
> Kind regards,
>
> Dmitri
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   




More information about the Users mailing list