[OpenSIPS-Users] Load balancing to Asterisk
Stephen Vigus
svigus at gmail.com
Fri Jun 28 12:05:59 CEST 2013
Hi Bogdan
Thanks for the suggestion. If I understand you right, I should have rule to
try the subscriber locally first before sending it to the LB.
I'll try and figure it out. I'm still trying to wrap my head around the
routing concept in Opensips, coming from Asterisk diaplan syntax background.
Regards
Stephen
On Fri, Jun 28, 2013 at 11:18 AM, Bogdan-Andrei Iancu
<bogdan at opensips.org>wrote:
> **
> 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 Developerhttp://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 listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130628/e0b97e95/attachment.htm>
More information about the Users
mailing list