cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2203
Views
5
Helpful
23
Replies

Voice translation rule change

isaaco001
Level 3
Level 3

Dear community,

This translation only picks three digits and maps it to 56xxx. However, I would like it to pick 5[6-9]xxx. what needs to be changed?

!
voice translation-rule 1
rule 1 /\(...\)/ /56\1/
!
voice translation-rule 2
rule 1 /.+\(...\)$/ /\1/
rule 2 /56/ //
!
voice translation-rule 3
rule 1 /56\(...\)/ /0956106\1/
!
voice translation-profile PROVIDER1
translate called 1
!
voice translation-profile PROVIDER2
translate calling 3
!
voice translation-profile HQ-OUTGOING
translate calling 2
!
voice translation-profile PROVIDER3
translate called 1
!

 

Regards,

Isaac.

2 Accepted Solutions

Accepted Solutions

You cannot have to rules with the same match-statement.
Doesn't matter if you want to match 3 digits, or 10 digits or whatever.

If it would work, same question to you applies: How should the router know, which rule to use?
E.g.
rule 1 /.../ /57\0/ --> matches 3 digits and adds the prefix 57
rule 2 /.../ /56\0/ --> matches 3 digits and adds the prefix 56
So the question to you now: how should the router know to use rule 1 and not rule 2? Or vice-versa?
Correct answer: He doesn't know, therefore you cannot have multiple rules with the same matching statement

To your example with 10 digits:
If you want to receive calls to 57xxx or 56xxx, ... you have to differentiat your 10 digit dial-plan, as already explained in my previous post and also by @Nithin Eluvathingal

View solution in original post

Let me try to explain this as easy and clearly as I possibly can.

  1. You have a range of numbers assigned to you by the Telco, per your information that range is 0711099000-0711099999, aka 1000 numbers.
  2. Now let's say the user with extension that ends with 558 calls out to the PSTN you'd want that to display the calling number as 0711099558.
  3. Now let's say that the extension that you use on the inside for that user is 56558, then you'd need to have a rule that translates the calling number in the outbound direction to your Telco from 56558 to 0711099558.
  4. To do this translation you'd need to have a translation rule and profile that looks like this.
    voice translation-rule 30
     rule 1 /^56\(...\)$/ /0711099\1/
    !
    voice translation-profile PSTN-OUT
     translate calling 30

    This translation-profile needs to be assigned to the outbound direction to either the trunk group, voice port or outbound dial-peer depending on what you use or prefer.

    What this does is that it matched the calling number 56... and copies what is inside the parentheses to memory and then prefixes 0711099 and takes the three digits that is stored in memory and appends that so that the resulting number is 0711099558. To explain a little more, the ^ means start of string and $ means end of string, meaning that the match statement will only match if the number starts with 56 and then have 3 more digits.

  5. Now let's say that someone from PSTN, aka external to you, calls to 0711099558. Then you'd need to translate that to 56558 in the inbound direction.
  6. To do that you'd need to have a translation rule and profile that looks like this.
  7. voice translation-rule 10
     rule 1 /^0711099\(...\)$/ /56\1/
    !
    voice translation-profile PSTN-IN
     translate calling 10

    This translation-profile needs to be assigned to the inbound direction to either the trunk group, voice port or inbound dial-peer depending on what you use or prefer.

    What this does is that it matched the calling number 0711099... and copies what is inside the parentheses to memory and then prefixes 56 and takes the three digits that is stored in memory and appends that so that the resulting number is 56558. To explain a little more, the ^ means start of string and $ means end of string, meaning that the match statement will only match if the number starts with 0711099 and then have 3 more digits.

  8. When this is sent from the gateway to the CM it will match the 56558 extension that you have.

As has been pointed out in multiple answers by me and @b.winter and @Nithin Eluvathingal you cannot have multiple ranges of extensions in CM that uses the same number on the gateway. I don't know how to make this any clearer to you? There is really no point in doing what you're trying as you have been assigned a 1000 numbers from your Telco, aka 000 to 999, with this you cannot use 3000 extension (numbers) in CM and try somehow magically have those share the 1000 numbers that you'd been assigned.

