Код: Выделить всё
followme => mysql,general,followme
followme_numbers => mysql,general,followme_numbers
Код: Выделить всё
CREATE TABLE `followme` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` char(100) default NULL,
`musicclass` char(100) NOT NULL default 'default',
`context` char(100) default NULL,
`takecall` int(11) default '1',
`declinecall` int(11) default '2',
`call_from_prompt` char(100) NOT NULL default 'followme/call-from',
`norecording_prompt` char(100) NOT NULL default 'followme/no-recording',
`options_prompt` char(100) NOT NULL default 'followme/options',
`pls_hold_prompt` char(100) NOT NULL default 'followme/pls-hold-while-try',
`status_from_prompt` char(100) NOT NULL default 'followme/status',
`sorry_prompt` char(100) NOT NULL default 'followme/sorry',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
);
CREATE TABLE `followme_numbers` (
`id` int(4) NOT NULL AUTO_INCREMENT,
`name` char(100) default NULL,
`ordinal` int(4) DEFAULT '1',
`phonenumber` char(250) default NULL,
`timeout` int(4) default '15',
PRIMARY KEY (`id`)
);
Код: Выделить всё
exten=>_3XX,1,Set(__DYNAMIC_FEATURES=tefe)
exten=>_3XX,n,Set(__CHANNEL(language)=ru)
exten=>_3XX,n,MYSQL(Connect connid 127.0.0.1 myuser mypassword mybase)
exten=>_3XX,n,MYSQL(Query resultid ${connid} SELECT type, dialstr1, dialstr2, dialstr3, dialstr4, vm FROM `forward` WHERE `ext`=${EXTEN})
exten=>_3XX,n,MYSQL(Fetch fetchid ${resultid} type dialstr1 dialstr2 dialstr3 dialstr4 vm)
exten=>_3XX,n,MYSQL(Clear ${resultid})
exten=>_3XX,n,MYSQL(Disconnect ${connid})
exten=>_3XX,n,Macro(fordial,${type},${dialstr1},${dialstr2},${dialstr3},${dialstr4},${vm})
Код: Выделить всё
[macro-fordial]
exten=>s,1,Goto(s-${ARG1},1)
exten=>s-0,1,Dial(SIP/${MACRO_EXTEN},120,TthHKkmw)
exten=>s-0,n,Hangup()
exten=>s-1,1,Dial(SIP/${ARG2},120,Tt)
exten=>s-1,n,Hangup()
exten=>s-2,1,Dial(SIP/${MACRO_EXTEN},10,TthHKkmw)
exten=>s-2,n,GotoIf($["${DIALSTATUS}"="BUSY"]?:end)
exten=>s-2,n,Dial(SIP/${ARG3},120,Tt)
exten=>s-2,n(end),Hangup()
exten=>s-3,1,Dial(SIP/${MACRO_EXTEN},10,TthHKkmw)
exten=>s-3,n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?:end)
exten=>s-3,n,Dial(SIP/${ARG4},120,Tt)
exten=>s-3,n(end),Hangup()
exten=>s-4,1,Dial(SIP/${MACRO_EXTEN},10,TthHKkmw)
exten=>s-4,n,Dial(SIP/${ARG5},120,Tt)
exten=>s-5,1,Dial(SIP/${MACRO_EXTEN},10,TthHKkmw)
exten=>s-5,n,Voicemail(${MACRO_EXTEN},${ARG6})