Solved

Multi User Asterisk Setup, Extensions only No Trunk needed

Posted on 2008-06-15
7
372 Views
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.
0
Comment
Question by:Sam Cohen
  • 3
  • 2
7 Comments
 
LVL 19

Expert Comment

by:feptias
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)
0
 
LVL 8

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
0
 
LVL 19

Expert Comment

by:feptias
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.

http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+Dial
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 8

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..

[fakeuser]
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.
0
 
LVL 19

Accepted Solution

by:
feptias earned 250 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):
http://www.asteriskguru.com/tutorials/voicemail2.html
0
 
LVL 25

Assisted Solution

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

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

[5555]
type=friend
secret=12345
host=dynamic
canreinvite=no
dtmfmode=rfc2833
context=default

-----------------------------------
Extensions.conf

example dialplan entry for dialing the sip peer.

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

To add voicemail, you need to edit voicemail.conf file...
and add a line after dial...
example...
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"

...now 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...

CONTEXT then PRIORITY, then EXTENSION

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 files....trust 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 do...you are pretty stuck using the GUI, but some people prefer it.....not me.
http://www.asterisknow.org/
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Implementing Avaya's One-X portal is pretty painless, until you want to deploy this to the Android and iPhone clients when these clients are outside of your network. The clients will also work within your local network. Here is our experience and so…
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now