Use Asterisk Realtime Extensions With Switch-statement And Include-statement

Home » Asterisk Users » Use Asterisk Realtime Extensions With Switch-statement And Include-statement
Asterisk Users 1 Comment

Hello,

Is it possible to use the switch => statement in extensions.conf
(http://www.voip-info.org/wiki/view/Asterisk+RealTime+Extensions) to point to a database and in the database use the include-statement ?

In extconfig.conf I would have :
extensions => mysql,asterisk,extensions_table

In extensions.conf I would then have :

[includecontext]
switch => Realtime/includecontext@realtime_ext

in database :

INSERT IGNORE INTO `my_extensions_table` VALUES (NULL, ‘includecontext’,
‘include’, =>, ‘context1’, ”);
INSERT IGNORE INTO `my_extensions_table` VALUES (NULL, ‘includecontext’,
‘include’, =>, ‘context2’, ”);
INSERT IGNORE INTO `my_extensions_table` VALUES (NULL, ‘includecontext’,
‘include’, =>, ‘context3’, ”);

This would then replace the following in extensions.conf :

[includecontext]
include => context1
include => context2
include => context3

Possible or not ?

Thanks, Jonas Kellens

One thought on - Use Asterisk Realtime Extensions With Switch-statement And Include-statement