<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
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="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id250265">http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id250265</a><br>
[2]
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id292791">http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id292791</a><br>
<br>
Regards,<br>
<pre class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer</pre>
<br>
On 11/11/2011 02:51 AM, Mistral 66 wrote:
<blockquote cite="mid:BAY170-W7834C977119C0203A248E1B3DD0@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
<div dir="ltr">
I am planning to use opensips to load balance/direct traffic to
asterisk servers. We have about 40 locations (will have many
more) with 5 phones each, and we would like to have all the
traffic coming from a location to go to the same asterisk
server; i.e., if the first SIP message from location 1 is sent
to Server A, we would like the other messages coming from there
also sent to A. Is this possible? Traffic from each location
will be more or less the same, so can opensips do the load
balancing maybe in a round robin style (I guess via dispatcher)
taking the source IP into consideration; e.g. location 1 goes to
server A, location 2 goes to server B, location 3 goes to server
C, location 4 goes to server A, etc.?
<br>
<br>
The reason I want to do this is to keep the device state
information for each location on the same Asterisk server (I'm
not sure if asterisk can store device state data in a database
for realtime updates and lookups) and maybe avoid extra
messaging (e.g. openais) betwen asterisk servers to distribute
the device state data.<br>
<br>
I'm very new to opensips and asterisk...<br>
<br>
Thanks,<br>
Matt<br>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
</body>
</html>