Digit Maps,也称为Dial Plan。电信MGW(媒体网关)和MGCF(如IMS中的AGCF、PCSCF)等之间用于媒体控制主要是用H.248协议进行的,H.248协议交互中,MGCF会使用DigitMap将服务器使用的拨号数图发给MGW,告知MGW可以接受哪些形式的用户拨号。
Digit Maps定义在RFC3435协议中,摘抄如下:
* Digit: A digit from "0" to "9".
* Timer: The symbol "T" matching a timer expiry.
* DTMF: A digit, a timer, or one of the symbols "A", "B", "C",
"D", "#", or "*". Extensions may be defined.
* Wildcard: The symbol "x" which matches any digit ("0" to "9").
* Range: One or more DTMF symbols enclosed between square brackets
("[" and "]").
* Subrange: Two digits separated by hyphen ("-") which matches any
digit between and including the two. The subrange
construct can only be used inside a range construct,
i.e., between "[" and "]".
* Position: A period (".") which matches an arbitrary number,
including zero, of occurrences of the preceding
construct.
我们举个例子,基本都是正则表达式的基础。
(*xx | [3469]11 | 0 | 00 | <:1408>[2-9]xxxxxx | 1[2-9]]xx[2-9]xxxxxx | 011x. )
() 表示整个DialPlan
| 用于隔开每条规则
x 0-9任一个数字
[] 和正则表达式一样,可以选择[]中的任一字符
<:> 拨号头替换,如<8:1650>xxxxxxx,当你拨打85551212,实际拨出的号码是16505551212
9,1xxxxxxx 逗号表示发送拨号音,等待继续拨号,就是那种公司里面拨外线的时候,先拨个9,让后听等待音,接着拨外线的情况
190xxxxxxx! 感叹号表示禁止拨打此号码
双括号前面加入 "L=8,S=4" 表示设置设置8S的超时时间,比较少用
011x. .表示与前一项相同,不计长度。所以01122,011223,0112234都符合
下面举实际的例子:
(1 xxx xxxxxxx) 表示拨打美国号码,xxx为区号
(1 xxx xxxxxxx | <:1212>xxxxxxx) 如果拨号少于7位,则自动在号码前面加入1212用于本地号段
(<9,:>1 xxx xxxxxxx | <8,:1212>xxxxxxx) 9和8用于小总机拨打外线预拨号码,当拨打9或者8时,可听到等待音
S:4,(00 | 011 xxxxxxx.) 短超时为4S,只可拨打00或者011开头的号码。
(0 | [49]11 | 1[2-9]xx[2-9]xxxxxx) 用于411或者911
(1[2-8]xx[2-9]xxxxxx) 典型的美国号码规则
(1 947 xxxxxxx! | 1 xxx xxxxxxx) 禁止拨打区号为947的号码
(S0<:12125551234>) 热线拨出,用户拿起电话就自动拨打12125551234
(P5<:1000>|xxxx) 如果用户拿起电话没有拨入4个号码5S后,自动拨出1000