我想知道是否有人知道使用星号拨号计划是否可以执行以下操作,如果是这样,我会在哪里找到编程的信息。
1) 座席拨号分机,例如 1234
2) 代理免打扰状态切换开/关3) MWI 已更改以反映免打扰状态,如果免打扰 MWI 打开
4) 更新 MySql 数据库以记录更改状态的时间
提前致谢
我希望我没有误解你的意图,下面的代码会给你一些启发。
[ext-local-custom]
exten => 1234,1,Answer()
; Ask agent to input action
; 1 - enable DND
; 0 - disable DND
exten => 1234,n(input),Read(digito,enter-toggled-on-off,1)
exten => 1234,n,GotoIf($["foo${digito}"="foo1"]?toggledOn)
exten => 1234,n,GotoIf($["foo${digito}"="foo0"]?toggledOff)
exten => 1234,n,Playback(invalid)
exten => 1234,n,Goto(input)
exten => 1234,n(toggledOn),NoOP(section toggled On)
; Set DND ON
exten => 1234,n,Set(DB(DND/${CALLERID(number)})=YES)
; MySQL record action
exten => 1234,n,MySql(connect connid localhost root test)
exten => 1234,n,MySql(query resultidr ${connid} INSERT INTO `test`.`togglelog` (`exten`,`toggle`,`logtime`)VALUES ('${CALLERID(number)}',1,'${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}'))
exten => 1234,n,Goto(end)
exten => 1234,n(toggledOff),NoOP(section toggled Off)
; Set DND Off
exten => 1234,n,DBdel(DND/${CALLERID(number)})
; MySQL record action
exten => 1234,n,MySql(connect connid localhost root test)
exten => 1234,n,MySql(query resultidr ${connid} INSERT INTO `test`.`togglelog` (`exten`,`toggle`,`logtime`)VALUES ('${CALLERID(number)}',0,'${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}'))
exten => 1234,n,Goto(end)
exten => 1234,n(end),Hangup()