Installing Asterisk: A second attempt

Asterisk Installation Guides | Communications

Reciently, I have had the experience of setting up my second Asterisk Server. The first one ended in dismal failure as the client ended up not wanting to keep the server. I couldn't blame him, we used an old computer, i used three 1 port modems instead of one 4 port modem, the phone lines had been sliced and hacked to get them all in one single location, we were shairing the same network as the computers, which were questionably infected with spyware and who knows what else and on top of all that, i didn't really fully understand how asterisk works.

I was also using asterisk@home for the install this proved to be a mistake as well. It seems that asterisk@home is very picky as to changing the structure of the file. If you change something in the asterisk configuration files, and then go into the AMP (asterisk management portal) it will some cases overwrite your changes, thus breaking your system. If you then make changes to the dial plan for your customer and then give them access to the AMP portal to relieve your self of the duty, your customer will surely find a way to break the system, prompting an emergency call to you at 6:15 AM monday morning.

I found this situation to be unnacceptible and found that for this reason, i have compiled a list of DO's and DO NOT'S when setting up a production system.

DO NOT:

1) DO NOT USE THE ASTERISK MANAGEMENT PORTAL ON AN PRODUCTION SYSTEM.

2) DO NOT attempt to use old or cheap hardware. don't pull the old pIII out of the closet with the BIOSTAR motherboard and try and turn it into a phone system. You will only regret it later

3) DO NOT attempt to use multiple cards in the same system. If you have a need for 3 phone lines, Get a single card that can handel 4 lines, DO NOT get 3 single line cards thinking it will work just as good. You will get dropped calls, bad sound quality, and just weird stuff. Try and get a card that will handel you for a while.

4) DO NOT make any changes with out first MAKING A BACKUP OF YOUR WORKING DIAL PLAN. Of course if your dial plan is not working, who cares, but if it is in-fact working, then why not just make a quick backup and save your self some major headaches... for the change your about to make will completely break your system...

5) DO NOT forget, the three most important files to edit are the sip.conf, extensions.conf, voicemail.conf.

sip.conf == Describes the phones you plan to use. Basically you tell the server what to expect as far as equiptment connecting to the system here. You need one section for each phone. I have set my plan up so that i don't edit sip.conf directly. instead, we just include a directory called sip-phones.d In that folder, we create a seperate file for each phone that you have. this makes everything just so much more organized then trying to put everything in one big file.

Example sip.conf
#include /etc/asterisk/sip-phones.d/*.conf
;EOF

mkdir /etc/asterisk/sip-phones.d
cd /etc/asterisk/sip-phones.d
nano 501.conf

;example 501.conf
[501]
type=friend
;describe phone here...

;EOF

extensions.conf == Describes the phone numbers you plan to use. Basically you tell the server what phone numbers can be called, and how those calls get routed when they do get called. Add a section for each incoming call seperatly. You should be able to add a single section for all outgoing calls. Just the same as before, we create a sub folder called /etc/asterisk/extensions-phones.d In there we create a seperate file for each extension that we would like to allow.

/etc/asterisk/extensions-phones.d/*.*
501.conf 502.conf 503.conf 504.conf
4700.conf 4710.conf 4747.conf

In each file we describe what happens when someone calls that phone number or extension.

;sample extensions.conf
#include /etc/asterisk/extensions-phones.d/*.conf
;EOF

/etc/asterisk/extensions-phones.d/*.*
501.conf 502.conf 503.conf 504.conf

;describe what happens when you call this number
[501]
exten=>501,1,Answer()
exten=>501,2,Wait(1)
exten=>501,3,Dial(sip/501,20,tr) ;try to call the extension for 20s
exten=>501,4,Voicemail(u501) ; voicemail if they dont anwer
exten=>501,104,Voicemail(b501) ; voicemail if the are busy (3+101)
;EOF

voicemail.conf == Set up voicemail for people.
This file and setup are simple enough as to let you figure it out for your self. A clue, just do it the same way i described above.

6) DO NOT contunue if you feel that your setup in not solid, redo it from scratch. I know it seems like a lot of work, but if you do it enough times, you can get your setup time down to a few hours. It would probably be a good thing if you could set the the system that fast and knew it well. For example, on this second system i'm setting up. all the sudden, my polycom soundpoint 501 phones quit recieveing audio. You could call and the call would complete, but i couldn't hear them. This was true of all the polycom phones. i messed around with the phone, the dialplan the firewall the cables, restored from a backup and still for hours and hours only to give up in complete frustration. I then formatted and started over from scratch. I had the system back up and running in two hours, better then before, i then restored from a backup my dial plan and bam, everything was working great. The system seemed to be working perfectly. Basically what i learned is that if your system is not solid, just redo it. Its not the end of the world, just make sure you backup your dial plan and your sound files. if you use the same IP address, your phones should re register with out a problem when you get your server re installed.

7) DO NOT share your phone network and your computer network. The first time some employee gets infected with a virus, it will bring your phone system down because their computer is flooding your network with packets and causing the voice calls to drop out. Call your cabling guy and have him run a seperate set of wires for your phone network and put it on its own switch. You will thank me later.

8) DO NOT forget to set up your caller ID. You would think its not important, but i just had a major problem calling out. It was because my caller id was not properly formatted. I could call out some times, others, the remote switch would reject our call. When we called the tech support to try and figure out why it was not working, not one single person in the company could give me an answer. It took weeks of research and then alot of guessing to figure out that my caller ID was not set correctly. Although this was not my fault, the phone company could have told me this had they a tech with a brain that could talk to me...it fell on me to figure this out.

Thats it for now, I'll write more later...