<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.sig
        {mso-style-name:sig;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The way I accomplish this is by having an active/passive cluster.  The two or more servers have individual IP addresses and running heartbeat creates a clustered IP address.  The active server uses the cluster IP address.  If the active server should fail then the cluster IP address moves to another server.  Each handset and peer uses the clustered IP address to communicate to the server.  This way all devices only communicate to a single server and you don’t have the problem of having different devices connected to different servers.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have created a Wiki page based on this which may help you. <a href="http://www.klaverstyn.com.au/david/wiki/index.php?title=Cluster">http://www.klaverstyn.com.au/david/wiki/index.php?title=Cluster</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The wiki mentions a script file to copy files between servers to keep the data consistent.  To do this more efficiently DRDB should be used but the scripts works well in my situation.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>Mikhail Lischuk<br><b>Sent:</b> Saturday, 19 May 2012 5:48 PM<br><b>To:</b> asterisk-users@lists.digium.com<br><b>Subject:</b> [asterisk-users] Extensions routing<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p>Greetings!<o:p></o:p></p><p>I've been playing around with &quot;clustering&quot; some Asterisk servers for sake of fail-over and load balancing with DNS round-robin, and came to one problem.<o:p></o:p></p><p>If I have, say, 2 servers, and clients register either on 1 or 2, how can I route extensions between them? I mean, if today user with extension 101 is registered on server1, and tomorrow he will register with server2 - how would any of servers know where to route it?<o:p></o:p></p><p>As some examples, if I have only 2 servers, things are not so bad. I can use Dial(SIP/101&amp;SIP/server2/101) on server1 and vice versa. OR, I can check the hungup code, and if it's 34 (or whatever I get when I try to dial unavailable peer) - try it on another server.<o:p></o:p></p><p>But I guess things get tricky when you have 3 or more servers, and besides maybe this solution is not the best one. Could you share some knowledge on this, please?<o:p></o:p></p><div><pre style='margin-bottom:12.0pt'><span class=sig><span style='color:#999999'>-- </span></span><br><span class=sig><span style='color:#999999'>With Best Regards</span></span><br><span class=sig><span style='color:#999999'><a href="mailto:mlischuk@itx.com.ua" title="mailto:mlischuk@itx.com.ua">Mikhail Lischuk</a></span></span><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre></div></div></body></html>