一、组网需求:
北京和上海各有一个由PBX组成的本地电话网,利用两台语音网关实现互通, PBX内部用户可以通过VoIP拨打异地的普通电话。
在北京和上海都有财务部、市场部和销售部。在这些部门,本地拨打本地的电话,只需要拨打内部短号,而拨打外地部门电话,需要拨打长号。例如,上海的财务部打市场部,拨3366。上海的财务部打北京的市场部,拨0106788即可接通,而北京的市场部来电显示为0211688,即上海区号+上海财务部电话号码。
在各地语音网关用户线对应的pots实体配置的都是短号。
二、组网图:
1. 上海语音网关的配置:
# 配置以太口地址为 2.2.2.2
[VGA] interface
[VGA-if] ether 0
[VGA-if-eth0] address ip 2.2.2.2
# 配置本地用户线号码
[VGA] voice-setup
[VGA-voice] dial-program
[VGA-voice-dial] entity 20 pots
[VGA-voice-dial-entity 20] match-template 2323
[VGA-voice-dial-entity 20] line 0
[VGA-voice-dial] entity 21 pots
[VGA-voice-dial-entity 21] match-template 1688
[VGA-voice-dial-entity 21] line 1
[VGA-voice-dial] entity 22 pots
[VGA-voice-dial-entity 22] match-template 3366
[VGA-voice-dial-entity 22] line 2
# 配置被叫号码变换表:
[VGA-voice-dial] number-substitute 1
[VGA-voice-dial-subst1] rule 1 ^010....$ ....
# 配置主叫号码变换表:
[VGA-voice-dial-subst2] quit
[VGA-voice-dial] number-substitute 2
[VGA-voice-dial-subst2] rule 1 1688 0211688
[VGA-voice-dial-subst2] rule 2 3366 0213366
[VGA-voice-dial-subst2] rule 3 2323 0212323
# 配置上海到北京的VoIP语音实体。
[VGA-voice-dial-subst2] quit
[VGA-voice-dial] entity 10 voip
[VGA-voice-dial-entity10] match-template 010....
[VGA-voice-dial-entity10] address ip 1.1.1.1
# 配置上海到北京的VoIP语音实体的号码变换规则
[VGA-voice-dial-entity10] substitute called 1
[VGA-voice-dial-entity10] substitute calling 2
2. 北京语音网关的配置:
# 配置以太口地址为 1.1.1.1
[VGB] interface
[VGB-if] ether 0
[VGB-if-eth0] address ip 1.1.1.1
# 配置本地用户线号码
[VGB] voice-setup
[VGB-voice] dial-program
[VGB-voice-dial] entity 20 pots
[VGB-voice-dial-entity 20] match-template 1234
[VGB-voice-dial-entity 20] line 0
[VGB-voice-dial] entity 21 pots
[VGB-voice-dial-entity 21] match-template 6788
[VGB-voice-dial-entity 21] line 1
[VGB-voice-dial] entity 22 pots
[VGB-voice-dial-entity 22] match-template 6565
[VGB-voice-dial-entity 22] line 2
# 配置被叫号码变换表:
[VGB-voice-dial] number-substitute 1
[VGB-voice-dial-subst101] rule 1 ^1234$ 0101234
[VGB-voice-dial-subst101] rule 2 ^6788$ 0106788
[VGB-voice-dial-subst101] rule 3 ^6565$ 0106565
# 配置主叫号码变换表:
[VGB-voice-dial-subst101] quit
[VGB-voice-dial] number-substitute 2
[VGB-voice-dial-subst102] rule 1 ^021....$ 021....
# 配置北京到上海的VoIP语音实体:
[VGB-voice-dial-subst102] quit
[VGB-voice-dial] entity 10 voip
[VGB-voice-dial-entity10] match-template 021….
[VGB-voice-dial-entity10] address ip 2.2.2.2
# 配置北京到上海的VoIP语音实体的号码变换规则
[VGB-voice-dial-entity10] substitute calling 1
[VGB-voice-dial-entity10] substitute called 2
四、配置关键点:
首先使用number-substitute定义了号码变换的规则,然后在对应的语音实体视图下使用substitute绑定号码变换规则。注意:语音实体下的号码变换规则是匹配了语音实体以后的变换规则,所以不存在in和out的概念。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作