Monday, September 6, 2010

Asterisk 1.6 Compilation and Installation on Debian 5 (lenny)

This guide refers to Asterisk version 1.6.0.6 but has been tested as well on older 1.6.x versions,
tested on the GNU/Linux Debian Lenny 5.0 release 1 distribution, installed from the “netinst” cd image version, available, for example, here
This guide shows how to install Debian 5.
Index
• Satisfying Asterisk dependencies
• Downloading and extracting Asterisk
• Pre-building configuration
• Building
• Installation
• Installing sample configuration files
• Init scripts for getting Asterisk to start at boot
• First execution of Asterisk
• Reboot and verify
Satisfying Asterisk dependencies
In order to successfully build Asterisk, the following dependencies need to be satisfied:
• gcc
• g++
• make
• libncurses5-dev
On Debian “Lenny“, running the following command, as root, will suffice:
apt-get install gcc g++ make libncurses5-dev
The other dependencies will be resolved automatically
Downloading and extracting Asterisk
• Download Asterisk asterisk-1.4.24.tar.gz using wget:
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.24.tar.gz
• Extract the archive with tar:
tar xzvf asterisk-1.4.24.tar.gz
a new folder named “asterisk-1.6.0.6″ will be created
• Change the current working directory to that folder, with cd:
cd asterisk-1.4.24
Pre-building configuration
Stay in the “asterisk-1.4.24″ folder, which holds the source code of Asterisk and run the script:
./configure
which will check the usability of the system libraries and create a ’Makefile’, based on your system.
The ’Makefile’ will later on be used by ’make’ to build Asterisk
If the ’configure’ script ran fine, you should read on the screen something like:
configure: OS type : linux-gnu
configure: Host CPU : i686
Building
Stay in the “asterisk-1.4.24″ folder, which now holds also the ’Makefile’ and run make:
make
consider that on an 800MHz AMD Athlon CPU system, the building of Asterisk takes around 7 minutes
however, rebuilding Asterisk from the same source tree will take much less because only the files affected from changes to the ’Makefile’ with the ./configure script will be rebuilt.
If the building ran fine, you should read on the screen:
+——— Asterisk Build Complete ———
+ Asterisk has successfully been built, and
+ can be installed by running:
+
+ make install
+——————————————-
Installation
Always staying in the “asterisk-1.6.0.6″ folder, write the command:
make install
which will finally install Asterisk.
You should then read something like:
+—- Asterisk Installation Complete ——-+



Installing sample configuration files
The sample configuration files which comes with Asterisk, will provide a good basic running setup to start customizing.
To install them, run the command:
make samples
Init scripts for getting Asterisk to start at boot
Having Asterisk to start at boot is as simple as running, in the “asterisk-1.6.0.6″ folder, the command:
make config
which will choose the right init files for your distribution, and copy them in /etc/asterisk
For your information, those files are located in the contrib/init.d/ folder
First execution of Asterisk
As the superuser root, from whatever folder you are in, run:
asterisk -vvvc
Asterisk will load it’s modules and it’s configuration, you should then read:
Asterisk Ready.
*CLI>
this is the command line interface of Asterisk, to logout run the command:
stop now
Reboot and verify
Reboot the system with the command:
reboot
after the reboot process, you can verify that Asterisk is running with the command:
asterisk -r
and logout from the command line interface with the command:
exit



======
apt-get install cvs
apt-get install subversion
svn checkout http://svn.digium.com/svn/asterisk-gui/branches/2.0
cd 2.0/
./configure
make
make install
make checkconfig
=>
* Checking if HTTP is enabled: FAILED
-- Please be sure you have 'enabled = yes'
-- in /etc/asterisk/http.conf

=>
* Checking if HTTP static support is enabled: FAILED
-- Please be sure you have 'enablestatic = yes'
-- in /etc/asterisk/http.conf

bindaddr=0.0.0.0

=>
* Checking if manager is enabled: FAILED
-- Please be sure you have 'enabled = yes'
-- in /etc/asterisk/manager.conf
 enabled = yes
webenabled = yes

* GUI should be available at http://192.168.2.18:8088/asterisk/static/config/index.html

* Note: If you have bindaddr=127.0.0.1 in /etc/asterisk/http.conf
you will only be able to visit it from the local machine.

Example: http://localhost:8088/asterisk/static/config/index.html

* The login and password should be an entry from /etc/asterisk/manager.conf
which has 'config' permission in read and write. For example:

[admin]
secret = gulfagate.com
read = system,call,log,verbose,command,agent,config
write = system,call,log,verbose,command,agent,config