Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Multi User Asterisk Setup, Extensions only No Trunk needed

Posted on 2008-06-15
Medium Priority
Last Modified: 2013-11-12
I am looking for assistance in setting up a dial plan for my company. We will be using the Asterisk PBX, however I am not familiar with the syntax of the dial plan's that Asterisk use's

This will only be used for the IT department, and will need to have the ability to have assigned extensions..

So for example User1's extension is 5555, anyone can dial 5555 and get to that person. Any help would be greatly appriciated.
Question by:Sam Cohen
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 19

Expert Comment

ID: 21792051
Are you using IP phones/softphones as extensions or have you got conventional analogue extensions connected via a Digium card (or similar card)?

Do you know which context is used when someone dials a number? For example, the [default] context. Contexts are the logical blocks of the dial plan within extensions.conf. Which context is used by each connected device depends on the configuration in the conf file for that device type. For example, the context for SIP phones is defined by settings in sip.conf and the context used by analogue extensions would be defined in zapata.conf. Once you know which context is used by the calling phone, then you just add a dial plan into that context with an extension number or pattern that matches the dialled number. So in its most basic form, assuming your extensions are SIP phones, you could add:
exten => 5555,1,Dial(SIP/5555,25)

If you know that all internal extension numbers are 4 digits long and start with 5 then you could use a pattern match and variable instead like this:
exten => _5XXX,1,Dial(SIP/${EXTEN},25)

Author Comment

by:Sam Cohen
ID: 21794767
The extensions are still being worked on, but more than likely they will be numerical. We will be using soft phones, which will be SIP based.

Based on your example "exten => 5555,1,Dial(SIP/5555,25)" What does this part do I guess you could say. (SIP/5555,25) I understand the first portion which is basicly, user,priority,action, however I am not familiar with the additional information added. If you could explain that part it would be very helpful and would probably give me the understanding I need to progress further. Thank you
LVL 19

Expert Comment

ID: 21795033
"Dial" is the action, but the parameters used by the Dial command are passed in parantheses (similar to calling a subroutine in a programming language). So the Dial command is sent two parameters: the first is the target that it will dial - a SIP extension with number 5555 - and the second is the time it will wait, in seconds, before reporting a NOANSWER result.
Eye-catchers on the conference table

Challenge: The i-unit group was not satisfied with the audio quality during remote meetings. They were looking for a portable solution with excellent audio quality for use in their conference room but also at their client’s offices.


Author Comment

by:Sam Cohen
ID: 21795928
Ok, so please correct me if I am wrong, but an example dial plan for a single user would be something like..

exten =>5555,1,Dial(SIP/5555,25)
exten =>5555,1,Answer()
exten =>5555,2,Hangup()

Does that look about right or am I missing info? We will be using Voice Mail also.
LVL 19

Accepted Solution

feptias earned 1000 total points
ID: 21800824
Unfortunately, that is not right and it contains an error - you must not have two lines with the same extension number and step number (=>5555,1,..). The Asterisk way of thinking does take a bit of getting used to, especially with respect to the Dial action. I'll try to explain it:

When Asterisk acts as a PBX, it is able to deliver the call without first having to answer it. You would only need Asterisk to answer the call if you wanted Asterisk to interact with the caller - for example, to play a greeting or request some input from the caller. In effect, Asterisk handles all the stuff concerned with the caller's phone going off-hook and the caller dialling a number, without you having to write a single line in the dial plan. So you don't *have* to use the Answer() action anywhere if you just want your Asterisk extensions to be able to call each other. You just need to tell Asterisk where to deliver the call when the caller dials a particular number - that is done using the Dial action. If the called phone (the target of the Dial action) answers, then Asterisk will bridge the two legs of the call together and the calling and called parties can talk to each other. When they hang up, the dial plan will jump to a hangup section (if one exists) or will simply exit - it doesn't go to step 2 after they hangup. So one line of dial plan is enough (I have deliberately changed the target to 5678 to illustrate the point):
exten => 5555,1,Dial(SIP/5678,25)

This means that when the caller dials 5555, they will be connected to SIP extension 5678. That would of course be slightly perverse, so the actual line would be:
exten => 5555,1,Dial(SIP/5555,25)

The next step in the dial plan would only be reached if extension 5555 failed to answer. For example:
exten => 5555,1,Dial(SIP/5555,25)
exten => 5555,2,<next_action>

If you had 200 extensions, it would be very tedious to have to add those lines 200 times into the dial plan, so instead you can use pattern matching and variables. _5XXX is an example of a pattern that would be matched whenever the caller dials a 4 digit number starting with 5. The variable that has the actual number dialled would be ${EXTEN} so the dial plan might look like this:
exten => _5XXX,1,Dial(SIP/${EXTEN},25)
exten => _5XXX,2,<next_action>

I don't use Asterisk voicemail so I'm not qualified to explain how that would be done, but this link might be helpful (interestingly they use step 1 Answer before step 2 Dial, but I am 100% certain that the Dial command will work without the need to use Answer() beforehand):
LVL 25

Assisted Solution

by:Ron Malmstead
Ron Malmstead earned 1000 total points
ID: 21950744
The two main files you will need to edit to get calls working, are SIP.conf and Extensions.conf

This is where you create entries for SIP peers...
example entry...



example dialplan entry for dialing the sip peer.

exten => 5555,1,Dial(SIP/${EXTEN},20)

To add voicemail, you need to edit voicemail.conf file...
and add a line after dial...
exten => 5555,n,VoiceMail(5555@default,u)

[default] is the context, the "n" is the priority, of extension 5555... the above invokes the voicemail app after the dial timeout of 20 seconds...and plays the "unavailable" message ... ",u" after you get basic calling and vm setup you can experiment with different dialplan applications...

just remember this one important thing...

The traversal of calls or channels through the dialplan always goes like this...


If you plan on doing anything beyond basic calling I would suggest getting a book or two on asterisk.

also, backup your conf files before every edit...  you can never have enough backups of these me.

If you want to take the easy road...with the least manual configuration needed... try AsteriskNOW.  Asterisk now is limited however in what you can are pretty stuck using the GUI, but some people prefer it.....not me.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How To Create Custom / Distinctive Ring Tones on Polycom Phones Purpose and Overview When creating a custom ring tone, you have simple aspirations: to make your phone cooler than everyone else's. Perhaps you need a louder ringer. Perhaps you w…
I recently purchased a Bluetooth headset called the Music Jogger (model BSH10). The control buttons on it look like this: One of my goals is to use it as the microphone and speakers for Skype calls. In that respect, it works well. However, I …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question