Freepbx dynamic routing module

Introduction

The script could be of help if you use:

This is a freepbx module and has no additional prerequisites. The module has been tested with mysql database.

This module allows you to send incoming calls to different destinations based on the result of a mysql query that can use special variables [NUMBER] which is substituted by callerid and [INPUT] which is substituted by dtmf input.

Additionally the dtmf input or mysql query result can be stored into named variables for later use. That would typically be on a further pass through a dynamic route (where those variables can be accessed in the subsequent queries using [VARIABLE-NAME] or in custom extensions where they can be accessed with the prefix DYNROUTE_ i.e. DYNROUTE_VARIABLE-NAME

This can be used to:

The following is just an example of how it could be setup to read the class of a caller from a database:

Example table mapping customers callerids to a priority

+-----------------+-------------+---------------+
| calleridname    | calleridnum | cust_priority |
+-----------------+-------------+---------------+
| Customer Name 1 | 12345678    | top           |
| Customer Name 2 | 12345679    | important     |
| Customer Name 3 | 12345670    | normal        |
+-----------------+-------------+---------------+

Then in the freepbx query under dynamic route module set up a route which uses this query:

select cust_priority from calleridlookup where calleridnum like '%[NUMBER]' and length('[NUMBER]') > 4

and then set up some routing destinations in the options part of the screen where every value returned by cust_priority is mapped to a specific destination. Example:

the destinations can be anything that is allowable as a destination in freepbx. An option called default should be set to indicate where to route calls if database does not return any of the forseen values.The built in default destination is to hang up.

I have used this module to make an out of hours support IVR that requests users to input their support contract number and if it is valid asks them to input their contact number and then passes these values (and customer id which is looked up in the db) to a custom extensions which calls an AGI script to email/sms support personnel.

Implementation notes: this module takes code from calleridlookup and ivr.

Obtaining and installing

Download

dynroute-2.8.0.0.tar.gz

The following files are not part of the install but are needed if you want to verify the gpg signature of the downloaded file:
GPG signature for dynroute-2.8.0.0.tar.gz
John Fawcett public key

Installation

Contact

john at gufonero.com

Last Modified: Thursday, 08-Mar-2012 23:17:57 CET