There are many different ways to dial calls the way you want.
The answer would depend on how you primarily dial calls.
I use macros to dial my calls. It allows more control. If you used macros to dial your calls, your macro might look like this:
[default]
exten => 06xxxxxxxx,1,Macro(dialoutside)
[macro-dialoutside]
exten => s,1,Dial(${TRUNK}/${MACRO_EXTEN})
exten => s,2,Congestion
exten => s,103,Busy
In the above example, a dialed number is refered to in the macro as the variable ${MACRO_EXTEN}. ${MACRO_EXTEN} is a predefined Asterisk variable. Using variables in your macros you can modify dialed digits and other controls as you need them to be. If you also used macros and variables, you would create a macro such as this to dial your calls:
[macro-dialoutside]
exten => s,1,SetVar(CALLER_DIALED=${MACRO_EXTEN:1:9})
exten => s,2,Dial(${TRUNK}/8${CALLER_DIALED})
exten => s,3,Congestion
exten => s,104,Busy
Here you see an example of how to modify dialed digits without using the deprecated StripMSD() and StripLSD(). These commands are considered obsolete, and should be removed from any .conf files.
In the above example, the string of variable ${MACRO_EXTEN} is modified by moving to offset 1, taking the next 9 digits, and copying them into a variable called ${CALLER_DIALED}. Starting at offset 0 would have included the first digit, offset 1 skips to the second digit, and offset 2 to the third digit, etc… This strips the first digit from the digits the caller dialed.
On the next line, an 8 is dialed, and then the rest of the digits that the caller dialed are sent.
For more information about using and modifying variables, please click here:
voip-info.org/tiki-index.php … +variables