<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
The $random gives an integer value, so max length is 10. Actually,
vars in config file can be either integer or string. If you want a
larger length you can build it as tring from two other random
values. Like:<br>
<br>
$var(r1) = $RANDOM;<br>
$var(r2) = $RANDOM;<br>
<br>
$var(largerandom) = "" + $var(r1) + $var(r2);<br>
<br>
Note the empty string "" used as first element in the right side of
the above assignment -- that will make the result to be string,
otherwise will be another int, rounded after overflow.<br>
<br>
To get string from concatenating two integers you can use
alternatives as pv_printf(...) or $_s(...).<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<br>
<div class="moz-cite-prefix">On 23/03/16 11:03, Cibin Paul wrote:<br>
</div>
<blockquote cite="mid:E5F8902A-CF16-4661-A6F2-EAB5FA7003D4@me.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
Daniel,
<div class=""><br class="">
</div>
<div class="">I tried using $RANDOM. It is always giving a random
value between 9 digits to 10 digits How can I get a random
value between 10 digits to 13 digits. </div>
<div class=""><br class="">
</div>
<div class="">Regards</div>
<div class="">Cibin</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 22-Mar-2016, at 1:19 PM, Cibin Paul <<a
moz-do-not-send="true" href="mailto:paul_cibin@me.com"
class=""><a class="moz-txt-link-abbreviated" href="mailto:paul_cibin@me.com">paul_cibin@me.com</a></a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">Thanks
Daniel for the pointer. I will check both modules
<div class=""><br class="">
</div>
<div class="">Regards</div>
<div class="">Cibin</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 22-Mar-2016, at 1:13 PM,
Daniel-Constantin Mierla <<a
moz-do-not-send="true"
href="mailto:miconda@gmail.com" class=""><a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a></a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><br style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<br style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">On
22/03/16 08:40, Cibin Paul wrote:</span><br
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<blockquote type="cite" style="font-family:
Helvetica; font-size: 12px; font-style:
normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">Thanks
Daniel,<br class="">
<br class="">
I will try app_lua as you said this being
faster compared to $RANDOM.<br class="">
</blockquote>
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">I
didn't say that app_lua is faster than
$RANDOM -- what I said is that</span><br
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">app_lua
is also fast.</span><br style="font-family:
Helvetica; font-size: 12px; font-style:
normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<br style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<blockquote type="cite" style="font-family:
Helvetica; font-size: 12px; font-style:
normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class=""><br
class="">
Now if I want to modify the caller id number
(ANI) , can I assign the newly generated
number to the variable $fU?<br class="">
</blockquote>
<br style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">Yes,
look also at uac module for functions to
replace From URI.</span><br
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<br style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">Cheers,</span><br
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">Daniel</span><br
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<blockquote type="cite" style="font-family:
Helvetica; font-size: 12px; font-style:
normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class=""><br
class="">
Regards<br class="">
Cibin<br class="">
<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">On
22-Mar-2016, at 12:50 PM,
Daniel-Constantin Mierla <<a
moz-do-not-send="true"
href="mailto:miconda@gmail.com" class=""><a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a></a>>
wrote:<br class="">
<br class="">
Hello,<br class="">
<br class="">
besides $RANDOM from cfgutils as pointed
already, you can use an<br class="">
embedded interpreter (e.g., app_lua is
really fast).<br class="">
<br class="">
If you need some unique values, but not
only numbers, see uuid module.<br class="">
<br class="">
Cheers,<br class="">
Daniel<br class="">
<br class="">
On 22/03/16 07:54, Cibin Paul wrote:<br
class="">
<blockquote type="cite" class="">Hi,<br
class="">
<br class="">
How can I generate a random number say
of length 10-14 in Kamailio. Can I use
cfgutils for this. Please advise<br
class="">
<br class="">
Regards<br class="">
Cibin<br class="">
<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
SIP Express Router (SER) and Kamailio
(OpenSER) - sr-users mailing list<br
class="">
<a moz-do-not-send="true"
href="mailto:sr-users@lists.sip-router.org"
class="">sr-users@lists.sip-router.org</a><br
class="">
<a moz-do-not-send="true"
href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
class="">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br
class="">
</blockquote>
--<span class="Apple-converted-space"> </span><br
class="">
Daniel-Constantin Mierla<br class="">
<a moz-do-not-send="true"
href="http://www.asipto.com/" class="">http://www.asipto.com</a><br
class="">
<a moz-do-not-send="true"
href="http://twitter.com/#%21/miconda"
class="">http://twitter.com/#!/miconda</a>
- <a moz-do-not-send="true"
href="http://www.linkedin.com/in/miconda"
class="">http://www.linkedin.com/in/miconda</a><br
class="">
Kamailio World Conference, Berlin, May
18-20, 2016 - <a moz-do-not-send="true"
href="http://www.kamailioworld.com"
class="">http://www.kamailioworld.com</a><br
class="">
<br class="">
<br class="">
_______________________________________________<br class="">
SIP Express Router (SER) and Kamailio
(OpenSER) - sr-users mailing list<br
class="">
<a moz-do-not-send="true"
href="mailto:sr-users@lists.sip-router.org"
class="">sr-users@lists.sip-router.org</a><br
class="">
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br
class="">
</blockquote>
</blockquote>
<br style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">--<span
class="Apple-converted-space"> </span></span><br
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">Daniel-Constantin
Mierla</span><br style="font-family:
Helvetica; font-size: 12px; font-style:
normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<a moz-do-not-send="true"
href="http://www.asipto.com/"
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">http://www.asipto.com</a><br
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<a moz-do-not-send="true"
href="http://twitter.com/#%21/miconda"
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">http://twitter.com/#!/miconda</a><span
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class=""><span
class="Apple-converted-space"> </span>-<span
class="Apple-converted-space"> </span></span><a
moz-do-not-send="true"
href="http://www.linkedin.com/in/miconda"
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class=""><a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></a><br
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">Kamailio
World Conference, Berlin, May 18-20, 2016 -<span
class="Apple-converted-space"> </span></span><a
moz-do-not-send="true"
href="http://www.kamailioworld.com/"
style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; widows: auto;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class=""><a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, Berlin, May 18-20, 2016 - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
</body>
</html>