<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=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@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:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle25
        {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:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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 bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>The dispatcher works now. I had forgot some iptables NAT rules from previous testing, and had to flush all my iptables NAT rules. The source IP is now correct.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><p class=MsoNormal><span style='color:#1F497D'>Tuomas Kaikkonen<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Software Developer | Twisted Pair Solutions<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>3131 Elliott Ave, Suite 200, Seattle, WA 98121<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Tel: (206) 812-0732<o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> users-bounces@lists.opensips.org [mailto:users-bounces@lists.opensips.org] <b>On Behalf Of </b>Tuomas Kaikkonen<br><b>Sent:</b> Tuesday, March 19, 2013 4:49 PM<br><b>To:</b> OpenSIPS users mailling list; Bogdan-Andrei Iancu<br><b>Subject:</b> Re: [OpenSIPS-Users] Load Balancer module for REGISTER as well as INVITE?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='color:#1F497D'>Trying dispatcher:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>mysql&gt; select * from dispatcher;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>+----+-------+---------------------------------------+-------+--------+-------+-------------+<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>| id | setid | destination&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; | flags | weight | attrs | description |<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>+----+-------+---------------------------------------+-------+--------+-------+-------------+<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>|&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp; 1 | <a href="sip:WWW.WWW.WWW.WWW:5060;transport=udp">sip:WWW.WWW.WWW.WWW:5060;transport=udp</a>&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 0 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>|&nbsp; 2 |&nbsp;&nbsp;&nbsp;&nbsp; 1 | <a href="sip:XXX.XXX.XXX.XXX:5060;transport=udp">sip:XXX.XXX.XXX.XXX:5060;transport=udp</a> |&nbsp;&nbsp;&nbsp;&nbsp; 0 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>+----+-------+---------------------------------------+-------+--------+-------+-------------+<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>The WWW and XXX are IP addresses in my actual database, just scrubbing them for posting to this mailing group.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>My opensips.cfg route for the dispatching opensips is this:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>route{<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( !mf_process_maxfwd_header(&quot;10&quot;) )<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; send_reply(&quot;483&quot;,&quot;To Many Hops&quot;);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( !ds_select_dst(&quot;1&quot;, &quot;0&quot;) ) {<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; send_reply(&quot;500&quot;,&quot;Unable to route&quot;);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_relay();<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>}<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>The database is shared by the three opensips servers. When I try to register my client with the SIP domain as the IP address of the dispatching OpenSIPs &nbsp;server as the SIP proxy on the client, the registration request times out. I do NOT see the destination OpenSIPs servers getting the REGISTER at all. <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I see in tcpdump the client&#8217;s register is received, then the dispatching OpenSIPs sends it to one of the two OpenSIPs servers configured in the dispatcher table, but when it is sending them the IP packets Source IP is marked as 192.168.1.1&nbsp; -- which is NOT the internal or public IP address of this system. Somehow the OpenSIPs dispatcher will overwrite the source IP with &#8220;192.168.1.1&#8221; &#8211; is there a configuration that I should have to make it use its advertised_address?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><p class=MsoNormal><span style='color:#1F497D'>Tuomas Kaikkonen<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Software Developer | Twisted Pair Solutions<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>3131 Elliott Ave, Suite 200, Seattle, WA 98121<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Tel: (206) 812-0732<o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> <a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a> <a href="mailto:[mailto:users-bounces@lists.opensips.org]">[mailto:users-bounces@lists.opensips.org]</a> <b>On Behalf Of </b>Tuomas Kaikkonen<br><b>Sent:</b> Tuesday, March 19, 2013 10:43 AM<br><b>To:</b> Bogdan-Andrei Iancu; OpenSIPS users mailling list<br><b>Subject:</b> Re: [OpenSIPS-Users] Load Balancer module for REGISTER as well as INVITE?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='color:#1F497D'>Bogdan,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>What I am trying to do is this: &nbsp;Have two or more OpenSIPs servers with each having their own rtpproxy server. The database is shared over ssh tunnel so it looks to each server as they are using a local database. The goal is to make the service scalable so that we can add more OpenSIPs hosts as the need comes. Also we want to have the system detect if a server has failed and not direct calls/registers to that server. All the servers are in a cloud system (which does not provide Multicast, only Unicast), and they will have both public IP and internal IP associated with them. The problem with the shared database is that the location table has the socket column storing the Internal IP of the OpenSIPs server who did the REGISTER of the SIP client with. I need to relay all INVITE/BYE/CANCEL requests via that server. I have no UDP load balancer to balance the SIP requests, and having the RTP Proxy proxy all audio packets is an extra burden to the design. &nbsp;Our clients register with only one SIP server, there is no configuration to register with a primary and secondary SIP proxy. <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>What we worry about is putting one OpenSIPs server acting as a load balancer or dispatcher, is that we&#8217;d be then again dependent on one OpenSIPs server. That dispatching / load balancing OpenSIPs server should be also backed up by a fail over server. I&#8217;ve looked into some, mostly academic, papers on how they did their load balancing and fail over. <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><p class=MsoNormal><span style='color:#1F497D'>Tuomas Kaikkonen<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Software Developer | Twisted Pair Solutions<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>3131 Elliott Ave, Suite 200, Seattle, WA 98121<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Tel: (206) 812-0732<o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Bogdan-Andrei Iancu <a href="mailto:[mailto:bogdan@opensips.org]">[mailto:bogdan@opensips.org]</a> <br><b>Sent:</b> Tuesday, March 19, 2013 8:01 AM<br><b>To:</b> OpenSIPS users mailling list<br><b>Cc:</b> Tuomas Kaikkonen<br><b>Subject:</b> Re: [OpenSIPS-Users] Load Balancer module for REGISTER as well as INVITE?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><tt><span style='font-size:10.0pt'>Hi Tuomas,</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><br><tt>The LB modules is only for CALLs - it understands by +1 load only a call. You cannot use it for REGISTERs....Anyhow REGISTERs and INVITEs are as apples and onions :)...so you cannot put them in the same basket. </tt><br><br><tt>if you could provide more details on what you are trying to achieve, maybe I can advice you on the best balancing option (like maybe using dispatcher module)</tt><br><br><tt>Regards, </tt></span><o:p></o:p></p><pre>Bogdan-Andrei Iancu<o:p></o:p></pre><pre>OpenSIPS Founder and Developer<o:p></o:p></pre><pre><a href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre><p class=MsoNormal><br>On 03/18/2013 07:56 PM, Tuomas Kaikkonen wrote: <o:p></o:p></p><p class=MsoNormal>Can the Load Balancer module be configured to balance REGISTERs as well as the INVITES so that the above mentioned setup would work? OR is the Load Balancer module just useful for balancing RTP Proxy / media server resources for INVITEs?<o:p></o:p></p><p class=MsoNormal>&nbsp;<o:p></o:p></p><p class=MsoNormal>I&#8217;m new to the Load Balancer module of OpenSIPs. I am running OpenSIPs stable branch 1.7 &#8211; just by looking examples from the documentation it looks like INVITE load balancing is supported.<o:p></o:p></p><p class=MsoNormal>&nbsp;<o:p></o:p></p><p class=MsoNormal>Tuomas Kaikkonen<o:p></o:p></p><p class=MsoNormal>&nbsp;<o:p></o:p></p><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>Users mailing list<o:p></o:p></pre><pre><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><o:p></o:p></pre><pre><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></pre></div></body></html>