[OpenSIPS-Users] Problem with Routing (extension -> opensips -> isp)

Sheran Corera sherancorera at gmail.com
Tue Sep 15 14:01:55 CEST 2009


Hi,

I am trying to use my opensips application to work as a router whereby
extensions would be registered in my opensips box and the REGISTER
request would be forwarded to my ISP. If the ISP is down it would
connect to a secondary ISP. So essentially what I am trying to do is
route the REGISTER messages of a given extension to multiple ISPs..

Currently what I have done is this in my opensips.cfg file is this

route{

        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                exit;
        }

        if (src_ip == 192.168.7.48) {

                #remove misleading CONTACT header line
                remove_hf("Contact");
                #remove UTF-8 information, as * is not able to process
it properly
                subst("/^(CONTENT-TYPE:.*);[ ]*charset=utf-8(.*)/\1\2/");
                #relay request to

                #relay register to server 1
                if (!t_relay("udp:192.168.15.41:5060")) {
                        xlog("LOG: Goto asterisk  \n");
                        sl_reply_error();
                }

                #relay register to server 2
                if (!t_relay("udp:192.168.15.42:5060")) {
                        xlog("LOG: Goto asterisk  \n");
                        sl_reply_error();
                }
         }
}

so that registrations are now forwarded to the relay point (for
testing purposes i have setup 2 asterisk installations). This works
fine but asterisk registers the extension with the opensips domain.
How do I change the domain part so that opensips passes the src_ip
(the ip of the extension) to asterisk (external ISP) instead? (so that
I would be able to register the extension on multiple ISPs and switch
between them when i want without having to re register each time and
the ISP would be able to communicate with the local extension to passs
incoming calls directly to it)

An alternative solution would be to make my opensips to work as an
inbound server but that seems quite complicated. The help given is
very much appreciated.

Cheers..
Sheran

P.S - Sorry for the capitals..



More information about the Users mailing list