Skip to content

Instantly share code, notes, and snippets.

@iKlotho
Created December 23, 2020 21:05
Show Gist options
  • Save iKlotho/1f24981822b1869c688db052cf4cb78b to your computer and use it in GitHub Desktop.
Save iKlotho/1f24981822b1869c688db052cf4cb78b to your computer and use it in GitHub Desktop.
fs_answer_random.xml
<extension name="DTMF_TEST">
<condition break="never">
<action application="set" data="rand_val=${expr(randomize(&x);ceil(random(1,4,&x)))}" inline="true"/>
<action application="log" data="INFO Random value is ${rand_val}"/>
</condition>
<!-- answer randomly -->
<condition field="${cond(${rand_val} > 2 ? YES : NO)}" expression="^YES$" inline="true">
<action application="set" data="rand_resp=${expr(randomize(&x);ceil(random(1,5,&x)))}"/>
<action application="sleep" data="100" />
<action application="start_dtmf" />
<action application="start_dtmf_generate" />
<action application="answer" />
<action application="sleep" data="2000" />
<action application="send_dtmf" data="${rand_resp}" />
<action application="sleep" data="2000" />
<anti-action application="hangup" data="NO_ANSWER" />
</condition>
</extension>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment