Hi friends,<br><br>I am having problems setting up seamless openser registrar failover. I am trying to setup OpenSER registrar HA using 2 openser registrars v1.3.0 behind a Netscaler citrix Load balancer and I cant get the failover scenario to work without re-registration of the remote sip client. <br>
<br>I am desperately looking for tips to make this configuration work or any other ideas to achieve SIP registrar HA using OpenSER. Thanks.<br><br><br><br>The setup is configured as active-passive and the 2nd OpenSER becomes active only after a Openser_1 fails and the LB fails-over to the 2nd. The 2 openser servers are SIP registrars for my voice network.<br>
<br>REGISTRATION:<br>remote SIP UA ---> remote firewall ---> internet ---> my firewall ---> citrix NA loadbalancer (VIP) ----> openSER_1 <br> \---> openSER_2 <br>
<br>1. Remote SIP client configures the LB VIP as the SIP proxy and registers<br>2. the citrix LB gets the registrations and forwards to the active openser (say, openser_1)<br>3. openser_1 stores the contact as MIP:port in the mysql database<br>
4. openser_1 replicates the registration to openser_2 (t_replicate)<br><br>OUT-GOING CALL - before fail-over<br>remote SIP UA <--- remote firewall <--- internet <--- my
firewall <--- citrix NA loadbalancer (VIP) <----> openSER_1 <br>
^ openSER_2<br> |<br> Asterisk<br>
<br>1. call (INVITE) is generated from asterisk and sent to LB VIP<br>2. the citrix LB gets the INVITE and forwards to the active openser (say, openser_1)<br>3. openser_1 looks-up the URI in the MySQL database, finds the MIP:port that the registration was received from the LB and forwards the INVITE to that destination. <br>
4. the LB receives the INVITE and forwards it to the remote SIP client<br><br><br>OUT-GOING CALL - after fail-over<br>remote SIP UA ---x remote firewall ---x internet ---x my
firewall ---x citrix NA loadbalancer (VIP) ----x openSER_1 <br>
^ \-----< openSER_2<br>
|<br>
Asterisk<br><br>1. call (INVITE) is generated from asterisk and sent to LB VIP<br>
2. the citrix LB gets the INVITE and forwards to the openser now active (openser_2)<br>
3. openser_2 looks-up the URI in the MySQL database, finds the same
MIP:port of the LB that was replicated from openser_1 and forwards
the INVITE to that destination. <br>4. the LB receives the INVITE and drops the packet without forwarding it out to the remote SIP client<br><br><br><br>For the outgoing call to work: the remote sip client either has to re-register, so the registration gets passed to openser_2. OR, openser_1 is made active again.<br>
<br><br>Configuration of OpenSER:<br><br>REGISTRATION:<br> # If this is a registration from the public UA,<br> # then we store it<br> fix_nated_contact(); # use ip address of the packet instead of the sip message<br>
force_rport(); # append rport. might not be necessary<br><br> # save Registration in location table<br> save("location");<br> xlog("L_DBG", "SipMsgId[$mi] Save Registration: To[$tu] Contact[$ct]\n");<br>
append_hf("CtlRegFwd: \r\n");<br> # replicate the register message to the backup registrar<br> # if I am the backup, ignore the message<br> if(!t_replicate("sip:openser_2:5060")) {<br>
xlog("L_WARN", "SipMsgId[$mi] Fail to replicate Contact[$ct] to fail over registrar\n");<br><br>OUTGOING CALL:<br><br> # Do lookup so it gets to the correct NATed destination<br>
if (!lookup("location"))<br> {<br> # this user has not REGISTERed or registration has expired<br> xlog("L_INFO", "SipMsgId[$mi] Send 404-Not Found (Msg rejected because user not found)\n");<br>
sl_send_reply("404", "Not Found");<br> exit;<br> };<br><br> # keep track of reply<br> t_on_reply("11");<br> if (!t_relay())<br> {<br> xlog("L_DBG", "SipMsgId[$mi] Failed t_relay. Do sl_reply_error.\n");<br>
sl_reply_error();<br> };<br><br><br><br>Thank you for your anticipated help.<br><br>Regards,<br><br>Buki A<br>