<div class="gmail_quote"><div>Thanks Patrick,<br><br>I have re-configured a common database for the servers and I am still having the same issues. Can this be an issue with PAT at the Load balancer after failover since the INVITE is coming from&nbsp; openser_2 and going to the same IP:port associated with openser_1. <br>
<br>I am also open to trying other methods to achieve OpenSER registrar HA if any available.<br><br>Thanks.<br><br>Buki A<br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>---------- Forwarded message ----------<br>From:&nbsp;Patrick Miccio &lt;<a href="mailto:pmiccio@upcbroadband.com">pmiccio@upcbroadband.com</a>&gt;<br>To:&nbsp;&lt;<a href="mailto:users@lists.openser.org">users@lists.openser.org</a>&gt;<br>
Date:&nbsp;Thu, 6 Mar 2008 11:04:40 +0100<br>Subject:&nbsp;Re: [OpenSER-Users] issue - remote sip client must re-register after failover in Openser Registrar HA config<br>Hi,<br>
<br>
you need to have a common mysql table for the registrations so that when OpenSER_2 taks over it has the informations<br>
OpenSER_1 wrote in the DB.<br>
<br>
you can achieve this with a single mysql server, or better with a cluster ;)<br>
<br>
<br>
cheers,<br>
<br>
Patrick.<br>
<br>
<br>
&gt; Hi friends,<br>
&gt;<br>
&gt; I am having problems setting up seamless openser registrar failover. I am trying to setup OpenSER registrar HA using<br>
&gt; 2 openser registrars v1.3.0 behind a Netscaler citrix Load balancer and I cant get the failover scenario to work<br>
&gt; without re-registration of the remote sip client.<br>
&gt;<br>
&gt; I am desperately looking for tips to make this configuration work or any other ideas to achieve SIP registrar HA<br>
&gt; using OpenSER. Thanks.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; The setup is configured as active-passive and the 2nd OpenSER becomes active only after a Openser_1 fails and the LB<br>
&gt; fails-over to the 2nd. The 2 openser servers are SIP registrars for my voice network.<br>
&gt;<br>
&gt; REGISTRATION:<br>
&gt; remote SIP UA ---&gt; remote firewall ---&gt; internet ---&gt; my firewall ---&gt; citrix NA loadbalancer (VIP) ----&gt; openSER_1<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\---&gt;<br>
&gt; openSER_2<br>
&gt;<br>
&gt; 1. &nbsp; Remote SIP client configures the LB VIP as the SIP proxy and registers<br>
&gt; 2. &nbsp; the citrix LB gets the registrations and forwards to the active openser (say, openser_1)<br>
&gt; 3. &nbsp; openser_1 stores the contact as MIP:port in the mysql database<br>
&gt; 4. &nbsp; openser_1 replicates the registration to openser_2 (t_replicate)<br>
&gt;<br>
&gt; OUT-GOING CALL - before fail-over<br>
&gt; remote SIP UA &lt;--- remote firewall &lt;--- internet &lt;--- my firewall &lt;--- citrix NA loadbalancer (VIP) &lt;----&gt; openSER_1<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^<br>
&gt; openSER_2 |<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Asterisk<br>
&gt;<br>
&gt; 1. &nbsp; call (INVITE) is generated from asterisk and sent to LB VIP<br>
&gt; 2. &nbsp; the citrix LB gets the INVITE and forwards to the active openser (say, openser_1)<br>
&gt; 3. &nbsp; openser_1 looks-up the URI in the MySQL database, finds the MIP:port that the registration was received from the<br>
&gt; LB and forwards the INVITE to that destination. 4. &nbsp; the LB receives the INVITE and forwards it to the remote SIP<br>
&gt; client<br>
&gt;<br>
&gt;<br>
&gt; OUT-GOING CALL - after fail-over<br>
&gt; remote SIP UA ---x remote firewall ---x internet &nbsp; ---x my firewall ---x citrix NA loadbalancer (VIP) ----x &nbsp;openSER_1<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^<br>
&gt; \-----&lt; &nbsp; openSER_2 |<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Asterisk<br>
&gt;<br>
&gt; 1. &nbsp; call (INVITE) is generated from asterisk and sent to LB VIP<br>
&gt; 2. &nbsp; the citrix LB gets the INVITE and forwards to the openser now active (openser_2)<br>
&gt; 3. &nbsp; openser_2 looks-up the URI in the MySQL database, finds the same MIP:port of the LB that was replicated from<br>
&gt; openser_1 and forwards the INVITE to that destination. 4. &nbsp; the LB receives the INVITE and drops the packet without<br>
&gt; forwarding it out to the remote SIP client<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; For the outgoing call to work: the remote sip client either has to re-register, so the registration gets passed to<br>
&gt; openser_2. OR, openser_1 is made active again.<br>
&gt;<br>
&gt;<br>
&gt; Configuration of OpenSER:<br>
&gt;<br>
&gt; REGISTRATION:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # If this is a registration from the public UA,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # then we store it<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fix_nated_contact(); # use ip address of the packet instead of the sip message<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; force_rport(); # append rport. might not be necessary<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # save Registration in location table<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; save(&quot;location&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot;L_DBG&quot;, &quot;SipMsgId[$mi] Save Registration: To[$tu] Contact[$ct]\n&quot;);<br>
&gt; &nbsp; &nbsp; append_hf(&quot;CtlRegFwd: \r\n&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # replicate the register message to the backup registrar<br>
&gt; &nbsp; &nbsp; # if I am the backup, ignore the message<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!t_replicate(&quot;sip:openser_2:5060&quot;)) {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot;L_WARN&quot;, &quot;SipMsgId[$mi] Fail to replicate Contact[$ct] to fail over registrar\n&quot;);<br>
&gt;<br>
&gt; OUTGOING CALL:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Do lookup so it gets to the correct NATed destination<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!lookup(&quot;location&quot;))<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # this user has not REGISTERed or registration has expired<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot;L_INFO&quot;, &quot;SipMsgId[$mi] Send 404-Not Found (Msg rejected because user not found)\n&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };<br>
&gt;<br>
&gt; &nbsp; &nbsp; # keep track of reply<br>
&gt; &nbsp; &nbsp; t_on_reply(&quot;11&quot;);<br>
&gt; &nbsp; &nbsp; if (!t_relay())<br>
&gt; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot;L_DBG&quot;, &quot;SipMsgId[$mi] Failed t_relay. Do sl_reply_error.\n&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; sl_reply_error();<br>
&gt; &nbsp; &nbsp; };<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thank you for your anticipated help.<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Buki A<br>
<br>
<br></blockquote></div><br>