Hi, Guys! One hint, please. Is there a way to get random integer in FS variable without lua in Dialplan like: <action application="set" data=" myvar= some function to get random number betwee 100-200 or curl fetch? "/> Thank you, Gregor
https://wiki.freeswitch.org/wiki/Mod_expr has it On Thu, Dec 14, 2017, at 02:05 AM, Gregor Nanger wrote:
Hi, Guys!
One hint, please. Is there a way to get random integer in FS variable without lua in Dialplan like:> <action application="set" data=" myvar= some function to get random number betwee 100-200 or curl fetch? "/>
Thank you, Gregor
___________________________________________________________________- ________> Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users> http://www.freeswitch.org
:-) thank you, Aviv 2017-12-14 10:17 GMT+01:00 Aviv Shaham <aviv@ironsip.com>:
https://wiki.freeswitch.org/wiki/Mod_expr has it
On Thu, Dec 14, 2017, at 02:05 AM, Gregor Nanger wrote:
Hi, Guys!
One hint, please. Is there a way to get random integer in FS variable without lua in Dialplan like:
<action application="set" data=" myvar= some function to get random number betwee 100-200 or curl fetch? "/>
Thank you, Gregor
*_________________________________________________________________________* Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Gregor Nanger *CTO* t./f.: 00386 (0) 7 6000 308/309 • m:. 00386 (0)41 756485 • Infomedia d.o.o. • Jerebova 3, Novo mesto, Slovenia • www.infomedia.si
either the random function, or a global counter if you want some more predictable randomness: <action application="set_global" data="global_fsqa_counter=${expr(mod(${global_fsqa_counter}+1,23))}"/> <action application="set" data="silence_pause=${expr(${global_fsqa_counter}*3+1000)}"/> <action application="playback" data="silence_stream://${silence_pause}"/> this was for a test appliance, to make sure the same pieces of playback audio don't get cut into 20ms frames in the same way. On Thu, Dec 14, 2017 at 1:05 PM, Gregor Nanger <gregor@infomedia.si> wrote:
:-) thank you, Aviv
2017-12-14 10:17 GMT+01:00 Aviv Shaham <aviv@ironsip.com>:
https://wiki.freeswitch.org/wiki/Mod_expr has it
On Thu, Dec 14, 2017, at 02:05 AM, Gregor Nanger wrote:
Hi, Guys!
One hint, please. Is there a way to get random integer in FS variable without lua in Dialplan like:
<action application="set" data=" myvar= some function to get random number betwee 100-200 or curl fetch? "/>
Thank you, Gregor
*_________________________________________________________________________* Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Gregor Nanger
*CTO* t./f.: 00386 (0) 7 6000 308/309 • m:. 00386 (0)41 756485 • Infomedia d.o.o. • Jerebova 3, Novo mesto, Slovenia • www.infomedia.si
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thank you 2017-12-14 14:17 GMT+01:00 Stanislav Sinyagin <ssinyagin@gmail.com>:
either the random function, or a global counter if you want some more predictable randomness:
<action application="set_global" data="global_fsqa_counter=${ expr(mod(${global_fsqa_counter}+1,23))}"/> <action application="set" data="silence_pause=${expr(${ global_fsqa_counter}*3+1000)}"/> <action application="playback" data="silence_stream://${ silence_pause}"/>
this was for a test appliance, to make sure the same pieces of playback audio don't get cut into 20ms frames in the same way.
On Thu, Dec 14, 2017 at 1:05 PM, Gregor Nanger <gregor@infomedia.si> wrote:
:-) thank you, Aviv
2017-12-14 10:17 GMT+01:00 Aviv Shaham <aviv@ironsip.com>:
https://wiki.freeswitch.org/wiki/Mod_expr has it
On Thu, Dec 14, 2017, at 02:05 AM, Gregor Nanger wrote:
Hi, Guys!
One hint, please. Is there a way to get random integer in FS variable without lua in Dialplan like:
<action application="set" data=" myvar= some function to get random number betwee 100-200 or curl fetch? "/>
Thank you, Gregor
*_________________________________________________________________________* Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
____________________________________________________________ _____________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Gregor Nanger
*CTO* t./f.: 00386 (0) 7 6000 308/309 • m:. 00386 (0)41 756485 • Infomedia d.o.o. • Jerebova 3, Novo mesto, Slovenia • www.infomedia.si
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Gregor Nanger *CTO* t./f.: 00386 (0) 7 6000 308/309 • m:. 00386 (0)41 756485 • Infomedia d.o.o. • Jerebova 3, Novo mesto, Slovenia • www.infomedia.si
participants (3)
-
Aviv Shaham
-
Gregor Nanger
-
Stanislav Sinyagin