Académique Documents
Professionnel Documents
Culture Documents
Installation:
Dependencies
The first thing to do is to get your box up to date. If you have CentOS 5.1 or lower, you may want to upgrade to CentOS 5.2. Try: yum -y upgrade and then reboot. Otherwise, to update all the installed packages, at the shell, run yum -y update When you've done either of the above, reboot the machine when it's finished (as it'll install a new kernel) and then run yum -y update again and repeat until there are no more updates.
Quick method:
Do you trust me? If so, the line below will install all the dependencies you need (and then some!) - cut and paste from here if you're happy to install things you may or may not need. If not, then have a look at this page's history as some of the dependencies are listed separately.
yum -y install gccgcc-c++ kernel-devel bison openssl-devel \ libtermcap-develncurses-develdoxygen curl-devel newt-devel \ mlocate lynx tar wgetnmap bzip2 mod_sslcrontabsvixie-cron \ speexspeex-develunixODBCunixODBC-devellibtool-ltdl \ libtool-ltdl-develmysql-connector-odbcmysqlmysql-devel \ mysql-server php-mysqlphp-mbstringphp-mcrypt flex screen \ libxml2 libxml2-devel libtifflibtiff-develgmimegmime-devel \ net-snmp-utils net-snmp-devel neon libxml2 openssl \ openssl-develgnutls-develgnutls-utils
SpanDSP(optional)
cd /usr/src/asterisk/spandsp-0.0.5 make clean ./configure make make install cat > /etc/ld.so.conf.d/spandsp.conf<< EOF /usr/local /usr/local/lib EOF ldconfig v
Libpri(optional)
If you are using E1 cards you need to install LIBPRI. If you do want to use LIBPRI, make sure you compile and install it before you compile Asterisk. Replace 'VERSION' with the correct details.
DAHDI
You're pretty much going to need DAHDI. If not for any hardware then for the dummy timer anyway. Note that the stock CentOS kernels come with a 1000HZ timer and so don't need recompiling (phew!). Replace 'VERSION' with the correct details.
Asterisk
cd /usr/src/asterisk/asterisk-VERSION make clean ./configure Choose which options to install (audio files, voicemail storage, codecs etc.) makemenuselect make make install Install sample files in /etc/asterisk, install docs/manpages and set to start on boot.
Configuration:
Once you have asterisk installed and running you need to configure it, to be able to use it as PBX. Asterisk has a lot of features, and we will start to explore some of them here step by step, in this first post about configuring Asterisk, I will only show you how to configure a single two internals and make them be able to call each other, you may add more than one, as you will see later, and all of them will be able to call each other. So lets start: Asterisk has two main configuration files, and those are:
/etc/asterisk/sip.confand /etc/asterisk/extensions.conf
On the first one we will configure the extensions, properties, and on the second one we will configure the dial plans, and how they will be able to reach each other. Here is a simple example of /etc/asterisk/sip.conf file, with two extensions.
[5010] type=friend username=5010 secret=123456 host=dynamic context=default [5020] type=friend username=5020 secret=123456 host=dynamic context=default
This will create two extensions, 5010 and 5020, this is assuming they are not behind a nat, if that is the case, this could the configuration file instead.
[5010] type=friend nat=yes username=5010 secret=123456 host=dynamic context=default [5020] type=friend nat=yes username=5020 secret=123456 host=dynamic context=default
Well now, lets explain a little the fields in this configuration file:
y
y y y y y
type: Defines the role the extension will have, and we have three options: - peer: Where the device will only be able to receive calls from the PBX - user: Where the device will only be able to make calls to the PBX - friend: Where the device will be able to both make and receive calls through the PBX nat: Defines, if the connecting device that will use that profile, is or is not behind nat. username: Defines the username to be used to connect to the PBX secret: Is the password to be able to connect to the PBX host: The IP that the device will have, if it is set to dynamic, that device will be able to log into the PBX from any IP default: This is very important and defines the group at which that profile belongs, and it is used in the /etc/asterisk/extensions.conf file.
I am keeping this as simple as possible, for now, and this will only make possible to call from one extension to the other one, this file, contains the rules about dialing, and what to do, when the PBX "sees" the numbers dialed by a remote user. What we see here, is that to reach extension 5010, the PBX should dial 5010 using SIP, and as you can see, those rules belong to the default profile, so you can create a lot of profiles, and each telephone attached to the PBX, will belong to one of them and will be able to do only what this file is allowing it to do, so is more or less like having VLANs, or in this case Virtual PBXs, and later we will see how to permit to call from one VPBX to the other. Well, with this simple configuration you now have a running and working PBX, I will show you later, how to configure Ekiga to use this asterisk configuration.