[OpenSIPS-Users] Problem with Routing (extension -> opensips -> isp)
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Fri Sep 18 11:53:47 CEST 2009
HI Sheran,
Sheran Corera wrote:
> 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..
>
So, bottom line, one incoming REGISTER must be parallely forked to
several 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();
> }
> }
> }
>
This not really correct - do not do 2 t_relays for a single request.
Better do parallel forking (fork the request in 2 directions) or
replication (send to a primary destination and replicated it to a
secondary one).
> 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)
>
I understand the problem is * registers as contact point the IP of
opensips? Or it is about the SIP domain in AOR ?
Regards,
Bogdan
> 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..
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
More information about the Users
mailing list