cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
18552
Views
17
Helpful
11
Replies

num-exp vs dial-peer & translation-rules

anis_cisco
Level 1
Level 1

Hello every body,

Can any body help me to understand in which scenario's we should use num-exp ?

I was running through a scenario, where incoming call was suppose to hit an extension & then from extension it had to divert on an IVR at HQ through VPN.

For this i configured a translation rule for incoming call, incoming dial-peer with incoming called-number . , outgoing dial-peer with destination-pattern to IVR ext 1234) & call-forward all on extension (under ephone-dn) to IVR number.

With this my calls were not going through to the IVR number, then i configure num-exp XXXX 1234 & it worked.

I didnt understand how num-exp is working in above scenario can any body explain please ? also what will be the steps for an incoming call when we have translation rules, dial-peers & num-exp configured ?

Thanks in advance

11 Replies 11

Harmit Singh
Cisco Employee
Cisco Employee

Hi anis_cisco,

Number expansion is a globally applied rule that enables you to define a  set of digits for the router to prepend to the beginning of a dialed  string before passing it to the remote telephony device. Automatically  prepending digits in the dial peer configuration reduces the number of  digits that a user must dial to reach a remote location. Number  expansion is similar to using a prefix, except that number expansion is  applied globally to all dial peers.

Using a simple telephony-based example, suppose that user A works in a  company where employees extensions are reached by dialing the last four  digits of the full E.164 telephone number. The E.164 telephone number is  555-2123; user A's extension number is 2123. Suppose that every  employee on user A's floor has a telephone number that begins with the  same first four digits: 5552. You could define each dial peer's  destination pattern using each extension number, and then use number  expansion to prepend the first four digits onto the extension. In this  example, the router could be configured as follows:

num-exp 2... 5552...

dial peer voice 1 pots

 destination pattern 2123

Number expansion can also be used to replace a dialed number with  another number, as in the case of call forwarding. Suppose that for some  reason, user A needs to have all of his telephone calls forwarded to  another number, 555-6611. In this example, you would configure the  router as follows:

num-exp 2123 5556611

dial peer voice 1 pots

 destination pattern 2123

In this example, every time the device receives a call for extension  2123, the dialed digits will be replaced with 555-6611 and the call will  be forwarded to that telephone.

To understand why the translation rule didn't work, I would suggest using "test voice translation-rule ".

HTH.

Regards,

Harmit.

Thank Harmit, for detail explaination.

I tried with test voice translation-rule command & it was translated properly.

So you mean, when call arrives in the call flow will be,

It will match incoming dial-peer frist then it will match destination-pattern then it will match num-exp ?

correct me if i am wrong

Regards,

Hi anis_cisco,

Num-exp happens BEFORE dial-peer matching, they would have a higher precedence than any translation profiles applied to your dial-peers i.e. a Cisco gateway will take the digits a user dialed and apply any  matching number-expansions BEFORE looking to match outbound dial-peers  so the number-expansion takes priority.

Please refer to the following link for more info and examples of num-exp:

http://www.cisco.com/en/US/docs/ios/12_3/vvf_c/dial_peer/dp_confg.html#wp1067388

HTH.

Regards,

Harmit.

Harmit,

I understand the purpose & function of num-exp.

Below are the configuration from my device, in scenario 1 i used num-exp & it was working while in 2 scenario i used translation-rules & it was NOT working.

can you tell the reason of failure & the call flow for both scenario ?

SCENARIO 1: WORKING

voice translation-rule 1

rule 1 /.*\(....\)/ /\0/

voice translation-profile 1

translate called 1

voice-port 0/0/0:23

translation-profile incoming 1

num-exp 2222 1234

dial-peer voice 1 pots

incoming-called number.

direct-inward-dial

dial-peer voice 2 voip

destination-pattern 1234

SCENARIO 2: NON WORKING

voice translation-rule 1

rule 1 /.*\(....\)/ /\0/

voice translation-rule 2

rule 1 /^11112222/ /1234/

voice translation-profile 1

translate called 1

voice translation-profile 2

translate called 2

voice-port 0/0/0:23

translation-profile incoming 1

dial-peer voice 1 pots

incoming-called number.

direct-inward-dial

dial-peer voice 2 voip

translation-profile incoming 2

