10-07-2016 07:34 PM - edited 03-17-2019 08:18 AM
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
Solved! Go to Solution.
10-08-2016 12:33 AM
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.
10-08-2016 12:33 AM
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.
02-21-2017 12:25 PM
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?
02-21-2017 01:44 PM
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'.
02-22-2017 05:12 PM
Thanks a ton!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide