Asterisk RealTime Extensions

From Etel

Jump to: navigation, search

Contents

Title

Asterisk Real Time Extensions

Problem

You wan't to be able to modify the extensions in real time without the need to reload the dialplan.

Solution

There are a few stages to getting this setup with MySQL. Ensure that you have the MySQL module's loaded in by doing:


extconfig.setup:

extensions => mysql,oreillydb,extensions

modules.conf setup:

load => res_config_mysql.so
load => app_realtime.so
load => func_realtime.so
load => pbx_realtime.so

extensions.conf setup:

[OReilly]
; switch => Realtime/[contextname]@[family][/options]
; If context is not provided, default will be used
; If family is not provided, extensions will be used
switch => Realtime/OReilly@

Database setup:

CREATE TABLE `extensions` (
  `id` int(11) NOT NULL auto_increment,
  `context` varchar(25) NOT NULL default ,
  `exten` varchar(25) NOT NULL default ,
  `priority` tinyint(4) NOT NULL default '0',
  `app` varchar(30) NOT NULL default ,
  `appdata` varchar(255) NOT NULL default ,
  PRIMARY KEY (`context`, `exten`, `priority`),
  KEY `id` (`id`)
);

Discussion

The Asterisk external configuration engine is the result of work by Anthony Minessale II, Mark Spencer and Constantine Filin It is designed to provide a flexible, seamless integration between Asterisk's internal configuration structure and external SQL other databases.

External configuration is configured in /etc/asterisk/extconfig.conf allowing you to map any configuration file (static mappings) to be pulled from the database, or to map special runtime entries which permit the dynamic creation of objects, entities, peers, etc. without the necessity of a reload.

When using a Goto or GotoIf or Dial command you may only use '|' in the app_data field of the command and not ','. Here are a few examples to clear this up:

Dial()
Goto()
GotoIf()

See Also:

Metadata

  • By: Pedram Messri
Personal tools