cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1209
Views
5
Helpful
2
Replies

Number slicing

daneth.mean
Level 1
Level 1

Dear All,

Could anyone help me to show example on splicing digit in translation rule.

Example i received full Calling number 123456789 from my Originate and i want to change digit in the middle to 0 ( change number in the middle to 0 )  with keeping the first and last digit same to what i have received and forward to PSTN site.

Diagram.

USA Client ------> Originate GW ( send calling number123456789 ) ------------> Terminate GW ( Translate 123406789 ) --------> PSTN.

Thanks and Regards,

Dan

1 Accepted Solution

Accepted Solutions

Aaron Harrison
VIP Alumni
VIP Alumni

voice translation-rule 1

rule 1 /\(1234\).\(6789\)/ /\10\2/

Basically the format is the string to match, then the string to replace, with / to surround each. So /1234/ /5678/ would replace 1234 with 5678.

If you surround a part of the match string with brackets, you can use the bracketed bit in the replacement string. To use a bracket, you have to prefix a \ to escape it... so the brackets look like \(xxx\) but are wrapped in / / pairs, which can make it look a little confusing. To use a bracketed chunk, you put in a number - again, escaped with \ - so \1 refers to the string from the first bracket pair, and \2 the second. The 0 after \1 is a simple character to insert 0 between the two bracketed string tokens..

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

View solution in original post

2 Replies 2

Aaron Harrison
VIP Alumni
VIP Alumni

voice translation-rule 1

rule 1 /\(1234\).\(6789\)/ /\10\2/

Basically the format is the string to match, then the string to replace, with / to surround each. So /1234/ /5678/ would replace 1234 with 5678.

If you surround a part of the match string with brackets, you can use the bracketed bit in the replacement string. To use a bracket, you have to prefix a \ to escape it... so the brackets look like \(xxx\) but are wrapped in / / pairs, which can make it look a little confusing. To use a bracketed chunk, you put in a number - again, escaped with \ - so \1 refers to the string from the first bracket pair, and \2 the second. The 0 after \1 is a simple character to insert 0 between the two bracketed string tokens..

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

Dear Aaron,

Good, it fixed my issue now.

Thanks so much.

Dan