Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

configure : add prefix and remove prefix


I have 4 pods in our voip netowrk.

Each pod have owner PBX system.

But they have complex dial plan.

So I have to configure as simple as possible.

Thus, I have good idea to resolve.

In my opinion, I'm gonna give prefix number both of them. Pod-A is 1, Pod-B is 2, Pod-C is 3, Pod-D is 4.

for example, I'll add prefix 1 all phone number entering from pod-A's pbx to gateway in pod-A on pots dial-peer.

When the call flow pod-B, I'll strip the prefix 1 from gateway in pod-B to pod-B's PBX on pots dial-peer.

Is it possible?

Actually, I had a test, but i couldn't success it....

may be...wromg configuration...

Could you please advice to me to reslove? and any other good idea?



New Member

Re: configure : add prefix and remove prefix

How can i configre each pots...?

Re: configure : add prefix and remove prefix

Hi John,

It is important to note that the DNIS you receive from the PBX really should have the pod code prefixed before the gateway receives it. It is important because you have complex dial plans and you will be very limited by the number of translations you can perform on each trunk.

This is a very simple example, but it should give you some idea of how this will work.

Dial-peer 10 is the inbound pots dial-peer on the source gateway. Dial-peer 20 is outbound to the POD A gateway.

Dial-peer 30 is the inbound voip dial-peer on the POD A gateway. Dial-peer 40 is the outboud pots dial-peer on the POD A gateway. You will replace ....... with the correct number of digits or the T parameter if the digit strings are variable.

direct-inward-dial may be required on pots peers if the interface supports DID.

On source gateway:

dial-peer voice 10 pots

port x/x

dial-peer voice 20 voip

destination-pattern 1.......

session target ipv4:

dtmf-relay h245-alpha

codec g711ulaw

no vad

On Pod A gateway:

dial-peer voice 30 voip

incoming called 1.......

codec g711ulaw

no vad

dial-peer voice 40 pots

destionation-pattern 1.......

port x/x:x

Again, if you must prefix/translate in the gateway then you'll be limited by the number of translations (15) you can configure per trunk.

Here's some examples of how to prefix the DNIS. I'm assuming PodA numbers begin with 555321, PodB 666321, and PodC 777321. Of course this will depend on your dial plan.

voice translation-rule 1

rule 1 /\(555321\)\(.*\)/ /1\1\2/

voice translation-rule 2

rule 1 /\(666321\)\(.*\)/ /2\1\2/

voice translation-rule 3

rule 1 /\(777321\)\(.*\)/ /3\1\2/



voice translation-profile podA

translate called 1

voice translation-profile podB

translate called 2

voice translation-profile podC

translate called 3

dial-peer voice 10 pots

translation-profile incoming podA

port A/A

dial-peer voice 11 pots

translation-profile incoming podB

port B/B

dial-peer voice 10 pots

translation-profile incoming podC

port C/C


Let me know if this helps by rating the post.

New Member

Re: configure : add prefix and remove prefix

Thank you for your helping.

I have two simple questions.

If i use translation-rule to change digit, What kind of character using? that is all match such as * or .

And Is it possible to use that incoming calls from specific PBX to another specific PBX between gateways?

In my opion, If All PBX enviroment may possible, but Not in VoIP network. because Calls using VoIP didn't consider some specific PBX, that is, calls doesn't know the origin PBX and destination PBX. all calls just use IP routing it a right?



Re: configure : add prefix and remove prefix

For your first question, you should take a look at the following link. It describes the translation rule syntax. the .* is a wild card that means any number of any digits. You could replace it with your dial-plan for a specific PBX.

The only way to know where the call came from is to match on ANI or Voice-Port. See the next two links for dial-peer matching. They explain better than I could.

Understanding Dial-peers and Call legs

Understanding Dial-peer matching in IOS.


CreatePlease login to create content