<div class="gmail_quote">Hi mark, the entire solution that I sent needs to save registration to database, then when one opensips bring up load at start up all registration saved on database to memory.<br>Both opensips must connect to the same database, then you need MySQL server located on another server, then you will be thinking about MySQL HA problem.. but it's another topic :)<br>
<br>Best,<br><font color="#888888"><br>Gustavo</font><div><div></div><div class="Wj3C7c"><br><div class="gmail_quote">On Tue, Dec 2, 2008 at 10:18 AM, mark morreny <span dir="ltr"><<a href="mailto:markmorreny@gmail.com" target="_blank">markmorreny@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>This solution will work for me but it may not solve the whole problem. Let's say when the server is bought back up, it will start off with no registration information. When the B2BUA sends it the INVITE request, it would then reply User Not Found, even that user is already registered with the other opensips servers. <br>
<br>Is there a solution for this problem?<br><br>Alternatively, maybe I can write the location into db, but that means each opensips would have to replicate the info in the db for all the users. This is also not a very nice option either. <br>
<br>Is there anyway for all the opensips server to share the info in one single db table? It looks like in the location table, there is a domain field and each opensips only identify the users under its own domain.<br><br>
Any suggestion will be greatly appreciated.<br><br><br>Thanks,<br><font color="#888888">Mark</font><div><div></div><div><br><br><br><br><div class="gmail_quote">On Fri, Nov 28, 2008 at 11:03 AM, Gustavo Mistrinelli <span dir="ltr"><<a href="mailto:gmistrinelli@gmail.com" target="_blank">gmistrinelli@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Mark, I'm sending below code to meet your request.<br>On each server you need to put it code inside REGISTER method and replace LOCAL_IP, PAIR_IP with your real information<br>
When one OpenSIPS receive a REGISTER save it in memory and database and then send it to the other pair OpenSIPS.<br>
<br>...<br># Register method<br><br> if ( !(src_ip=="PAIR_IP" && src_port==5060) ) {<br> # Register is for me<br> if (!save("location")) {<br> sl_reply_error();<br> exit;<br> } <br>
add_sock_hdr("Local-Sock");<br> force_send_socket( "LOCAL_IP");<br> t_replicate("sip:PAIR_IP:5060"); # send to the other sip server<br> } else {<br> # it's a replicated REGISTER<br>
# set the flag for retrieving sock_info from header<br> # save contact, but only in cache<br> save("location","0x01");<br> };<br><br>I hope my can undertand my explanation and code.<br><br>
Cheers,<br>
<br>Gustavo<br><br><div class="gmail_quote"><div><div></div><div>On Fri, Nov 28, 2008 at 12:36 AM, mark morreny <span dir="ltr"><<a href="mailto:markmorreny@gmail.com" target="_blank">markmorreny@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>
<div>Hi,</div>
<div> </div>
<div>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?</div>
<div> </div>
<div>Thanks,</div>
<div>Mark</div>
<br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><font color="#888888">Gustavo Mistrinelli<br>
</font></blockquote></div><br>
</div></div></blockquote></div>
</div></div></div><br><br clear="all"><br>-- <br>Gustavo Mistrinelli<br>