Asterisk is a complete PBX in software. It runs on Linux, BSD, Windows and OS X and provides all of the features you would expect from a PBX and more. Asterisk does voice over IP in four protocols, and can interoperate with almost all standards-based telephony equipment using relatively inexpensive hardware.
Asterisk provides Voicemail services with Directory, Call Conferencing, Interactive Voice Response, Call Queuing. It has support for three-way calling, caller ID services, ADSI, IAX, SIP, H.323 (as both client and gateway), MGCP (call manager only) and SCCP/Skinny.
This wiki will show you how to configure a simple in house network enabling us to use a SIP softphone to talk to another SIP softphone on your LAN. This is nothing major, but will get you familiar with Asterisk configuration and its pretty cool.
What You Need
Of course, youll need Asterisk. You can grab it from [community]. You should also grab asterisk-addons, asterisk-sounds and asterisk-zaptel. You'll also need a SIP softphone and at least two machines. Recommendations for SIP phones are kphone, in the AUR and x-lite, a binary.
Assuming your asterisk server is up and running we will only need to edit two files sip.conf and extensions.conf.
Change to your asterisk configuration directory (should be
/etc/asterisk). Edit sip.conf and place the following in:
[me1] type=friend username=me1 secret=password host=dynamic context=house [me2] type=friend username=me2 secret=password host=dynamic context=house
This creates our two SIP users
me2 with a password of
password in the
house context. We will be defining the context next.
Edit extensions.conf with the following:
[house] exten => 100,1,Dial(SIP/me1) exten => 101,1,Dial(SIP/me2)
This creates that context
house and assigns extension 100 to the SIP user
me1, and extension 101 to the SIP user
me2. Now all thats left is to see if it works.
Music On Hold
Music on hold is a really sweet feature. And once again easy to install and configure. Edit /etc/asterisk/musiconhold.conf and add (or make sure its uncomented)
[default] mode=files directory=/var/lib/asterisk/mohmp3
Now go into your sip.conf
And that's all there is to it. Just copy your favorite legally obtained MP3 to
Voicemail is another cool feature of asterisk. There are many ways to configure it, however Ill just cover the simple in-home, just messing around version.
Create/edit your (you guessed it) voicemail.conf
[general] format=gsm|wav49|wav serveremail=asterisk attach=no mailcmd=/usr/sbin/sendmail -t maxmessage=180 maxgreet=60 [default] 100 => 1234,Me,email@example.com
Ok, so whats that mean? Most of the [general] is pretty self explainitory. However make a note, if you have postfix set up right the PBX will send an email notifying the user of a new voicemail and if
attach=yes it will attach the file.
Now for the actual mailbox. The format is
mailbox => password,user,emailIn this case, we gave Me (email firstname.lastname@example.org) mailbox 100, with a password of 1234.
Now we have to have a way to leave messages to this voicemail, and a way to access it. For this, we go back to the extensions.conf and modify your exsisting entry as follows:
exten => 100,1,Dial(SIP/me1,20) exten =>100,2,Voicemail(100@default)
The 20 on the end of the first exten tells Dial() to call for 20 seconds. If noone answers it heads to Voicemailbox 100 in the default context. Easy enough. Next is actually accessing your voicemail. For that we add
exten => 600,1,VoiceMailMain,s100@default
So when we call 600, the application VoiceMailMain goes to 100 in the default context. The
s allows for automatic login.
The voicemail apps have a TON of options so I'd suggest reading over some additional docs. This is just for a basic, home use setup. Also note that it is generally a good idea to use extenstions higher then your users extentions for accessing voicemail. This way someone dialing 208 doesn't hit someones voicemail at 205. I will update soon on how to use CALLERIDNUM to log into your voicemail.
Asterisk Console And Softphones
Now lets get Asterisk going.
# asterisk -vvvvvvc
This will give us the Asterisk CLI with verbose output. If Asterisk is already running you'll need to use
# asterisk -r
Now fire up your SIP clients and set them up with the information in the sip.conf. Switch back to your Asterisk CLI and you should see
Registered SIP 'me1' at 192.168.0.142 port 5061 expires 60
Now you should be able to dial
me1 and talk to me2.
If you recieve a 404 Not Found error check your extensions.conf and the number you dialed.