[Freeswitch-users] System global mode variable

Pete Ashdown pashdown at xmission.com
Tue Jun 7 18:50:38 MSD 2016


What is the simplest way to have a conditional branch based on a global
variable in a dialplan?  Actually using a global variable and xml is
giving me mixed results.  Do I need to use Lua or another scripting
language?

This is what I have, which doesn't give the results desired.   The
"speak" actions are merely debug placeholders.  I know there are better
ways to do conditional voice to text.

      <condition regex="any" field="${cond(${mode} == 'open' ? YES :
NO)}" expression="^YES$">
            <action application="speak" data="open"/>
      </condition>

      <condition regex="any" field="${cond(${mode} == 'tech only' ? YES
: NO)}" expression="^YES$">
            <action application="speak" data="teck only"/>
      </condition>

      <condition regex="any" field="${cond(${mode} == 'event' ? YES :
NO)}" expression="^YES$">
            <action application="speak" data="event"/>
      </condition>




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