User interaction and DTMF gathering
This recipe elaborates the interaction of the dialplan with the users.
Getting ready
This time, the dialplan extension that we add will do things before starting the Lua script. This is not necessary at all, but is being done here to let you know that the dialplan and scripting complement each other.
Tip
The best strategy for efficiency, counseled by FreeSWITCH developers, is to use the dialplan as much as you can. It is the most efficient (compiled in a tree in RAM) way to process your calls. Then, when things require logic (loops, conditionals, and so on) that does not fit well in XML, spawn a script.
Create a dialplan extension 12346
. It will call our second Lua script. Edit the /usr/local/freeswitch/conf/dialplan/default/02_interaction.xml
file:
<include> <extension name="Interaction and DTMFs gathering"> <condition field="destination_number" expression="^(12346)$"> <action application="answer"/> <action application...