Asterisk

將呼叫星號轉移到不同的上下文

  • January 28, 2013

我有一個小型和基本的 PBX,並且有兩個上下文,基本上是銷售和主管都有不同的角色和權限。我注意到可以從同一上下文轉移呼叫,但不可能將任何內容轉移到另一個上下文。

任何見解,我有點像星號的菜鳥,但目前沒有其他人負責……

謝謝

編輯

這是 extension.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

為了讓主管擁有與他相同的特權並且銷售人員能夠將電話轉接給他,您有什麼建議

當您轉移呼叫時,星號將在您目前的上下文中搜尋分機,因此如果有人使用“銷售”呼叫,他將只能轉移到分機 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 :)

引用自:https://serverfault.com/questions/266811