cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1595
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.

23 Replies 23

No you can not do that. You'll need something on the match side that differentiate the numbers to be able to do a translation to three different ranges. Why do you not just use one range as you anyway do not have 3000 numbers assigned to you?



Response Signature


Roger,

I have over 3000 users, so unless you mean an expanded number block.

Regards,

Isaac.

Well 3000 users cannot share the 1000 numbers that you've got assigned by your Telco, it's as simple as that. If each and everyone of your 3000 users need to have their own DID number, aka be reachable from PSTN, you’ll need to have 3000 numbers.



Response Signature


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


Roger,

Thanks for your reply and patience.

I think the issue as you have broken down well is the number that has been assigned to me by the telco. It limits me to use only one of the scopes. If I need to work with another range, then It will need another telco scope or allow for more digits. That's why @b.winter  keeps on going back to the matching issue since the router cannot distinguish if 56558 or 57558 or 58558 calling.

I hope i understand it now. The translation examples you have shared  will be very useful in future, much appreciated!

Regards,

Isaac.

You're very welcome. You almost got it right in you last response. The router can distinguish between calls coming from 56XXX, 57XXX or 58XXX, but what it cannot do is translate that to something meaningful as you only have a 1000 numbers. Aka there is no point in translating all of these 56558, 57558 or 58558 to 0711099558 as the router would not know where to deliver the call that came back from the external party as you cannot translate 0711099558 to 56558, 57558 and 58558, as stated before you can only translate that to one of these.



Response Signature


That because you are matching the last three digit. Normally ISP provide you a block of numbers and not some random numbers. Is this analogue lines or PRI/SIP lines. If analogue yes it could be random numbers but for SIP/PRI it must be block numbers and not random numbers.

Could you share the block of numbers or more details regarding your Direct numbers ? and also details regarding where it should land. So we can suggest a translation rule matching your requirement. 



Response Signature


Nithin,

Thanks for your reply.

In my country pstn numbers(public numbers) are 10digits for example 0715326599 is a mobile number belonging to an individual somewhere in the country. ISP will also issue 10 digit number to companies.

My company has extensions are 56xxx,57xxx and 58xxx. The number ISP issued for our external use is 0711099000.

so when am making an outbound call it will appear as 0711099558 for example. Now, for inbound calls how do I make the call  reach my internal extension 56xxx,57xxx and 58xxx. I expect the internal voip to see the number that called i.e 0715326599 and be able to call it back.

so flow for inbound 0715326599(outsider calling to my company)--->my gateway---->56xxx,57xxx,58xx

for outbound 56xxx,57xxx,58xxx---->my gateway(0711099558 i.e translated)--->0715326599(outsider being called back)

It's an E1 line. what I meant by random number is that anybody with a 10digit number from outside the company can call in.

I hope its clear what am trying to achieve, i can supply more information.

Regards,

Isaac.

To add to my previous answer and provide you with some explanation on this part in your reply as it seems like you might have a gap in knowledge on how translation rules works.

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.

This is because the rule have two different parts, the left hand side is the matching side and the right hand side is the replacement side. So if you remove a rule and replace it with something else then there isn’t anything doing the replacement that you had before, ie there is no rule that translates the number to 56XXX as you now have a rule that has the same match statement, but translates to 57XXX. With this you cannot receive calls to extensions in the 56XXX range as the gateway doesn’t translate to that.

I hope this might help clear up some of the confusion you have about how translations operates in a gateways. To know more about how to form translation rules please have a look at this document. Determine Voice Translation Rules 



Response Signature