星号11.7匹配来电显示

星号11.7匹配来电显示

问题描述:

我有一个星号pbx,它管理一些sip提供商(一个ISDN Patton)和一些Voip提供商. 我尝试按照此处所述在拨号计划中使用CID匹配. 这是我拨号计划的相关部分,请注意,拨号计划的这一部分包含在我的extension.conf中:

I've an asterisk pbx that manages some sip providers (a ISDN Patton) and some Voip providers. I'm trying to use matching of CID in my dialplan as described here. This is the relevant part of my dialplan, please note that this part of dialplan is included my extension.conf:

[patton];Calls from Patton
exten => 0219999999/_0031X.,1,Answer(0)  
exten => 0219999999/_0031X.,n,Hangout()

exten => 0219999999,1,Answer(0)   
exten => 0219999999,n,Goto(in_4,${EXTEN},1)

[in_4]
exten => 0219999999,1,Noop(Exten: ${EXTEN})
exten => 0219999999,n,Noop(CID: ${CALLERID(NUM)})

简而言之,当呼叫者的CID来自荷兰时,我想做些不同的事情. 看着Asterisk CLI发生了什么,我看到了:

In short I want do something different when the CID of the caller cames from Netherlands. Watching what happens in Asterisk CLI I see:

 == Using SIP RTP CoS mark 5
-- Executing [0219999999@patton:1] Answer("SIP/patton-00000011", "0") in new stack
-- Executing [0219999999@patton:2] Goto("SIP/patton-00000011", "in_4,0219999999,1") in new stack
-- Goto (in_4,0219999999,1)
-- Executing [0219999999@in_4:1] NoOp("SIP/patton-00000011", "Exten: 0219999999") in new stack
-- Executing [0219999999@in_4:2] NoOp("SIP/patton-00000011", "Cid: 0031123456789") in new stack

所以我了解的是,Asterisk不应用CID匹配,但我不明白为什么,考虑到如果我打印CID,它将与我的表达式完全匹配.

So what I understand is that Asterisk don't apply the CID matching but I don't understand why, considering that if I print the CID it matches perfectly my expression.

这是我的extensions.conf文件的一部分,用于处理来自PSTN线路的入站呼叫者ID匹配

Here is a section of my extensions.conf file that deals with inbound caller ID matching (from a PSTN line)

也许有另一种/更好的方法来执行此操作,但是从1.4开始,它对我来说是一个有效的配置,而我现在正在运行13.7,没有任何问题. (个人号码已替换为#")-这是一个简单的拨号计划.

There might be another/better way to do this, but its been a working config for me since 1.4 and I'm now running 13.7 without any issues. (Individual numbers have been replaced with '#') - This is a simple dial plan.

这用于捕获发送084或087前缀,几个特定数字以及来自国际"或懒惰系统管理员不可用"的任何信息的人

This is used to catch anyone who send an 084 or 087 prefix, a couple of specific numbers and anything from 'international' or lazy system administrators 'UNAVAILABLE'

我也为SIP中继设置了相同的东西,因此它应该适用于任何通道类型.

I've the same thing set up for SIP trunks as well so this should work across any channel type.

[from-pstn]
exten => s,1,Verbose(CLID From BT ${CALLERID(all)})
exten => s,2,GotoIf($[${CALLERID(num):0:3} = 087]?103:3)
exten => s,3,GotoIf($[${CALLERID(num):0:3} = 084]?103:4)
exten => s,4,GotoIf($[${CALLERID(num):0:11} = 07896######]?103:5)
exten => s,5,GotoIf($[${CALLERID(num):0:11} = 01494######]?103:6)
exten => s,6,GotoIf($["${CALLERID(name):0:13}" = "INTERNATIONAL"]?103:7)
exten => s,7,GotoIf($["${CALLERID(name):0:11}" = "UNAVAILABLE"]?103:8)
exten => s,8,GotoIf($[${CALLERID(num):0:10} = 020315####]?103:9)
exten => s,103,Answer
exten => s,104,Wait(1)
exten => s,105,Playtones(info)
exten => s,106,Wait(7)
exten => s,107,Hangup
exten => s,9,Goto(internal-ext,5800,1)

您想要类似的东西

[from-yourtrunk]
exten => s,1,Verbose(CLID From <yourtrunk> ${CALLERID(all)})
exten => s,2,GotoIf($[${CALLERID(num):0:4} = 0031]?103:3)
exten => s,103,<do something with the call that matches the CLI>
exten => s,3,Goto(<your-internal-ext>,<number>,1)

需要注意的事情-如果您处理可以以0031开始的入站呼叫者ID,但不是来自.nl的呼叫,则您需要对第二行应用一些额外的模式匹配以强制执行最小位数(例如),否则将与CLI为0031的任何调用相匹配........... .....

Something to keep in mind - if you handle inbound caller ID that could start 0031 but its not a call from .nl then you would need to apply some additional patten matching to the 2nd line to enforce a minimum number of digits (for example) otherwise that will match any call that comes in with a CLI of 0031...............................

如果您需要更多说明,或者我手头有误,请在此答案中添加评论.

If you need any more explanation, or I've got the wrong end of the stick just add a comment to this answer.