[Asterisk-Users] Realtime Engine
Michael Baird
mike at tc3net.com
Thu Jan 20 11:45:48 MST 2005
I'm going to be testing the new realtime stuff further in the next few
days, and just wanted some clarification on a couple of things before I
start on it.
I believe I can store any config file in a external config such as
mgcp.conf for example, by adding it to extconfig.conf with the below
syntax.
mgcp.conf => mysql,asterisk,mgcpchans
Doing this will require a reload of asterisk to read the changes in
(since chan_mgcp hasn't been moved to realtime yet), as well as removing
the text file called mgcp.conf, so that asterisk knows to use the
database version from extconfig.conf.
I also want to play with the extensions.conf, realtime extensions config
using the switch statement as described on the WIKI.
My question on this is if I can use the SWITCH statement in a Wildcard
match context.
like the example below.
[inbound]
exten => _XXXXXXXXXX,1,SetVar(CALLEDTO=${EXTEN})
exten => _XXXXXXXXXX,2,GotoIf($[${CALLERIDNUM} = ${EXTEN}]?3:5)
exten => _XXXXXXXXXX,3,VoiceMailMain,${EXTEN}
exten => _XXXXXXXXXX,4,Hangup
exten => _XXXXXXXXXX,5,Dial,SIP/${EXTEN}|20
exten => _XXXXXXXXXX,6,VoiceMail,u${EXTEN}
exten => _XXXXXXXXXX,7,Hangup
exten => _XXXXXXXXXX,107,VoiceMail,b${EXTEN}
exten => _XXXXXXXXXX,108,Hangup
I want to replace priority 5 with the switch statement to go to the
database and match the extension to a channel like.
[inbound]
exten => _XXXXXXXXXX,1,SetVar(CALLEDTO=${EXTEN})
exten => _XXXXXXXXXX,2,GotoIf($[${CALLERIDNUM} = ${EXTEN}]?3:5)
exten => _XXXXXXXXXX,3,VoiceMailMain,${EXTEN}
exten => _XXXXXXXXXX,4,Hangup
switch =>Realtime/@
exten => _XXXXXXXXXX,6,VoiceMail,u${EXTEN}
exten => _XXXXXXXXXX,7,Hangup
exten => _XXXXXXXXXX,107,VoiceMail,b${EXTEN}
exten => _XXXXXXXXXX,108,Hangup
Then in my extensions table I will have data like the following
INSERT INTO `extensions_table` VALUES (1, 'inbound', '_5172078354',
5,'DIAL', 'SIP/5172078354');
INSERT INTO `extensions_table` VALUES (2, 'inbound', '_5172078355', 5,
'DIAL', 'SIP/5172078355');
INSERT INTO `extensions_table` VALUES (3, 'inbound', '_5172078356', 5,
'DIAL', 'SIP/5172078360');
Or do I need to put all the priorities for a specific extension in the
database for each extension?
Regards
Michale Baird
More information about the asterisk-users
mailing list