I have a CUCM 9.x cluster with an E.164+ dial plan for internal extensions, route patterns etc.
I have an ISDN gateway (2911 ISR with IOS 15.3(3)M1) which connects to the PSTN.
The ISDN provider cannot accept E.164+ format destination numbers so I need to manipulate the called digits before sending them to the PSTN switch.
I can obviously do this using CUCM Called Party Translation Patterns but I am wondering whether it is possible to do the translation on the gateway instead?
The rule I have tried to use is shown below (United Kingdom Country Code).
rule 1 /^+44\(.*\)/ /0\1/
What I want it to do is strip +44 of the start of the number and replace it with 0
e.g. +441234444666 would become 01234444666
The rule I have tried fails because the + symbol is identified as a wildcard rather than as part of the number string I want to match.
Is there any way around this?
Solved! Go to Solution.
I believe you got a bit lucky by using ".+" because that just matched any character. What you should have done is use "\" to denote that the next character is an actual character and not an operator. It should look like this:
rule 1 /^\+44\(.*\)/ /0\1/
I know this was answered previously, but I wanted to clarify.
Great post Jamie.
I used your example to write a Translation-Profile which truncates the E.164 number into the last 7 digits:
voice translation-rule 5002
rule 1 /^\+1...\(.*\)/ /\1/
Example String: +15554443333
Replaced String: 4443333
As Nadeem mentioned the /.+/ will do the trick.
These tables define wildcard and wildcard combinations and show some examples.
|.||Any single digit|
|0 to 9,*,#||Any specific character|
|[0-9]||Any range or sequence of characters|
|*||Modifier—match none or more occurrences|
|+||Modifier—match one or more occurrences|
|?||Modifier—match none or one occurrence|
|.*||Any digit followed by none or more ocurrences. This is effectively anything, including null.|
|.+||Any digit followed by one or more ocurrences. This is effectively anything, except null.|
|^$||No digits, null|