Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Asterisk Sangoma
Asterisk Sangoma
Mayo 2011
Gabriel Bozada <gabriel@demerzel.org>
http://www.trantoriano.net
Estos son los paquetes que tuve que instalar para la compilacion de wanpipe, dahdi, asterisk y openr2,
hay dependencias entre ellos por lo tanto es necesario instalarlos todos, con yum o createrepo es mas
autom
atico sin embargo no son muchos paquetes y de esta manera uno se da cuenta de los necesarios.
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
kernel-devel-2.6.18-238.el5.x86_64.rpm
ncurses-devel-5.5-24.20060715.x86_64.rpm
ncurses-5.5-24.20060715.x86_64.rpm *
kernel-headers-2.6.18-238.el5.x86_64.rpm
glibc-headers-2.5-58.x86_64.rpm
glibc-devel-2.5-58.x86_64.rpm
gcc-4.1.2-50.el5.x86_64.rpm
flex-2.5.4a-41.fc6.x86_64.rpm
patch-2.5.4-31.el5.x86_64.rpm *
libtermcap-devel-2.0.8-46.1.x86_64.rpm
bison-2.3-2.1.x86_64.rpm
imake-1.0.2-3.x86_64.rpm
autoconf-2.59-12.noarch.rpm
automake-1.9.6-2.3.el5.noarch.rpm
libtool-1.5.22-7.el5_4.x86_64.rpm
libstdc++-devel-4.1.2-50.el5.x86_64.rpm
gcc-c++-4.1.2-50.el5.x86_64.rpm
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
Server]#
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
rpm
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
-ivh
slang-devel-2.0.6-4.el5.x86_64.rpm
newt-devel-0.52.2-15.el5.x86_64.rpm
zlib-devel-1.2.3-3.x86_64.rpm
libxml2-devel-2.6.26-2.1.2.8.el5_5.1.x86_64.rpm
e2fsprogs-devel-1.39-23.el5_5.1.x86_64.rpm
keyutils-libs-devel-1.2-1.el5.x86_64.rpm
libsepol-devel-1.15.2-3.el5.x86_64.rpm
libselinux-devel-1.33.4-5.7.el5.x86_64.rpm
krb5-devel-1.6.1-55.el5.x86_64.rpm
openssl-devel-0.9.8e-12.el5_5.7.x86_64.rpm
En el directorio de IPBX descargaremos las ultimas versiones de cada una de las aplicaciones que vamos
a utilizar, para este caso usaremos Wanpipe 3.5.20, Asterisk 1.8.4, DAHDI linux 2.4.1.2, DAHDI tools
2.4.1 y OpenR2 1.3.1.
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
[root@asterisksangoma
IPBX]#
IPBX]#
IPBX]#
IPBX]#
IPBX]#
wget
wget
wget
wget
wget
ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-3.5.20.tgz
http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-2.4.1.2.tar.gz
http://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/dahdi-tools-2.4.1.tar.gz
http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8.4.tar.gz
http://openr2.googlecode.com/files/openr2-1.3.1.tar.gz
Antes que nada debemos conectar al equipo la tarjeta y verificar que se reconocida por Linux, mediante lspci verificamos que adecuadamente el sistema operativo la reconocio y nos muestra donde esta
conectada fsicamente.
Figura 3: CD de Wanpipe
El script de instalaci
on verificara los componentes necesarios como son paquetes, libreras del kernel
utilizado y el directorio de DAHDI a utilizar.
[root@asterisksangoma wanpipe-3.5.20]# ./Setup dahdi
---------------------------------------------------------WANPIPE v3.5.20 Installation Script
Copyright (c) 1995-2010, Sangoma Technologies Inc.
---------------------------------------------------------WANPIPE INSTALLATION FOR DAHDI
You are about to install WANPIPE TDM Voice drivers
for Asterisk/Dahdi framework.
You will be prompted for path to DAHDI source.
Wanpipe drivers will compile into dahdi WITHOUT any
dahdi patching or need to recompile dahdi modules.
You must have Linux Kernel Headers along with
full development tools (i.e. GNU C compiler and utilities)
installed in order to be able to install this product.
If you have previoulsy installed WANPIPE, this release
will overrite/upgrade full release without the need to
uninstall first!
IMPORTANT:
It is always recommended to say YES to all options
prompted during the install!
Please visit: http://wiki.sangoma.com for more info.
Would you like to install WANPIPE now? [y] (y/n) y
---------------------------------------------------------WANPIPE v3.5.20 Installation Script
Copyright (c) 1995-2010, Sangoma Technologies Inc.
---------------------------------------------------------Fixing file permissions...
Verifying files and fixing permissions ...Done
Checking for C developement tools ...(gcc) OK
Checking for C++ developement tools ...OK
Checking for Make utility ...OK
Checking for ncurses library ... OK
Checking for Perl developement tools ...OK
Checking for AWK ...OK
Checking for FLEX ...OK
Checking for Patch ...OK
Checking for libtermcap-devel...OK
Checking for bison...OK
Checking for libtool...OK
for
for
for
for
for
for
for
for
Asterisk/Dahdi/Zaptel
Asterisk/Dahdi/Zaptel
Wan Routing/API
Wan/IP Routing and Data API
Asterisk SMG/SS7
Asterisk SS7
TDM API
FreeSwitch and Voice API
Custom Compilation:
-----------------Customise WANPIPE driver compilation to add only the
protocols that you need. This way one can reduce
the size of the WANPIPE kernel drivers.
Refer to http://wiki.sangoma.com for more info
-DAF_WANPIPE_2612_FORCE_UPDATE -DWANPIPE_MOD_266_FORCE_UPDATE
-------------------------------------------------CFLAGS: gcc -Wp,-MD,.wanpipe.o.d -nostdinc -iwithprefix include -D__LINUX__ -Dlinux -D__KERNEL__ -I/usr/include/
-------------------------------------------------Checking for REGPARM kernel option ...Disabled.
Compiling General WANPIPE Driver for 2.6.X Kernel .....Done.
Vemos que satisfactoriamente esta reconocida por la aplicacion, aqu en este punto especial introduzco
el siguiente error que se presento en diversos intentos de instalacion con otros kernel o sin la tarjeta
E1 en el puerto PCI del equipo en cuestion.
FATAL: Error inserting wanpipe (/lib/modules/2.6.18-238.el5/kernel/drivers/net/wan/wanpipe.ko):
Unknown symbol in module, or unknown parameter (see dmesg) Would you like to generate /etc/asterisk/zapata.conf
Iniciamos el script de configuraci
on tomando los pasos de un white paper denominado Running
R using OpenR2 (libopenr2), para generar el archivo de configuMFC/R2 with Sangoma Wanpipe
raci
on de wanpipe.
[root@asterisksangoma wanpipe-3.5.20]# wancfg_dahdi
########################################################################
#
Sangoma Wanpipe
#
#
Dahdi/Zaptel/SMG/TDMAPI/BOOT Configuration Script
#
#
v2.39
#
#
Sangoma Technologies Inc.
#
#
Copyright(c) 2009.
#
########################################################################
Would you like to generate /etc/asterisk/chan_dahdi.conf
1. YES
2. NO
[1-2]:1
--------------------------------------------Configuring T1/E1 cards [A101/A102/A104/A108]
--------------------------------------------A101 detected on slot:0 bus:7
----------------------------------------------------------Configuring port 1 on A101 slot:0 bus:7.
----------------------------------------------------------Select media type for AFT-A101 on port 1 [slot:0 bus:7 span:1]
1. T1
2. E1
3. Unused
4. Exit
[1-4]:2
10
11
###################################################################
Configuration Complete! Please select following:
1. YES - Continue
2. NO - Exit
[1-2]:
Dahdi and Wanpipe configuration complete: choose action
1. Save cfg: Restart Asterisk & Wanpipe now
2. Save cfg: Restart Asterisk & Wanpipe when convenient
3. Save cfg: Stop Asterisk & Wanpipe now
4. Save cfg: Stop Asterisk & Wanpipe when convenient
5. Save cfg: Save cfg only (Not Recommanded!!!)
6. Do not save cfg: Exit
[1-6]:5
12
Posteriormente realizaremos unos cambios en el archivo de configuracion, vamos a verificar que wanrouter nos muestre el dispositivo.
[root@asterisksangoma wanpipe-3.5.20]# wanrouter start
Starting up device: wanpipe1
--> Loading ec image OCT6116-64S.ima...
Configuring interfaces: w1g1
done.
[root@asterisksangoma wanpipe-3.5.20]# wanrouter list
Devices currently active:
wanpipe1
[root@asterisksangoma wanpipe-3.5.20]# wanrouter status
Devices currently active:
wanpipe1
Wanpipe Config:
13
Device name | Protocol Map | Adapter | IRQ | Slot/IO | Ifs | CLK | Baud rate |
wanpipe1
| N/A
| A101/1D/A102/2D/4/4D/8| 169 | 0
| 1
| N/A | 0
Wanrouter Status:
Device name | Protocol | Station | Status
wanpipe1
| AFT TE1 | N/A
| Disconnected
|
|
wanpipe-3.5.20]# cd ..
IPBX]# tar xfz dahdi-tools-2.4.1.tar.gz
IPBX]# cd dahdi-tools-2.4.1
dahdi-tools-2.4.1]# ./configure
dahdi-tools-2.4.1]# make
dahdi-tools-2.4.1]# make install
dahdi-tools-2.4.1]# make config
dahdi-tools-2.4.1]# cd ..
IPBX]#
IPBX]#
IPBX]#
IPBX]#
IPBX]#
IPBX]#
Configuraremos DAHDI con los siguientes parametros especficos para el E1 de TELMEX, son treinta
canales posibles de comunicaci
on con el canal 16 para se
nalizacion.
[root@asterisksangoma IPBX]# vi /etc/dahdi/system.conf
span=1,1,0,cas,hdb3
cas=1-15:1101
dchan=16
cas=17-31:1101
loadzone=us
defaultzone=us
Cargamos la configuraci
on.
14
01:
02:
03:
04:
05:
06:
07:
08:
09:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
31 channels to configure.
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
for
for
for
for
for
for
for
for
for
for
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
1 to none
2 to none
3 to none
4 to none
5 to none
6 to none
7 to none
8 to none
9 to none
10 to none
15
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
Setting
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
echocan
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
channel
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
Con esto ya tenemos configurada la parte de Asterisk y DAHDI para solo recibir la se
nal del E1, vamos
a terminar de configurar Wanpipe. Conectar el E1 no basta para que nuestra tarjeta inmediatamente
empiece a trabajar, en dado caso wanpipemon nos ayudara a identificar las posibles alarmas existentes
para lograr poner en verde el led indicador del estado de nuestra tarjeta.
Aqu cito la siguiente pagina: http://wiki.sangoma.com/wanpipemon-T1-E1-line-alarms-0 de la
wiki de sangoma donde nos muestran la descripcion de cada una de estas alarmas, verificamos como
wanpipemon muestra las alarmas cuando no tenemos conexion alguna en la tarjeta, nota la alarma de
open circuit, loss of framing y loss of frame signal.
[root@asterisksangoma IPBX]# wanpipemon -i w1g1 -c Ta
16
Aqu un ejemplo de la tarjeta conectada con un loop en los coaxiales, esto con el fin de comparar
ciertas alarmas que van desde una mala se
nal enviada por el otro lado de nuestro enlace as como
cables invertidos en la conexi
on, la alarma es la de loss of framing.
17
En los logs del sistema se pueden presentar mensajes similares a los siguientes haciendo referencia al
reloj, en mi caso fue por que el Rx y Tx de los coaxiales estaban invertidos en el balun, sin embargo
en la FAQ de Sangoma hay mas causas posibles, tambien nota que aparecen otras alarmas diferentes
en especial la de short circuit que nos indica que los cables estan cruzados, y la de remote alarm
indication.
[root@asterisksangoma ~]# wanpipemon -i w1g1 -c Ta
***** w1g1: E1 Rx Alarms (Framer) *****
ALOS: OFF | LOS: OFF
RED: ON | AIS: OFF
LOF: ON | RAI: ON
***** w1g1: E1 Rx Alarms (LIU) *****
Short Circuit: ON
Open Circuit: OFF
Loss of Signal: OFF
***** w1g1: E1 Tx Alarms *****
AIS: OFF | YEL: ON
18
on the bus!
conform to the
on the bus!
conform to the
on the bus!
conform to the
on the bus!
conform to the
on the bus!
conform to the
on the bus!
conform to the
on the bus!
conform to the
on the bus!
conform to the
on the bus!
En los casos anteriores el comando dahdi tool nos mostrara la alarma en la tarjeta y mientras exista
Asterisk no podr
a usarla.
19
H.100 spec!
H.100 spec!
H.100 spec!
H.100 spec!
H.100 spec!
H.100 spec!
H.100 spec!
H.100 spec!
20
CRC4 Errors : 0
FAS Errors : 1507
Figura 7: E1 conectado
21
Satisfactoriamente no hay ninguna alarma, nuestra tarjeta se pone en verde y esta lista para recibir
llamadas, confirmamos con dahdi tool.
Rx CAS
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
MOH Interpret
default
22
Blocked
State
In Service
1
from-pstn
2
from-pstn
3
from-pstn
4
from-pstn
5
from-pstn
6
from-pstn
7
from-pstn
8
from-pstn
9
from-pstn
10
from-pstn
11
from-pstn
12
from-pstn
13
from-pstn
14
from-pstn
15
from-pstn
17
from-pstn
18
from-pstn
19
from-pstn
20
from-pstn
21
from-pstn
asterisksangoma*CLI>
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
In
In
In
In
In
In
In
In
In
In
In
In
In
In
In
In
In
In
In
In
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Si tenemos la tarjeta con alarma los canales se nos mostraran de la siguiente manera:
asterisksangoma*CLI> dahdi show channels
Chan Extension Context
Language
pseudo
default
1
from-pstn
2
from-pstn
3
from-pstn
4
from-pstn
5
from-pstn
6
from-pstn
7
from-pstn
8
from-pstn
9
from-pstn
10
from-pstn
11
from-pstn
12
from-pstn
13
from-pstn
14
from-pstn
15
from-pstn
17
from-pstn
18
from-pstn
19
from-pstn
20
from-pstn
21
from-pstn
asterisksangoma*CLI>
Chan Variant Max ANI
1 MX
10
2 MX
10
3 MX
10
4 MX
10
5 MX
10
6 MX
10
7 MX
10
MOH Interpret
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
default
23
Blocked
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
Rx CAS
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
State
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
In Service
8 MX
10
9 MX
10
10 MX
10
11 MX
10
12 MX
10
13 MX
10
14 MX
10
15 MX
10
17 MX
10
18 MX
10
19 MX
10
20 MX
10
21 MX
10
asterisksangoma*CLI>
4
4
4
4
4
4
4
4
4
4
4
4
4
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
Configuramos r
apidamente una extensi
on SIP 1000 con el contexto from-pstn para que pueda recibir
las llamadas, marcamos y vemos como la llamada entra con el primer DNI y se dirige a la extensi
on
1000.
asterisksangoma*CLI>
== Using SIP RTP CoS mark 5
-- Executing [46028079@pruebas:1] Dial("SIP/1000-00000007", "DAHDI/g1/46028079") in new stack
-- Called g1/46028079
MFC/R2 call has been accepted on forward channel 1
-- DAHDI/1-1 is ringing
-- DAHDI/1-1 is making progress passing it to SIP/1000-00000007
MFC/R2 call has been answered on channel 1
-- DAHDI/1-1 answered SIP/1000-00000007
Chan 1 - Far end disconnected. Reason: Normal Clearing
MFC/R2 call disconnected on channel 1
-- Hungup DAHDI/1-1
== Spawn extension (pruebas, 46028079, 1) exited non-zero on SIP/1000-00000007
25
http://code.google.com/p/openr2/downloads/list
http://wiki.sangoma.com/wanpipemon-T1-E1-line-alarms-0
http://www.fonality.com/trixbox/forums/vendor-forums-certified/sangoma/sangoma-a101d-alarm-redon-lofo
http://wiki.sangoma.com/konrads-cheat-sheet
http://wiki.sangoma.com/mfcr2
http://wiki.sangoma.com/wanpipe-linux-asterisk-debugging#pri_span_debugging
http://wiki.sangoma.com/wanpipe-linux-asterisk-appendix
http://libopenr2.org
http://code.google.com/p/openr2/downloads/list
http://edocs.mitel.com/UG/EN/5312-5324_SIP7.2_UG_GA.pdf
http://sangoma.com/assets/docs/misc/MFCR2_and_Sangoma_English.pdf
http://demerzel.wordpress.com/2008/10/23/asterisk-y-e1-experiencias/
http://demerzel.org/?p=13
27