Book Image

Freeswitch 1.6 Cookbook

Book Image

Freeswitch 1.6 Cookbook

Overview of this book

Table of Contents (14 chapters)
FreeSWITCH 1.6 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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...