![]() |
|
| Daemon News Ezine | BSD News | BSD Mall | BSD Support Forum | BSD Advocacy | BSD Updates |
Asterisk PBX on BSDBy Chris Coleman <chrisc@vmunix.com>What is Asterisk?Asterisk is an open source PBX (Personal Branch Exchange). A PBX is a phone system commonly found in office settings that allows you to make calls between cubicals just by dialing that extension. A PBX also allows things like Automated Attendant, which creates those annoying messages that say "Press 1 to talk to a human" or "Press 2 if you are willing to pay to talk to a human".Asterisk however takes this to a new level by integrating the Internet into your office and allowing you to do Voice Over IP (VOIP). The big benefit of VOIP is now your office doesn't have to be located in one place. You can have phones ring is several places at the same time and who ever picks it up first gets the call. You are not even confined to the same country. For instance, you can get a US based phone number and have it ring in Australia. As long as your phone can plug into the internet, you can make and receive phone calls as though you were in your office. If you are extension 1234 at work, just take your phone with you and when you plug it in to the Internet, you will still be extension 1234. Because it is open source, it is quite a bit cheaper than most commerical PBX systems. And most importantly, it now runs on BSD.
Asterisk comes in two pieces: the PBX which is called asterisk and the hardware drivers for phones and phonelines called zaptel. You can use asterisk without any of the hardware drivers if you only need VOIP capabilities. The hardware support for BSD is in progress still, but is currently at a usable level for regular analog lines. Analog lines come in two flavors: FXO and FXS. What kind of line it is depends on whether or not it has a dial tone. An FXO line can receive a dial tone and functions much like a computer modem. An FXS line generates a dial tone. For instance, a telephone handset and a computer modem are both FXO devices. Neither of them generates the dial tone. So, if you were to plug a telephone into the computer modem, you wouldn't get a dial tone. An FXS line emulates the incoming line from the telephone company. If you attach a telephone to the FXS line in an Asterisk box, it will give you a dial tone and allow you to make outgoing calls. It then passes the digits you dial to an FXO line that is connected to the telephone company, thus completing your call. Asterisk can also make FXS to FXS calls, where one extension rings another internal extension off the same PBX.
FXS -> PBX -> FXO -- Make an outgoing call. When you add VOIP in to the mix, the combinations become endless. But I think you get the picture.
Asterisk HardwareBSD currently supports the X100P card from Digium, which is a 1 Port FXO card. Also supported is the TDM400P, which is a 4 Port modular FXS/FXO card. You can swap out modules on the card to designate a port either FXS or FXO, but not both.Also available from digium but not yet supported on BSD are T1/E1 cards in single and quad ports. A T1 lets you have up to 24 voice channels and a quad T1 card would support 96 voice lines on a machine.
Even if you plan on compiling asterisk from CVS, you should install from the port the first time. It gets all the pieces in all the right places and handles the dependancies for you. If you are using any of the Digium hardware, you need to install the /usr/ports/misc/zaptel port first. Then go to /usr/local/etc/rc.d and move zaptel.sh.sample to zaptel.sh so it will load the driver after a reboot. Then install the asterisk port. If you want to compile a version of asterisk that is not in ports, such as HEAD or STABLE, you should use this patch to the asterisk makefile to get the files put in the right place. You also have to use gmake to build it. Once you have it installed, you will need to follow the standard configuration instructions available most places on the web. The only changes I had to make were: To /usr/local/etc/asterisk/modules.conf I added
; Remove module that causes high CPU Usage To /usr/local/sbin/safe_asterisk I removed the TTY= line so it wouldn't try to bind to a console. Then you can attach to it using asterisk -r. -Chris |