Voice Translation Rules… The Rules
#1 Replace
Rule 1 /123/ /456/ -> 123 = 456
#2 replace any start occurance
Rule 1 /^123/ /456/ -> 123456 = 456 456
123 = 456
#3 Match Exact Number
Rule 1 /^123$/ /456/ -> 123 = 456
1234 = No Match
#4 Any 5 digits beginning with XX
Rule 1 /^12…/ /0121/ 12 = 0121
#5 Replace All numbers
Rule 1 /.*/ /0121/ * = 0121
#6 replace all except null
Rule 1 /.+/ /0121/ 123 = 0121
#7 replace start number that begins with 0 (and combinations e.g.00)
Rule 1 /^0+/ /909/ 0123 = 909123
00123 = 090123
123 = No Match
\ = Slice
\ = in replacement indicates what to keep
( ) = Indicates what to keep
(a\) = Keep ‘a’
b\ = ignore ‘b’
\l = copy first into replacement number
e.g.
/ (x\) y\ (z\) / / w\1\2 /
rule 1 /^\ (12\) 3\ (45\) $ / /4\1\2/ -> 12345 = 41245
Rule 1 /^2\ (…$) / / 01211234 \ 1 / -> 2001 = 01211234001
Reject Calls
Rule 1 reject /^1234/
Apply Rules
Voice Translation-rule 1
Rule 1 /123/ /456/
Voice Translation-profile CALLING_PROFILE
Translate calling 1
Dial-peer voice 1 pots
Translation-profile outgoing CALLING_PROFILE
More Examples
Rule 1 /^.*/ (..\) /1\/ = 12345 = 45
Rule 2 /^\ (01…\) \-\ (…….?$)/ /1\2\3/ = 01208-333444 = 01208333444
Rule 3 /^\ (0[12]..\) \-\ (…\) \-\ (….$\)/ /1\2\3/ = 0208-123-4567 = 02081234567