Book Image

Elastix Unified Communications Server Cookbook

Book Image

Elastix Unified Communications Server Cookbook

Overview of this book

Table of Contents (24 chapters)
Elastix Unified Communications Server Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Description and Use of the Most Well-known FreePBX Modules
Addon Market Module
Asterisk Essential Commands
Asterisk Gateway Interface Programming
Helpful Linux Commands
Index

Creating a phone poll using Elastix


The following example is an AGI script that asks for a code when the user dials in. This code is used to query a database called balance. After the user enters the code, the balance is reproduced. If the user wants to send this data to a call center to get registered for special offers for instance, he/she will be asked to enter the phone number for calling back when any special offer becomes available. When this information is entered, an e-mail will be dispatched to the call center supervisor in order to book a call to the user whenever a special offer may apply.

How to do it…

  1. The first step to take is to create a database and a table with the following structure in MySQL Database Engine:

    CREATE TABLE balance( name  VARCHAR NOT NULL, code  INT NOT NULL, balance  INT NOT NULL );
    
  2. Add the following code in the /var/lib/asterisk/agi-bin/ folder. In the previous sections, we described the process for using AGI-based programs to interact with our PBX. This is...