[OpenSIPS-Users] Using OpenSIPS as Proxy to Asterisk

Pasan Meemaduma pasandev at ymail.com
Thu Jul 21 11:47:26 CEST 2011


HI Michael,

I would say you can get each sip messages (REGISTER,INVITE,ACK,BYE) routed to your asterisk server using rewritehostport("<your_ip>:5060");

you can configure proxy as your opensips in sip clients with port 5260.


if(is_method("REGISTER")){
              rewritehostport("<your_ip>:5060");  # This will forward any register packet to your asterisk. 

              route(1);  # <-- this route actually send the sip packet to asterisk
}


route[1] {

      if (!t_relay()) {
               xlog("L_INFO", "(Rewriting) t_relay 1 - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
              sl_reply_error();
       }
       t_on_reply("1");
       t_on_failure("1");               
}



Just as above you can route other sip messages as well to your asterisk box.



________________________________
From: Michael <voip.question at gmail.com>
To: OpenSIPS users mailling list <users at lists.opensips.org>
Sent: Thursday, July 21, 2011 2:56 PM
Subject: Re: [OpenSIPS-Users] Using OpenSIPS as Proxy to Asterisk


On Thu, Jul 21, 2011 at 12:20 PM, Gareth Blades <list-asterisk at skycomuk.com> wrote:

 
>The only documentation I know of is
>http://www.opensips.org/Resources/DocsTutAsterisk
>

In this tutorial, the extensions register to OpenSIPS, while we would like to use it only as a Proxy and not as a Registrar, so that a few of the extensions would be able to register to Asterisk and make/receive calls to/from it, going through OpenSIPS, as a simple relay only. I assume it should be possible.

_______________________________________________
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/20110721/93bddabf/attachment.htm>


More information about the Users mailing list