Remove "0" before numbers

Hello can anyone share how and where to get 0+23123
in which directory I need to log in to remove 0, and the numbers look like this: +23123

I call this number +23123 / of this number added to asterisk 123456789

The directory and file depend on how you configured Asterisk. In the most common, plain, Asterisk installation, the file is /etc/asterisk/extensions.conf. Other files may be included from that, and the directory can be overridden, in the configuration. There are alternative ways of providing the dialplan, using different files.

I believe the sample configurations files, supplied with the Asterisk source code, include an example of stripping an initial digit when dialling a number.

If this relates to FreePBX, please use instead.

thanks for the reply,
and what will be the removal code 0 before +123

extent => 0023123, 1 Goto (new,0${EXTENT:5}1), ?

That code replaces 00231 with 0. It does not add or remove “+” and will not match a number that contains “+”.

but what is the code when 00123456789 calls 0023123 and does not display the dispatcher 0+123456789 and write +123456789?

You would need to do a pattern match that matches enough of the initial digits to recognize the general case, then takes a substring that excludes only the first, not the first five, digits.

how the code would look like?
if you have any example code I will be very grateful to you…


As I already said, there are examples supplied with Asterisk. The closest example actually strips 9, but that is easy to generalise.

You can’t expect people to show you, in detail, how to do basic things, as, otherwise, you will just keep coming back here, rather than learning how to do things for yourself.

The Wiki has some examples you can look at.