<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<STYLE>.hmmessage P {
        PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
BODY.hmmessage {
        FONT-FAMILY: Calibri; FONT-SIZE: 12pt
}
</STYLE>

<META name=GENERATOR content="MSHTML 8.00.6001.23588"></HEAD>
<BODY class=hmmessage bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi Moacir,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I use keepalived and MySQL in a similar way to what 
you have described.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Keepalived to manage an active/passive Kamailio 
pair and MySQL to store relevant data.  I have both Master-Master and 
Galera in use for MySQL.  Mater-Master (again using Keepalived for an 
active/passive pair) is rock-solid.  Galera is good, although occasionally 
the cluster will stop and need to be manually recovered - maybe I need to update 
to later software.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I use Kamailio primarily for call routing, so do 
not store state - so cannot advise on ability to find a called number.  If 
you are storing all info to the DB I would hope the 2nd server would have access 
to the system state at the time the first server became inactive.  You 
would just lose whatever calls ended during the period between 1st server 
failing and 2nd starting (max 20-30 seconds in my experience).</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Kind regards,</FONT></DIV>
<DIV><FONT size=2 face=Arial>Mark</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV 
  style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> 
  <A title=moacirferreira@hotmail.com 
  href="mailto:moacirferreira@hotmail.com">Moacir Ferreira</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A 
  title=sr-users@lists.sip-router.org 
  href="mailto:sr-users@lists.sip-router.org">Kamailio Mail List</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, June 05, 2016 10:26 
PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [SR-Users] High 
  availability</DIV>
  <DIV><BR></DIV>
  <DIV dir=ltr>Hi,<BR><BR>Sorry... I should have mentioned before. You guys are 
  thinking on the standard Internet SIP calls' behavior while I am trying to use 
  Kamailio on a large "industrial" project. This said:<BR><BR>Assuming that the 
  end-point is "smart", the DNS method is functional but it would take quite a 
  while before the UA (phone) recovers from the previous name/IP binding it has 
  in cache;<BR>SRV is good for a "smart" UA that, unfortunately, is not the 
  case;<BR>Same for the phone units as they are industrial "Help Points" and so 
  quite "dummy".<BR><BR>While I never tested it, I thought I could use two 
  Kamailio servers with a mysql cluster like mariadb-galera where, for Kamailio 
  functions, one server would be "active" and another "passive" server. Then use 
  keepalived for monitoring the "active" Kamailio and starting the "passive" 
  server if the active Kamailio fails. Without any testing, tests that I think I 
  should have done before putting questions in here, my questions 
  are:<BR><BR>Suppose that  I have two Kamailio servers, one "active" and 
  another one "passive" (not running) where the mysql databases are synchronized 
  in between two servers using MySQL Galera. Using keepalived I would monitor 
  the active Kamailio instance. Should it fails, start the "passive" Kamailio 
  instance using the same MySQL database that were supposed to be synchronized. 
  Would this new Kamailio instance be able to find a called number? Why this 
  question? As long as I understand, Kamailio will always challenge the UA for 
  authentication before making a call, so if this second server gets a call 
  request it would just challenge and authenticate the caller. The "key point" 
  would be having this new Kamailio instance aware about the called 
  destinations. So, delivering a MySQL database, with the latest data the active 
  Kamailio had, to this new Kamailio instance would be enough to allow it find 
  the called party?<BR><BR>Anyway, can you guys comment on my "thoughts"? Is it 
  possible? Am I missing something? Would you suggest another approach for such 
  scenario?<BR><BR>Cheers!<BR>Moacir <BR><BR>
  <DIV>
  <HR id=stopSpelling>
  Date: Sun, 5 Jun 2016 21:07:41 +0200<BR>From: chabert.loic.74@gmail.com<BR>To: 
  sr-users@lists.sip-router.org<BR>Subject: Re: [SR-Users] High 
  availability<BR><BR>
  <P dir=ltr>Hello Bill,</P>
  <P dir=ltr>I have made kamailio ha using exabgp with loopbacks.</P>
  <P dir=ltr>Check <A href="https://github.com/Exa-Networks/exabgp" 
  target=_blank>https://github.com/Exa-Networks/exabgp</A></P>
  <P dir=ltr>With bgp, kamailio cluster can be splited on severals 
  datacenters.</P>
  <P dir=ltr>Regards.</P>
  <DIV class=ecxgmail_quote>Le 5 juin 2016 20:53, "Bill" <<A 
  href="mailto:bill@novatrope.us">bill@novatrope.us</A>> a écrit :<BR>
  <BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; PADDING-LEFT: 1ex" 
  class=ecxgmail_quote>
    <DIV>Hi Moacir<BR><BR>We have only found three ways to handle 
    failover.<BR>1. Change the DNS entry whenever a failure is detected.<BR>2. 
    Use SRV records to display an alternate route.<BR>3. Use the failover 
    mechanism in the phone itself<BR><BR>1. works, but it may take some time for 
    your ua's to become aware of the change<BR>2. never have been able to get 
    this to work as advertised.<BR>3. Works pretty well depending on the phone. 
    (We use mostly Yealink's and they seem to handle the failover pretty 
    well.)<BR><BR>Hope this helps<BR><BR>
    <DIV>On 06/05/2016 07:41 AM, Moacir Ferreira wrote:<BR></DIV>
    <BLOCKQUOTE>
      <DIV dir=ltr>Hi,<BR><BR>I got two questions regarding high 
      availability:<BR><BR>1 - Should my Kamailio server fail, I would like 
      another Kamailio "box/server" to take over with minimum services 
      disruption. What is the "community" advice for such environment?<BR><BR>2 
      - Should my main PSTN gateway fail, what would be the best mechanism to 
      redirect calls to a second PSTN 
      gateway?<BR><BR>Cheers!<BR>Moacir<BR></DIV><BR>
      <FIELDSET></FIELDSET> <BR><PRE>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<A href="mailto:sr-users@lists.sip-router.org" target=_blank>sr-users@lists.sip-router.org</A>
<A href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target=_blank>http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</A>
</PRE></BLOCKQUOTE><BR></DIV><BR>_______________________________________________<BR>SIP 
    Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<BR><A 
    href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</A><BR><A 
    href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" 
    rel=noreferrer 
    target=_blank>http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</A><BR><BR></BLOCKQUOTE></DIV><BR>_______________________________________________ 
  SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list 
  sr-users@lists.sip-router.org 
  http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</DIV></DIV>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>SIP Express Router 
  (SER) and Kamailio (OpenSER) - sr-users mailing 
  list<BR>sr-users@lists.sip-router.org<BR>http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<BR></BLOCKQUOTE><br />
<table style="border-top: 1px solid #D3D4DE;">
        <tr>
        <td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/2016/icons/icon-envelope-tick-round-orange_184x116-v1.png" height="29px" /></a></td>
                <td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>
                </td>
        </tr>
</table></BODY></HTML>