User Tools

Site Tools


installation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
installation [2011/10/13 17:02]
pagilm [Obtain source code]
installation [2017/03/13 10:38] (current)
bg [Module Configuration]
Line 1: Line 1:
 +====== Installation ======
 +
 +Chan_dongle runs only in asterisk 1.6.2 and asterisk 1.8. Asterisk 1.4 is not supported.
 +===== Asterisk Installation =====
 +
 +There is a lot of very good howto'​s explaining Asterisk installation. Take a look at this brief summary (Debian), but you can take a look at [[http://​www.powerpbx.org/​content/​centos-asterisk-freepbx-install-guide-centos-v5x-asterisk-v16x-freepbx-v26x|1]],​ [[http://​mikeoverip.wordpress.com/​2010/​09/​26/​freepbx-2-8-installation-on-debian-5-lenny/​|2]] or [[http://​ualtech.files.wordpress.com/​2008/​02/​asterisk_debian_etch_v11.pdf|3]] (in spanish).
 +
 +Note that we don't need Dahdi channel to run chan_dongle,​ so it can be avoided.
 +
 +==== Prerequisites ====
 +Be careful with iptables and selinux. If needed, edit ''/​etc/​selinux/​config''​ and write:
 +<​code>​
 +SELINUX=disabled
 +SELINUXTYPE=targeted
 +</​code>​
 +Then, disable iptables ​
 +<​code>​
 +iptables -F
 +iptables-save > /​etc/​iptables.up.rules
 +</​code>​
 +or configure it to allow SIP (port 5060) and RTP (port 10000-20000) if you plan to use these protocols.
 +
 +Now upgrade your system
 +<​code>​
 +apt-get update
 +apt-get upgrade
 +</​code>​
 +And install packages needed for compilation of asterisk
 +<​code>​
 +apt-get install linux-headers-`uname -r` gcc g++ make libnewt-dev libncurses5-dev openssl libssl-dev zlib1g-dev
 +</​code>​
 +
 +==== Asterisk Installation ====
 +Download source files and untar. Asterisk 1.6 is explained, but 1.8 looks similar.
 +<​code>​
 +wget http://​downloads.asterisk.org/​pub/​telephony/​asterisk/​releases/​asterisk-1.6.2.13.tar.gz
 +tar zxvf asterisk-1.6.2.13.tar.gz
 +</​code>​
 +
 +If you will use FreePBX, then install asterisk-addons
 +<​code>​
 +wget http://​downloads.asterisk.org/​pub/​telephony/​asterisk/​releases/​asterisk-addons-1.6.2.2.tar.gz
 +tar zxvf asterisk-addons-1.6.2.2.tar.gz
 +</​code>​
 +Now compile
 +<​code>​
 +cd asterisk-1.6.2.13
 +make clean && ./configure --disable-xmldocs && make && make install && make config
 +</​code>​
 +
 +If needed
 +<​code>​
 +make samples
 +</​code>​
 +
 +===== Install chan_dongle =====
 +
 +==== Obtain source code ====
 +
 +If you installed asterisk as described [[installation#​asterisk installation|here]],​ go ahead. Anyway, check some dependencies like ''​automake''​ and ''​autoconf''​. Also must have asterisk sources and development tools like ''​make'',​ ''​gcc''​ and so on.
 +
 +=== SVN Method===
 +<​code>​
 +svn checkout https://​github.com/​bg111/​asterisk-chan-dongle/​trunk/​ dongle-read-only
 +cd dongle-read-only
 +aclocal && autoconf && automake -a
 +</​code>​
 +
 +=== Compressed package ===
 +<​code>​
 +wget https://​github.com/​bg111/​asterisk-chan-dongle/​archive/​master.zip
 +unzip master.zip
 +cd asterisk-chan-dongle-master
 +aclocal && autoconf && automake -a
 +</​code>​
 +
 +==== Set Build options ====
 +<​code>​
 +./configure
 +</​code>​
 +configure options:
 +  * %%--enable-debug%%
 +  * %%--disable-debug%%
 +  * %%--enable-manager%%
 +  * %%--disable-manager%%
 +  * %%--enable-apps%%
 +  * %%--disable-apps%%
 +
 +  * %%--with-asterisk=/​path_to_source/​asterisk.h%%
 +
 +usefull environment variables
 +  * DESTDIR
 +  * CFLAGS
 +  * LDFLAGS
 +
 +Examples
 +  * DESTDIR="/​usr/​lib/​asterisk/​modules"​ ./configure
 +  * ./configure --with-asterisk=/​usr/​src/​asterisk-1.6.2.13/​include
 +  * CFLAGS="​-I /​usr/​src/​asterisk-1.6.2.13/​include"​ ./configure
 +  * ./configure %%--enable-debug%%
 +  * ./configure %%--disable-apps --disable-manager%%
 +  * CFLAGS="​-O0 -g" ./configure
 +  * CFLAGS="​-Os"​ ./configure
 +
 +default is
 +  * ./configure %%--disable-debug --enable-apps --enable-manager%%
 +  * DESTDIR searching in /​usr/​lib/​asterisk/​modules /​usr/​local/​lib/​asterisk/​modules /​opt/​local/​lib/​asterisk/​modules
 +and 
 +  * asterisk.h searching in ../include /​usr/​include /​usr/​local/​include /​opt/​local/​include
 +
 +==== Building ====
 +For compile and build source to module
 +<​code>​
 +make
 +</​code>​
 +==== Installation ====
 +For install property configured and build module:
 +<​code>​
 +sudo make install
 +</​code>​
 +
 +==== Module Configuration ====
 +Once installed, copy example file ''​dongle-read-only/​etc/​dongle.conf''​ to ''/​path_to_asterisk_config/''​ (i.e. ''/​etc/​asterisk/''​). Configure it as desired and start asterisk. To load, stop or restart chan_dongle:​
 +
 +<​code>​
 +CLI>​module load chan_dongle.so
 +CLI>​module unload chan_dongle.so
 +CLI>​module reload chan_dongle.so
 +</​code>​
 +
 +or much easy 
 +<​code>​
 +CLI>​module reload now
 +CLI>​module reload gracefully
 +CLI>​module reload convenient
 +</​code>​
 +