[OpenSIPS-Users] Random decision

M S medeanwz at gmail.com
Sat Jul 16 15:42:04 UTC 2022


If your list is large, you can add them to a database, give each row an Id
number, then use it with sql_cacher and random number generator to randomly
look up a number in table.

On Sat, Jul 16, 2022 at 4:06 PM John Burke via Users <
users at lists.opensips.org> wrote:

> Hey Alexey,
>
> One solution might be to use a parallel set of AVPs (1 for CIDs, 1 for
> weight) and use "set_select_weight" [1] to select a random index. There is
> also a PR in to shuffle an AVP list in place [2].
>
> If your list of CIDs is large, then it may not be performant to load the
> list on every request and you may need to look into leveraging another
> module that has similar functionality (like dispatcher).
>
> [1]
> https://opensips.org/html/docs/modules/3.1.x/cfgutils.html#func_set_select_weight
>
> [2] https://github.com/OpenSIPS/opensips/pull/2852
>
> Thanks,
> John
>
>
> -------- Original message --------
> From: Alexey Kazantsev via Users <users at lists.opensips.org>
> Date: 7/16/22 7:52 AM (GMT-06:00)
> To: users at lists.opensips.org
> Subject: [OpenSIPS-Users] Random decision
>
> Hi list.
>
>
> I’m looking for a solution how to set caller id from a pre-defined list of
> phone numbers _randlomly_ .
> So, there is some number of caller ids allowed by our VoIP provider for
> outgoing calls.
> And I need to set it randomly, from the list.
>
> I know the solution how it can be achieved in Asterisk, but I also would
> like to know
>
> how to configure it in OpenSIPS.
>
> Not sure if the dialplan module is what I need.
> -----------------------------------------------
> BR, Alexey
> https://alexeyka.zantsev.com/
>
> --
>
> * Please be cautious!* This email was sent from outside of Voxtelesys.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20220716/57f61906/attachment.html>


More information about the Users mailing list