Book Image

FreeSWITCH 1.6 Cookbook

By : Giovanni Maruzzelli, Anthony Minessale II
Book Image

FreeSWITCH 1.6 Cookbook

By: Giovanni Maruzzelli, Anthony Minessale II

Overview of this book

Table of Contents (14 chapters)
FreeSWITCH 1.6 Cookbook
About the Authors
About the Reviewers

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.


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:

  <extension name="Interaction and DTMFs gathering">
    <condition field="destination_number" expression="^(12346)$">
        <action application="answer"/>
        <action application...