Misc. Dialplan Tools execute extension
From FreeSWITCH Wiki
You can execute an extension from within another extension with this dialplan application.
execute_extension executes an extension like a macro then returns where transfer actually goes to the new extension instantly. When you don't need to do anything else use transfer and exit what you are doing and the channel goes back to the dialplan
execute_extension will keep the current scope and build a one time extension, execute it, and return right back to where it was called from.
The transfer actually alters the channels state, so if you are in a script you should exit the script as soon as you call transfer.
Usage is: <action application="execute_extension" data="extension [dialplan] [context]"/> If you do not specify the dialplan and context, it defaults to the current one.
An example extension that makes use of this application:
<extension name="hold_music">
<condition field="destination_number" expression="^9999$"/>
<condition field="${sip_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$">
<action application="answer"/>
<action application="execute_extension" data="is_secure XML features"/>
<action application="playback" data="$${moh_uri}"/>
<anti-action application="answer"/>
<anti-action application="playback" data="$${moh_uri}"/>
</condition>
</extension>
Another example is in features.xml
<extension name="dx">
<condition field="destination_number" expression="^dx$">
<action application="answer"/>
<action application="read" data="11 11 'tone_stream://%(10000,0,350,440)' digits 5000 #"/>
<action application="execute_extension" data="is_transfer XML features"/>
</condition>
</extension>
<extension name="is_transfer">
<condition field="destination_number" expression="^is_transfer$"/>
<condition field="${digits}" expression="^(\d+)$">
<action application="transfer" data="-bleg ${digits} XML default"/>
<anti-action application="eval" data="w00t"/>
</condition>
</extension>
