[OpenSIPS-Users] setting global variables and selecting among them

Jayesh Nambiar jayesh.voip at gmail.com
Wed Dec 7 10:42:23 CET 2011


Hi All,
I was thinking of a requirement and wanted to know if it is possible. For
example:
I define two variables,
var(media-relay){1} = 1.2.3.4
var(media-relay){2} = 4.3.2.1
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:

modparam("mediaproxy", "media_relay_avp", "$avp(media_relay)")

$avp(media_relay) = $var(media-relay);

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?
Thanks in advance for any suggestion.

--- Jayesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20111207/b61cdaaf/attachment.htm>


More information about the Users mailing list