[Freeswitch-users] Random not working?

Kevin Wormington kworm at sofnet.com
Thu Aug 29 20:28:53 MSD 2013


I believe you would need to add inline="true" to your action setting the 
variable...see http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions

Kevin

On 08/29/2013 10:10 AM, David Villasmil wrote:
> Hello guys,
>
> I've got this in my dialplan:
>
> <action application="set" data="rand_val=${expr
> randomize(&x);ceil(random(0,100,&x))}"/>
> <action application="log" data="INFO Random dialplan ${expr
> randomize(&x);ceil(random(0,100,&x))}"/>
> <action application="log" data="INFO Random value is ${rand_val}"/>
>
> and this is what i see in my cli:
>
> Dialplan: sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4> Regex
> (PASS) [respond] destination_number(1234) =~ /^.*/ break=on-false
> Dialplan: sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4> Action
> set(rand_val=${expr randomize(&x);ceil(random(0,100,&x))})
> Dialplan: sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4> Action
> log(INFO Random dialplan ${expr randomize(&x);ceil(random(0,100,&x))})
> Dialplan: sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4> Action
> log(INFO Random value is ${rand_val})
> 2013-08-29 16:40:48.834592 [DEBUG] switch_core_state_machine.c:167
> (sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4>) State Change
> CS_ROUTING -> CS_EXECUTE
> 2013-08-29 16:40:48.834592 [DEBUG] switch_core_session.c:1341 Send
> signal sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4> [BREAK]
> 2013-08-29 16:40:48.834592 [DEBUG] switch_core_state_machine.c:471
> (sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4>) State ROUTING
> going to sleep
> 2013-08-29 16:40:48.834592 [DEBUG] switch_core_state_machine.c:416
> (sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4>) Running State
> Change CS_EXECUTE
> 2013-08-29 16:40:48.834592 [DEBUG] switch_core_state_machine.c:478
> (sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4>) State EXECUTE
> 2013-08-29 16:40:48.834592 [DEBUG] mod_sofia.c:230
> sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4> SOFIA EXECUTE
> 2013-08-29 16:40:48.834592 [DEBUG] switch_core_state_machine.c:209
> sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4> Standard EXECUTE
> EXECUTE sofia/external/12345 at 1.2.3.4 <mailto:12345 at 1.2.3.4> log(INFO ASR
> 40 we got )
> 2013-08-29 16:40:48.854572 [INFO] mod_dptools.c:1567 ASR 40 we got
>
>
> Why is the "${rand_val}" not being parsed?
>
> Thanks,
>
> David
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list