[SR-Users] Random number generation kamailio

Cibin Paul paul_cibin at me.com
Tue Mar 22 08:20:41 CET 2016


Thanks a lot Alex,

Now using this random generated number, can I modify the ANI something like this on INVITE

if(!($fU=~"^(\+1|1[1-9][0-9]{10})$"))
        {
                $fU = ($RANDOM / 73249615);
        }

Regards
Cibin

> On 22-Mar-2016, at 12:28 PM, Alex Balashov <abalashov at evaristesys.com> wrote:
> 
> Cibin,
> 
> Yes, that is what $RANDOM is for. It returns a 32-bit signed integer (‎range 0 - 2^31), so you can divide it by the appropriate value to get something in the length range you're after.
>> --
> Alex Balashov | Principal | Evariste Systems LLC
> 1447 Peachtree Street NE, Suite 700
> Atlanta, GA 30309
> United States
> 
> Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
> Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
> 
> Sent from my BlackBerry.
> 
> 
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160322/1a17b3cb/attachment.html>


More information about the sr-users mailing list