cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3272
Views
8
Helpful
14
Replies

Translation Pattern to Drop and Replace Digit

a.gooding
Level 5
Level 5

Guys,

i have a block of DID numbers coming into my H323 gateway which in turn is connected to my CUCM.

the block is 7XX-XXX-[0001 TO 9999]

I need to create two rules to do the following:

1. Convert 7XX-XXX-[0001 TO 9999] to go to extensions starting with 6XXX, Therefore, if i call 7XX-XXX-0001 it should translated to 6001

2. Call out from those extensions so if i call from 6001 it should advertise 7XX-XXX-0001

im able to do the basic translations but i cannot get it to replace the leading digit of the four digits to 6, meaning, 0001, drop the first 0 and replace with 6 to give 6001

Any assistance would be appreciated and rated accordingly as always

1 Accepted Solution

Accepted Solutions

Outgoing :

go to each directory , and edit the external phone number mask to the number you want to be used then go to the route pattern and enable the use external phone number mask.

incoming :

On the gateway :

voice translation-rule 1

rule 1 /^7.....0\(...\)/ /6\1/

voice translation-profile DID

translate called 1

apply the translation profile on the incoming pots dial-peer

translation-profile incoming DID

View solution in original post

14 Replies 14

Outgoing :

go to each directory , and edit the external phone number mask to the number you want to be used then go to the route pattern and enable the use external phone number mask.

incoming :

On the gateway :

voice translation-rule 1

rule 1 /^7.....0\(...\)/ /6\1/

voice translation-profile DID

translate called 1

apply the translation profile on the incoming pots dial-peer

translation-profile incoming DID

Great stuff,

for the outgoing though, suppose i didnt want to change the mask in CUCM but have it be matched only on the H323?

Hello,

Yes , you can , convert the above i guess , but it is easier to be done on CCM.

If you want to do it on the H.323 gateway , i guess it will be a headache since you have to apply the translation profile to every outgoing POTS dial-peer that you have.

Amer

Yeah

the situation is this, ther are multiple providers coming in with each providing DID to the extensions. hence the reason for me to place it on the H323.

for this specific configuration, its only two dial-peers so its not an issue.

might you have a sample of the rule for outgoing in that case? on the h323?

Ok this simple one should work where X is my PSTN numbers

rule 1 /6+/ /XXXXXX0/

Hi there,

To add to Amer's response you can also apply voice translation profiles to voice-ports to minimize configuration on dial-peers.

Depending on what your current external number mask is configured in CUCM, you can create a translation-rule to translate the calling number as well.  Below is assuming that your ANI hitting the gateway is 6XXX (you can check this by doing a "debug voip ccapi inout" and checking the calling number)

voice translation-profile ANI

translate calling 2

voice translation-rule 2

rule 1  /^6\(...\)$/  /^7.....\1/

voice-port x/x/x:x

translation-profile outgoing ANI

HTH,

Chris

Chris

thanks for the reply. good information and this is normally how we actually configure it however the customer setup in this case is somewhat different.

Amer was spot on with it and i have it working.

HOWEVER, the customer has a new change request. We need to now split the DID in two blocks and assign ranges to each extension pattern as below. Any ideas?

• 0001 – 0699 – To be used for 6xxx extensions

• 0700 – 0999 – To be used for 7xxx extensions

P.S BTW im reading up (finally) on translations, dunno it always seemed like advanced Mathematics to me so i just ignored it

Hello,

It is almost the same as i gave you , the thing is that you have to create two rules instead of one , and they will look like :

1- rule 1 /^7.....0\([0-6]..\)/ /6\1/

2- rule 2 /^7.....0\([7-9]..\)/ /7\1/

I am sure you know how to create the profile and enables it on the voice-port

Hope that helps.

Amer

Hello,

I forgot to tell you not to forget creating the 7... voip dial-peer

Just in case , i am sure you already did it.

Amer

Great stuff,

il lbe the one answering translations next time around.

thanks again and ive rated accordingly

Amer,

last one and i knew i should have asked but how do i advertise each range for outgoing using the translations?

So say we have EXT 7001 calling out on this. it should basically advertise 7XX-XXX-0701 and EXT 7100 should be 7XX-XXX-0799

Hello,

i am not really sure if this is going to work ( i mean to change the ANI from the gateway ) you have to test it, i had never done this from the gateway side , i always do this from the call manager side by playing with the external call number mask.

But for the translation rule , it will look like :

1- rule 1 /\(^[0-6]\)\(.\)\(..\)/ /700000\1\3/

2- rule 2 /\(^[7-9]\)\(.\)\(..\)/ /700000\1\3/

You have to replace the zero's with the actual DID number.

Amer

Definitely you can change it in the voice GW if you are using H323 for example or a CUBE for SIP trunk

just make sure in your translation you use calling keyword and apply to your outbound dialpeer in the outbound direction

dont wanna speak too soon but i think im getting the hang of it

rule 1 /^71\(..\)/ /7XXXX07\1/

rule 2 /^72\(..\)/ /7XXXXX08\1/

rule 3 /^6\(.\)\(..\)/ /XXXXXX0\1\2/

So if i understand correct

rule 1 states that any number starting with 71 is replaced with pattern 7XX-XXX-07 and inserts the last two digits defined by set one \1/

Rule 2 states the same

Rule 3 states that anything starting with 6 is broken into two sets for the extra three digits. the match is XXX-XXX-0 and include the first and second set which is essentially the last three numbers

make sure you change the X with .

as Cisco IOS dose not use the X like CUCM instead it uses the .

but the  question here is the calling number translation going to be sequential or not

for example

700X to be translated to 7XXXXX7X

which will looks like

7001 > 7XXXXX71

7009 > 7XXXXX79

if it is not sequential then there will be a lot of translation rules need to be applied ( depends on your amount of numbers need to be translated )

and max rules per translation profile is 15 which means you need to have multiple triangulation profiles with multiple dial peers ! ( a bit complicated if your numbers not sequential )

Good luck

hope this will help