我使用sagoma 8端口卡我chan_dahdi.conf
配置端口獲得組名稱的accoding PRI端口星號
;autogenerated by /usr/sbin/wancfg_dahdi do not hand edit
;autogenrated on 2015-06-12
;Dahdi Channels Configurations
;For detailed Dahdi options, view /etc/asterisk/chan_dahdi.conf.bak
[trunkgroups]
[channels]
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no
;Sangoma A108 port 1 [slot:4 bus:2 span:1] <wanpipe1>
switchtype=euroisdn
context=from-pstn
group=1
echocancel=yes
signalling=pri_cpe
channel =>1-15,17-31
;Sangoma A108 port 2 [slot:4 bus:2 span:2] <wanpipe2>
switchtype=euroisdn
context=from-pstn
group=2
echocancel=yes
signalling=pri_cpe
channel =>32-46,48-62
;Sangoma A108 port 3 [slot:4 bus:2 span:3] <wanpipe3>
switchtype=euroisdn
context=from-pstn
group=3
echocancel=yes
signalling=pri_cpe
channel =>63-77,79-93
;Sangoma A108 port 4 [slot:4 bus:2 span:4] <wanpipe4>
switchtype=euroisdn
context=from-pstn
group=4
echocancel=yes
signalling=pri_cpe
channel =>94-108,110-124
;Sangoma A108 port 5 [slot:4 bus:2 span:5] <wanpipe5>
switchtype=euroisdn
context=from-pstn
group=5
echocancel=yes
signalling=pri_cpe
channel =>125-139,141-155
;Sangoma A108 port 6 [slot:4 bus:2 span:6] <wanpipe6>
switchtype=euroisdn
context=from-pstn
group=6
echocancel=yes
signalling=pri_cpe
channel =>156-170,172-186
;Sangoma A108 port 7 [slot:4 bus:2 span:7] <wanpipe7>
switchtype=euroisdn
context=from-pstn
group=7
echocancel=yes
signalling=pri_cpe
channel =>187-201,203-217
;Sangoma A108 port 8 [slot:4 bus:2 span:8] <wanpipe8>
switchtype=euroisdn
context=from-pstn
group=8
echocancel=yes
signalling=pri_cpe
channel =>218-232,234-248
我的問題是我怎麼能獲得當前掛靠港的組號動態在我的撥號方案中。
例如,如果用戶的呼叫,在端口1的優先級,然後我的撥號聲明
exten => _X.,n,dial(DAHDI/g1/${NUMBER})
而對於第二個PRI端口上的呼叫2
exten => _X.,n,dial(DAHDI/g2/${NUMBER})
G3,G4,G5 etc爲其他端口,以設置該特定的DID
當前我在做什麼時,來電我創建一個組變量,通過檢查DID範圍
same => n,Set(__GROUP=${IF($[ ${EXTEN} >= ${DIDMINPORT1}]? ${IF($[ ${EXTEN} <= ${DIDMAXPORT1}]?g1:g1)} :g1)})
same => n,Set(__GROUP=${IF($[ ${EXTEN} >= ${DIDMINPORT2}]? ${IF($[ ${EXTEN} <= ${DIDMINPORT2}]?g2: ${GROUP})} : ${GROUP})})
和等其他羣體,撥號我做
exten => _X.,n,dial(DAHDI/${GROUP}/${NUMBER})
但我不認爲這是一個好主意,因爲我有8個端口,所以我必須寫8行,以確定組和撥號通過匹配的DID.So有什麼辦法讓我的撥號方案動態組意味着如果有任何通道變量,我可以從中獲取當前傳入的端口呼叫組?