destination-pattern 1234

ephone-dn 1 octo-line

number 2222

call-forward all 1234

Regards,

Anis

Hi Anis,

Thanks for sharing these details. For the non working scenario, did you try adding the "port 0/0/0:23" command under the incoming pots dialpeer 1? Secondly, is the original incoming DNIS 11112222 or is it 2222? Voice translation rule 2 suggests its 11112222:

voice translation-rule 2

rule 1 /^11112222/ /1234/

Regards,

Harmit.

Hello Harmit,

No i didnt tried this & i dont think so its mandatory as i have configured incoming translation-profile under voice-port 0/0/0:15

DNIS is 8digit which is 11112222.

About voice translation-rule 1 & voice translation-rule 2 in non-working scenario,

when call arrives having DNIS 11112222 it will match voice translation-rule 2 as it has exact match NOT voice translation-rule 1 right ?

Thanks

Hi Anis,

It will not match voice translation-rule 2 because you have applied profile 1 to the voice-port:

voice-port 0/0/0:23

translation-profile incoming 1

Since the incoming DNIS is 11112222, you should apply profile 2 to the voice port instead of profile 1. This should cause the ephone-dn to get matched where CFA to 1234 is applied. That would further match the destination-pattern applied on the voip dialpeer and route the call to the session target.

Regards,

Harmit.

Hello Harmit,

I didnt understand why it will not match voice translation 2 as i have define voice translation-profile under dial-peer voice 2 voip.

As per my understanding When call comes in it should hit dial-peer 1 pots first (as incoming dial-peer) then it should manipulate from translation-rule 2 & then dial-peer voice 2 viop & then to the destination-pattern and sesstion target.as following configuration:

dial-peer voice 1 pots

incoming called-number .

direct-inward-dial

voice translation-rule 2

rule 1 /^11112222/ /1234/

voice translation-profile 2

translate called 2

dial-peer voice 2 voip

translation-profile incoming 2

destination-pattern 1234

session target ipv4:x.x.x.x

ephone-dn 1 octo-line

number 2222

call-forward all 1234

Do translation-profile defined under voice-port 0/0/0:15 has more priority then translation-profile defined under dial-peer ?

As you said "This should cause the ephone-dn to get matched where CFA to 1234 is applied" Does it mean it will match only when we will have translation-profile configured under voice-port ?

As per my understanding this should match even if i am configuring translation-profile under dial-peer as well.

Hi Anis,

It can be confusing

Take a look at this and see if it helps:

First of all, voice translation rule 1 doesn't do any number translation:

voice translation-rule 1

rule 1 /.*\(....\)/ /\0/

voice translation-profile 1

translate called 1

R7#test voice translation-rule 1 11112222

Matched with rule 1

Original number: 11112222       Translated number: 11112222

Original number type: none      Translated number type: none

Original number plan: none      Translated number plan: none

This is applied to your voice-port, which means it should match this rule on the incoming leg:

voice-port 0/0/0:23

translation-profile incoming 1

So uptil here, assuming the DNIS is 11112222 (since that's the voice translation rule 2), the DNIS remains unchanged.

If the DNIS remains unchanged, then there is no dialpeer match that takes place i.e. dial-peer 2 does not get matched nor does the ephone-dn that you created:

dial-peer voice 2 voip

translation-profile incoming 2

destination-pattern 1234

ephone-dn 1 octo-line

number 2222

call-forward all 1234

Hence, the call doesn't get routed correctly.

What I noticed in the working scenario is that the num-exp is set to convert 2222 to 1234. So are you receiving 4 digits as the DNIS or all 8 digits??

Regards,

Harmit.

Anis,

Forgot to add - I've set up the same config in my lab and the non working config works on my end if  the DNIS is 2222 and not 11112222. Please take a debug isdn q931 for a test call to see what digits you get in the DNIS.

Regards,

Harmit.

Hi Harmit,

Although this is very old post but worth to clarify. As number expansion is matched before dial peer matching, the translated number from number expansion must match with the destination-patter under dial peer.

This means that the translated number from number expansion command should be programmed in dial-peer instead of actual number dialed by user. 

In your above example, if 7 digits number starts with 5552 should be configured in destination pattern under dial peer as this is the translated number.

Am I skipping something here?

Thanks

Vivek