[OpenSIPS-Users] Opensips load balancing cluster

Gustavo Mistrinelli gmistrinelli at gmail.com
Fri Nov 28 04:03:41 CET 2008


Hi Mark, I'm sending below code to meet your request.
On each server you need to put it code inside REGISTER method and replace
LOCAL_IP, PAIR_IP with your real information
When one OpenSIPS receive a REGISTER save it in memory and database and then
send it to the other pair OpenSIPS.

...
# Register method

  if ( !(src_ip=="PAIR_IP" && src_port==5060) ) {
    # Register is for me
    if (!save("location")) {
      sl_reply_error();
      exit;
    }
    add_sock_hdr("Local-Sock");
    force_send_socket( "LOCAL_IP");
    t_replicate("sip:PAIR_IP:5060"); # send to the other sip server
  } else {
    # it's a replicated REGISTER
    # set the flag for retrieving sock_info from header
    # save contact, but only in cache
    save("location","0x01");
  };

I hope my can undertand my explanation and code.

Cheers,

Gustavo

On Fri, Nov 28, 2008 at 12:36 AM, mark morreny <markmorreny at gmail.com>wrote:

> Hi,
>
> I am working on setting up a cluster of opensips server.  Opensips is
> writing the urs_loc info in the location table of mysql.  Let's say usc-a
> registers with opensips-A and usc-b registers with opensips-B, when usc-a
> calls usc-b, opensips would say that the user is not found.  Both usc-a and
> usc-b data is in the location identified by the different opensips's ip.
> Does anyone know how to make the two opensips to share the registration
> infoation?
>
> Thanks,
> Mark
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>


-- 
Gustavo Mistrinelli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20081128/bf59f760/attachment-0001.htm 


More information about the Users mailing list