Good news, bad news:<br><br>The good news is that the XML dialplan is a very efficient way of handling call routing. The bad news is that the XML dialplan is not a programming language. There is no "rand" function, so you'll need to do something different. One option is to use mod_distributor, however it is not "random" so that may not work for you. The other option is to call Lua or system or something and snag a random number.<br>
<br>-MC<br><br><div class="gmail_quote">On Thu, Apr 8, 2010 at 1:29 PM, Krzysztof Drewicz <span dir="ltr"><<a href="mailto:krzysztofdrewicz@gmail.com">krzysztofdrewicz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
i'm slowly, but constantly moving from asterisk to fs.<br>
<br>
Stuck on translating this into a freeswitch:<br>
<br>
exten => s,1,Random(90:s,3)<br>
exten => s,2,Noop(his is hit 10% times)<br>
exten => s,3,Dial(SIP/8000)<br>
<br>
What i need to do is put a bucket on some calling_number + destination numer<br>
with some random percent to a voiceguide and hangup.<br>
<br>
i've found that memcache is very convinent way to put data into<br>
dialplan logic in runtime, so i plan to do:<br>
<br>
<extension name="bucket_part_01" continue="true"><br>
<condition field="${do_bucket}" expression=".+" break="on-true"/><br>
<condition field="caller_id_number" expression="^123456789$"><br>
<action data="do_bucket=${memcache(get<br>
b_${caller_id_number})}" application="set"/><br>
<action data="bucket_part_02" application="transfer"/><br>
<action application="hangup"/><br>
</condition><br>
</extension><br>
<br>
So above i check for caller_id_number in the memchache b_123456789 with option 1<br>
Then i transfer to anoter extension:<br>
<br>
<extension name="bucket_part_02"><br>
<condition field="destination_number" expression="bucket_part_02"/><br>
<condition field="${czy_robic}" expression="^1$"><br>
<action data="bypass_media=true" application="set"/><br>
<action data="hits=${memcache(increment<br>
hit_bucket_test)}" application="set"/><br>
<br>
AND HERE I do need some logic that does if Random() > 50%<br>
<br>
<action application="answer"/><br>
<action<br>
data="/usr/local/freeswitch/sounds/pc/weRbusyRightNow.wav"<br>
application="playback"/><br>
<action application="hangup"/><br>
</condition><br>
</extension><br>
<br>
<br>
any cleaner approach or someone has done it better?<br>
note: don't want to use any lua, api or sth, just plain xml dialplan logic.<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br>