cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3021
Views
15
Helpful
4
Replies

prefix number on voip dial peer

Joli Martinez
Level 1
Level 1

I need to append a string to my SIP provider in this form 1234*dialed number.  This is for outbound traffic.  I have tried the following with no luck.

I am looking for any number dialed by the pbx to be forwarded as a 10 digit number to the pstn with the prefix in front of it

voice translation-rule 1

rule 1 /1112223333/ /1234*1112224444/  (doesnt work)

also added to the dial peer and it still didnt work.

tech-prefix 1234

What is the easiest way to do this

1 Accepted Solution

Accepted Solutions

Evgeny Izetov
Level 1
Level 1

This should work:

voice translation-rule 1

 rule 1 // /1234*/

voice translation-profile ADD1234*

 translate called 1

dial-peer voice 100 voip

 translation-profile outgoing ADD1234*

That rule syntax worked last time I tried to prepend something. If it somehow doesn't work for you, the alternative could be:

rule 1 /.*/ /1234*&/

Remember you can always test the rules with "test voice translation-rule" command before applying them to a dial-peer.

View solution in original post

4 Replies 4

Evgeny Izetov
Level 1
Level 1

This should work:

voice translation-rule 1

 rule 1 // /1234*/

voice translation-profile ADD1234*

 translate called 1

dial-peer voice 100 voip

 translation-profile outgoing ADD1234*

That rule syntax worked last time I tried to prepend something. If it somehow doesn't work for you, the alternative could be:

rule 1 /.*/ /1234*&/

Remember you can always test the rules with "test voice translation-rule" command before applying them to a dial-peer.

Another related question if i may.

Can we use this method to only add a prefix if certain numbers hit the gateway?

For example,  we want a certain country code to include the local countries international dialing code.  So if we drop in a number to the gateway that is 886-xxx-xxx-xxx, can we use the 886 to prepend a 002(international access number) so that the actual dialed number would be 002-886-xxx-xxx-xxx? 

You could use this syntax:

rule 1 /^886.........$/ /002&/

Read it as 'if the number begins with 886 followed by exactly 9 digits, then prepend 002 to the entire matched string'.

Thanks a ton!