<!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>
Please check out the rand_event [1] function exported by the
cfgutils module.<br>
<br>
[1]
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/devel/cfgutils.html#id250076">http://www.opensips.org/html/docs/modules/devel/cfgutils.html#id250076</a><br>
<br>
Regards,<br>
<pre class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer</pre>
<br>
On 12/07/2011 11:42 AM, Jayesh Nambiar wrote:
<blockquote
cite="mid:CALvF6vAvCXp2fGjSqvWopb44CBjzXMiu6xedTyng51_EySCVOg@mail.gmail.com"
type="cite">Hi All,<br>
I was thinking of a requirement and wanted to know if it is
possible. For example: <br>
I define two variables,<br>
var(media-relay){1} = 1.2.3.4<br>
var(media-relay){2} = 4.3.2.1<br>
Now I wish to use both these relays randomly or in a 50-50 manner.
So for example, if I have something like this in my script:<br>
<br>
modparam("mediaproxy", "media_relay_avp", "$avp(media_relay)")<br>
<br>
$avp(media_relay) = $var(media-relay);<br>
<br>
It should either randomly select between 1.2.3.4 and 4.3.2.1 or
use some algorithm to do a round-robin between them. Is this in
someway possible in the current setup?<br>
Thanks in advance for any suggestion.<br>
<br>
--- Jayesh<br>
<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>