We require a FreePBX module that can route calls based on a database lookup. The module should be compatible with FreePBX 2.9.0.7 and Asterisk 1.8.7.0.
The database table will contain a primary indexed text field containing the phone number and a second field containing an integer value (see below). The table will be in a database called 'routes' and will be located on the same server as the 'asterisk' database.
The module will use AMPDBHOST, AMPDBUSER and AMPDBPASS to access the database server.
The module will have a configuration parameter to choose the database table name.
The module will have a configurable number of destinations. Each destination will be associated with an integer value read from the database
There will be a failover destination that will be used if the phone number is not in the database
It must be possible for there to be multiple instances of the module in the dialplan.
Database table definition
CREATE TABLE IF NOT EXISTS `routes`.`support` (
`number` VARCHAR(16) NOT NULL ,
`route` INT(11) NULL ,
PRIMARY KEY (`number`) )
ENGINE = MyISAM;