<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Thanks Vlad!<br><br><div><hr id="stopSpelling">Date: Fri, 11 Nov 2011 10:59:40 +0200<br>From: vladpaiu@opensips.org<br>To: users@lists.opensips.org<br>Subject: Re: [OpenSIPS-Users] load balancing based on source IP<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<title></title>
Hello,<br>
<br>
You can use the dispatcher module to accomplish this. Please check
the hash_pvar param [1] and the ds_select_dst() func [2] with the
7th algorithm. <br>
<br>
So what you need to do is put the $si ( source IP ) in the hash_pvar
AVP, and then call ds_select_dst("1","7"). This will lead to having
calls from the same IP to be routed to the same Asterisk server.<br>
<br>
<br>
[1]
<a class="ecxmoz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id250265" target="_blank">http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id250265</a><br>
[2]
<a class="ecxmoz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id292791" target="_blank">http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id292791</a><br>
<br>
Regards,<br>
<pre class="ecxmoz-signature">Vlad Paiu
OpenSIPS Developer</pre>
<br>
<br></div>                                            </div></body>
</html>