Cisco VoIP配置中translation-rule命令的用法

Cisco VoIP配置中translation-rule命令的用法
一、概述
Translation-rule用于增加、移除和替换VoIP中dial-peer拨号对等体inbound和outbound号码。它有以下几种应用:
1、  应用于所有inbound call legs。
2、  应用于特定voice-port的所有inbound call legs。
3、  应用于特定dial-peer的所有outbound call legs。

二、命令格式
Translation-rule在全局模式侠有以下两种命令配置方式:
1、    (config)translation-rule rule_tag
(config-rule)rule <0-10> match pattern  replacement pattern
应用translation-rule:
1)       所有inbound call legs
(config) voip-incoming translation-rule rule_tag {called/calling}
2)       特定voice-port的所有inbound call legs
     (config)voice-port 0/0/0
     (config-voiceport)translate {called/calling} rule_tag
3)       特定dial-peer的所有outbound call legs
     (config)dial-peer voice 10 pots
     (config-dial-peer)translate-outgoing {called/calling} rule_tag

2、    (config)voice translation-rule rule_tag
(config-rule)rule <1-15> /match pattern/  /replacement pattern/
应用voice translation-rule:
1)      创建voice translation-profile
(config) voice translation−profile profile_name
(cfg-translation-profile) translate {called/calling} rule_tag
2)      特定的dial-peer所有incoming和outgoing call legs
      (config)dial-peer voice 10 pots
     (config-dial-peer)translation-profile {incoming/outgoing} profile_name


三、通配符
1、  数字通配符    


  2、其他符号:


四、用法示例

1、将40开头的5位号码替换为号码"6666000":
voice translation−rule 1
rule 1 /^40.../ /6666000/
router#test voice translation−rule 1 40123
Matched with rule 1
Original number: 40123 Translated number: 6666000

2、将所有号码替换为 "5554000":
voice translation−rule 2
rule 1 /.*/ /5554000/
router#test voice translation−rule 2 123
Matched with rule 1
Original number: 123 Translated number: 5554000
router#test voice translation−rule 2 86573
Matched with rule 1
Original number: 86573 Translated number: 5554000
router#test voice translation−rule 2 ""
Matched with rule 1
Original number: Translated number: 5554000

3、将所有非空号码替换为 "5554000".
voice translation−rule 2
rule 1 /.+/ /5554000/
router#test voice translation−rule 2 123
Matched with rule 1
Original number: 123 Translated number: 5554000
router#test voice translation−rule 2 ""
Didn't match with any of rules

4、保留最后3位号码至5554开头的后3位:
voice translation−rule 2
rule 1 /^....(...\)/ /5554\1/
router#test voice translation−rule 2 1234567
Matched with rule 1
Original number: 1234567 Translated number: 5554567
router#test voice translation−rule 2 123456
Didn't match with any of rules

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值