Hopefully this clears out things for you. If not please reach out to a reputable Cisco partner for help with this as we apparantly cannot help you with this in the community.



Response Signature


View solution in original post

23 Replies 23

Your rules are for matching three digits 000-999 and add 56, and if understood correctly its working as expected. What you expect by "I would like it to pick 5[6-9]xxx"



Response Signature


Nithin,

Thanks for your response.

I would like it to translate from matched to 57xxx or 58xxx or 59xxx . It doesnt allow that kind of translation but gives the error as a duplicate entry.

Regards,

Isaac.

 

 

Something like "rule 1 /.../ /5[6-9]\1/" won't work. Because how should the router know, if you he should add 56, or 57, ... to the matched number? Just by guessing?

You need to define your matching statement, to define, then which prefix should be added.
E.g.

rule 1 /[1-2]../ /56\1/
rule 2 /[3-4]../ /57\1/
...

 

b.winter,

thanks for your reply. I believe you we are on the right track with your recommendation.

However, I have one dilemma with the matching statement. If I expect to receive both 56444 and 57444 how will the match statement look like, i get lost here. 

 rule 1 /[1-9]../ /56\1/

 rule 2 /[1-9]../ /57\1/

configured as above but got error below

Error: Duplicate with rule 1

To make it more clear, I want to receive calls to extensions on 56xxx and 57xxx individually but something is wrong with the translation. 

Regards,

Isaac.

That rule is wrong and it’s duplicate.

In your case you must match with 5 digit and not the last three digit.

assume you receive call with called numbers  12xxx , 13xxx , 14xxx

and if you want  to translate the above to 56xxx 57xxx 58xxx

the below rule will work

rule 1 /14\(…\)/ /56\1/

 rule 2 /15\(…\)/ /57\1/

rule 3 /16\(…\)/ /58\1/



Response Signature


b.winter,

Thanks for your reply.

It's still unclear to me. The scenario is that I receive random 10 digita pstn calls so I can't dictate how to match them. I just want to receive calls to any internal  56xxx,57xxx or 58xxx extension.

For some reason if I remove 

rule 1 /\(...\)/ /56\1/ and replace with rule 1 /\(...\)/ /57\1/

I receive calls to 57xxx and not 56xxx as was.

Regards,

Isaac 

 

You cannot have to rules with the same match-statement.
Doesn't matter if you want to match 3 digits, or 10 digits or whatever.

If it would work, same question to you applies: How should the router know, which rule to use?
E.g.
rule 1 /.../ /57\0/ --> matches 3 digits and adds the prefix 57
rule 2 /.../ /56\0/ --> matches 3 digits and adds the prefix 56
So the question to you now: how should the router know to use rule 1 and not rule 2? Or vice-versa?
Correct answer: He doesn't know, therefore you cannot have multiple rules with the same matching statement

To your example with 10 digits:
If you want to receive calls to 57xxx or 56xxx, ... you have to differentiat your 10 digit dial-plan, as already explained in my previous post and also by @Nithin Eluvathingal

You will not receive random 10 digit numbers from your service provider, you will receive the range of numbers that is assigned to you by the service provider. Can you please provide the number range that you have been assigned and explain what you want to translate to what? With that we should be able to help you.



Response Signature


Hi Roger,

Thanks for your reply.

What I meant is that anybody with an 10 digit number from outside the organization can call in. The expectation is that when an internal extension receives the 10 digit number, they will be able to call back since they need to know who called in the first place.

So the number issued to us by ISP is 0711099000. When calling out its translated to say 0711099558. So when calling in/inbound calls how can I translate called to internal extension 56xxx,57xxx and 58xxx?

Regards,

Isaac.

So your did block is 0711099xxx.

I assume you have 1000 block numbers from 0711099000 - 0711099999

so now out of this 1000 number block which number you need to translate to 56xxx, 57xxx,58xxx



Response Signature