<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Hi Tuomas,<br>
<br>
In your script, I would try to handle the case when a back server
(a destination in dispatcher) is down and re-route to the other
available destination - use failure route with the ds_next_dst()
in order to do serial forking in case of failure.<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<br>
On 03/20/2013 01:48 AM, Tuomas Kaikkonen wrote:
<blockquote
cite="mid:8EB2F40A66D62F46B7273A3DF611418A0BBB55DF40@exchsea01"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<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.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
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.EmailStyle24
        {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]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Trying
dispatcher:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">mysql>
select * from dispatcher;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">+----+-------+---------------------------------------+-------+--------+-------+-------------+<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">| id
| setid | destination | flags |
weight | attrs | description |<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">+----+-------+---------------------------------------+-------+--------+-------+-------------+<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">| 1
| 1 | <a class="moz-txt-link-freetext" href="sip:WWW.WWW.WWW.WWW:5060;transport=udp">sip:WWW.WWW.WWW.WWW:5060;transport=udp</a> | 0
| 1 | | |<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">| 2
| 1 | <a class="moz-txt-link-freetext" href="sip:XXX.XXX.XXX.XXX:5060;transport=udp">sip:XXX.XXX.XXX.XXX:5060;transport=udp</a> | 0
| 1 | | |<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">+----+-------+---------------------------------------+-------+--------+-------+-------------+<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">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: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">My
opensips.cfg route for the dispatching opensips is this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">route{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
if ( !mf_process_maxfwd_header("10") )<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
send_reply("483","To Many Hops");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
};<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
if ( !ds_select_dst("1", "0") ) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
send_reply("500","Unable to route");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
t_relay();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">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 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: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I
see in tcpdump the client’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 -- which is NOT the internal or public IP
address of this system. Somehow the OpenSIPs dispatcher will
overwrite the source IP with “192.168.1.1” – 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: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Tuomas
Kaikkonen<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Software
Developer | Twisted Pair Solutions<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">3131
Elliott Ave, Suite 200, Seattle, WA 98121<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Tel:
(206) 812-0732<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<div>
<div style="border-right: medium none; border-width: 1pt
medium medium; border-style: solid none none; border-color:
rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;
padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;
font-family:
"Tahoma","sans-serif"; color:
windowtext;">From:</span></b><span style="font-size:
10pt; font-family:
"Tahoma","sans-serif"; color:
windowtext;"> <a class="moz-txt-link-abbreviated" href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>
[<a class="moz-txt-link-freetext" href="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> </o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Bogdan,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">What
I am trying to do is this: 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. 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: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">What
we worry about is putting one OpenSIPs server acting as a
load balancer or dispatcher, is that we’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’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: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Tuomas
Kaikkonen<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Software
Developer | Twisted Pair Solutions<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">3131
Elliott Ave, Suite 200, Seattle, WA 98121<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Tel:
(206) 812-0732<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<div>
<div style="border-right: medium none; border-width: 1pt
medium medium; border-style: solid none none; border-color:
rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;
padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;
font-family:
"Tahoma","sans-serif"; color:
windowtext;">From:</span></b><span style="font-size:
10pt; font-family:
"Tahoma","sans-serif"; color:
windowtext;"> Bogdan-Andrei Iancu <a
moz-do-not-send="true"
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> </o:p></p>
<p class="MsoNormal" style="margin-bottom: 12pt;"><tt><span
style="font-size: 10pt;">Hi Tuomas,</span></tt><span
style="font-size: 10pt; 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 moz-do-not-send="true" 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"> <o:p></o:p></p>
<p class="MsoNormal">I’m new to the Load Balancer module of
OpenSIPs. I am running OpenSIPs stable branch 1.7 – just by
looking examples from the documentation it looks like INVITE
load balancing is supported.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Tuomas Kaikkonen<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Users mailing list<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><o:p></o:p></pre>
<pre><a moz-do-not-send="true" 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>
</blockquote>
</body>
</html>