我有一个小型基础 PBX,有两个上下文,基本上是销售和主管,它们都有不同的角色和权限。我注意到可以从同一个上下文转移呼叫,但无法将任何东西转移到另一个上下文。
有什么见解吗,我在 asterisk 上有点像新手,但目前没有其他人负责......
谢谢
编辑
这是扩展.conf
[supervisor]
include => from-internal
exten => _40XX,1,Answer
exten => _40XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _40XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _40XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _40XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _40XX,n,Hangup
[sales]
include => out-trunksip
exten => _41XX,1,Answer
exten => _41XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _41XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _41XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _41XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _41XX,n,Hangup
sip.conf 如下所示:
[supervisor]
username=sales
secret=ASUPERSECRETPASSWORD
type=peer
.....
context=supervisor
mailbox=supervisor
[sales]
username=sales
secret=ASUPERSECRETPASSWORD
type=peer
.....
context=sales
mailbox=sales
你有什么建议,可以让主管拥有与他已有的相同权限,并且销售人员能够将电话转接给他
答案1
当你转接电话时,Aterisk 会在你的当前上下文中搜索分机,所以如果有人使用“销售”呼叫,他将只能转接到分机 41XX,如果你想让他转接到分机 40XX,那么你应该将 40XX 添加到销售上下文中,例如:
[sales]
include => out-trunksip
exten => _41XX,1,Answer
exten => _41XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _41XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _41XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _41XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _41XX,n,Hangup
exten => _40XX,1,Dial(SIP/${EXTEN},40,TtRr)
(您还可以在销售上下文中包含主管上下文)
如果您想阻止销售用户呼叫主管用户或主管用户呼叫销售用户,但仍允许他们互相转接电话,那么您可以通过以下方式解决:
创建一个仅用于呼叫转移的新上下文,其中您提供在转移呼叫时应可接通的分机,例如:
[call-transfer]
exten => _40XX,1,Dial(SIP/${EXTEN},40,TtRr)
exten => _41XX,1,Dial(SIP/${EXTEN},40,TtRr)
然后设置__TRANSFER_CONTEXT=call-transfer:
[supervisor]
include => from-internal
exten => _40XX,1,Answer
exten => _40XX,n,Set(__TRANSFER_CONTEXT=call-transfer)
exten => _40XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _40XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _40XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _40XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _40XX,n,Hangup
[sales]
include => out-trunksip
exten => _41XX,1,Answer
exten => _40XX,n,Set(__TRANSFER_CONTEXT=call-transfer)
exten => _41XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _41XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _41XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _41XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _41XX,n,Hangup
我只是不确定 __TRANSFER_CONTEXT 是否仍然存在于新版的 asterisk 中:)