Monday, March 29, 2010

Cấu hình Voice Translation Rules trên Router (tập 1)

Sau một thời gian nghiên cứu Callmanager Express trên IOS, đến phần Voice Translation Rules thật sự là phức tạp nhưng sau khi xem kỹ ví dụ sau của Cisco thì mọi cái sáng tỏ dần ra.Quả là một ngày may mắn khi đọc được tài liệu này.
Đây là link của Cisco:
Voice Translation Rules
Sau đây là một số ví dụ đơn giản và dẽ hiểu nhất về Translation Rules :

Example 1

This example replaces the first occurrence of the number "123" with "456".

voice translation-rule 1
rule 1 /123/ /456/

These are test voice translation-rule examples:

router#test voice translation-rule 1 123
Matched with rule 1
Original number: 123 Translated number: 456

router#test voice translation-rule 1 1234
Matched with rule 1
Original number: 1234 Translated number: 4564

router#test voice translation-rule 1 6123
Matched with rule 1
Original number: 6123 Translated number: 6456
router#test voice translation-rule 1 6123123
Matched with rule 1
Original number: 6123123 Translated number: 6456123
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none

In this example, the rule matches the first occurrence of the number that contains the pattern "123" anywhere in the number. Specifically, you can use the start and end of number indicators. The Example 2 and Example 3 sections show this.

Example 2

This example shows how to replace any occurrence of "123" at the start of a number with "456".

voice translation-rule 1
rule 1 /^123/ /456/

These are test voice translation-rule examples.

router#test voice translation-rule 1 123
Matched with rule 1
Original number: 123 Translated number: 456

router#test voice translation-rule 1 1234
Matched with rule 1
Original number: 1234 Translated number: 4564

router#test voice translation-rule 1 6123
6123 Didn't match with any of rules

Example 3

If you want only the match of an exact number, specify both the start and end number indicators:

voice translation-rule 1
rule 1 /^123$/ /456/
router#test voice translation-rule 1 123
Matched with rule 1
Original number: 123 Translated number: 456

router#test voice translation-rule 1 1234
1234 Didn't match with any of rules

router#test voice translation-rule 1 6123
6123 Didn't match with any of rules

Sẽ còn tiếp về các ví dụ phức tạp hơn trong các bài viết sau.