ā01-30-2014 09:51 AM - edited ā03-16-2019 09:31 PM
Hello,
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?
Thanks
Solved! Go to Solution.
ā01-30-2014 10:11 AM
Hello James
This is regular expression, have you tried putting (.) dot first then + followed by your number
let me try at lab
Br,
Nadeem
Please rate all useful post.
ā01-30-2014 10:11 AM
Hello James
This is regular expression, have you tried putting (.) dot first then + followed by your number
let me try at lab
Br,
Nadeem
Please rate all useful post.
ā07-25-2015 06:52 PM
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.
ā06-02-2019 05:36 PM
Great post Jamie.
I used your example to write a Translation-Profile which truncates the E.164 number into the last 7 digits:
conf t
voice translation-rule 5002
rule 1 /^\+1...\(.*\)/ /\1/
Example String: +15554443333
Replaced String: 4443333
ā01-30-2014 10:22 AM
Hi James,
As Nadeem mentioned the /.+/ will do the trick.
These tables define wildcard and wildcard combinations and show some examples.
Wildcard | Definition |
---|---|
. | 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 |
Wildcard Combination | Definition |
---|---|
.* | 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 |
ā01-30-2014 10:34 AM
Worked a treat - thank you both
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide