[OpenSIPS-Users] Load balancing to Asterisk

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Jun 28 11:18:14 CEST 2013


Hello Stephen,

When receiving a call in opensips you need (by looking at the dialed
number) to make difference between subscribers (extensions) and call to
be sent to LB. Can you do that ?

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 06/28/2013 09:36 AM, Stephen Vigus wrote:
> Hi guys
>
> First time posting to the list.
>
> I am investigating the use of Opensips to load balance between
> Asterisk boxes. I have a running testing environment, where Opensips
> successfully load balances between the Asterisk boxes. However, after
> a few days of reading and struggling, I came to a dead end with a
> specific test.
>
> I have my extensions registered to Opensips and want them to be able
> to phone each other, but I cannot seem to get this working. Every time
> I attempt to dial another extension, I see the dialplan triggered on
> one of the Asterisk boxes and then it fails.
> Calls coming in over a trunk are load balanced fine and reaches an IVR
> I configured on both Asterisk boxes.
>
> What am I missing or doing wrong?
>
> Below are my routing in opensips.cfg:
> route{
>
>         if (!mf_process_maxfwd_header("10")) {
>                 sl_send_reply("483","Too Many Hops");
>                 exit;
>         }
>
>         if (!has_totag()) {
>                 # initial request
>                 record_route();
>         }
>         else {
>                 # sequential request - obey the indicated route
>                 lookup("location");
>                 loose_route();
>                 t_relay();
>                 exit;
>         }
>
>         # handle cancel and re-transmissions
>         if ( is_method("CANCEL") ) {
>                 if ( t_check_trans() )
>                         t_relay();
>                 exit;
>         }
>
>        # record routing
>         if (!is_method("REGISTER|MESSAGE"))
>                 record_route();
>
>        if (is_method("REGISTER"))
>         {
>                 if (!save("location"))
>                         sl_reply_error();
>                 exit;
>         }
>
>
>         # from now on we have only the initial requests
>
>         # select the node that'll handle the call (load balanced)
>         # the method used is different for invite/register requests
>         # unknown methods are rejected here
>         if (is_method("INVITE")) {
>                 if (!load_balance("1","pstn","1")) {
>                         send_reply("503","Service Unavailable");
>                         exit;
>                 }
>         }
>
>         else {
>                 send_reply("405","Method Not Allowed");
>                 exit;
>         }
>
>         # route the request
>         if (!t_relay()) {
>                 sl_reply_error();
>         }
> }
>
>
> Please excuse me if this comes off as daft, this week was my first
> look into Opensips.
>
> Regards
> Stephen
>
>
> _______________________________________________
> 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/20130628/ec671234/attachment.htm>


More information about the Users mailing list