cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
683
Views
5
Helpful
12
Replies

How to strip 09 digits numbers to 04 digits numbers

Hello,

I have a cisco callmanager express and the SIP provider gives us the following range number to be used to make outside calls. the range is from 555091900 to 555091999.These numbers are configured on users IPhones as an extension for making outside calls. Now we have purchase a billing application to manage our calling expenses but to install the application we need to strip the SIP numbers digit to 05 digits. This is because the application supports 05 digits.

 

So how to strip these 09 digits numbers to 04 digits numbers so that the users with the new 04 digits numbers can still make outside calls and is reachable from outside.

 

Example:

Let say a user has the number 555091901 on his iphone to make outside calls and is reachable from outside with the same number through SIP trunk. let strip this number to 91901 and configured it on iphone.

How this user can still make outside calls and be reachable at the same time?

 

Thank you.

1 Accepted Solution

Accepted Solutions

Try below config. and configure 5 digit extension for the users. 

 

 

Voice translation-rule 1
rule 1 /^5550\(91...$\)/ /\1/ >>>> Translate 9 Digit to 5 digit this will be used when call comes inside  
!
voice translation-rule 2
rule 1 /\(^91...$\)/ /5550\1/ >>>> Translate 5 Digit to 9 digit  this will be used when call goes outside 
!
!
!
voice translation-profile in
translate called 1
!
voice translation-profile out
translate calling 2
!
!

 

 

dial-peer voice 1 voip >>>> incoming Dial-peer
description ***ALL INCOMING***
translation-profile incoming in
incoming called-number .

dial-peer voice 2 voip >>> Outgoing dial-peer 
description ##DIAL_PEER_GSM##
translation-profile outgoing out
destination-pattern 9[79].......
session target ipv4:XX.XX.XX.XX
!



Response Signature


View solution in original post

12 Replies 12

Pretty simple, you would use voice translation rules. You’ll need one that strips the long numbers down to the short for ingress calls and then you need to do the reverse for calls in the egress direction.



Response Signature


Try below config. and configure 5 digit extension for the users. 

 

 

Voice translation-rule 1
rule 1 /^5550\(91...$\)/ /\1/ >>>> Translate 9 Digit to 5 digit this will be used when call comes inside  
!
voice translation-rule 2
rule 1 /\(^91...$\)/ /5550\1/ >>>> Translate 5 Digit to 9 digit  this will be used when call goes outside 
!
!
!
voice translation-profile in
translate called 1
!
voice translation-profile out
translate calling 2
!
!

 

 

dial-peer voice 1 voip >>>> incoming Dial-peer
description ***ALL INCOMING***
translation-profile incoming in
incoming called-number .

dial-peer voice 2 voip >>> Outgoing dial-peer 
description ##DIAL_PEER_GSM##
translation-profile outgoing out
destination-pattern 9[79].......
session target ipv4:XX.XX.XX.XX
!



Response Signature


Details, but your rules you created translate to/from 5 digits and your explanation text says 4 digits.



Response Signature


Hello Roger,

You are right it is to in strip to 05 digits 

Is there any specific reason for writing 05 instead of 5?



Response Signature


No specific reason Roger

05=5

Hello Nithin,

You have understood my needs it is 05 digits instead of 04 digits as said earlier. I will try your solution asap and let you know.

 

Thanks

Hello Nithin,

 

Your solution was very helpfull but I have just adjust configuration dial peer.

 

Thank you

@henriprisodjango Sorry for pointing out the obvious, but isn't it expected that you can't actually expect that you could take a suggested change and implement that without any adoption to fit into your specific configuration, anyway not when you haven't shared any piece of information about your setup?



Response Signature


@Roger Kallberg What do you mean? The solution given by @Nithin Eluvathingal was helpfull although I have ajusted the configuration. The adjustments were done on dial-peer. I have applied the two translations profile on all diall-peer.

 

Exemple:

dial-peer voice 1 voip
description outgoing call to SIP TRUNK

translation-profile incoming in

translation-profile outgoing out
destination-pattern 222......
session protocol sipv2
session target ipv4:XX.XX.XX.XX
voice-class codec 1
dtmf-relay rtp-nte
no vad

I have done this to every destination-pattern and the user can call outside using 5 digits numbers  and can be reachable from outside with the 9 digits numbers.

 

I did not use this

dial-peer voice 1 voip >>>> incoming Dial-peer
description ***ALL INCOMING***
translation-profile incoming in
incoming called-number .


@henriprisodjango wrote:
Your solution was very helpfull but I have just adjust configuration dial peer.


You wrote this.

What I mean is as you did not share any details on your configuration @Nithin Eluvathingal could not have known what dial peer(s) you use. So at a minimum that would be something that you you're self would need to put some effort on to adopt to fit to your needs.



Response Signature


@Roger Kallberg Ok I understand. Anyway thanks for all.