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 < [email protected]> 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 <[email protected]> > Date: 7/16/22 7:52 AM (GMT-06:00) > To: [email protected] > 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 > [email protected] > http://lists.opensips.org/cgi-bin/mailman/listinfo/users >
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
