Build Your Own PBX With Asterisk and Linux - Page 2
The next step is to compile the source code, starting with libpri, followed by DAHDI and DAHDI tools, and finally Asterisk itself.
To compile libpri, go to the command line and type:
# cd libpri-1.4.10
# make clean
# make install
# cd ..
# cd dahdi-linux-2.2
# make all
When this is complete, compile and install DAHDI tools:
# cd dahdi-tools-2.0.0
# make install
# make config
# cd ..
Finally, it's time to compile Asterisk.
# cd asterisk-22.214.171.124
# make menuselect
This will bring up a text-based menu offering various modules that you can select to compile, as well as various other options. To prevent unnecessary error message while learning to use Asterisk, deselect pbx_ael . Save the changes by pressing x, then continue to:
#make samples (to install sample config files which are useful when learning to configure Asterisk)
# make config
Finally, reboot the system.
When the system comes back up, Asterisk should start automatically. To check that everything is working, check DAHDI is loaded by opening a terminal window and, with root privileges, typing:
# lsmod | grep dahdi
You should see references to several dahdi modules, including dahdi_dummy, dahdi_transcode, crc_ccitt, and dahdi_voicebus.
Check Asterisk is running and log on to the Asterisk command line with:
You should see some version and license information along with a "Connected to Asterisk" message and prompt.
To stop asterisk from the Asterisk command line type
CLI> stop now
or from the Linux command prompt type
# service asterisk stop
Configuring an Asterisk system and getting it fully working is beyond the scope of this piece, but here are some pointers to get started.
When using Asterisk, calls are treated as having two parts: a call in to the Asterisk box, and another call out to its destination. Pairing these two calls so that you end up talking to the person you want to is handled by Asterisk's configuration files, which are mostly to be found in the /etc/asterisk/ directory.
To configure the system to handle calls to and from SIP devices (either physical SIP phones or software-based SIP softphones), the SIP devices first have to be registered in the relevant configuration file, which, logically enough, is called sip.conf. You can edit Asterisks many .conf files using any text editor, such as nano or gedit
You'll also have to edit the extensions.conf file to assign an extension number to that device. This tells Asterisk that when it receives a call for extension 6001, for example, it should make an outward call to connect to the appropriate phone. You can optionally add other behaviors, such as that a different phone extension, or perhaps the mailbox system, should be called if the first phone is not answered within a given period of time.
Confused? Its inevitable really: it takes a while to get your head round the basics which have barely been touched upon in this article - but if you persevere it all begins to make perfect sense surprisingly quickly.
If you want to learn more about how to configure your running Asterisk installation to make and receive calls, youll need to buy a book like Asterisk The Future of Telephony published by 0Reilly, find an online tutorial, or as mentioned earlier go on a three day Asterisk Fast Start course.
Dont expect to master Asterisk quickly, but also dont forget that if you succeed youll be in a very good position to make some significant savings for your company.