Newbie Dialplan Question

Hello Community,

I want to create a dialplan to serve up to 150 clients.

I want to modify the extensions file in a way that when a softphone needs to be added in the system, only the sip file will be needed to be modified.

Could you please help me how to do that?

Thanks in advance.

No, you’ll probably don’t find anybody. You’d either have to pay for the service or do it yourself. You probably want to start with something like this:,%204th%20Edition.pdf

Asterisk is not an end-user program. It’s more like a toolbox that allows to build specific systems.

Hello EkFudrek,

Thank you for your reply.

What do you mean i have to pay for the service?

I just want to create a diaplan and i saw this book in the corresponding section.

But i got a liitle bit confused how to do it.

Use a pattern match for your extension definitions, If your phones will be extensions 100-199 define a match as exten => _1xx,1,Dial(PJSIP/${EXTEN})

Hi johnkiniston,

Thank you for your reply.

Is it possible to do it somehow like this?


I tried it but it didnt work.

Check out this page on the Wiki for an explanation of how the pattern match logic works.

Also I recommend against variable length extensions. you don’t want to have extensions 1,10,and 100.

This is a very contorted way of saying:


Character class patterns aren’t exactly special to Asterisk.

As pointed out already variable length numbers are a very bad idea.

Hello david551,

Thank you for your reply.

Could you please advice me how to do this?

I saw that [1-150] does not mean 1 to 150.

So how can i do this?

Thanks in advance.

The correct answer is you don’t do it, because it isn’t a sensible thing to do, especially when using analogue phones. (With SIP phones you will get the problem in setting up the phone’s own “dial plan”, or will have to tolerate waiting for a timeout on the last digit.)

However, you can do it with four line:


However, anyone sensible would actually have, say, extensions 2001-2150.

NB I haven’t tested this. The ! is the highest risk element. It should not be used on analogue phones,as they really send the digits one by one. For those you will have to relay on a timeout. However, I’m not sure I’ve ever used in in anger.

1 Like

how about this?




XXX won’t accept one and two digit numbers. It will accept 151.

XX. won’t accept one and two digit numbers and will accept four digit ones. It will accept 151

Hello david,

Thank you again for your reply.

Could you please explain your solution a little bit, because i am a little bit confused at the moment.

Thanks in advance.

It provides four ways of matching. The first line matches 1 digit numbers, the second two digit numbers, the third matches 100-149 and the fourth matches 150. If I’ve got it right, the ! prevents having to wait for a timeout, when all the digits are sent at once, but will cause everything to be treated as a one digit number if the digits are sent individually.

s is a shorthand for n-1 and means all the lines have the same priority. You really should know what n means.

The ellipsis is your Dial application call.

I didn’t bother writing “exten=>” each time.

1 Like

So it is going to be like :


And for me to understand it, if the 150 clients become for example 148, then will be like this?


Thanks in advance.


Please hire a consultant. You are guessing without understanding, and you didn’t even follow the bits that I did code for you.

Hello david,

I just a have a virtualized environment for tests nothing special.

I am trying to do this and understand the solution you gave.

If you could explain it a little bit further i would appreciate it.

Your answers are here:,%204th%20Edition.pdf

You need to have some basic skills in order to understand the answers here. David could answer your questions, but it would essentially be the same as in the guide. Sorry, but there is no shortcut.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.