The ever-popular
Nerd Vittles site has released their
Unabridged Installation and Upgrade Guide for Asterisk@Home 2.7. Before you begin, be sure to scroll down to the
comments, particularly if you have a Zaptel card in your system.
For those of you not familiar with Asterisk@Home, here’s a short description, from the introductory paragraphs:
Want a rock-solid PBX at a rock-bottom price: free! Asterisk@Home 2.7 has hit the street with some new goodies and a new release of Asterisk. So here we go again. With this update, you get version 1.2.5 of Asterisk as well as the latest and greatest version of Linux, CentOS 4.2, the latest Festival Speech Engine (1.96), the latest version of the Asterisk Management Portal (1.10.010), the Flash Operator Panel (version 0.24), Open A2Billing, Digium card auto-configuration, loads of AGI scripts including weather forecasts and wakeup calls, xPL support, the latest SugarCRM Contact Management System with the Cisco XML Services interface and Click-to-Dial support, Microsoft File Sharing and Networking support through Samba (3.0.10), plus dozens and dozens of free utility software applications for Asterisk compliments of Nerd Vittles. And, yes, Asterisk@Home 2.7 still fits on a single CD! By popular request, we’ve also added something new in this tutorial: some tips and tricks to assist those of you upgrading from a previous version of Asterisk@Home. No, you can’t just copy your old config files over and expect things to work. But, in the Nerd Vittles’ tradition, we’ll show you how to take most of the torture out of the upgrade process. For those new to Nerd Vittles, be aware that we make slipstream changes to articles as users discover things we’ve missed in our first pass. So check for Comments before you begin or subscribe to our Comments RSS Feed. And add yourself to our Frappr map.
The installation process is pretty straightforward. You need a dedicated machine for this install although, for Windows users, here’s another option that doesn’t require a dedicated machine. The VMware edition from vmwarez.com runs in a window on your Windows XP or 2000 desktop and has been updated to version 2.7. You can download it here. For now, however, we’re assuming you’re doing the dedicated machine install: pure Linux on a clean machine. So begin by downloading the 2.7 ISO image from here, burn a CD (click here if you need a refresher course), use an old clunker PC or a $200 WalMart special, insert the CD you made, plug your machine into the Internet and turn it on. Then watch while Asterisk@Home loads CentOS/4.2 and all the Asterisk and Linux goodies imaginable: Apache, SendMail, Asterisk Mail, SugarCRM, MySQL, PHP, phpMyAdmin, SSH, Bluetooth, the Asterisk Management Portal, the Flash Operator Panel, Call Detail Reporting, and on and on. We’ve covered how to use most of the Linux products in our Mac HOW-TO’s (see sidebar), and they work exactly the same way with Asterisk@Home so keep reading. And, yes, this install will reformat (aka ERASE) your hard disk before it begins, but it now warns you first.
Note: Several edits have been made in this post since it was originally posted.
I’m going to add a few hints for those of you who, like me, come from a Windows background and may not be all that familiar with Linux. Please understand that I am NOT an expert on this stuff, having all of about a month’s familiarity with the Asterisk@Home package, but there were some things that drove me nuts at the beginning and they do not have to do the same for you.
The first thing is, after you complete the installation, do the upgrades, install Webmin, etc. you will find that you need to make changes to some configuration files. Nerd Vittles wants you to do it using a Linux text editor called nano, which I’m sure is a fine editor if you’re used to it, but it can drive you a bit crazy at first if you are used to working in Windows. So bear in mind that there are a couple of things you can do at this point. One is to get Samba (support for Windows-style networking) up and running, and in this version of Asterisk@Home they actually give you a way to do that without having to resort to doing it through Webmin (which, by the way, is still considerably easier than trying to configure Samba to work on your own). Once Samba is configured, you can then treat your Asterisk@Home box as a shared resource on your local network, and you can edit files using a text editor on your Windows box, but if you do that, there are a couple of pitfalls to watch out for.
The first is a thing called permissions – this is a form of security in Linux, which is a derivation of Unix, which was originally designed back in the days of time-sharing computers, when many users and many unrelated processes might be sharing the same system. Permissions are designed as a way to keep files restricted to only those people and processes that are supposed to have access to them. It would take far too much space here to go into greater detail about permissions but suffice it to say that when the permissions aren’t set correctly on a file, things break. If you plan on learning anything about Linux, permissions should probably be one of the first subjects you study.
Normally, if you use your Windows-based text editor to load a file in from your Asterisk box over the local network, make some changes, and save it back, the permissions won’t change (but beware of changed line endings – we’ll get to that in a moment). However, if you create a new file, or change the filename before saving it, or delete the original file before saving the changes, that may (probably will) change either the permissions, or the owner and user, and suddenly the file may become inaccessible to the software. Yeah, I really hate this, while folks who love Linux seem to think it’s one of the best features of that operating system. Get bitten by permissions a few times (when you are scratching your head wondering why Asterisk seems to be ignoring a file that you know is there) and you will probably wish the software ran under Windows. I don’t think most Linux users have any idea how foreign the concept of permissions is to a typical Windows user.
So, changing a file on your Windows box may not always be such a great idea. Fortunately, there are still easier ways of doing things than sitting right at tyour Asterisk box and using nano. The trick is to set up a SSH client on your Windows box such as PuTTY, assuming you are not in a country where where encryption is outlawed (if you are, there are probably components of Asterisk@Home itself that may be illegal in your country). Install PuTTY and use it to connect to your Asterisk@Home box, using an appropriate user name and password (root will let you do anything on the system, but it’s also the most dangerous way to operate if you don’t know what you’re doing). Before you connect for the first time, you may want to change a couple of configuration settings in PuTTY, so that your numeric keypad works as expected.
In PuTTY configuration, open up the Terminal settings and click on Keyboard. Then make sure you have the following settings checked:
The Backspace key: Control-? (127)
The Home and End keys: Standard
The Function keys and keypad: Xterm R6
Application keypad settings: Both should be Normal
Enable extra keyboard features: Check Control-Alt is different from AltGr
Click on Window and look at the scrollback buffer size – you may want to expand this a bit beyond the default (if you don’t see the need now, you can always come back and do it later). Then click on Translation and look to see which option is used for “Handling of line drawing characters” – if you get display weirdness in some situations you can try changing this around (I use “Use Unicode line drawing code points” but I will not guarantee that’s the best setting). Then click on Selection and note the mouse options – again you may want to change these as you get more familiar with the program, or if you already have a personal preference.
You really shouldn’t have to change anything else unless you’re operating under special circumstances. Once you have PuTTY configured, click on Session, put the IP address of your Asterisk box in the Host name field, give this configuration a name (in the Saved Sessions text box – I suggest using the name Asterisk), then click the button to save this configuration.
Now click the Open button and you should get a login prompt. Login using one of your user names and passwords that you set during installation. Once you login and are at a command prompt, it’s just as if you are sitting in front of your Asterisk@Home box.
Now, whether you are connecting through PuTTY, or actually at your Asterisk@Home box keyboard, you can make changes to the text files from within Linux itself. You could use nano, but there’s another way that many from a Windows background will consider easier, especially if you’ve ever used a dual-pane file manager like Norton/Windows/Total Commander (or a similar program). From the Linux command prompt, type mc -a (mc stands for Midnight Commander) and you will find yourself in front of a (hopefully) familiar environment. The -a option makes it render the line drawing characters as something at least a little more presentable when using PuTTY; you probably don’t need (or want) to use that option if you’re actually at your Asterisk box.
In Midnight Commander, as in the Windows variants, you can highlight a file, then press or click on F4 to bring up an editor, which is probably going to work a lot more as you’d expect it to work than nano if you come from a Windows/DOS background.
Remember how I talked about permissions above, and how they can give you fits? Well, you can use Midnight Commander to manage them, also. Highlight a file, then click on File (in the top menu bar), then I suggest using Advanced chown which shows both the permissions, and the owner and group settings, and allows you to easily change them.
If you want to learn more about Midnight Commander, there’s a FAQ here.
Should you decide to edit configuration files on your Windows box, be aware that Windows normally saves text files with a carriage return and a linefeed at the end of each line, while the Linux/Unix convention is to use a linefeed only (this is the other pitfall I was referring to). If you save a configuration file with carriage returns in it, you may get all sort of unpredictable (and bad) results. So, be sure to use a text editor that will let you save files in the format Linux prefers, and then remember to save the files that way (you may have to use the “Save As” command rather than just doing a simple “Save”). Just to confuse matters, I’ll mention that some other types of systems (Macs, I think) use a carriage return only to end a line. If your text editor doesn’t give you an option to save files in the Linux/Unix format, it might not be able to do it. That’s why it’s probably better to use nano or the Midnight Commander editor to make changes in the configuration files.
Now, here’s one other tip. If your Asterisk@Home box is behind a NAT (generally, behind a router, as it probably will be if you are using it, well, at home) and you are getting one way audio on some SIP connections, then you may need to add some lines to the top of sip.conf, under [general]:
nat=yes
externip = your fixed internet address, e.g. youraccount.dyndns.org
fromdomain = your fixed internet address (again)
localnet = 192.168.x.0/255.255.255.0
(Replace the x with the octet number used in your local network).
One other place you might need to put your fixed IP address is in the file etc/sysconfig/network after the HOSTNAME= part. If this isn’t done, sendmail may not work correctly and you may not be able to get your voicemails e-mailed to you. Additionally, you may need to go into /etc/hosts and make sure that there is NO line linking your fixed internet address to 127.0.0.1
I again remind you that I’m no expert in this stuff; what I’ve written above is what I have found works. If you know of a better way to do anything I’ve shown here, by all means please feel free to leave a comment (hints on configuring PuTTY and/or Midnight Commander for a better display are especially welcome).
Technorati Tags: Asterisk, Asterisk@home, PBX, VoiP, telephone, telephony, MichiganTelephone