[OpenSER-Users] srv load-balancing

David Villasmil david.villasmil.work at gmail.com
Sun May 4 21:02:12 CEST 2008


My two cents:

my pertinent config part is:

loadmodule "dispatcher.so"

modparam("dispatcher", "list_file", "/etc/openser/dispatcher.list")
route{
...

     if (method=="INVITE"||method=="CANCEL") {
               #    INTERNATIONAL/NATIONAL CALLS DIALED WITH 0+
               if (uri=~"^sip:0"){
                    xlog("L_ERR", "\n**************
INTERNATIONAL/NATIONAL CALL DIALED WITH 0+ ************\n");
                    route(5);
               }
     }
...
}

route[5] {

     #         AUTHORIZE AND ROUTE CALL

     if(!proxy_authorize("","subscriber"))
     {
          proxy_challenge("","0");
          exit;
     }

     xlog("L_NOTICE", "\n************** GOT OUTSIDE CALL ************\n");
     ds_select_dst("1","2");
     sl_send_reply("100","Trying");
     forward();
     exit();
}


and my dispatcher.list is:

# group sip addresses of my asterisk for rtps
1 sip:IP_SERVER_1:5060
1 sip:IP_SERVER_2:5060


Works like a charm! beautiful!


Have fun!


David

On Sun, May 4, 2008 at 3:47 PM, toly <hippo_big at hotmail.com> wrote:
>
>  User dispatcher module, openser does not do load balancing based on SRV
>  records itself.
>
>
>
>
>  Stanisław Pitucha-2 wrote:
>  >
>  > Hi,
>  > I've got a problem with openser servers and load balancing. Current setup
>  > contains 2 asterisks and 2 opensers. I've got a srv record xxx for both
>  > asterisk-1 and asterisk-2 - same priorities and weights.
>  > Openser's config runs basically:
>  >
>  > rewritehostport("xxx");
>  > t_relay();
>  >
>  > But all packets go to first host on the list anyways. For example now I
>  > get this from dns (same order):
>  >
>  > _sip._udp.xxx. 300 IN SRV 1 50 5060 asterisk-2
>  > _sip._udp.xxx. 300 IN SRV 1 50 5060 asterisk-1
>  >
>  > and got 6 calls on asterisk-2 and none on asterisk-1. If I change the
>  > order, all calls go to the first host on the list. Shouldn't openser do
>  > load-balancing in this scenario? I don't use any options in t_relay().
>  >
>  > Thanks for ideas.
>  >
>  > _______________________________________________
>  > Users mailing list
>  > Users at lists.openser.org
>  > http://lists.openser.org/cgi-bin/mailman/listinfo/users
>  >
>  >
>
>  --
>  View this message in context: http://www.nabble.com/srv-load-balancing-tp17017757p17046607.html
>  Sent from the OpenSER Users Mailing List mailing list archive at Nabble.com.
>
>
>
>
>  _______________________________________________
>  Users mailing list
>  Users at lists.openser.org
>  http://lists.openser.org/cgi-bin/mailman/listinfo/users
>


More information about the Users mailing list