Documentos de Académico
Documentos de Profesional
Documentos de Cultura
*******
********************************************************************************
********
********************************************************************************
********
********************************************************************************
********
Estos son algunos pasos opcionales si quieres tener tu RedHat(CentOS) para traba
jar comodamente,
paquetes que puedes encontrar en la web o en la carpeta "Paquetes" de tu ultimo
servidor
configurado.
copio los archivos a /usr/src/asterisk o cualquier directorio
luego entro a el directorio cd /usr/src/asterisk
yum --nogpgcheck localinstall bash-completion-20060301-1.el5.rf.noarch.rpm
yum --nogpgcheck localinstall fail2ban-0.8.4-23.el5.noarch.rpm shorewall-3.2.7-1
.0.el5.noarch.rpm
vi /etc/fail2ban/jail.conf
chkconfig fail2ban on
service fail2ban start
vi .bashrc
* agregar "alias vi='vim'"
********************************************************************************
********
* Para empezar, necesitamos alguna herramientas para descomprimir paquetes y com
pilar.
yum -y install gcc glibc-devel ncurses-devel kernel-devel libtermcap-devel gcc-c
++ openssl-devel newt-devel zlib-devel make unixODBC-devel libtool-devel rpm-bui
ld
yum -y install libtool-devel kernel-headers
yum -y install flex bison
yum -y install mysql mysql-server mysql-devel libtiff-devel net-snmp-devel
********************************************************************************
********
* Preparar la carpeta para la descargar de los sources
cd /usr/src/
mkdir asterisk && cd asterisk/
wget -c http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8-curren
t.tar.gz
wget -c http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-l
inux-complete-current.tar.gz
wget -c http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.ta
r.gz
********************************************************************************
********
* Compilando libpri
cd /usr/src/asterisk
tar -zxf libpri-1.4-current.tar.gz
cd libpri-1.4.12/
make clean
make
make install
********************************************************************************
********
* Compilando dahdi, tenemos tarjetas SANGOMA, por lo tanto no detectara las tarj
etas.
cd /usr/src/asterisk
tar -zxf dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-*
make all
make install
make config
********************************************************************************
********
* Como las tarjetas que estamos utilizando son SANGOMA, necesitamos instalar los
drivers
* de esas tarjetas, para que el dahdi las detecte. Comprobamos los ultimos drive
s del
* sitio http://wiki.sangoma.com/wanpipe-linux-drivers
cd /usr/src/asterisk
wget -c ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-3.5.20.tgz
tar xvfz wanpipe-3.5.20.tgz
cd wanpipe-3.5.20/
--------------------------------------------------------------------------------------------------* Ejecutamos el siguiente comando pero no instalamos, solo llegamos hasta el
* proceso de verificacin de dependencias.
./Setup install
Would you like to install WANPIPE now? [y] (y/n) y
Ctrl + C
--------------------------------------------------------------------------------------------------* Ejecutamos el proceso de instalacin con el siguiente comando
./Setup dahdi
Would you like to install WANPIPE now? [y] (y/n) y
Please select working zaptel directory [1-1][m]: 1
Would you like to configure wanpipe devices for DAHDI? (y/n) y
Would you like to generate /etc/asterisk/chan_dahdi.conf
1. YES
2. NO
[1-2]:1
[1-3]:1
1 continuar
* al final opcion 2
--------------------------------------------------------------------------------------------------* En el proceso, es posible que no encuentre la carpeta de asterisk creada, por
lo que podemos
* decirle que no realize el asistente de configuracion del chan_dahdi.conf.
* Despues de tener la carpeta /etc/asterisk creada, podemos ejecutar el siguient
e comando:
wancfg_dahdi
--------------------------------------------------------------------------------------------------* Verificamos la creacin de los archivos en la carpeta del DAHDI y realizamos cop
ia del
* archivo generado.
cd /etc/dahdi/
cp system.conf system.conf.orig
vi system.conf
cp system.conf.bak system.conf.bak.orig
--------------------------------------------------------------------------------------------------* verificar que dahdi arranque cuando arranque el sistema
cd /usr/src/asterisk
ll
cd dahdi-linux-complete-*
ll
cd /usr/src/asterisk
ll
cd
cd /usr/src/asterisk/wanpipe-3.5.20
ll
--------------------------------------------------------------------------------------------------* Instalacin de scripts de inicio rc.d
./Setup install_init
-------------------------------------------------------------------------------------------------------qqqqqqqqq * esto no por ahora
qqqqqqqqq cd /etc/asterisk/
qqqqqqqqq cp chan_dahdi.conf chan_dahdi.conf.001
********************************************************************************
********
* OPENR2
* Si estamos configurando una Tarjeta E1, la sealizacin en Latinoamerica es R2
* Por lo que tenemos que instalar las librerias para que asterisk reconozca la
* sealizacin MFC/R2
* sitio http://code.google.com/p/openr2/
cd /usr/src/asterisk
wget http://openr2.googlecode.com/files/openr2-1.3.1.tar.gz
tar zxvf openr2-1.3.1.tar.gz
ll
cd openr2-1.3.1
ll
* Por defecto instala en /usr/local/ Para evitar problemas de ubicacin.
./configure --prefix=/usr
make
make install
* Se hace necesario cambiar las configuraciones en /etc/dahdi/system.conf para
* que quede de la siguiente manera:
cd /etc/dahdi/
ll
vi system.conf
cp system.conf.bak system.conf.bak.orig01
ll
--------------------------------------------------------------------------------------------------#Sangoma A104 port 1 [slot:4 bus:3 span:1] <wanpipe1>
span=1,1,0,cas,hdb3
cas=1-15,17-31:1101
echocanceller=mg2,1-15,17-31
dchan=16
------------------------------------------------------------------------------------------------------* verificar que dahdi arranque con el sistema
cd /usr/src/asterisk
ll
cd dahdi-linux-complete-*
ll
cd ..
ll
-----------------------------------------------------------------------------------------------------------* para verificar que arranquen los archivos
cd /usr/src/asterisk/wanpipe-3.5.20
ll
./Setup install_init
--------------------------------------------------------------------------------------------------* El :1101 es la posicin inicial de los bits CAS (conocidos tambin como los bits A
BCD) que son
* usados por R2 para sealizar el estado de la lnea (contestada, colgada, etc.). La
seal 1101
* significa bloqueado en R2, que significa que cuando el hardware despierta por pr
imera vez no
* podr recibir llamadas (Asterisk o cualquier otro software que use R2 despus camb
iarn los
* bits a 1001, que significan IDLE, o listo para hacer llamadas).
********************************************************************************
********
* COMPILANDO ASTERISK
cd /usr/src/asterisk/
ll
tar zxvf asterisk-1.8-current.tar.gz
cd asterisk-1.8.5.0/
ll
--------------------------------------------------------------------------------------------------* Para soporte MP3, ejecutamos el siguiente comando
contrib/scripts/get_mp3_source.sh
--------------------------------------------------------------------------------------------------* En el make menuselect, quitamos el soporte para pbx_ael, agregamos SOUNDS en E
S/EN(GSM,ULAW,ALAW)
* MOH (GSM,ULAW,ALAW), Addons(MySQL,mp3)
make clean
./configure
make menuselect
* quitar pbx-ael
---->
opcion 10 del menu
* agregar cdr-mysql
---->
opcion 1 del menu
* agregar format-mp3
---->
opcion 1 del menu
* agregar los 4 todos
---->
opcion 16 del menu
* agregar CORE-SOUNDS-EN-ALAW ---->
opcion 18 del menu
* agregar CORE-SOUNDS-EN-ULAW ---->
opcion 18 del menu
* agregar CORE-SOUNDS-EN-GSM ---->
opcion 18 del menu
* agregar CORE-SOUNDS-ES-ALAW ---->
opcion 18 del menu
* agregar CORE-SOUNDS-ES-ULAW ---->
opcion 18 del menu
* agregar CORE-SOUNDS-ES-GSM ---->
opcion 18 del menu
* agregar NOH-OPSOUNDS-ULAW ---->
opcion 19 del menu
* agregar NOH-OPSOUNDS-ALAW ---->
opcion 19 del menu
* agregar NOH-OPSOUNDS-GSM ---->
opcion 19 del menu
* agregar EXTRA-SOUNDS-EN ULAW ---->
opcion 20 del menu
* agregar EXTRA-SOUNDS-EN ALAW ---->
opcion 20 del menu
* agregar EXTRA-SOUNDS-EN GSM ---->
opcion 20 del menu
--------------------------------------------------------------------------------------------------make
make install
--------------------------------------------------------------------------------------------------* Ejecutar si no tenemos nada configurado ya.
make samples
--------------------------------------------------------------------------------------------------VERIFICAR
wancfg_dahdi
--------------------------------------------------------------------------------------------------* LUEGO DE CONFIGURAR DADHI (LOS PUERTOS)
* pregunta que si quiere iniciar wanrouter cuando inicie el sistema y desimos qu
e si
Removing existing wanrouter boot scripts...OK
Would you like wanrouter to start on system boot?
1. YES
2. NO
[1-2]:1
-------------------------------------------------------------------------------------------------* pregunta que si quiere iniciar dahdi-cfg al mismo tiempo que wanrouter y decim
os que si.
/etc/dahdi/
system.conf
/etc/asterisk/
chan_dahdi.conf.bak chan_dahdi.conf.bak.orig
*///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
*///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
*///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
*///////
/////
///// //////////// /////////////////
////////////////////////////////////////////////////////////////////
*////// //////////// /////////// ////////////
////////// /////////////////
///////////////////////////////////////////////////////////
*////// //////////////////////// //////////// // //////// /////////////////
///////////////////////////////////////////////////////////
*////// //////////////////////// //////////// /// /////// /////////////////
/////////////////////////////////////////////////////////
*////// //////////////////////// //////////// //// ////// /////////////////
///////////////////////////////////////////////////////////
*////// //////////////////////// //////////// ///// ///// /////////////////
/////////////////////////////////////////////////////////
*//////
/////////////// //////////// ////// //// /////////////////
//////////////////////////////////////////////////////////
*////// //////////////////////// //////////// ////// //// /////////////////
//////////////////////////////////////////////////////////
*////// //////////////////////// //////////// ////// //// /////////////////
/////////////////////////////////////////////////////////
*////// //////////////////////// //////////// /////// /// /////////////////
//////////////////////////////////////////////////////////
*////// //////////////////////// //////////// //////// // /////////////////
/////////////////////////////////////////////////////////
*////// //////////////////////// //////////// ///////// / /////////////////
/////////////////////////////////////////////////////////
*////// //////////////////
/// ////////// //////////////////
///////////////////////////////////////////////////////////
*///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
*///////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
*///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
*///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
********************************************************************************
********
* Configurando system-config-securitylevel
system-config-securitylevel
--------------------------------------------------------------------------------------------------* Por lo general contamos con 1 o 2 tarjeta de Red. Si necesitamos permitir acc
eso desde
* la red Publica, estas serian los datos a configurar:
Trusted Devices:
[ ] eth0 [*] eth1
[*] SSH
Other ports 5060:udp 5061:udp 10000-20000:udp 161:udp
--------------------------------------------------------------------------------------------------********************************************************************************
********
* Configurando FAIL2BAN para ASTERISK.
Tomado de http://www.voip-info.org/wiki/view/Fail2Ban+(with+iptables)+And+Asteri
sk
cd /etc/fail2ban/filter.d/
vi asterisk.conf
--------------------------------------------------------------------------------------------------# Fail2Ban configuration file
#
#
# $Revision: 250 $
#
[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
# common.local
#before = common.conf
[Definition]
#_daemon = asterisk
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
#
host must be matched by a group named "host". The tag "<HOST>" can
#
be used for standard IP/hostname matching and is only an alias for
#
(?:::f{4,6}:)?(?P<host>\S+)
# Values: TEXT
#
failregex = NOTICE.*
' - Wrong password
NOTICE.*
' - No matching peer
NOTICE.*