Possible to use fresh channelvariables in conditions?
I have tried this: <condition field="${SHOWANUMBER}" expression="^(2015[0-9][0-9][0-9][0-9])$"> <action application="eval" data="ACTION=${SHOWANUMBER}"/> <anti-action application="eval" data="ANTI_ACTION=${SHOWANUMBER}"/> </condition> It runs through the conditions, but the channel variable SHOWANUMBER is not initiated at that time. When it comes to the code above, it chooses the anti-action. It looks as if the condition-mechanism cannot be used if the channel variable is not defined when the system goes through the conditions in the first run? Are there any alternative ways - except for using a script language? Thanks, Jon
You'll need to use execute_extension <action application="execute_extension" data="eval_data XML features"/> Then in extension eval_data you'll have it... but you do realize that you can just: <action application="eval" data="Number: $1"/> So you have that data from the regular expression capture. FreeSWITCH doesn't traverse the dialplan in realtime. Its done once at the start of the call and all the actions are put into a todo list so to speak and the session is sent into the state machine never to return unless you transfer it back to the dialplan for any reason. ie execute_extension, transfer, uuid_transfer and so on. /b On Sep 11, 2008, at 8:13 AM, Jon Bruel wrote:
<condition field="${SHOWANUMBER}" expression="^(2015[0-9][0-9][0-9][0-9])$"> <action application="eval" data="ACTION=${SHOWANUMBER}"/> <anti-action application="eval" data="ANTI_ACTION=${SHOWANUMBER}"/> </condition>
Brian West sip:brian@freeswitch.org
participants (2)
-
Brian West
-
Jon Bruel