论坛风格切换切换到宽版
  • 448阅读
  • 0回复

[提问]asterisk脚本修改队列中动态分机登入登出问题 [复制链接]

上一主题 下一主题
离线zyz520asd
 

有这么一个脚本是设置IPPBX同一队列中的动态分机登入登出时话机指示灯切换状态:

[macro-agent-add]
include => macro-agent-add-custom
exten => s,1,Wait(1)
exten => s,n,ExecIf($["${ARG2}" != ""]?Authenticate(${ARG2}))
exten => s,n,Macro(user-callerid,)
exten => s,n,GotoIf($["${DB(QPENALTY/${ARG1}/dynmemberonly)}" = "1" & ${DB_EXISTS(QPENALTY/${ARG1}/agents/${PBXUSER})} != 1]?invalid)
exten => s,n,AddQueueMember(${ARG1},,,,${PBXUSER})
exten => s,n,Wait(1)
exten => s,n,ExecIf($[ "${ARG1}"="820" ]?Set(DEVICE_STATE(Custom:Logout820)=NOT_INUSE))
exten => s,n,ExecIf($[ "${ARG1}"="820" ]?Set(DEVICE_STATE(Custom:Login820)=INUSE))
exten => s,n,ExecIf($[ "${ARG1}"="821" ]?Set(DEVICE_STATE(Custom:Logout821)=NOT_INUSE))
exten => s,n,ExecIf($[ "${ARG1}"="821" ]?Set(DEVICE_STATE(Custom:Login821)=INUSE))

exten => s,n,Playback(agent-loginok&vm-goodbye)
exten => s,n,Hangup
exten => s,n(invalid),Playback(pbx-invalid)
exten => s,n,Hangup


[macro-agent-remove]
include => macro-agent-remove-custom
exten => s,1,Wait(1)
exten => s,n,RemoveQueueMember(${ARG1})
exten => s,n,ExecIf($[ "${ARG1}"="820" ]?Set(DEVICE_STATE(Custom:Login820)=NOT_INUSE))
exten => s,n,ExecIf($[ "${ARG1}"="820" ]?Set(DEVICE_STATE(Custom:Logout820)=INUSE))
exten => s,n,ExecIf($[ "${ARG1}"="821" ]?Set(DEVICE_STATE(Custom:Login821)=NOT_INUSE))
exten => s,n,ExecIf($[ "${ARG1}"="821" ]?Set(DEVICE_STATE(Custom:Logout821)=INUSE))
exten => s,n,Playback(agent-loggedoff&vm-goodbye)
exten => s,n,Hangup

[exts-hints]
include => exts-hints-custom
include => exten-hints
include => park-hints
include => trunk-hints
include => queue-hints

[queue-hints]
exten => 820*,hint,Custom:Login820
exten => 820**,hint,Custom:Logout820
exten => 821*,hint,Custom:Login821
exten => 821**,hint,Custom:Logout821

上面是注册了两个队列820和821,分别给他们之中的动态分机设置登入和登出时用户Login820(Login821)和Logout820(Logout821)的启用状态,
在话机拨打queue-hints中的号码时,会进行相应操作.
目前是两部动态分机注册的话机(均已设置好BLF),其中一部拨打820*,话机上对应Login820的指示灯变红.而另外一部跟它同在队列820里的动态分机没有拨打820*,话机上对应Login820的指示灯也跟着变红了.
现在想求助各位大神,如何修改,可以实现某台话机拨号820*只切换本身话机指示灯的状态而不影响其他话机?
谢谢
评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
欢迎来到“Asterisk资源分享-互助学习社区”——-Asterisk工程师的家园
请记住我们的网址 www.Asterisk-help.com [这是默认签名,更换签名点这里<<]
快速回复
限100 字节
>> 支持Asterisk-help社区, 谢绝无意义字符回复
批量上传需要先选择文件,再选择上传
 
上一个 下一个