Vous êtes sur la page 1sur 479

Comunicaciones Unificadas con Elastix Vol.

Indice
Portada ndice Introduccin 1. Introduccin a la telefona
1.1 Breve historia de la telefona Los albores de la telefona Los problemas con las patentes El desarrollo de la tecnologa telefnica 1.2 Los principios de la transmisin de voz Rango de frecuencias de la voz humana El micrfono Ancho de banda y capacidad de informacin 1.3 Digitalizacin de la voz Teorema de Nyquist 1.4 Redes orientadas a circuitos 1.5 Redes orientadas a paquetes 1.6 Red Pblica Telefnica (PSTN) 1.7 Circuitos analgicos Sealizacin analgica DTMFs El telfono analgico 1.8 Circuitos digitales La base DS-0 Circuitos T-carrier y E-carrier SONET y Circuitos pticos 1.9 Protocolos de Sealizacin Digital Sealizacin Asociada al Canal (CAS) Sealizacin de Canal Comn (CCS) 2.1 VoIP: una sopa de protocolos Clasificando los protocolos VoIP 2.2 Protocolo IP El Internet Qu es el protocolo IP? Direccin IP Paquete IP Direccionamiento IP 2.3 Protocolos de transporte Protocolo TCP Protocolo UDP 2.4 Codificacin de la voz Codecs 2.5 Sobrecarga de protocolos Comparativa de codecs 3.1 Introduccin

2. Introduccin a la VoIP

3. Linux para Administradores de Elastix

http://www.elastixbook.com/es/Indice.htm[24/11/2011 10:21:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

4. Asterisk: Conceptos Esenciales

3.2 Lnea de comandos de Linux 3.3 Comandos bsicos 3.4 Sistema de archivos Organizacin Permisos 3.5 RPMs y actualizaciones va Yum Yum al rescate

5. Instalando Elastix

4.1 Qu es Asterisk? 4.2 Breve historia de Asterisk 4.3 Funcionalidad provista por Asterisk 4.4 Funcionamiento de Asterisk Directorios de Asterisk Estructura modular 4.5 El proyecto DAHDI Breve historia de DAHDI 4.6 Configuracin de Asterisk Archivos de configuracin Comentarios en los archivos de configuracin 4.7 Plan de marcado (dial plan) Contextos Extensiones Variables Aplicaciones ms comunes 4.8 Asterisk CLI Comandos CLI 5.1 Instalando desde CD 5.2 Instalando Elastix sobre un soft-RAID

6. Introduccin a Elastix
6.1 Qu es Elastix? 6.2 Breve historia del proyecto Galardones 6.3 Caractersticas de Elastix PBX Fax Email Mensajera instantnea (IM) Calendario Colaboracin Call Center General 6.4 Licenciamiento 6.5 Elastix.org: Sitio oficial del proyecto Foros 6.6 La interfaz Web de Elastix 6.7 Configuracin de red 6.8 Sobrevuelo por la interfaz de administracin Web de Elastix Mens y mdulos Navegando por la interfaz Web
http://www.elastixbook.com/es/Indice.htm[24/11/2011 10:21:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

7. Configuracin Bsica de PBX

6.9 Administracin de usuarios Grupos de usuarios Permisos de grupo Creacin de usuarios

8. Configuracin de hardware

7.1 Creando una extensin Configuracin de telfono IP 7.2 Configuraciones generales Opciones del comando Dial 7.3 Configuracin de colas 7.4 IVR y sistema de grabacin Grabacin de mensaje de bienvenida Configurar un IVR de bienvenida 7.5 Salas de conferencias 7.6 Parqueo de llamadas 7.7 Msica en espera 7.8 Panel de Operador 7.9 Funciones de transferencia de llamadas Transferencia ciega Transferencia atendida

9. Configuracin de telfono IP

8.1 Tipos de tarjetas y fabricantes 8.2 Instalacin de hardware de telefona en Elastix 8.3 Instalacin fsica de una tarjeta Hardware modular 8.4 Deteccin de hardware 8.5 Configuracin del hardware de telefona a nivel de Asterisk Configuracin del archivo chan_dahdi.conf 8.6 Configuracin de interfaces digitales utilizando los archivos de configuracin DAHDI Configuracin de drivers DAHDI 8.7 Detalles de DAHDI 8.8 Antes de DAHDI: equipos que usaban Zaptel Algunos cambios de nombre a tener en cuenta 9.1 Configuracin de softphone 9.2 Configuracin de telfono IP Configuracin de red Configuracin de registro contra el servidor Elastix 9.3 Utilizando el Endpoint Configurator Configuracin de un telfono ATCOM, modelo AT-530 Configuracin de un telfono Polycom SoundPoint IP 501 Actualizacin por TFTP Personalizando los archivos de configuracin 10.1 Ruteo de llamadas Rutas Entrantes Rutas Salientes 10.2 Troncales Troncales de tipo IAX y SIP Troncales de tipo DAHDI

10. Configuracin avanzada de PBX

http://www.elastixbook.com/es/Indice.htm[24/11/2011 10:21:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Troncales personalizadas 10.3 Tarifacin Visualizar, Editar y Eliminar Crear Tarifa Reporte de Facturacin Distribucin de Destinos Configurar Facturacin 10.4 Reportes Reporte CDR Uso de Canales 10.5 Configuracin DISA 10.6 Condiciones de tiempo

11. Funcionamiento interno de FreePBX


11.1 Fundamentos de FreePBX 11.2 Organizacin de archivos 11.3 Configuracin amportal.conf 11.4 retrieve_conf: Generador del plan de marcado 11.5 dialparties.agi 11.6 Estructura de un mdulo de FreePBX

12. Conectando Servidores Elastix

13. Calidad de voz

12.1 Interconexin entre dos servidores Elastix Definiendo la troncal SIP Definiendo las rutas salientes 12.2 Conexin con proveedores de llamadas va IP Definiendo la troncal SIP Definiendo la ruta saliente 12.3 Conexin predefinida con proveedores de llamadas va IP 13.1 Sntomas de los problemas de voz Eco Bajo nivel de volumen Retardo de voz Distorsin de voz 13.2 Parmetros relacionados con la calidad de voz en redes de paquetes Retardo de red Prdida de paquetes Jitter 13.3 Cmo medir la calidad de voz Escala MOS Modelo E 13.4 Canceladores de eco Funcionamiento de canceladores de eco El estndar G.168 OSLEC 14.1 Protocolo SIP Detalles del protocolo Sealizacin SIP SIP y Asterisk

14. Protocolos VoIP al descubierto

http://www.elastixbook.com/es/Indice.htm[24/11/2011 10:21:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

15. Diagnstico bsico de problemas

14.2 Protocolo IAX Fases de una llamada IAX Frames 14.3 Protocolo RTP Estructura de un paquete RTP 14.4 Protocolo SRTP

15.1 Interpretando el log El archivo /var/log/asterisk/full Qu informacin nos puede indicar el campo MENSAJE? Nmero de proceso (PID) 15.2 Diagnstico a travs del CLI 15.3 Sniffing 16.1 Asterisk AGI Ejecucin de scripts AGI Parmetros enviados al script AGI Comandos AGI Libreras AGI Ejemplo sencillo de script AGI 16.2 Asterisk AMI Probando desde telnet Tipo de paquetes AMI Comandos o acciones AMI

16. Control externo de Asterisk

Apndice A. Archivos de configuracin de Asterisk distribuidos con Elastix

http://www.elastixbook.com/es/Indice.htm[24/11/2011 10:21:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Ir a ndice

Comunicaciones Unificadas con Elastix


Volumen 1 Segunda Edicin

Edgar Landvar
Copyright (c) 2008-2011 Edgar Landvar La presente obra se encuentra licenciada bajo los trminos de la licencia Creative Commons

http://www.elastixbook.com/es/Portada.htm[24/11/2011 10:21:11 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

que se encuentra a continuacin http://creativecommons.org/licenses/by-nc-nd/3.0/. Si luego de leerla todava tiene alguna duda acerca de esta licencia, enve una carta a Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA. Segunda Edicin

A Danielita, por su sonrisa

Reconocimiento
La elaboracin de este libro involucr un enorme trabajo que fue facilitado gracias a la generosa colaboracin de algunas personas con las cuales me encuentro enormemente agradecido. Mis agradecimientos ms especiales a: Jos Landvar y Alfredo Salas de ElastixDepot LLC, por la prolija revisin del volumen 1, prrafo a prrafo. A mi Esposa, por la comprensin durante el tiempo que le tuve que dedicar a la escritura del presente libro. A Paul Estrella, por ejercer la presin necesaria para que esta obra se termine a tiempo. A Bob Fryer por su importante ayuda revisando la versin en Ingls.

El libro online
A partir de esta segunda edicin el libro contar con su propio sitio Web en http://www.elastixbook.com. Desde aqu el lector podr acceder al libro en formato HTML.

Dnde adquirir este libro?


La versin impresa, tanto como la versin digital, pueden ser adquiridas a travs de Lulu.com. Un hipervnculo est disponible en http://www.elastixbook.com.

http://www.elastixbook.com/es/Portada.htm[24/11/2011 10:21:11 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Feedback
Como siempre, cualquier sugerencia ser bien recibida. Que el lector no dude en escribir un email a elastixbook@palosanto.com Ir a ndice

http://www.elastixbook.com/es/Portada.htm[24/11/2011 10:21:11 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Ir a ndice

Introduccin
Muchas cosas han cambiado en Elastix desde el ao 2008, cuando se public por primera vez la presente obra. Debo admitir eso s que la tarea de actualizar el libro inicialmente me pareci sencilla, pero pronto me di cuenta que se trataba de un trabajo enorme. El estar inmerso da a da en el desarrollo del producto no me haba hecho notar la gran cantidad de cambios ocurridos desde aquel Octubre de 2008 cuando la primera versin fue lanzada. La inicialmente sencilla tarea tom 4 veces ms de lo planificado, teniendo que postergar la fecha de publicacin ms de una vez. Aquella primera edicin lanzada en 2008 tuvo para m un xito mucho mayor al esperado. Desde el primer da tuve en mi bandeja de correo agradecimientos y sugerencias de mejoras para prximas versiones. El libro se convirti en libro de texto del programa oficial de entrenamiento y certificacin de Elastix e inclusive gan un premio a las ventas en Lulu.com, lo cual, tengo que admitir, me sorprendi enorme y gratamente. Pese a todo lo anterior, lo ms importante que aquella primera edicin me dej fue la indescriptible satisfaccin personal de sentirme un escritor. Mientras lo escriba nunca pude percibir este hecho pues estaba ms concentrado en que el libro fuera de utilidad a la comunidad de usuarios de Elastix. Sin embargo, luego de su publicacin, cuando comenc a recibir el primer feedback de los interesados lectores, supe que haba hecho algo importante, no solo para los usuarios de Elastix, sino para m mismo. En cuanto a los cambios producidos en esta segunda edicin debo mencionar que he tratado que los captulos de la presente obra se mantengan fieles a la estructura original, para de esta manera facilitar la lectura a quienes ya leyeron la edicin anterior. Sin embargo, mucho contenido ha sido actualizado o mejorado. Algunos captulos han sido prcticamente reescritos, mientras que en otros los retoques son solo superficiales. No me queda ms que invitarlos a explorar el fascinante mundo de las comunicaciones unificadas. Por supuesto, usando Elastix.

-- Edgar Landivar Elastix Project Leader

Ir a ndice

http://www.elastixbook.com/es/Introduccion.htm[24/11/2011 10:21:12 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Ir a ndice

Siguiente

1
Introduccin a la telefona
No importa si yo muero, otros terminarn mi trabajo -- Mark Twain

1.1 Breve historia de la telefona


Sin duda la invencin de lo que hoy conocemos como telefona debi ser un acto asombroso en su tiempo, casi mgico. El or la voz en tiempo real de alguien ubicado en un sitio remoto saliendo de una misteriosa caja en una poca en la que esto era solo posible en la ciencia ficcin debi haber sido una experiencia nica y casi fantstica. De seguro que la idea de un aparato parlante ya rondaba por la cabeza de muchos inventores desde tiempos inmemoriales. Sin embargo, solo recin a inicios del siglo 19 fue cuando pareci algo alcanzable pues ya se haba descubierto la electricidad, inventado el telgrafo y algunos ya experimentaban con ondas de radio.

Los albores de la telefona


A mediados del siglo 19 hubo un interesante movimiento en torno a lo que hoy conocemos como telfono. En 1849 Antonio Meucci, mdico italiano considerado por muchos como el inventor del telfono, hizo una demostracin de un dispositivo capaz de transmitir voz en La Habana, Cuba. Pocos aos despus, en 1854, el mismo Meucci hace una nueva demostracin de su invencin en la ciudad de Nueva York, USA. Mientras Meucci se las daba a las tareas de inventor, otros tambin perseguan la idea de construir un telgrafo parlante y es as como en 1860 el alemn Johann Philipp Reis construye un dispositivo capaz de transmitir voz.
http://www.elastixbook.com/es/capitulos/capitulo_1/1.1_Breve_historia_telefonia.htm[24/11/2011 10:21:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Este aparato estaba basado en la idea original de Charles Bourseul quien a su vez describi la construccin de dicho dispositivo en 1854 pero nunca lo construy. Reis continu mejorando su aparato y un ao ms tarde ya estaba transmitiendo voz a ms de 100 metros de distancia.

Telfono de Reis

Un par de aos ms tarde Innocenzo Manzetti construye el esperado telgrafo parlante que l mismo haba visionado ya en 1844, pero no se interesa en patentarlo.

Los problemas con las patentes


Hasta este momento en la historia ya existan algunos prototipos de telfono pero nadie lo haba patentado. El primero en tratar de patentar el invento fue Meucci, quien en 1871 suscribi un documento de aviso de patente pero por su condicin econmica nunca pudo pagar el dinero para terminar este trmite y su documento expir pocos aos despus. Meucci nunca pudo comercializar su invento y alcanzar la prosperidad. En 1875, un ao despus de expirar el trmite de patente de Meucci, Alexander Graham Bell, un escocs radicado en los Estados Unidos, logra patentar un aparato similar y es el primero en hacerlo. Bell haba estado experimentando previamente con algunas ideas para concebir su dispositivo telefnico hasta que un da logr arrancarle a la electricidad algunos sonidos. Cuenta la historia que la primera llamada que hizo fue para decirle a su asistente las clebres frases Mr. Watson, come here. I want to see you. (Sr. Watson, venga. Necesito verlo.) Un hecho curioso que desat mucha polmica es que otro inventor llamado Elisha Gray tambin trat de patentar un invento similar tan solo unas pocas horas despus de Bell. Los dos inventores entraron en una conocida disputa legal que finalmente gan Bell. Gracias a la patente Bell pudo hacer de la idea del telfono un negocio rentable y tiene el mrito de haber desarrollado la idea y convertirla en algo prctico para la sociedad.

http://www.elastixbook.com/es/capitulos/capitulo_1/1.1_Breve_historia_telefonia.htm[24/11/2011 10:21:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Ilustracin de dos personas hablando por telfono a fines del siglo 19

Se cuenta que en determinado momento Bell trat de vender su patente a Western Union por $100 mil dlares pero el presidente de Western Union se neg pues consider que el telfono era nada ms que un juguete. Tan solo dos aos ms tarde el mismo directivo de Western Union le coment a sus colegas que si pudiera conseguir la patente de Bell por $25 millones de dlares lo considerara una ganga! Esto nos da una idea de cmo comenzaba a crecer el negocio de Bell en aquellos tiempos. En 1886, ya existan ms de 150,000 abonados telefnicos en los Estados Unidos. A partir de ese entonces la telefona poco a poco se empez a convertir en un servicio bsico de la sociedad actual.

El desarrollo de la tecnologa telefnica


Como sucede siempre con los avances tecnolgicos, la telefona continu evolucionando. Al principio para que un abonado se comunicara con otro ste tena que solicitarle la llamada a una operadora. Esta persona era quien conectaba manualmente los cables para conmutar un punto con el otro. En 1891 se invent un telfono automtico que permita marcar directamente. En un principio Bell fue exclusivamente la nica compaa en explotar la tecnologa debido a sus patentes. Sin embargo, cuando estas expiraron nacieron cientos de pequeas compaas que empezaron a prestar este servicio, la mayora en sitios rurales donde Bell an no llegaba. Poco a poco estas compaas empezaron a crecer y ya a inicios del siglo 20 tenan en su conjunto ms abonados que la propia Bell. La competencia hizo lo suyo y la tecnologa telefnica aceler su evolucin. Ya para finales de la segunda guerra mundial el servicio telefnico llegaba a millones de abonados. Cabe mencionar que los abonados arrendaban el aparato telfonico a la compaa telefnica como parte del contrato. En 1947, cientficos de Bell inventan el transistor y cambian el curso de la historia de la humanidad. En 1948 ganan el Premio Nobel por su trabajo. En los aos sesenta se lanzan los primeros satlites de comunicaciones y las comunicaciones entre continentes se facilitan. No est dems decir que esto no hubiera sido posible sin la previa invencin del transistor. En 1982, el Departamento de Justicia de los Estados Unidos gana un juicio a AT&T (nuevo nombre de Bell) en el cual esta ltima acuerda desmembrar la compaa en siete compaas regionales de telefona conocidas como

http://www.elastixbook.com/es/capitulos/capitulo_1/1.1_Breve_historia_telefonia.htm[24/11/2011 10:21:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Regional Bell Operating Companies (RBOCs) o Baby Bells. Todo esto a cambio de los derechos de ingresar en el mercado de las computadoras. A partir de sta y otras decisiones legales, los abonados pueden comprar sus propios aparatos telefnicos lo cual termina mermando el monopolio de AT&T. La compaa pierde mucha de su valuacin y se ve en graves problemas financieros. Es irnico que en el 2005, AT&T terminase siendo adquirida por una de las Baby Bells, SBC Communications. Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_1/1.1_Breve_historia_telefonia.htm[24/11/2011 10:21:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

1.2 Los principios de la transmisin de voz


La voz humana est compuesta por ondas acsticas que viajan a travs del aire a la velocidad del sonido, esto es a 1,244 Km/h (o 340 m/s). Esto es ms rpido que un avin comercial. Pero esta rapidez no significa que usted se pueda comunicar fcilmente con puntos distantes pues la voz humana se atena rpidamente, perdiendo energa a medida que viaja. Luego de unos pocos metros ya no podemos escuchar una conversacin. La voz humana por tanto es de la misma naturaleza que el resto de ondas acsticas y esto ya se conoca desde antes de la invencin del telfono. Antes de la invencin del telfono tambin se conoca que existan otros tipos de ondas llamadas ondas elctricas que podan ser transmitidas a travs de un conductor metlico como un cable de cobre. Este segundo tipo de ondas es de una naturaleza diferente a las ondas acsticas y viaja a la velocidad de la luz, es decir aproximadamente 300,000 Km/s. Esto es ms rpido de lo que podamos imaginar aunque para fines prcticos podemos decir que estas ondas se desplazan casi instantneamente de un punto a otro. Otra cosa interesante es que podemos controlar la atenuacin de estas ondas y hacerlas viajar grandes distancias. Con estos hechos conocidos ya a mediados del siglo 19 es ms fcil comprender que muchos persiguieran la idea de transformar las ondas acsticas en ondas elctricas para as poder luego transmitirlas a grandes distancias a travs de conductores metlicos. La cuestin es que haba que inventar un dispositivo para hacer dicha transformacin y all estaba la clave del asunto. Este dispositivo, conocido como micrfono en nuestros das es una parte importante de cualquier aparato telefnico.

Rango de frecuencias de la voz humana


Otra caracterstica importante de la voz humana es que las cuerdas vocales modulan la voz en un amplio espectro de frecuencias que van de graves a agudos en un rango aproximado de 200Hz a 7kHz. Todo un abanico de sonidos! Esto nos hace suponer que un micrfono debe ser capaz de capturar y transmitir todo este rango de frecuencias. Sin embargo, en la actualidad sabemos que para transmitir voz entendible no es necesario transmitir todas las frecuencias sino un rango mucho menor lo cual tiene sus ventajas pues facilita su transmisin como veremos ms adelante. Por lo tanto los telfonos comerciales solo transmiten un rango aproximado de 400Hz a 4kHz. Esto distorsiona en algo la voz aunque an es posible entender. Es por eso que cuando omos a alguien por telfono su voz suena ligeramente diferente que en la vida real pero aun as podemos entender la conversacin.

El micrfono
El micrfono fue un elemento clave en la invencin del telfono pues es el dispositivo que realiza la conversin de las ondas mecnicas a ondas elctricas. Hay muchos tipos de micrfonos que operan sobre diferentes principios. Uno que se us por mucho tiempo en telfonos era el de carbn que consista en una cpsula llena de granitos de carbn entre dos placas metlicas. Una de las placas era una membrana que vibraba con las ligeras presiones de las ondas de voz. De esta manera la resistencia elctrica de la cpsula variaba con la voz y se generaba una seal elctrica correspondiente.

http://www.elastixbook.com/es/capitulos/capitulo_1/1.2_Principio_transmision_de voz.htm[24/11/2011 10:21:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Micrfono de carbn extrado de telfono de disco

Otro tipo de micrfono muy comn en la actualidad es el dinmico o electro-magntico que consiste en una bobina de hilo de cobre enrollada sobre un ncleo de material ferromagntico. Este ncleo se encuentra sujetado a un diafragma que vibra con la presin de las ondas de voz. De esta manera se induce una ligera corriente elctrica en la bobina que es amplificada luego al interior del telfono.

Diagrama esquemtico de micrfono electro-magntico

Ancho de banda y capacidad de informacin


Ancho de banda puede ser un trmino difcil de entender al principio pues es un concepto bastante amplio. En general podemos decir que ancho de banda es una medida de la cantidad de informacin que podemos transmitir por un medio por unidad de tiempo. Debido a que es una medida por unidad de tiempo muchas veces se hace una analoga con la velocidad. Pero hay que estar atento a confusiones. Medidas comunes para expresar el ancho de banda son los bits por segundo. Esta medida se puede abreviar como bits/s, bps o baudios.

http://www.elastixbook.com/es/capitulos/capitulo_1/1.2_Principio_transmision_de voz.htm[24/11/2011 10:21:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

El ancho de banda es un trmino muy importante cuando se habla de telefona pues las comunicaciones en tiempo real necesitan un ancho de banda mnimo asegurado para entregar una comunicacin de calidad en su destino. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_1/1.2_Principio_transmision_de voz.htm[24/11/2011 10:21:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

1.3 Digitalizacin de la voz


Las redes digitales de transmisin de voz y datos son comunes en nuestra era. Fueron creadas ya que presentan ciertas ventajas sobre las redes analgicas como por ejemplo que conservan la seal casi inalterable a travs de su recorrido. Es decir, es ms difcil que la comunicacin se vea afectada por factores externos como el ruido elctrico. Adems nos provee de mtodos para verificar peridicamente la integridad de la seal, entre otras ventajas. Dicho fcil, digitalizar una seal de voz no es otra cosa que tomar muestras (a intervalos de tiempo regulares) de la amplitud de la seal analgica y transformar esta informacin a binario (1s y 0s). Este proceso de denomina muestreo.

Teorema de Nyquist
En 1928 Henry Nyquist, un ingeniero Suizo que trabajaba para AT&T, resolvi el dilema del nmero mnimo de muestras necesarias para poder reconstruir una onda a su forma original. El teorema propuesto dice que la frecuencia de muestreo debe ser como mnimo el doble de ancho de banda. Esto queda reflejado de mejor manera con la siguiente expresin.

fm 2 BWs
Hagamos un breve clculo acerca de cual sera la frecuencia de muestreo para poder convertir una seal de voz humana (anloga) a digital y luego poder reconstruirla en el destino. Ya habamos dicho que para que la voz humana sea entendible es suficiente transmitir un rango de frecuencias de entre 400Hz a 4kHz. Por lo tanto, segn el teorema de Nyquist deberamos muestrear al doble de la frecuencia mayor como mnimo, es decir a 8kHz. Ms adelante veremos que precisamente esta frecuencia de muestreo de 8,000Hz es la que se usa en la mayora de codecs. Gracias Nyquist! Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_1/1.3_Digitalizacio_voz.htm[24/11/2011 10:21:17 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

1.4 Redes orientadas a circuitos


Las redes orientadas a circuitos (circuit switched) son aquellas donde se establece un circuito exclusivo o dedicado entre los nodos antes de que los usuarios se puedan comunicar. Una vez que se establece un circuito entre dos puntos que quieren comunicarse, el resultado bsicamente es el equivalente a conectar fsicamente un par de cables de un extremo a otro. El circuito es exclusivamente reservado para uso de una conversacin y no puede ser usado por otros. En cada circuito el retardo es constante, lo cual es una ventaja. Sin embargo, este tipo de redes es costoso debido al mismo hecho de que se necesita un circuito dedicado para las conversaciones de cada abonado. Este tipo de redes es el tradicionalmente usado hoy en da por compaas telefnicas alrededor del mundo y es el mismo que us Bell en sus inicios; obviamente guardando las distancias tecnolgicas correspondientes. Es comn que ciertas personas confundan las redes de circuitos con las redes analgicas pero es necesario aclarar que las redes de circuitos bien pueden transportar datos digitalmente. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_1/1.4_Redes_orientadas_a_circuitos.htm[24/11/2011 10:21:18 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

1.5 Redes orientadas a paquetes


Las redes orientadas a paquetes (packet switched) son aquellas en las que se transmiten simultneamente diferentes flujos de informacin en un mismo medio. Para hacer esto, se divide el trfico de cada flujo de informacin en fragmentos o paquetes que se envan intercaladamente. Luego, en el destino los paquetes se reensamblan para reproducir el mensaje original.

Simulacin grfica de envo de informacin en una red orientada a paquetes

Un ejemplo de este tipo de redes son las redes IP como es el caso del Internet, donde por una misma conexin pueden transmitirse distintos flujos de informacin. De esta manera podemos atender una video-conferencia al mismo tiempo que enviamos un correo electrnico o navegamos por el Web. Inclusive por este tipo de redes pueden circular simultneamente flujos de informacin para diferentes destinos o direcciones IP. A diferencia de las redes orientadas a circuitos, en este tipo de redes el ancho de banda no es fijo ya que depende del trfico de la red en un momento dado. Adicionalmente, cada paquete de un mismo flujo de informacin no est obligado a seguir el mismo camino para llegar a su destino. Debido a esto, los paquetes que originalmente fueron generados en secuencia pueden llegar desordenados a su destino. Este tipo de factores son muy importantes a tener en cuenta cuando se trafica voz sobre una red de paquetes ya que afectan la calidad de la llamada. Las redes de paquetes se han vuelto populares, principalmente porque optimizan recursos debido al hecho de poder utilizar el mismo medio para enviar varios flujos de informacin.. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_1/1.5_Redes_orientadas_a_paquetes.htm[24/11/2011 10:21:19 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

1.6 Red Pblica Telefnica (PSTN)


La Red Pblica Telefnica o PSTN (por sus siglas en ingls) es esencialmente una red basada en circuitos. Esta red cubre tanto telefona fija como mvil y es quien hace posible que podamos comunicarnos con cualquier persona en nuestra ciudad o alrededor del mundo. Originalmente fue una red analgica aunque actualmente es una red digital en su mayor parte. Es importante revisar los dos tipos de circuitos: analgicos y digitales. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_1/1.6_Red_Publica_Telefonica.htm[24/11/2011 10:21:20 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

1.7 Circuitos analgicos


Los circuitos analgicos son comnmente pares de cobre que llegan a los abonados del servicio telefnico y por donde se transmite la seal elctrica de la voz de manera analgica. El mismo circuito lleva adicionalmente la sealizacin necesaria para establecer, mantener y terminar una llamada. Estos circuitos analgicos se deben conectar a un switch telefnico encargado de direccionar la comunicacin entre los abonados. Actualmente, los circuitos analgicos estn en decadencia pues las compaas telefnicas encontraron muchas ventajas en las comunicaciones digitales. Por esta razn, pese a que en la actualidad an vemos circuitos analgicos esto se trata tan solo de la ltima milla. En cierto punto de la red telefnica esta comunicacin se convierte a digital y es transmitida a un switch telefnico digital. Los circuitos analgicos se asocian comnmente con el trmino de telefona tradicional. Debido a que originalmente era ms comn que los telfonos estuvieran ubicados en reas rurales donde no llegaba la electricidad se decidi que la red telefnica proveyera cierto voltaje de alimentacin. Es por esto que algunos modelos de telfonos analgicos no necesitan conectarse a la alimentacin elctrica. En todo caso la Oficina Central (OC) genera 48 Voltios de corriente directa para alimentar a los telfonos de los abonados. Usando lxico estricto deberamos decir -48 Voltios debido a que este voltaje se mide con respecto a uno de los conductores. Sin embargo para ser prcticos en este libro usaremos indistintamente 48V o 48V para referirnos a lo mismo.

Sealizacin analgica
Para que las llamadas telefnicas funcionen correctamente es necesario contar con indicaciones o seales elctricas que nos permitan intercambiar informacin entre el abonado y la OC. En breve veremos en qu consisten las seales ms comunes. Existen bsicamente tres mtodos de sealizacin analgica que la industria ha desarrollado a travs de los aos. Estos se llaman loop start, ground start y kewlstart. Es importante cuando se configura una central telefnica que va conectada a una lnea analgica que escojamos el mtodo de sealizacin adecuado pues caso contrario podemos encontrarnos con problemas extraos como que la lnea se cuelga inesperadamente o que no podemos colgar la lnea correctamente, entre otras cosas. La diferencia entre loop start y ground start radica en la manera en la que el telfono requiere tono de marcado a la OC (proceso tambin llamado seizure). Ground start requiere tono de marcado aterrizando (de all el trmino ground) uno de los conductores de la lnea telefnica mientras que loop start lo hace realizando un corto circuito entre ambos conductores (es decir creando un lazo o loop). Kewlstart es una evolucin de loop start que le aade un poco ms de inteligencia a la deteccin de desconexiones (colgado de la llamada) pero bsicamente sigue siendo un loop start. Debido a que ground start no es muy comn en nuestros das, casi siempre nos veremos usando loop start.

http://www.elastixbook.com/es/capitulos/capitulo_1/1.7_Circuitos analogicos.htm[24/11/2011 10:21:24 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

A continuacin explicaremos ms detalladamente la sealizacin analgica para los eventos ms comunes. Para hacerlo nos basaremos en el progreso de una llamada tpica usando sealizacin loop start. El progreso de una llamada lo podemos dividir en seis instancias: colgado (on-hook), descolgado, marcacin, conmutacin, ringado y conversacin.

Colgado Mientras el telfono est colgado la OC provee un voltaje DC de 48 Voltios. El telfono mantiene un circuito abierto con la lnea telefnica; es decir que acta como si no estuviera conectado y por lo tanto no fluye corriente por la lnea. Este estado tambin es conocido como on-hook por su significado en ingls.

Descolgado Cuando el usuario descuelga el auricular el telfono enva una seal a la OC. Esta seal consiste en cerrar el circuito. Es decir, internamente el telfono conecta entre s los dos cables de la lnea telefnica a travs de una resistencia elctrica. Apenas la OC se da cuenta de esto enva tono de marcado al telfono. Este tono de marcado le indica al abonado que ya puede marcar el nmero. En gran parte de Amrica el tono de marcado consiste en dos ondas senoidales enviadas simultneamente. Estas ondas son de 350 Hz y 440 Hz. En Europa el tono de marcado consiste en una sola onda de 425 Hz. Sin embargo hay pases en los que estos valores podran ser diferentes. Nota: Cuando era adolescente acostumbrbamos a afinar la guitarra escuchando el tono de marcado del telfono pues resulta que 440 Hz es la frecuencia de la nota musical LA (A) que corresponde a la quinta cuerda de la guitarra.

Marcacin La marcacin puede ser por pulsos o por tonos. Los pulsos ya casi no se usan y fueron populares en los tiempos de los telfonos de disco. Los tonos son pares de frecuencias asociadas con los dgitos telefnicos. Estas frecuencias se transmiten hasta la OC quien traduce estos tonos a nmeros. Ms adelante se explicar ms de estos tonos bajo el ttulo DTMFs.

Conmutacin Una vez recibido los dgitos, la OC tratar de asociar este nmero marcado con el circuito de un abonado. En caso de que el destinatario no fuere un abonado local, enviar la llamada a otro switch telefnico para su terminacin. Cabe resaltar que la conmutacin hoy en da es completamente automtica a diferencia del pasado cuando era trabajo de la operadora.

http://www.elastixbook.com/es/capitulos/capitulo_1/1.7_Circuitos analogicos.htm[24/11/2011 10:21:24 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Ringado o Timbrado Una vez que la OC encuentra al abonado destinatario tratar de timbrarlo (ringing). La seal de ring es una onda senoidal de 20 Hz y de 90 Voltios de amplitud. Nota: Si hemos sido observadores nos habremos dado cuenta de que la seal de ring tiene una amplitud considerable de 90 Voltios. Adems recordemos que la lnea ya tiene un componente adicional de Voltaje DC de 48 Voltios. Es por esta razn que si manipulamos los cables telefnicos desnudos en el preciso momento en el que llega una seal de ring podemos recibir una pequea descarga elctrica y pasar un buen susto. Adicionalmente a la seal de ring que la OC enva al destinatario tambin enva una notificacin a quien origin la llamada. Este tono audible recibe el nombre de ring-back y consiste en dos ondas senoidales superpuestas de 440 Hz y 480 Hz. Estas ondas van intercaladas con espacios de silencio. En caso de que el destinatario se encuentre ya en una llamada activa entonces en lugar del ring-back se devuelve un tono de ocupado (busy) a quien origin la llamada. Este tono de ocupado consiste en dos ondas sinusoidales superpuestas de 480 Hz y 620 Hz intercaladas con espacios de silencio de medio segundo. Todos los lectores sin duda han escuchado un ring-back y un tono de ocupado (busy) alguna vez en sus vidas.

Conversacin Si el destinatario decide contestar la llamada el telfono cerrar el circuito telefnico (de la misma manera que ocurri con el telfono que origin la llamada en la etapa de descolgado). Esta seal le informar a la OC que el destinatario decidi contestar y completar la conexin. La llamada telefnica est finalmente en curso.

DTMFs
Muchas veces es necesario enviar dgitos a travs de la lnea telefnica tanto para marcar como en medio de una conversacin. Con esta finalidad se pensaron los DTMFs. DTMF es un acrnimo de Dual-Tone Multi-Frequency. Es decir que cada DTMF es en realidad dos tonos mezclados enviados simultneamente por la lnea telefnica. Esto se hace as para disminuir los errores. A continuacin una tabla ilustrando los pares de frecuencias para cada dgito. 1209 Hz 1 4 7 * 1336 Hz 2 5 8 0 1477 Hz 3 6 9 # 1633 Hz A B C D

697 Hz 770 Hz 852 Hz 941 Hz

Como se puede ver en la tabla tambin hay correspondencias para los signos * y # as como tambin para los caracteres A, B, C y D.

El telfono analgico
http://www.elastixbook.com/es/capitulos/capitulo_1/1.7_Circuitos analogicos.htm[24/11/2011 10:21:24 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Es importante hablar de este componente importante de la red telefnica pues recordemos que su invencin fue lo que marc el desarrollo del negocio de la telefona. El telfono analgico todava es el tipo de telfono ms comn en el planeta y la comprensin de su funcionamiento nos permitir entender ms adelante algunos conceptos clave como por ejemplo el eco. En realidad el telfono analgico, en su forma ms bsica, es un dispositivo sencillo compuesto de unos cuantos componentes. Auricular Micrfono Switch para colgado/descolgado Convertidor de dos a cuatro hilos (tambin llamado hbrido) Marcador (dialer) Campana o dispositivo de timbrado

Diagrama de componentes de un telfono analgico

La mayora de los componentes se explican por si solos. Sin embargo algunos lectores se preguntarn de qu se trata el convertidor de 2 a 4 hilos tambin conocido como hbrido.

Convertidor de 2 a 4 hilos Un componente importante de un telfono analgico es el convertidor de 2 a 4 hilos, conocido tambin como dispositivo 2H/4H, bobina hbrida o simplemente hbrido. Este dispositivo es necesario para separar la seal de audio de ida de la de regreso ya que son dos los participantes en una conversacin y solo existe un par de cables. Si existieran tres o cuatro cables (2 de ida y 2 de venida) el convertidor de 2 a 4 hilos no fuera necesario, pero esto probablemente incrementara los costos de cableado y las compaas telefnicas prefieren lidiar con los problemas de acoplamiento que este convertidor introduce en lugar de incrementar sus costos. En general no existe convertidor de 2 a 4 hilos perfecto ya que es muy difcil separar las seales de ida y de regreso completamente. Es por eso que este dispositivo histricamente ha sido una de las causas de eco en lneas telefnicas mal acopladas. Ya hablaremos ms de esto en el captulo Calidad de voz.

http://www.elastixbook.com/es/capitulos/capitulo_1/1.7_Circuitos analogicos.htm[24/11/2011 10:21:24 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_1/1.7_Circuitos analogicos.htm[24/11/2011 10:21:24 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

1.8 Circuitos digitales


La PSTN tambin sirve a sus abonados con circuitos digitales. Estos circuitos ofrecen la ventaja de poder multiplexar ms de una lnea en el mismo medio por lo que resulta atractivo para abonados con necesidades de un gran nmero de lneas telefnicas, por lo general empresas.

La base DS-0
Para decirlo simple, DS-0 es un canal digital de 64Kbit/s. Un DS-0 es por tanto una medida de canal estndar o unidad que nos sirve para definir mltiplos mayores como los circuitos que veremos a continuacin.

Circuitos T-carrier y E-carrier


Los circuitos T-carrier (o portadora-T) fueron diseados como nomenclatura para circuitos digitales mutiplexados y fueron desarrollados por Bell Labs hace ms de cincuenta aos. Los circuitos E-carrier son la equivalente europea. El ms conocido de los circuitos T-carrier es el popular T1 (y su contraparte E1). Un T1 es un circuito digital compuesto de 24 DS-0s mientras que un E1 est compuesto por 32 DS-0s. Si hacemos las matemticas notaremos que un T1 trafica 1.544 Mbit/s mientras que un E1 trafica 2.048 Mbit/s. Existen mltiplos mayores de T1 como T2, T3, y T4, los que se relacionan en la siguiente proporcin. 1 T4 = 6 T3 = 42 T2 = 168 T1

SONET y Circuitos pticos


SONET (Synchronous optical networking) fue desarrollado con el objetivo de contar con una nomenclatura similar a las T-carrier pero usando la tecnologa de fibra ptica. SONET utiliza mltiplos de T3 para sus anchos de banda y su circuito base es el llamado OC-1 equivalente a 1 T3. Existen mltiplos mayores de OC-1 como OC-3, OC-12, OC-24, OC-48, entre otros. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_1/1.8_Circuitos digitales.htm[24/11/2011 10:21:25 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

1.9 Protocolos de Sealizacin Digital


Los protocolos de sealizacin se utilizan para transmitir informacin de estado del canal de comunicaciones (como desconectado, timbrando, respondido), informacin de control y otra informacin como DTMFs, caller ID, entre otros. Estos protocolos se pueden agrupar en dos tipos llamados Sealizacin Asociada al Canal (CAS, por el acrnimo en Ingls) y Sealizacin de Canal Comn (CCS, por el acrnimo en Ingls). La diferencia es que mientras CAS transmite la sealizacin en el mismo canal en que viaja la informacin, CCS la transmite en un canal separado. Es por esto que con CAS se reduce ligeramente el ancho de banda disponible para la comunicacin ya que una parte de l se est usando para sealizacin. Esa es una de las razones por las cuales las compaas telefnicas han adoptado en su mayora CCS. Nota: No confunda el lector CAS y CCS con protocolos de sealizacin. Tan solo son tipos de protocolos que se explican aqu para hacer ms fcil la categorizacin o agrupacin de los mismos.

Sealizacin Asociada al Canal (CAS)


El protocolo de tipo CAS ms conocido es robbed-bit y es usado en circuitos T1 y E1 alrededor del mundo. Robbed-bit toma (o roba, de all su nombre) el octavo bit de cada canal de comunicacin cada seis frames y lo reemplaza por informacin de sealizacin. El bit original robado simplemente se pierde. Nota: Como ejemplo para el lector, cada frame T1 consiste de 193 bits, 8 bits por cada uno de los 24 canales ms 1 bit de framing. Hay que notar de lo anterior que esto es posible debido a que la voz no es muy sensible a la prdida de ese bit de informacin ya que es el bit menos significativo. Sin embargo, cuando transportamos data (al contrario de la voz) la prdida de un bit no puede pasar desapercibida y la calidad de la transmisin se degrada de manera sensible. Otro protocolo de tipo CAS que an subsiste en nuestros das es R2. Se trata de un protocolo que fue popular en los aos sesenta. En realidad R2 es una familia de protocolos donde cada implementacin se denomina variante. Existen variantes dependiendo del pas o inclusive de la compaa telefnica que lo ofrece. Nota: Antes de la versin 1.6 Elastix soportaba el protocolo R2 utilizando la librera Unicall (http://www.soft-switch.org/unicall/installing-mfcr2.html), pero a partir de la versin 1.6 el soporte fue cambiado para utilizar la implementacin del proyecto openR2 desarrollado por Moiss Silva (www.libopenr2.org).

Sealizacin de Canal Comn (CCS)


El mejor ejemplo de protocolo de tipo CCS es el Integrated Services Digital Network (ISDN). Este protocolo nos permite transmitir voz y datos simultneamente sobre pares telefnicos de cobre con calidad
http://www.elastixbook.com/es/capitulos/capitulo_1/1.9_Protocolos_Senalizacion_Digital.htm[24/11/2011 10:21:26 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

superior a las lneas telefnicas analgicas. El objetivo de ISDN fue el de facilitar las conexiones digitales para poder ofrecer una amplia gama de servicios integrados a los usuarios. ISDN establece dos tipos de interfaces para cumplir con este fin. BRI: Basic Rate Interface PRI: Primary Rate Interface Un BRI supone 2 canales tiles (tambin llamados canales B) de 64Kbit/s cada uno, ms un canal de sealizacin de 16Kbit/s (tambin llamado canal D) que en total suman 144Kbit/s. BRI estaba llamado a ser un estndar popular en hogares pero no fue as del todo y tuvo muy poca acogida en este segmento del mercado en los Estados Unidos. En Europa la situacin fue diferente y actualmente es utilizado en muchos pases de este continente. PRI es la opcin ideal para usuarios de mayor envergadura como negocios o empresas pues puede aglutinar ms canales B. Actualmente es muy popular y se transmite sobre circuitos T-carrier y E-carrier. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_1/1.9_Protocolos_Senalizacion_Digital.htm[24/11/2011 10:21:26 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

2
Introduccin a la VoIP
Yo no hice nada por accidente, ni tampoco fueron as mis invenciones; ellas vinieron por el trabajo -- Thomas Edison La voz sobre IP o VoIP consiste en transmitir voz sobre protocolo IP. Dicho as puede sonar simple pero las redes IP fueron diseadas principalmente para datos y muchas de las ventajas de las redes IP para los datos resultan ser una desventaja para la voz. Esto se debe a que la voz es muy sensible a retardos y problemas de transmisin por muy pequeos que estos sean. Transmitir voz sobre protocolo IP es entonces toda una empresa con muchos problemas tcnicos que resolver. Por suerte la tecnologa ha evolucionado y la pericia de algunos ingenieros talentosos ha resultado en que podamos abstraernos en gran medida de aquellos problemas inherentes a las redes IP que perjudican la calidad de voz. La evolucin de la calidad de las comunicaciones de voz sobre IP en los ltimos aos ha sido realmente sorprendente. Actualmente podemos decir que la transmisin de voz por Internet ya es una alternativa rentable al alance de la mayora de nosotros.

2.1 VoIP: una sopa de protocolos


Hay muchos protocolos involucrados en la transmisin de voz sobre IP. Ya de por s hay protocolos de red involucrados como el propio protocolo IP y otros protocolos de transporte como TCP o UDP. Encima de ellos se colocan los protocolos de sealizacin de voz. Como si esto fuera poco existen adems muchas opciones de protocolos de sealizacin disponibles lo que puede hacer que todo suene un poco confuso al principio.

http://www.elastixbook.com/es/capitulos/capitulo_2/2.1_VoIP_sopa_de protocolos.htm[24/11/2011 10:21:28 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Sopa de protocolos VoIP

Clasificando los protocolos VoIP


Para simplificar las cosas podramos clasificar a los protocolos utilizados en la VoIP en tres grupos: protocolos de sealizacin, de transporte de voz y de plataforma IP.

Protocolos de sealizacin Los protocolos de sealizacin en VoIP cumplen funciones similares a sus homlogos en la telefona tradicional, es decir tareas de establecimiento de sesin, control del progreso de la llamada, entre otras. Estos protocolos se encuentran en la capa de sesin (capa 5) del modelo OSI. Existen algunos protocolos de sealizacin, que han sido desarrollados por diferentes fabricantes u organismos como la ITU o el IETF, y que se encuentran soportados por Asterisk. Algunos son: SIP IAX H.323 MGCP SCCP Entre estos los ms populares en el mbito de Asterisk son SIP e IAX. Ms adelante en este libro entraremos en ms detalles acerca del protocolo SIP.

Protocolos de transporte de voz No se debe confundir los protocolos de transporte de voz con protocolos de transporte de bajo nivel como TCP y UDP. Nos referimos aqu al protocolo que transporta la voz propiamente dicha o lo que comnmente se denomina
http://www.elastixbook.com/es/capitulos/capitulo_2/2.1_VoIP_sopa_de protocolos.htm[24/11/2011 10:21:28 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

carga til. Este protocolo se llama RTP (Real-time Transport Protocol) y su funcin es simple: transportar la voz con el menor retraso posible. Este protocolo entra a funcionar una vez que el protocolo de sealizacin ha establecido la llamada entre los participantes.

Protocolos de plataforma IP En esta categora agruparemos a los protocolos bsicos en redes IP y que forman la base sobre la cual se aaden los protocolos de voz anteriores. En estos protocolos podramos mencionar a Ethernet, IP, TCP y UDP. Nota: En el presente captulo pondremos nfasis en explicar este grupo de protocolos con el objetivo de nivelar a quienes no tengan conocimientos slidos en Networking. Sin embargo, los otros grupos de protocolos se revisarn con ms detalle en un captulo especial dedicado a este fin.

Protocolos involucrados en una llamada SIP. El caso de IAX es muy similar.

En la figura anterior podemos observar un hecho curioso y es que pese a que SIP soporta tanto UDP como TCP slo lo vemos posado sobre UDP. No se trata de un error sino ms bien que en Asterisk la implementacin de SIP solo est disponible para UDP. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_2/2.1_VoIP_sopa_de protocolos.htm[24/11/2011 10:21:28 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

2.2 Protocolo IP
El protocolo IP sin duda es uno de los ms populares jams implementados, principalmente por el auge de la gran red de redes llamada Internet, que utiliza este protocolo para su enrutamiento. Por esta razn, antes de entrar en detalles acerca del protocolo IP emplearemos un par de prrafos para resumir los orgenes del Internet.

El Internet
El Internet tuvo su origen en la dcada del sesenta como un proyecto del Departamento de Defensa de los Estados Unidos con el objetivo de crear una red robusta que conectara algunos organismos pblicos con universidades. La idea de la red, que originalmente se llam ARPANet, era que si alguno de los nodos quedaba fuera de funcionamiento esto no perjudicara significativamente a la red. Para esto se ide una red descentralizada que pudiera manejar ms de un camino entre dos de sus puntos. En resumen, se trataba de construir una red a prueba de fallos (recordemos tambin que eran pocas de la Guerra Fra) y de bajo coste. Gracias a este enfoque ARPANet evolucion hasta lo que hoy en da conocemos como Internet, una red de comunicaciones tan grande y poderosa que sin duda ha ejercido un impacto en nuestras culturas. Sin su existencia el proyecto Elastix no hubiera existido y no estaran leyendo esto ahora.

Qu es el protocolo IP?
El protocolo IP (Internet Protocol) trabaja a nivel de red donde la informacin se enva en paquetes llamados paquetes IP. Este protocolo ofrece un servicio sin garantas tambin llamado de mejor esfuerzo. Es decir que nada garantiza que los paquetes lleguen a su destino, aunque se har lo posible por hacerlos llegar.

Direccin IP
Una direccin IP es un nmero nico que provee adems informacin de cmo ubicar al equipo que la posee. Para que este nmero sea nico existe una autoridad que controla la asignacin de direcciones IP llamada IANA (Internet Assigned Numbers Authority). Este nmero nico es binario y consta de 32 bits. Sin embargo, para fines prcticos y hacer que este nmero sea ms entendible para los humanos casi siempre se representa en un formato de 4 nmeros decimales separados por puntos. Cada uno de estos cuatro nmeros decimales puede tomar un valor de 0 a 255. Un ejemplo de direccin IP es 172.16.254.1

Traduccin de notacin decimal a binaria (32 bits) de una direccin IP

http://www.elastixbook.com/es/capitulos/capitulo_2/2.2_Protocolo_IP.htm[24/11/2011 10:21:29 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Paquete IP
Como habamos dicho antes, el protocolo IP es un protocolo que divide la informacin en paquetes que enva a su destino. La ventaja de tener la informacin paquetizada es que estos paquetes pueden tomar diferentes caminos para llegar a destino. Es decir que hay redundancia de caminos y es menos probable que todos los paquetes se pierdan. Algunos lectores se preguntarn cmo lucen los famosos paquetes? El formato de un paquete IP est diseado para llevar informacin que permita diseccionarlo a su destino y obviamente que permita re-ensamblar los paquetes en el destino para recuperar la informacin til. A continuacin una figura con una cabecera de paquete IP.

Cabecera de un paquete IP

Direccionamiento IP
El direccionamiento o enrutamiento permite determinar la ruta ptima para que un paquete IP llegue su destino. Para saber dnde quiere llegar un paquete dado, hay que examinar la direccin IP de destino en el campo Destination Address de la cabecera de un paquete IP. Los equipos que se encargan de enrutar los paquetes a su destino se llaman ruteadores y bsicamente contienen tablas de rutas con informacin sobre cmo alcanzar otras redes. Por tanto, una vez que llega un paquete a un ruteador ste examina la direccin IP de destino y trata de determinar a qu red pertenece esa direccin IP. Determinar la red donde quiere llegar un paquete dado no es muy difcil puesto que esa informacin es parte de la direccin IP. Esto es porque cada direccin IP se podra dividir en dos partes: una parte que identifica a la red y otra que identifica al equipo (tambin llamado host). Identificar cada una de estas partes no es tan trivial pues existen redes de diferentes tamaos y el nmero de bits que corresponden a la red y al host varan respectivamente. La solucin es un parmetro adicional llamado mscara de red.

Mscara de red y clculo de direccin de red Veamos entonces cmo se obtiene la informacin sobre la red a la cual pertenece una direccin IP para que un
http://www.elastixbook.com/es/capitulos/capitulo_2/2.2_Protocolo_IP.htm[24/11/2011 10:21:29 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

ruteador pueda encaminar correctamente un paquete a su destino. La mscara de red es un nmero de 32 bits al igual que una direccin IP. Se llama mscara porque si se superpone a la direccin IP nos permite identificar cul parte es la que corresponde a la direccin de red y cul a la direccin del host. Imaginemos que tenemos la direccin IP 130.5.5.26 con mscara 255.255.255.0. Para ilustrar cmo aplicar la mscara sobre la direccin IP convirtamos estos datos a binario como lo muestra el diagrama a continuacin.

Aplicacin de mscara para obtener informacin de la red y host

Ahora podemos ver con ms claridad que los nmeros uno (1) en la mscara marcan el lmite entre la parte de la red y la parte del host por lo tanto la direccin de red es (en binario): 10000010.00000101.00000101.00000000 Todos los nmeros binarios a la derecha de la parte de red en la mscara se completan con ceros. Convirtamos ahora la direccin de red anterior a decimal. Veamos qu obtenemos: 10000010.00000101.00000101.00000000 130.5.5.0

Lo que quiere decir que la direccin IP 130.5.5.26 pertenece a la red 130.5.5.0. Ahora el ruteador ya puede decidir hacia qu red enviar nuestro paquete IP. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_2/2.2_Protocolo_IP.htm[24/11/2011 10:21:29 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

2.3 Protocolos de transporte


Nota: No se debe confundir estos protocolos con el protocolo de transporte de voz RTP. RTP es un protocolo ms especializado que incluso se monta sobre UDP (un protocolo que ser explicado aqu). Los protocolos de transporte aqu cubiertos son de propsito general y reposan directamente sobre el protocolo IP.

Protocolo TCP
Como ya habamos dicho el protocolo IP no garantiza que los datos lleguen a destino. Solo hace su mejor esfuerzo para que lleguen. Debido a esto es necesario un protocolo que se encargue de controlar la transmisin de datos y por esta razn se dise lo que se llama Transmission Control Protocol o simplemente TCP. Este es un protocolo de transporte que se transmite sobre IP. TCP ayuda controlando que los datos transmitidos se encuentren libre de errores y sean recibidos por las aplicaciones en el mismo orden en que fueron enviados. Si se pierden datos en el camino, TCP introduce mecanismos para que estos datos sean reenviados. Obviamente esto implica una carga extra de informacin en el flujo de datos ya que hay que enviar informacin de control adicional. Es por esto que TCP es un buen protocolo para control de sesiones pero no tan bueno para la transmisin de informacin en tiempo real como la voz. Sin embargo, TCP juega un rol muy importante en muchos protocolos relacionados con un servidor Elastix. TCP es quien introduce el concepto de puerto que no es otra cosa que una abstraccin para poder relacionar los flujos de datos con servicios de red especficos (o protocolos de ms alto nivel). Por ejemplo, el puerto 80 se asocia con el servicio de Web o el protocolo HTTP, mientras que el puerto 25 se asocia con el servicio de correo electrnico o protocolo SMTP.

Protocolo UDP
UDP (User Datagram Protocol) es otro protocolo de transporte. Se diferencia con TCP en que a este protocolo no le importa si los datos llegan con errores o no y tampoco le importa si llegan en secuencia. La pregunta entonces es para qu sirve este protocolo? Bueno, un protocolo de transporte no necesariamente tiene que garantizar que la informacin llegue a destino o llegue en secuencia. Esta es solo una caracterstica extra. Es ms o menos anlogo a un servicio de transporte de mercanca. Imaginmonos una flota de motocicletas que ofrece el servicio de transporte en una ciudad e imaginmonos que le encomendamos a dicha flota la tarea de transportar un gran cargamento de archivos de una oficina u otra. La compaa se encargar de dividir nuestro cargamento de archivos y distribuirlo en cantidades o paquetes que puedan ser transportados en sus vehculos. La flota har lo necesario para que nuestro cargamento llegue a su destino. Esto es en esencia el servicio de transporte. Sin embargo podemos escoger dos clases de servicio: una que garantiza que la mercanca llegue segura y otra que no. Estos dos tipos de servicio son anlogos a los dos tipos de protocolos de transporte que estamos describiendo en este apartado UDP y TCP.

http://www.elastixbook.com/es/capitulos/capitulo_2/2.3_Protocolos_transporte.htm[24/11/2011 10:21:34 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

En fin, UDP divide la informacin en paquetes, tambin llamados datagramas, para ser transportados dentro de los paquetes IP a su destino. Al no ser necesario incluir mucha informacin de control, el protocolo UDP reduce la cantidad de informacin necesaria en los paquetes por lo que es un protocolo ms rpido que TCP. Esto lo hace adecuado para transmisin de informacin que debe ser transmitida en tiempo real como la voz. Es por esta razn que la voz en aplicaciones de VoIP es transmitida sobre este protocolo. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_2/2.3_Protocolos_transporte.htm[24/11/2011 10:21:34 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

2.4 Codificacin de la voz


Ya tenemos claro que para transportar la voz se utilizan algunos protocolos como SIP, IAX y otros comoRTP o RTCP. Pero la voz es una onda analgica que necesita transformarse a digital en algn formato antes de ser transmitida. Lgicamente podramos tratar de transmitirla tal cual resulta de la conversin analgica-digital (conocida como Analog-to-Digital Conversion, o ADC) pero resulta que nos encontramos en una red de paquetes as que debemos paquetizar esta informacin. Adems existe la oportunidad de comprimir el resultado de la conversin ADC con algn algoritmo para no desperdiciar recursos de la red. La bsqueda de un formato de compresin ptimo gener algunas alternativas de formatos de transmisin llamadas codecs. Nota: Los codecs realmente no son exclusivos de la VoIP pues tambin se usan en otros tipos de comunicaciones digitales.

Codecs
La palabra codec proviene de abreviar las palabras codificacin y decodificacin. Su funcin principal es la de adaptar la informacin digital de la voz para obtener algn beneficio. Este beneficio en muchos casos es la compresin de la voz de tal manera que podamos utilizar menos ancho de banda del necesario. Algunos codecs soportados por Asterisk y comnmente usados en comunicaciones de VoIP son G.711, G.722, G.729, GSM, iLBC, entre otros. Revisemos brevemente cuatro de ellos: G.711, G.722, G.729 y GSM.

G.711 G.711 es uno de los codecs ms usados de todos los tiempos y proviene de un estndar ITU-T que fue liberado en 1972. Viene en dos sabores llamados u-law y a-law. La primera versin se utiliza en los Estados Unidos y la segunda se utiliza en Europa. Una de sus caractersticas es la calidad de voz debido a que casi no la comprime. Utiliza un muestreo de 8 bits a 8kHz resultando en 64kbit/s. Es el codec recomendado para redes LAN pero hay que pensarlo dos veces antes de utilizarlo en enlaces remotos debido al alto consumo de ancho de banda. El soporte para este codec viene habilitado por defecto en Elastix.

G.722 G.722 ofrece una taza de muestreo de 14 bits a 16 kHz, es decir mucho mayor a G.711. En otras palabras recupera
http://www.elastixbook.com/es/capitulos/capitulo_2/2.4_Codificacion_de_la_voz.htm[24/11/2011 10:21:34 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

ms informacin de la seal de audio y por lo tanto se dice que la calidad de la voz es superior. De hecho es el codec utilizado en muchos de los telfonos VoIP marcados como de alta definicin o HD (High Definition). Algo muy interesante de G.722 es que pese a tener una taza de muestreo mayor a la de G.711 y de que la resolucin de cada muestra es tambin mayor a la de dicho codec, el consumo de ancho de banda es casi el mismo, es decir 64kbit/s. Esto es posible debido a que G.722 utiliza un algoritmo diferente. Si analizamos rpidamente el ancho de banda de voz humana que este codec puede capturar (de acuerdo al teorema de Nyquist estudiado en el captulo anterior), veremos que la taza de muestreo de 16kHz nos permite digitalizar frecuencias de hasta 8kHz. Es decir una banda del doble de ancho que G.711, incluyendo frecuencias altas. Estas frecuencias altas contienen matices agudos que hacen que la voz sea ms entendible y clara. Con la reciente aparicin en el mercado de telfonos que dicen proveer audio de Alta Definicin (HD) hemos visto un incremento en el uso de este codec. El lector podra pensar entonces que se trata de una tecnologa nueva. Sin embargo, G.722 es un estndar de 1988.

G.729 Este tambin se trata de una recomendacin ITU cuyas implementaciones ha sido histricamente licenciadas. Esto quiere decir que usualmente hay que pagar por ellas. La ventaja en la utilizacin de G.729 radica principalmente en su alta compresin y por ende bajo consumo de ancho de banda. Esto lo hace atractivo para comunicaciones por Internet. Pese a su alta compresin no deteriora la calidad de voz significativamente y por esta razn ha sido ampliamente usado a travs de los aos por muchos fabricantes de productos de VoIP. G.729 utiliza 8kbit/s por cada canal. Si comparamos este valor con el de G.711 (64kbit/s) notaremos que consume 8 veces menos ancho de banda, lo cual a simple vista es un ahorro de recursos significativo. Nota: Existen variaciones de G.729 que utilizan 6.4kbit/s y 11.8kbit/s. Para habilitar canales G.729 en Elastix se debe adquirir una licencia por cada canal.

GSM Muchas personas correctamente asumen que el codec GSM tiene algo que ver con el estndar de comunicaciones celulares. El estndar que define la tecnologa celular GSM (Global System for Mobile communications) incluye este codec. La ventaja de este codec tambin es su compresin. Sin embargo, la calidad de voz se deteriora en relacin a otros codecs. Ya nos habremos fijado en esto cuando hemos hablado por un celular GSM alguna vez. GSM comprime aproximadamente a 13kbit/s y viene habilitado por defecto en Elastix. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_2/2.4_Codificacion_de_la_voz.htm[24/11/2011 10:21:34 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

2.5 Sobrecarga de protocolos


Por lo anteriormente visto, para transportar la voz de un lugar a otro en una red de paquetes necesitamos la ayuda de algunos protocolos. As tambin, ya nos habremos dado cuenta de que estos protocolos transmiten data adicional que ocupa ancho de banda adicional a la voz propiamente dicha. Algunos de ellos son Ethernet, IP, UDP y RTP. En resumen, esto hace que el ancho de banda real para transmitir la voz sea mayor al del codec. Por ejemplo, para transmitir voz usando G.711 en teora deberamos usar 64Kbps (peso del codec) cuando en realidad usamos 95.2Kbps de ancho de banda. En otros codecs de mayor compresin la sobrecarga es incluso ms significativa (porcentualmente hablando). Hagamos un ejercicio sencillo usando como ejemplo el codec G.711. Veamos la siguiente figura para ilustrar mejor el ejercicio.

Ilustracin de la sobrecarga de protocolos usando G.711

Calculemos el ancho de banda para G.711 basndonos en la figura anterior, la cual nos muestra el desperdicio u overhead de cada protocolo. Sumemos ahora todos estos bytes enviados. Bytes transmitidos por cada 20ms de audio = 38 + 20 + 8 + 12 + 160 = 238 bytes Bits transmitidos por cada 20ms de audio = 238 bytes * 8 bits/byte = 1904 bits Bits transmitidos cada segundo = 1904 bits/20ms * 1000 ms/seg . = 95,200 bits/s = 95.2Kbps!

Comparativa de codecs
A continuacin mostramos una tabla que muestra el overhead para algunos de los codecs ms populares soportados por Asterisk.
http://www.elastixbook.com/es/capitulos/capitulo_2/2.5_Sobrecarga_de_protocolos.htm[24/11/2011 10:21:36 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Codec G.711 iLBC G.729A Anterior

Ancho de cdec 64 Kbps 15.2 Kbps 8 Kbps

banda Ancho de banda real Porcentaje de overhead Ethernet 95.2 Kbps 48.75% 46.4 Kbps 205.26% 39.2 Kbps 390% Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_2/2.5_Sobrecarga_de_protocolos.htm[24/11/2011 10:21:36 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

3
Linux para Administradores de Elastix
Slo los dbiles hacen copias de seguridad en cintas: los hombres de verdad tan solo suben sus cosas importantes a un servidor ftp, y dejan que el resto del mundo las replique. -- Linus Torvalds, creador de Linux

3.1 Introduccin
En este captulo se repasarn algunos conceptos tiles de Linux para facilitan la tarea de los administradores de Elastix. Si usted ya conoce cmo administrar su Elastix desde la lnea de comandos de Linux puede saltarse este captulo e ir directamente al siguiente. Debido a que este no es un libro de Linux, no ahondaremos mucho en el tema ni hablaremos de la historia de Linux ni de sus ventajas. Si al leer este captulo en algn momento le parece que estamos abordando los temas de manera muy general, esta ha sido la intencin . Aunque este capitulo es un buen comienzo para el lector sin experiencia en Linux, le recomendamos capacitarse en su administracin ya que sin duda le facilitar las tareas como administrador de Elastix. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_3/3.1_Introduccion.htm[24/11/2011 10:21:36 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

3.2 Lnea de comandos de Linux


Una manera muy cmoda de administrar Elastix es desde la lnea de comandos de Linux. La lnea de comandos de Linux nos permite explotar al mximo el potencial de nuestro servidor de comunicaciones unificadas. Podemos ingresar a la lnea de comandos directamente conectando un monitor y un teclado a nuestro equipo instalado con Elastix. Alternativamente, se puede conectar remotamente a travs del protocolo SSH. Si estamos en un equipo Windows debemos descargar un programa cliente para podernos conectar de manera remota. El programa que recomendamos se llama PuTTY y basta hacer una bsqueda en Google por ese nombre para encontrar el sitio de descargas. Slo asegrese de hacerlo desde el sitio oficial.

La aplicacin PuTTY

Luego de ingresar los parmetros del servidor Elastix e iniciar la sesin podemos ejecutar comandos como si estuviramos conectados directamente con un monitor y un teclado.

http://www.elastixbook.com/es/capitulos/capitulo_3/3.2_Linea_de_comandos_Linux.htm[24/11/2011 10:21:38 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Ejecutando PuTTY

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_3/3.2_Linea_de_comandos_Linux.htm[24/11/2011 10:21:38 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

3.3 Comandos bsicos


A continuacin una lista de los comandos bsicos ms usados en Linux: Comando ls ls -la cd <directorio> cd .. cat <archivo> pwd cp <archivo1> <archivo2> mv <archivo1> <archivo2> rm <archivo> tail -f <archivo> mkdir <directorio> tar -xvzf <archivo>.tar.gz top Descripcin Enlista los archivos en el directorio actual Enlista los archivos y sus atributos Cambia de directorio Cambia al directorio padre Muestra el contenido de un archivo en la pantalla Muestra la ruta al directorio actual Copia un archivo o grupo de ellos Mueve un archivo. Tambin se lo usa para renombrar archivos Elimina un archivo Muestra las ltimas lneas de un archivo en forma dinmica Crea un directorio Descomprime un archivo tar.gz Muestra un reporte en tiempo real de los procesos que se ejecutan en el sistema. Puede ser ordenado por consumo de memoria o CPU. Muy til para diagnstico

find <directorio> <archivo> vim <archivo> ifconfig ps -aux reboot shutdown -h now

-name Permite buscar archivos a partir de un directorio determinado Programa para ver y editar archivos de texto plano Muestra informacin de las interfaces de red y permite modificarlas temporalmente Muestra un reporte de los procesos que se estn ejecutando en el servidor Reinicia el equipo Apaga el equipo

http://www.elastixbook.com/es/capitulos/capitulo_3/3.3_Comandos_basicos.htm[24/11/2011 10:21:39 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Ejemplo de la ejecucin del comando top

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_3/3.3_Comandos_basicos.htm[24/11/2011 10:21:39 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

3.4 Sistema de archivos


En Linux es muy importante la organizacin del sistema de archivos. Esta organizacin le otorga robustez e interoperabilidad a Linux pues los programas pueden predecir con mayor exactitud dnde se encuentran ciertos archivos para su correcto funcionamiento. Adems, permite que los procesos escriban archivos de manera que otros componentes los entiendan. Esto minimiza los conflictos y en conjunto con el sistema de permisos aade ms seguridad al sistema operativo.

Organizacin
La organizacin de directorios que se mostrar a continuacin no es arbitraria. Es producto de aos de evolucin desde las primeras versiones de UNIX hasta lo que hoy conocemos como Linux. Esta estructura de carpetas est ubicada en lo que se llama directorio raz, o directorio principal. Este directorio raz es el directorio de ms alto nivel en el sistema de archivos y se representa con una diagonal /. Los directorios enlistados en la siguiente tabla residen todos en el directorio raz. Directorio sbin bin Descripcin Incluye binarios que pueden ser ejecutados solo por el administrador Contiene binarios necesarios para el correcto funcionamiento del sistema. Los binarios de esta carpeta pueden tambin ser utilizados por los usuarios del sistema Contiene el kernel y otros archivos necesarios al momento de arranque Incluye archivos que representan dispositivos de hardware. Recordemos que en Linux prcticamente todo es un archivo Contiene bsicamente archivos de configuracin para todo el sistema Aqu residen los directorios de los usuarios. Por ejemplo, el directorio /home/jorge/ es el directorio del usuario jorge Contiene las libreras compartidas que requieren los programas. Algo anlogo a los archivos .dll en Windows Cuando por alguna razn el sistema de archivos se corrompe y hay que repararlo, los resultados de esa reparacin se guardan en este directorio Este es un lugar comn para montar otros sistemas de archivos o dispositivos. Por ejemplo una unidad de CD-ROM o una memoria USB

boot dev

etc home

lib

lost+found

mnt

http://www.elastixbook.com/es/capitulos/capitulo_3/3.4_Sistema_de_archivos.htm[24/11/2011 10:21:40 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

opt

proc

root tmp usr

var

Contiene paquetes de software que normalmente no son parte de la instalacin original Este es un directorio virtual (ya que realmente reside en la memoria) donde el kernel y drivers escriben archivos para que otros programas los puedan leer. Por ejemplo, aqu es donde los drivers de DAHDI escriben ciertos archivos en la ruta /proc/dahdi/ Contiene archivos del usuario root ya que este no tiene uno del tipo /home/root/ Guarda archivos temporales Es uno de los directorios ms importantes y contiene informacin para ser compartida con los usuarios del sistema. Es decir, aqu residen programas junto con la documentacin necesaria y hasta libreras relacionadas. Usualmente, este directorio no contiene informacin que cambie constantemente Contiene informacin en constante cambio como logs o colas de emails. Por ejemplo, aqu reside el log de Asterisk en la ruta /var/log/asterisk/full

Permisos
En Linux cada directorio o archivo tiene permisos de acceso y estos permisos pueden ser bsicamente de 3 tipos: Lectura Escritura Ejecucin Los permisos pueden ser aplicados al dueo del archivo, a un grupo de usuarios del sistema, o globalmente a todos los usuarios del sistema. Para cada una de estas entidades se puede establecer permisos diferentes. Dicho todo lo anterior podemos establecer la siguiente matriz de permisos que sera vlida para un determinado archivo del sistema: dueo x x x grupo x x otros usuarios x x

Lectura Escritura Ejecucin

En el ejemplo anterior, el usuario dueo tiene todos los permisos sobre el archivo mientras que los usuarios del grupo y otros usuarios globales del sistema solo tienen permisos de lectura y ejecucin.

http://www.elastixbook.com/es/capitulos/capitulo_3/3.4_Sistema_de_archivos.htm[24/11/2011 10:21:40 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Existe sin embargo una notacin ms sencilla para expresar esta informacin. Esta notacin compuesta de 10 caracteres simplifica el despliegue de la informacin de permisos y permite mostrarlos en una sola lnea. Esto es muy til cuando se quieren ver permisos de muchos archivos aunque toma tiempo acostumbrarse. Por ejemplo, la matriz de permisos del ejemplo anterior se puede expresar de la siguiente manera (hemos incluido la posicin de cada permiso como un nmero del 0 al 9):

-rwxr-xr-x 0123456789
Donde, El caracter en posicin 0 representa el tipo de archivo. Si se llena con la letra d significa que se trata de un directorio. Los caracteres en posiciones 1, 2 y 3 representan los permisos de lectura, escritura y ejecucin para el dueo del archivo. Los caracteres en posiciones 4, 5 y 6 representan los permisos de lectura, escritura y ejecucin para el grupo al que pertenece el archivo. Los caracteres en posiciones 7, 8 y 9 representan los permisos de lectura, escritura y ejecucin para otros usuarios. Ahora veamos un ejemplo de un listado donde podremos apreciar diferentes permisos:
$ ls -la drwxrwxr-x -rw-rw-r--rw-rw-r-drwxrwxr-x drwxrwxr-x drwxrwxr-x -rw-rw-r--rwxrw-r--rw-rw-r-drwxrwxr-x -rw-rw-r-drwxr-xr-x -rw-rw-r-drwxrwxr-x -rw-rw-r--rw-rw-r--rw-rw-r--rw-rw-r-drwxr-xr-x -rw-rw-r--rw-rw-r--rw-rw-r--

4 1 1 3 2 3 1 1 1 3 1 4 1 3 1 1 1 1 18 1 1 1

edgar edgar edgar edgar edgar edgar root root test prueba edgar edgar edgar edgar edgar edgar user4 101 edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar

4096 2008-09-01 21:20 Codigo 53058 2008-08-04 01:31 comohemo.mid 22785270 2008-08-07 12:09 dlj173.pdf 4096 2008-08-26 17:21 elastix 4096 2008-09-11 13:03 flashingfop 4096 2008-08-04 22:18 fpbx 398439 2008-08-19 19:19 gforge_manual.pdf 102135 2008-09-07 18:53 index2.html 3535 2008-08-19 23:20 install-ceros 4096 2008-08-03 01:52 installers 6860 2008-08-19 23:12 ksraid.cfg 4096 2008-08-06 12:14 lw 1020152 2008-07-30 14:00 Magic Button.pdf 4096 2008-09-02 17:25 monitoring 14341913 2008-08-12 01:59 prbx1.zip 7195354 2008-08-03 01:51 rotron1.7.1.tar.bz2 25343 2008-08-13 00:25 roundcube.diff 12167 2008-08-01 23:03 src-php.tar.bz2 4096 2008-08-13 09:38 wanpipe-3.2.7 16106184 2008-08-29 17:40 wanpipe-3.2.7.1.tgz 20525 2008-09-08 17:14 xorcom_test.txt 9277 2008-09-08 02:10 Xorcom_logo.png

Ejemplos de permisos de archivos

Representacin numrica de permisos Aparentemente vamos a complicar las cosas un poco ms aqu pero ya veremos ms adelante la utilidad de poder representar la matriz de permisos de una forma ms condensada llamada representacin numrica u octal de permisos. La idea es que los tres caracteres que definen los permisos para cada una de las tres entidades involucradas (dueo, grupo y otros) pueden ser representados por un solo nmero. De esta forma toda la informacin de permisos de un
http://www.elastixbook.com/es/capitulos/capitulo_3/3.4_Sistema_de_archivos.htm[24/11/2011 10:21:40 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

archivo pueden ser representados por 3 de estos nmeros. Por ejemplo, 755. Donde el primer dgito representa los permisos del dueo, el segundo dgito los permisos del grupo y el tercer dgito los permisos de otros usuarios o permisos globales. Puede ser complicado entender al principio pero sin duda se trata de un formato ms condensado. Veamos el siguiente ejemplo:

-rwxr-xr-x

equivale a

755

Resulta que cada uno de los tres caracteres que representan un permiso para una entidad dada puede ser reemplazado por 1 o 0 de tal manera que obtenemos un nmero binario. Este nmero binario se traduce a su equivalente decimal (realmente deberamos decir octal aqu) como se ve a continuacin..

-rwxr-xr-x
Transformado a binario constara de los siguientes tros (sin tomar en cuenta la primera posicin 0 correspondiente al directorio):

111

101

101

y ahora en su equivalente decimal

755
En fin, para los que no les gusta calcular binario quizs la siguiente tabla sea til. Versin texto ----x -w-wx r-r-x rwrwx Versin binaria 000 001 010 011 100 101 110 111 Versin octal 0 1 2 3 4 5 6 7

Ahora se estarn preguntando para qu nos sirve esta notacin numrica? Bueno, resulta que de esta manera es mucho ms fcil manipular los permisos de los archivos mediante comandos y eso es precisamente lo que veremos a continuacin.

Cambiando permisos y dueos de archivos Las tareas de cambio de permisos y dueos de archivos pueden ser realizadas fcilmente gracias a los comandos chmod y chown respectivamente.

http://www.elastixbook.com/es/capitulos/capitulo_3/3.4_Sistema_de_archivos.htm[24/11/2011 10:21:40 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

chmod toma como parmetros los permisos en modo numrico y el nombre del archivo al que se desea realizar el cambio. Por ejemplo:
$ ls -la archivo_prueba -rw-rw-r-- 1 edgar edgar 0 2008-09-19 04:21 archivo_prueba $ chmod 755 archivo_prueba $ ls -la archivo_prueba -rwxr-xr-x 1 edgar edgar 0 2008-09-19 04:22 archivo_prueba

El comando chmod tambin se puede usar recursivamente para cambiar los permisos de todos los archivos dentro de una carpeta. Esto se hace con la opcin R. Por ejemplo: chmod R 755 nombre_carpeta/ Para cambiar el dueo y grupo asociado con un archivo determinado podemos usar el comandochown. Por ejemplo para cambiar los permisos del archivo anterior al usuario y grupo root ejecutamos lo siguiente (ntese la separacin del usuario y grupo por un punto .).
# ls -la archivo_prueba -rwxr-xr-x 1 edgar edgar 0 2008-09-19 04:23 archivo_prueba # chown root.root archivo_prueba # ls -la archivo_prueba -rwxr-xr-x 1 root root 0 2008-09-19 04:24 archivo_prueba

Al igual que el comando chmod, el comando chown tambin soporta la opcin recursiva con R. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_3/3.4_Sistema_de_archivos.htm[24/11/2011 10:21:40 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

3.5 RPMs y actualizaciones va Yum


Los paquetes de software que se incluyen en Elastix vienen en un formato llamado RPM. Este es un formato heredado de Red Hat y su nombre significa Red Hat Package Manager por sus siglas en ingls. Esto quiere decir que los instaladores de muchos paquetes de software adicional pueden ser instalados en Elastix de manera sencilla utilizando paquetes comprimidos usualmente con la extensin .rpm. Los RPMs tambin nos permitirn actualizar paquetes de software y se encargarn de resolver las dependencias necesarias para que dichos paquetes no causen problemas en el sistema. Esto se logra gracias a que el sistema RPM mantiene una base de datos interna de todos los paquetes instalados con sus respectivas dependencias y versiones. Adems nos provee con un comando muy til para manipular las instalaciones, des-instalaciones, actualizaciones y otras tareas importantes. A continuacin se muestran algunas opciones de uso del comando rpm: Accin a realizar Instalacin de RPMs Actualizacin de un RPM Eliminacin de un RPM Obtener informacin de un archivo RPM Obtener un listado de todos los RPMs instalados en el sistema Comando rpm -ivh <paquete>.rpm rpm -Uvh <paquete>.rpm rpm -e <paquete>.rpm rpm qpi <paquete>.rpm rpm -qa

Yum al rescate
La instalacin manual de RPMs mediante el comando rpm est bien para muchas de las tareas. Sin embargo, hay ocasiones en las cuales instalar RPMs de esta manera es tedioso y complicado. Un ejemplo de esto es cuando instalamos paquetes RPMs complejos que tienen muchas dependencias. Al momento de instalar dicho paquete resulta que nos damos cuenta que tenemos que instalar otro paquete necesario y tenemos que buscarlo en Internet para instalarlo. Muchas veces un RPM tiene decenas o hasta cientos de dependencias lo que por supuesto nos llevara horas solucionar manualmente. Adicionalmente a este problema de dependencias existe otro y es el de la confiabilidad de los RPMs. Es decir, luego de horas y horas de instalar nuestros paquetes manualmente nos damos cuenta de que uno de ellos sobrescribi un archivo importante del sistema y corrompi nuestro servidor Elastix. Vaya dolor de cabeza! La solucin es una utilidad llamada yum Este programa nos ayuda a instalar paquetes RPM desde repositorios y lo hace de una manera muy amigable. La mayora de las distribuciones ms populares, y Elastix no es la excepcin, mantienen repositorios de paquetes oficiales de software accesibles gratuitamente a travs de Internet. Ellos hacen el mayor esfuerzo para que dichos paquetes no tengan problemas de dependencias entre s. Adems los paquetes de los repositorios oficiales son
http://www.elastixbook.com/es/capitulos/capitulo_3/3.5_RPMs_y_actualizaciones_via_Yum.htm[24/11/2011 10:21:42 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

probados para evitar incompatibilidades en lo posible. Es por esta razn que si se usa Elastix lo recomendable es que se instalen paquetes desde el repositorio oficial. A continuacin mostramos algunos comandos yum tiles: Comando yum update yum update <paquete> yum install <paquete> Descripcin Actualizar todo el sistema Actualiza solo el paquete especificado y todas sus dependencias Instala el paquete especificado y todas sus dependencias

Nota: Cabe destacar que Elastix nos provee de una interfaz Web amigable para actualizar paquetes y administrar repositorios. Por los tanto, los procedimientos de actualizacin manuales aqu descritos se dejarn para casos excepcionales. Se recomienda en lo posible utilizar la interfaz Web. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_3/3.5_RPMs_y_actualizaciones_via_Yum.htm[24/11/2011 10:21:42 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

4
Asterisk: Conceptos Esenciales
Si una idea no es absurda al principio, entonces no merece la pena. -- Albert Einstein

4.1 Qu es Asterisk?
Asterisk es un software de central telefnica (PBX) con capacidad para voz sobre IP que es distribuido bajo licencia libre. Partiendo de este concepto muy bsico Asterisk no es una central telefnica cualquiera; se trata de una central telefnica rica en caractersticas que en otros tiempos solo eran accesibles mediante la compra de productos costosos. Esto ha hecho que muchas empresas consideren a Asterisk como una seria opcin al momento de planificar su proyecto telefnico y por esta razn Asterisk ha tenido gran acogida a nivel mundial. Al ver la oportunidad de negocio muchos fabricantes se han sumado a ofrecer hardware telefnico compatible con Asterisk, principalmente tarjetas electrnicas para conexin con la PSTN. Esto ha hecho que la oferta de centrales telefnicas basadas en Asterisk crezca rpidamente en los ltimos tiempos. Asterisk es uno de los componentes ms importantes de Elastix y quien provee la mayora de las caractersticas telefnicas de la distro. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_4/4.1_Que_es_Asterisk.htm[24/11/2011 10:21:42 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

4.2 Breve historia de Asterisk


Asterisk fue concebido y desarrollado por Mark Spencer. En un principio por una necesidad personal pues necesitaba una central telefnica para la pequea empresa de soporte que estaba fundando llamada Linux Support Services. Inicialmente pens en adquirir una central telefnica pero pronto se dio cuenta que estaba lejos de su presupuesto. As que luego de pensarlo un poco decidi crear la suya propia y comenz a codificar lo que hoy conocemos como Asterisk. En 1999, cuando tuvo un cdigo funcional, decidi liberarlo bajo licencia GPL. A pesar de lo que se pueda pensar, Mark no era un novato en el mundo del software libre. l ya haba participado activamente en el desarrollo del cliente de mensajera Gaim, actualmente llamado Pidgin, uno de los ms populares en el mbito del software libre. En el 2002, Linux Support Services se convertira en Digium, quien actualmente ofrece productos y servicios relacionados con Asterisk y se encarga del desarrollo del software como tal. Cabe resaltar que en un principio Mark se dio cuenta de que su software necesitaba interactuar con hardware telefnico. Fue entonces cuando se encontr con el proyecto Zaptel, un proyecto de cdigo abierto creado por Jim Dixon. Zaptel tena el objetivo de crear drivers abiertos para tarjetas telefnicas de computadora. A partir de all Asterisk y Zaptel caminaran de la mano hasta el punto que en la actualidad los dos proyectos son mantenidos por Digium. En 2008 Digium decidi cambiar el nombre del proyecto que mantenan de Zaptel a DAHDI. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_4/4.2_Breve_historia_Asterisk.htm[24/11/2011 10:21:43 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

4.3 Funcionalidad provista por Asterisk


Como ya hemos dicho Asterisk es un software de central telefnica rico en caractersticas. Al momento de escribir este libro las caractersticas soportadas ms relevantes son las que enlistamos a continuacin. Contestacin automtica de llamadas Transferencia de llamadas Opcin de no molestar Parqueo de llamadas Contestacin de llamada desde extensin remota Monitoreo y grabacin de llamadas Voicemail Conferencias Reportacin de llamadas Colas de atencin Llamada en espera Identificador del llamante Bloqueo por llamante identificado Envo y recepcin de fax Listado interactivo del directorio de extensiones Interactive voice response (IVR) Msica en espera Manejo de comportamiento por horarios Follow me

Contestacin automtica de llamadas Asterisk provee la facilidad de configurar una contestadora automtica que ayuda al manejo del flujo de llamadas entrantes contestndolas automticamente sin necesidad de una operadora en vivo. Esta funcionalidad ha sido diseada para empresas que reciben altos flujos de llamadas y que no poseen el personal necesario para manejar el trfico de llamadas entrantes. La contestadora responde a los dgitos marcados por el teclado de la persona que llama, encamina las llamadas a extensiones especficas, provee acceso a informacin pregrabada y toma mensajes 24 horas al da.

Transferencia de llamadas En Asterisk existen dos mtodos para transferir llamadas: transferencia atendida y transferencia ciega. En la transferencia atendida se llama primero al destinatario para avisarle que se le trasferir una llamada. En la transferencia ciega se transfiere simplemente la llamada sin conversar con el destinatario previamente.

Opcin de no molestar
http://www.elastixbook.com/es/capitulos/capitulo_4/4.3_Funcionalidad_provista_por_Asterisk.htm[24/11/2011 10:21:44 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Esta opcin permite a cualquier usuario configurar su extensin para que no reciba llamadas por un perodo de tiempo. Cualquier llamada entrante a esta extensin ser ruteada automticamente al buzn de correos de la misma.

Parqueo de llamadas El parqueo de llamadas permite al usuario que recibe una llamada enviarla a un espacio de parqueo, para volver a atenderla desde otra extensin. Este tipo de accin es til en muchas situaciones como cuando un tcnico recibe una llamada a su escritorio la cual requiere que l se ubique de frente a un servidor localizado tres pisos ms arriba.. En este caso, la opcin es enviar la llamada a un cuarto temporal o espacio de parqueo, donde mientras tanto el llamante escuchar la msica en espera configurada. El tcnico puede retomar la llamada una vez que llegue al servidor. Contestacin de llamada desde extensin remota Esta caracterstica permite atrapar una llamada que se encuentra timbrando en una extensin que no es la suya. Tambin se la conoce como call pickup, debido a su nombre en ingls.

Monitoreo y grabacin de llamadas Asterisk permite monitorear y grabar llamadas. El monitoreo se suele usar para fines de control de calidad de los operadores telefnicos o de los agentes de ventas. Para esto existe la facilidad de que a travs de la digitacin de un cdigo predeterminado se permita escuchar en lnea la conversacin sostenida por una extensin cualquiera. Adicionalmente existe la facilidad de grabar las conversaciones de cualquier extensin en forma aleatoria programada previamente. Estas grabaciones se almacenarn en el disco duro del servidor Asterisk para su posterior revisin.

Voicemail (Buzn de mensajes de voz) El buzn de mensajes de voz es una aplicacin que permite guardar y escuchar mensajes dejados por llamantes que no pudieron ser atendidos. Para acceder al buzn de mensajes de voz hay que digitar un cdigo predeterminado. Asterisk nos preguntar por nuestra clave y a continuacin accederemos a los mensajes disponibles.

Conferencias Una conferencia no es ms que una llamada telefnica donde pueden conversar varios participantes a la vez. Para acceder a esta funcionalidad se crean cuartos de conferencia. Cada cuarto se encuentra asociado a un nmero como si se tratase de una extensin. Entonces, para acceder a una conferencia basta con marcar el nmero correspondiente al cuarto de conferencia deseado. Es posible configurar algunas caractersticas interesantes a un cuarto de conferencias determinado, como por ejemplo: limitar el nmero de participantes, solicitar una contrasea al ingreso o moderar el cuarto de conferencias.

Reportacin de llamadas
http://www.elastixbook.com/es/capitulos/capitulo_4/4.3_Funcionalidad_provista_por_Asterisk.htm[24/11/2011 10:21:44 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Asterisk genera Call Detail Records (CDRs) o Registros de Detalle de Llamadas y los puede almacenar en una base de datos. Accediendo a esta base de datos, se pueden generar reportes que detallan qu extensin llam a qu nmero, si la llamada fue contestada o no, cunto dur la llamada, o por qu puerto o lnea telefnica se realiz la llamada.

Colas de atencin Esta caracterstica permite que un gran nmero de llamantes puedan permanecer en espera hasta que un representante o recurso est disponible para dar asistencia. Esto asegura que los llamantes no terminarn obligatoriamente en el voicemail, lo cual puede resultar molestoso. Es decir, con las colas de atencin nos aseguramos que el llamante siempre tenga la oportunidad de ser atendido por una persona. El tiempo que el llamante permanece en espera puede aprovecharse para darle a conocer ms servicios o productos de la compaa, ofertas especiales, anuncios informativos simplemente se puede proporcionar msica en espera.

Llamada en espera Esta caracterstica permite que la persona que se encuentra atendiendo una llamada y recibe otra, pueda interrumpir temporalmente su primera conversacin para atender la segunda. Para alertar a la persona que una segunda llamada est ingresando se le reproduce un sonido caracterstico. En algunos escenarios este sonido no es deseable, por ejemplo en las conexiones telefnicas para transferencia de datos (Ej.: fax). En estos casos se opta por deshabilitar esta caracterstica ya que provoca errores en la transmisin del fax.

Identificador del llamante Esta seal es enviada entre las seales de ring o durante el proceso de establecimiento de la llamada, antes de que sea contestada. Asterisk aprovecha esta facilidad y a nivel de extensiones IP soporta plenamente su manejo. Sin embargo a nivel de lneas de la red telefnica pblica conmutada es el proveedor de estas quien debe habilitar o proporcionar esta caracterstica. Se la conoce tambin como Caller ID.

Bloqueo por llamante identificado Esta caracterstica previene que alguien con identificador de llamante vea el nmero desde el que usted llama. Esta facilidad de ocultar el ID puede ser completa o selectiva. No todas las redes de telefona pblica soportan esta caracterstica. En Asterisk esta caracterstica tambin incluye bloquear una llamada entrante en funcin del ID.

Envo y recepcin de fax Asterisk permite detectar automticamente cuando un llamante est intentando enviar un fax. Se puede poner como parte del mensaje de bienvenida de la central telefnica una frase que diga: Si quiere enviar un fax, envelo ahora. Esto nos ayuda a eliminar papel, prescindir de mquinas puertos telefnicos exclusivos para fax y digitalizar la informacin recibida como fax. Luego de ser digitalizado, este documento puede ser enviado va email a una cuenta especfica para su revisin.

Listado interactivo del directorio de extensiones


http://www.elastixbook.com/es/capitulos/capitulo_4/4.3_Funcionalidad_provista_por_Asterisk.htm[24/11/2011 10:21:44 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Asterisk cuenta con todo el directorio telefnico del personal de la empresa (nombre, apellido y extensin) en su base de datos. Esta facilidad permite que la persona que llama pueda digitar desde su telfono los nmeros correspondientes a las 4 primeras letras del apellido nombre de la persona con la que desea hablar. Esto puede proporcionar una alternativa para llamantes que no conocen la extensin de la persona a quien que quieren contactar pero conocen solo su apellido nombre.

Interactive voice response (IVR) A travs de esta caracterstica se proporciona acceso a opciones telefnicas que mejoran la forma en la cual un sistema telefnico acepta y distribuye sus llamadas. Con un men de IVR es posible distribuir las llamadas entrantes de una manera precisa. Esto ayudar a incrementar el desempeo de los empleados y la satisfaccin de los clientes, ya que se agilita el acceso a los servicios y a la informacin que posee su compaa. Con esta facilidad se proporcionan procesos de auto atencin que permitirn incluso prescindir de una recepcionista en ciertos casos. Mediante el uso de esta caracterstica se pueden crear mens de activacin por dgitos por comandos de voz para ejecutar inclusive consultas a otros sistemas de cmputo como bases de datos.

Msica en espera Asterisk permite utilizar cualquier archivo en formato mp3 o wav como msica de fondo. sta ser reproducida cuando algn llamante externo o interno se encuentra esperando a que un representante de la compaa lo atienda. Estos archivos pueden ser inclusive agrupados por categoras para reproducir diferentes melodas a diferentes grupos de llamantes.

Manejo de comportamiento por horarios Es posible configurar Asterisk para que tenga un tratamiento diferente para con las llamadas (tanto entrantes como salientes) dependiendo de la hora del da, da del mes o mes del ao. El ejemplo ms bsico es cuando se quiere que las llamadas entrantes recibidas fuera de horarios de oficina reciban un mensaje pregrabado sugiriendo al llamar nuevamente al siguiente da.

Follow me Esta caracterstica, conocida en espaol como sgueme, permite predefinir una secuencia de llamadas simultneas o en secuencia para poder ubicar a un usuario. Por ejemplo, se podra definir que cuando la extensin del gerente de la compaa timbre y este no conteste la llamada se redirija a su celular y otros telfonosde contacto. Se pueden especificar tiempos de gracia antes de que el siguiente nmero de telfono sea marcado. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_4/4.3_Funcionalidad_provista_por_Asterisk.htm[24/11/2011 10:21:44 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

4.4 Funcionamiento de Asterisk


Directorios de Asterisk
Asterisk organiza sus archivos distribuyndolos entre algunos directorios. Los ms importantes son los siguientes. Directorio /etc/asterisk/ /usr/lib/asterisk/modules/ /usr/sbin/ /var/lib/asterisk/agi-bin/ /var/lib/asterisk/mohmp3 /var/lib/asterisk/sounds /var/spool/asterisk/ Descripcin Lugar donde residen los archivos de configuracin de Asterisk Contiene los mdulos de Asterisk Incluye el binario de Asterisk Lugar donde residen los scripts AGI Contiene archivos para msica en espera Incluye sonidos que Asterisk utiliza como prompts de voz Lugar donde Asterisk guarda archivos que genera producto de su funcionamiento como voicemails y grabaciones de llamadas Guarda archivos con informacin de procesos (PIDs) Aqu residen los archivos de log de Asterisk como los CDRs o el /var/log/asterisk/full

/var/run/ /var/log/asterisk/

Estructura modular
Asterisk utiliza la idea de mdulos para extender su funcionalidad. Es tan importante la funcionalidad residente en los mdulos que sin ellos Asterisk por si solo no cumplira ninguna funcin interesante. Estos mdulos residen en la carpeta /usr/lib/asterisk/modules/ y son archivos con la extensin .so Los mdulos pueden ser controlados a travs del archivo de configuracin /etc/asterisk/modules.conf. Este archivo instruye a Asterisk a que cargue o no un mdulo especfico a travs de las directivas load y noload. Por omisin en Elastix todos los mdulos tratan de ser cargados. A continuacin un fragmento del archivo modules.conf que viene por defecto con Elastix. Aqu se puede observar cmo se le instruye a Asterisk a que no cargue algunos mdulos en el arranque.
; ; DON'T load the chan_modem.so, as they are obsolete in * 1.2 noload => chan_modem.so noload => chan_modem_aopen.so
http://www.elastixbook.com/es/capitulos/capitulo_4/4.4_Funcionamiento_Asterisk.htm[24/11/2011 10:21:45 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

noload => chan_modem_bestdata.so noload => chan_modem_i4l.so ; Ensure that format_* modules are loaded before res_musiconhold ;load => format_ogg_vorbis.so load => format_wav.so load => format_pcm.so load => format_au.so

Adicionalmente se pueden cargar mdulos en tiempo real a travs de la consola de Asterisk (no confundir con la lnea de comandos de Linux) con el comando: module load <modulo> Ms adelante veremos ms de la consola de Asterisk o CLI. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_4/4.4_Funcionamiento_Asterisk.htm[24/11/2011 10:21:45 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

4.5 El proyecto DAHDI


A pesar de ser un gran producto de software, Asterisk no puede hacer todo el trabajo por s solo. Uno de los paquetes de software que lo complementa se llama DAHDI. Bsicamente DAHDI es un conjunto de drivers para controlar hardware telefnico como tarjetas PCI o PCI Express que nos permiten conectarnos a la PSTN. Estos drivers se comunican con Asterisk a travs de un mdulo de Asterisk llamado chan_dahdi.so que se configura a travs del archivo de configuracin /etc/asterisk/chan_dahdi.conf. Adicionalmente DAHDI tiene sus propios archivos de configuracin, independientes de Asterisk, que se encuentran en la carpeta /etc/dahdi/. Nota: En versiones de Elastix menores a 1.5 se utiliza el software del proyecto Zaptel en lugar de DAHDI. Esto quiere decir que los archivos de configuracin para los drivers de telefona tienen nombres diferentes. En estos casos se recomienda, como referencia, consultar la primera edicin de la presente obra.

Diagrama simplificado de la interaccin de Asterisk con DAHDI

Breve historia de DAHDI


A pesar del cambio de nombre de Zaptel a DAHDI y toda la confusin que esto gener en un principio, no hay que olvidar que el origen de DAHDI estuvo en el proyecto Zaptel. Primero porque hay que dar el crdito merecido a quienes trabajaron en el proyecto original y segundo para no olvidarnos de la historia. A continuacin un breve resumen de dicha historia.

http://www.elastixbook.com/es/capitulos/capitulo_4/4.5_Proyecto_DAHDI.htm[24/11/2011 10:21:46 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

En el ao 2000, Jim Dixon lanz el proyecto Zaptel cuyo nombre era una abreviacin de Zapata Telephony Project. Lo nombr as en honor a Emiliano Zapata, hroe de la revolucin mexicana. Los drivers fueron lanzados bajo licencia GPL de tal manera que cualquiera pudo tener acceso al cdigo. Inicialmente Zaptel contena drivers para tarjetas Tormenta fabricadas por Zapata Telephony. No paso mucho tiempo hasta que Digium comenz a mejorar los drivers y extender el soporte para nuevos modelos de hardware, entre ellos los fabricados por Digium mismo. Es as que Digium se convirti en el principal desarrollador de Zaptel. Luego de algunos aos de mantener Zaptel, Digium cay en cuenta de que Zaptel era una marca registrada por una compaa vendedora de tarjetas de llamadas y para evitar cualquier posible confusin futura decidi cambiar de nombre a sus drivers. El nombre elegido es DAHDI, que es un acrnimo de Digium Asterisk Hardware Device Interface o Interfaz de Dispositivos de Hardware de Asterisk de Digium en espaol. Digium finaliz el soporte oficial de Zaptel a partir de la versin Asterisk 1.6 Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_4/4.5_Proyecto_DAHDI.htm[24/11/2011 10:21:46 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

4.6 Configuracin de Asterisk


Archivos de configuracin
Asterisk se puede configurar a travs de algunos archivos de configuracin ubicados en la ruta /etc/asterisk. Existen decenas de archivos de configuracin en este directorio y se encuentran en texto plano para facilitar su modificacin. Debido a esto, podemos usar el editor vim u otro editor de lnea de comandos de nuestra preferencia para editarlos. Si bien todos estos archivos son importantes no todos son necesarios. Algunos de ellos ya han sido pre configurados por Elastix para que no tengamos que modificarlos. Los ms importantes se explican en la siguiente tabla. Archivo extensions.conf Descripcin Define el plan de marcado. En Elastix se incluyen otros archivos ms para organizar el plan de marcado de mejor manera. Estos archivos adicionales empiezan con la cadena extensions_ Configura los dispositivos SIP Configura los dispositivos IAX Define la configuracin de los canales tipo DAHDI.

sip.conf iax.conf chan_dahdi.conf

Comentarios en los archivos de configuracin


Los archivos de configuracin de Asterisk pueden contener comentarios. Un comentario empieza con el caracter de punto y coma. Una vez escrito este caracter el resto de la lnea se convierte en un comentario. Es decir, esta lnea es ignorada por Asterisk al interpretar el archivo. Veamos un ejemplo de comentario.
; ; ; ; ; ; ;

El siguiente es un bloque de comentarios. Como pueden ver puedo escribir cualquier cosa aqu porque ser ignorada por Asterisk. Los comentarios son muy tiles para escribir notas e informacin relativa a la configuracin que estamos escribiendo.

; Ahora si contino con las directivas... ; #include #include #include #include sip_general_custom.conf sip_nat.conf sip_registrations_custom.conf sip_registrations.conf

http://www.elastixbook.com/es/capitulos/capitulo_4/4.6_Configuracion_Asterisk.htm[24/11/2011 10:21:47 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_4/4.6_Configuracion_Asterisk.htm[24/11/2011 10:21:47 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

4.7 Plan de marcado (dial plan)


El plan de marcado en Elastix reside principalmente en el archivo extensions.conf. Desde este se incluyen otros importantes archivos que contienen tambin porciones del plan de marcado. Los principales son: extensions_additional.conf: Aqu reside el plan de marcado variable escrito por FreePBX, el cual es un componente importante de Elastix. Si se realizan cambios manualmente en este archivo, los mismos se perdern cuando FreePBX lo sobreescriba. extensions_custom.conf: Aqu el usuario puede definir manualmente el plan de marcado. Este archivo no es tocado por FreePBX por lo que es seguro editarlo sin temor a perder los cambios. Todos estos archivos de plan de marcado estn escritos en texto plano en un formato definido por Asterisk. El contenido de estos archivos se encuentra dividido en secciones llamadas contextos.

Contextos
Los contextos sirven para agrupar la lgica del plan de marcado. Los contextos tambin a su vez incluir otros contextos mediante la clusula "include" o redirigir el hilo de ejecucin del plan de marcado a otros contextos dependiendo de condiciones. Por ejemplo, luego de examinar el prefijo del nmero telefnico marcado, un contexto puede contener la lgica necesaria para rutear una llamada hacia la troncal correspondiente. Un contexto tambin puede agrupar la lgica necesaria para la aplicacin de reloj despertador. Tambin puede incluir lgica para acceder al voicemail o para autenticar un nmero de PIN. En general, prcticamente todo en el plan de marcado se encuentra agrupado en contextos. Los contextos son los agrupadores u organizadores del plan de marcado. Cada contexto debe llevar un nombre nico y este nombre va encerrado entre los smbolos [ y ]. A continuacin se encuentra un ejemplo donde se pueden observar dos contextos llamados app-pickup y exttest

[app-pickup] include => app-pickup-custom exten => _**.,1,Noop(Attempt to Pickup ${EXTEN:2}) exten => _**.,n,Pickup(${EXTEN:2}) [ext-test] include => ext-test-custom exten => 7777,1,Goto(from-pstn,s,1) exten => 666,1,Goto(ext-fax,in_fax,1) exten => h,1,Macro(hangupcall,)
Fragmento del archivo extensions_additional.conf para ilustrar los contextos

Contextos reservados

http://www.elastixbook.com/es/capitulos/capitulo_4/4.7_Plan_de_marcado.htm[24/11/2011 10:21:48 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Hay dos nombres de contextos que estn reservados para un propsito especial y son [general] y [globals] .

Extensiones
Los contextos contienen instrucciones, conocidas como extensiones. Estas extensiones son lneas de plan de marcado que tienen la siguiente sintaxis.
exten => nombre_extension, prioridad, aplicacin

Nota: Normalmente asociamos el trmino extensin a un nmero de telfono, pero en Asterisk el trmino extensin va ms all de lo que normalmente conocemos. Una extensin es una serie de lgica de plan de marcado. Es ms, cuando marcamos un nmero desde nuestro telfono no necesariamente tiene que ringar otro telfono pues podemos crear la lgica que queramos para este nmero dado. Por ejemplo podemos hacer que la llamada simplemente se cuelgue, que reproduzca un mensaje dado o funciones mucho ms complejas. Una extensin tpica luce como la siguiente.
exten => 4567,1,Answer()

Nombre de Extensin El nombre de extensin es un identificador numrico de la extensin. Llammosle el nmero de telfono por ahora para simplificar el asunto. Existe una extensin especial no numrica llamada extensin s, a la que le prestaremos particular atencin. La extensin s significa cualquier extensin. La letra s viene de la palabra start que significa inicio. Un ejemplo del uso de la extensin s es el siguiente.
[prueba] exten => s,1,Answer() exten => s,2,noOp(Prueba)

La extensin s se usa cuando el usuario que realizo la llamada aun no ha presionado el numero de la extensin. Por ejemplo, este es el caso de una llamada entrante que todava se encuentra escuchando el IVR de bienvenida.

Prioridad La prioridad indica el orden en el que debe ser ejecutada una extensin dentro de un contexto. Es necesario que la primera prioridad sea la 1 pues cuando Asterisk lee un contexto lo primero que busca es esta prioridad. Existe tambin una prioridad especial que es la prioridad n. La prioridad n significa que a la prioridad de la instruccin anterior se le debe sumar uno. Esto es muy til para facilitar la escritura del plan de marcado.

http://www.elastixbook.com/es/capitulos/capitulo_4/4.7_Plan_de_marcado.htm[24/11/2011 10:21:48 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Por ejemplo, revisemos el siguiente plan de marcado.


exten => s,1,NoOp(Hola este es solo un ejemplo) exten => s,2,NoOp(para demostrar) exten => s,3,NoOp(como usar la prioridad n)

Este plan de marcado podra ser escrito de la siguiente manera usando la prioridad n.
exten => s,1,NoOp(Hola este es solo un ejemplo) exten => s,n,NoOp(para demostrar) exten => s,n,NoOp(como usar la prioridad n)

Las prioridades tambin pueden contener etiquetas para facilitar su identificacin ya que si usamos siempre la prioridad n ser difcil acceder a una ubicacin determinada dentro de un contexto. Esto se consigue con la sintaxis n(nombre_etiqueta).

Aplicacin En las aplicaciones radica el verdadero poder del plan de marcado en Asterisk. Para hacer una analoga, las aplicaciones son el equivalente a las funciones de un lenguaje de programacin. Las aplicaciones nos permitirn contestar una llamada o colgarla, reproducir msica en espera, saltar a otros contextos entre otras muchas funciones. Las aplicaciones tambin pueden recibir parmetros. Por ejemplo a la aplicacin Dial( ) habr que indicarle qu nmero marcar para que pueda realizar su labor. Ms adelante en el presente captulo se explicarn con ms detalle las aplicaciones ms comunes en el plan de marcado.

Variables
Las variables en el plan de marcado son un concepto similar a las variables en un lenguaje de programacin. Es decir, son abstracciones que pueden almacenar informacin de naturaleza variable. Una variable tiene la siguiente sintaxis. ${NOMBRE} Donde NOMBRE es el nombre de la variable. Las variables pueden ser de tres tipos: globales, de canal y pre definidas.

Globales Son las variables definidas en la seccin [globals] del archivo /etc/asterisk/extensions.conf, o directamente dentro de /etc/asterisk/globals_custom.conf en cualquier Elastix. La palabra global quiere decir que pueden ser referenciadas desde cualquier lugar.

http://www.elastixbook.com/es/capitulos/capitulo_4/4.7_Plan_de_marcado.htm[24/11/2011 10:21:48 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

De canal Son las variables que se pueden definir usando el comando (o aplicacin) Set().

Pre-definidas Asterisk se encarga de administrar algunos nombres de variables por su cuenta. Estos nombres se encuentran predefinidos y contienen cierta informacin dependiendo del comportamiento de la llamada o de otros factores. Algunas variables pre-definidas son: ${CALLERID(all)} ${CALLERID(name)} ${CALLERID(num)} ${CHANNEL} ${CONTEXT} ${EPOCH} ${EXTEN} ${SIPUSERAGENT} ${UNIQUEID} Nota: Hay un tipo adicional de variable introducida a partir de Asterisk 1.6 llamada variable compartida o shared. Esta variable permite que dos o ms canales accedan a lo que de otra manera sera una variable de canal. A continuacin reproducimos un segmento del archivo extensions.conf que se distribuye por defecto con Elastix. Aqu podemos ver algunas variables predefinidas como ${UNIQUEID}, ${BLINDTRANSFER} y ${EPOCH}, y variables de canal como ${CALLFILENAME}.
[macro-record-enable] exten => s,1,GotoIf($[${LEN(${BLINDTRANSFER})} > 0]?2:4) exten => s,2,ResetCDR(w) exten => s,3,StopMonitor() exten => s,4,AGI(recordingcheck,${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)},${UNIQUEID}) exten => s,5,Noop(No recording needed) exten => s,999,MixMonitor(${CALLFILENAME}.wav)

Aplicaciones ms comunes
Answer Sintaxis: Answer([delay]) Contesta un canal inmediatamente si ste est timbrando. Puede recibir opcionalmente el parmetro delay que indica a Asterisk que debe esperar un nmero determinado de milisegundos despus de contestar la llamada para pasar a la siguiente aplicacin.

http://www.elastixbook.com/es/capitulos/capitulo_4/4.7_Plan_de_marcado.htm[24/11/2011 10:21:48 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Background Sintaxis: Background(filename1[&filename2...][|opciones[|langoverride][|context]]) Reproduce un listado de archivos de audio en el fondo, es decir que devuelve el control a Asterisk, quien puede continuar ejecutando el plan de marcado mientras el audio es reproducido. Cuando termina de reproducir el ltimo archivo, su ejecucin finaliza por lo que si se quiere seguir esperando por una extensin se debe usar la aplicacin WaitExten() en conjunto.. Esta aplicacin es tpicamente usada para reproducir el mensaje de bienvenida de un IVR. La aplicacin Background puede recibir algunas opciones: Opcin s n m Descripcin Saltarse la reproduccin del audio si el canal no se encuentra contestado No contestar el canal antes de reproducir los archivos Dejar de reproducir el audio si un dgito marcado coincide con una extensin existente en el contexto destino

Playback Sintaxis: Playback(filename1[&filename2...][,options]) Reproduce uno o ms archivos de audio. La diferencia con la aplicacin Background es que Playback reproduce todo el archivo de audio hasta el final y no retorna el control hasta que termina la reproduccin. Nota: No es necesario especificar la extensin del archivo de audio en esta funcin. Los archivos de audio son buscados en el directorio /var/lib/asterisk/sounds

Hangup Sintaxis: Hangup() Cuelga el canal y retorna el valor -1.

Goto Sintaxis: Goto([[context|]extension|]priority) Salta la ejecucin del plan de marcado a un contexto, extensin y prioridades definidos. Si solo se pasa un parmetro se sobreentiende que se trata de una prioridad dentro del mismo contexto.

Dial

http://www.elastixbook.com/es/capitulos/capitulo_4/4.7_Plan_de_marcado.htm[24/11/2011 10:21:48 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Sintaxis: Dial(type/identifier, timeout, options, URL) Este comando es el responsable de marcar un canal especificado y lo vincula con el canal corriente. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_4/4.7_Plan_de_marcado.htm[24/11/2011 10:21:48 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

4.8 Asterisk CLI


Asterisk CLI es el nombre que recibe la consola de Asterisk. Es decir, una lnea de comandos para controlar Asterisk directamente. Para ingresar al CLI debemos ejecutar el siguiente comando desde la consola de Linux.
# asterisk -r Asterisk 1.4.21.2, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.4.21.2 currently running on elastix (pid = 2245) Verbosity is at least 3 elastix*CLI>

Como podemos observar, obtenemos un prompt CLI> desde donde podemos ejecutar una serie de comandos que veremos en breve. El CLI tambin nos puede proveer informacin en tiempo real de la actividad de Asterisk. Adems, podemos controlar el grado de detalle con el que queremos ver dicha informacin con algunos comandos. Los ms usados son los siguientes.
elastix*CLI> core set debug 9 Core debug was 3 and is now 9 elastix*CLI> core set verbose 9 Verbosity is at least 9

Mientras ms altos los niveles de las variables debug y verbose, ms detallada ser la informacin mostrada. Por omisin el nivel de debug es 0 y el de verbose 3 en Elastix. Nota: Debido a la gran cantidad de informacin que se puede generar con estos comandos es importante reestablecer los valores de las variables debug y verbose a los mnimos al finalizar nuestras tareas de diagnstico. Caso contrario Asterisk continuar generando esta informacin detallada cuando realmente no la necesitamos, lo cual es un trabajo extra que consume recursos del sistema. En sistemas con mucha actividad este consumo adicional puede ser significativo y afectar el desempeo de las llamadas.

Comandos CLI
A continuacin proveemos una breve lista de los comandos de CLI ms comunes. Comando agi set debug on Descripcin Permite habilitar el debug de scripts AGI. Se apaga con agi set debug off

http://www.elastixbook.com/es/capitulos/capitulo_4/4.8_Asterisk_CLI.htm[24/11/2011 10:21:49 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

core set debug channel core set debug core set verbose core show channels dialplan reload dialplan show help iax2 set debug

iax2 show peers

iax2 show registry

module reload

pri set debug on

core restart gracefully

core restart now core restart when convenient

sip set debug ip sip set debug peer sip show peers

sip show registry core stop gracefully

Habilita el debug en un canal determinado Permite cambiar el nivel de debugging. Se apaga con core set debug off Incrementa la intensidad del logging. Muy til en diagnstico Muestra informacin actualizada de los canales activos Recarga todo el plan de marcado Muestra el plan de marcado Muestra un listado con todos los comandos de CLI disponibles Habilita el debug a nivel de IAX. Se deshabilita con el comando iax2 set debug off Muestra los peers definidos y alguna informacin adicional como la direccin IP desde donde se conectan, el estatus, entre otros datos Muestra informacin de registro IAX e informacin como el estatus y la direccin IP a la que se trata de conectar Recarga todos los mdulos de Asterisk. til para aplicar los cambios hechos en los archivos de configuracin Habilita debug de los spans de la interfaz PRI. Se apaga con pri set debug off Reinicia Asterisk de manera ordenada. Es decir, no permite iniciar nuevas llamadas y espera a que las existentes terminen para proceder a reiniciar Reinicia Asterisk de manera brusca (de inmediato) Reinicia Asterisk cuando no haya actividad en la central. Adecuado en ambientes de produccin donde no tenemos otra opcin que reiniciar la central pero no queremos que se corten llamadas en curso Habilita debug de SIP a nivel de una direccin IP especfica Habilita debug de SIP a nivel de un peer especfico Muestra un listado con todos los peers SIP configurados e informacin de cada uno de ellos como su estatus Muestra un listado con los registros SIP e informacin relevante de cada uno de ellos Detiene Asterisk de manera ordenada. Es decir, no permite establecer nuevas llamadas y espera a que las existentes terminen para proceder a detener el Asterisk.

http://www.elastixbook.com/es/capitulos/capitulo_4/4.8_Asterisk_CLI.htm[24/11/2011 10:21:49 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

core stop now core stop when convenient

dahdi show status dahdi show channels

Detiene Asterisk de manera brusca (de inmediato) Detiene Asterisk cuando no haya actividad en la central. Adecuado en ambientes de produccin donde no tenemos otra opcin que apagar la central pero no queremos que se corten llamadas en curso Muestra un listado de los canales DAHDI y un reporte de alarmas y errores Muestra un listado de los canales DAHDI y algunos parmetros de funcionamiento.

elastix*CLI> dahdi Chan Extension pseudo 1 2 3 4 5 6 7 8 elastix*CLI>

show channels Context default from-pstn from-pstn from-pstn from-pstn from-pstn from-pstn from-pstn from-pstn

Language

MOH Interpret default default default default default default default default default

Listado de canales DAHDI producto del comando dahdi show channels

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_4/4.8_Asterisk_CLI.htm[24/11/2011 10:21:49 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

5
Instalando Elastix
Hay hombres que luchan un da y son buenos. Hay otros que luchan un ao y son mejores. Hay quienes luchan muchos aos, y son muy buenos. Pero hay los que luchan toda la vida, esos son los imprescindibles -- Bertolt Bretch

5.1 Instalando desde CD


Antes de comenzar, asegrese de tener una copia de la ltima versin estable de Elastix, (la presente obra est basada en la versin 2.0). sta puede ser descargada desde la pgina de descargas del proyecto Elastix en www.elastix.org. Escoja la versin apropiada dependiendo si dispone de una mquina con procesador de 32 o 64 bits.

Arranque desde CD
Elastix se distribuye como un archivo de imagen tipo ISO, que puede ser quemado a un CD desde cualquier software de grabacin de CDs. Una vez quemada esta imagen en el CD, insrtelo en su computador al momento de encenderlo. Asegrese de que su computador arranque de la unidad de CD-ROM, caso contrario deber habilitar esta opcin en el BIOS de su mquina. Si todo va bien debera obtener una pantalla como la siguiente.

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Pantalla de instalacin inicial

Nota: El CD de instalacin de Elastix formatear TODO el disco duro durante el proceso de instalacin as que asegrese de no tener informacin que vaya a necesitar en su disco duro. El proceso de instalacin iniciar automticamente dentro de diez segundos. Usted podra presionar la tecla de Enter si no desea esperar este tiempo.

Preferencias y bienvenida
Luego de cargar algunos programas necesarios para iniciar la instalacin, el proceso nos solicitar el idioma que ser utilizado para formular preguntas y mostrar mensajes a lo largo del proceso de instalacin. Escoja el idioma espaol (Spanish) utilizando las teclas de flechas de su teclado. Usando la tecla de TAB posicione el cursor sobre OK y presione la tecla de Enter.

Seleccin de idioma para instalacin

A continuacin, proceda a escoger el tipo de teclado de acuerdo al idioma. Si su teclado es de idioma espaol seleccione la opcin es.

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Seleccin de tipo de teclado

Particiones del disco duro


El siguiente es el paso crtico de la instalacin ya que configura las particiones del disco duro. Si usted es un administrador experimentado, podra escoger la opcin Utilizar diseo personalizado. Caso contrario, elija Usar espacio disponible en dispositivos seleccionados y crear diseo predeterminado. En nuestra instalacin seleccionaremos esta ltima opcin.

Particionamiento de disco duro

Ahora el programa instalador nos consulta si queremos revisar las particiones creadas. Escoja la opcin No y digite la tecla de Enter para proseguir.

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Confirmacin de particiones creadas

Configuracin de parmetros de red


Es el turno de la configuracin de los parmetros de red. El programa de instalacin preguntar si desea configurar los parmetros de direccionamiento IP en las tarjetas de red con las que cuenta su servidor. En la siguiente pregunta escoja Si.

Configuracin de red

Para cada tarjeta de red que se tenga instalada se preguntar si la desea activar a tiempo de arranque y qu tipo de soporte IP se va a habilitar en ella. El protocolo IP que hemos abordado en el captulo 2 es la versin 4, por lo que recomendamos escoger el soporte de IPv4. Presione Aceptar.

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Activacin de parmetros de la tarjeta de red en eth0

Si usted cuenta con un servidor de Dynamic Host Configuration Protocol (DHCP) en su red para la asignacin dinmica de direcciones IP, seleccione la opcin Configuracin de IP dinmica. De lo contrario deber asignar la direccin IP de manera manual seleccionando la opcin Configuracin manual TCP/IP.

Configuracin de direccin IP y mscara de red

La siguiente pantalla nos pide el ingreso de parmetros de red adicionales como la puerta de enlace (gateway), DNS primario y DNS secundario. Contine presionando Aceptar.

Configuracin de puerta de enlace y DNS

A continuacin debemos bautizar nuestro servidor con un nombre de host o hostname. Se debe considerar que un nombre host correcto tiene la forma nombre.dominio. Su administrador de red sabr decirle que nombre de host usar. En caso de no contar con uno, ingrese un nombre ficticio ya que luego es posible cambiarlo. Escoja Aceptar para continuar.

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Configuracin de nombre de host

Huso horario, contrasea de root y paquetes


En la siguiente pantalla, seleccione el huso horario de su regin y presione Aceptar para continuar.

Seleccin de huso horario

Es hora de especificar la contrasea que ser usada por el usuario con privilegios de administrador de Elastix. Recuerde esta contrasea ya que es una parte crtica para la seguridad del sistema. Debido a la importancia de este paso, se requiere confirmar la contrasea ingresndola nuevamente. Presione Aceptar para seguir con la instalacin.

Especificando la contrasea de administrador (root)

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Formateo y copia de archivos


A partir de este momento el programa instalador particionar y formatear el disco duro del servidor y toda la informacin almacenada all se perder para siempre.

Formateo del disco duro

Adicionalmente, se copiarn todos los archivos necesarios para correr Elastix hacia el disco duro.

Copiado de archivos al disco duro

Una vez que termina la copia de paquetes al disco duro, el servidor se reiniciar automticamente.

Reinicio automtico y contraseas varias


Permita que el sistema arranque por s solo asegurndose de no presionar ninguna tecla en la siguiente pantalla.

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Pantalla de arranque de Elastix

Luego de cargar programas esenciales para su funcionamiento, Elastix proceder a solicitar contraseas para los componentes importantes que conforman su sistema. Esta fase de ingreso de claves solo se realizar en el primer arranque luego de la instalacin. La primera clave que se solicita es la del administrador para la base de datos MySQL. Ingrese una clave y contine con el botn de Aceptar

Contrasea de administracin para MySQL

Usted deber confirmar la clave anteriormente ingresada para administracin de MySQL nuevamente en la siguiente pantalla.

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Confirmacin de contrasea de administracin para MySQL

La siguiente contrasea ser utilizada para ingresar con privilegios de administrador a la interfaz grfica de Elastix. Adems, esta misma clave ser utilizada para ingresar a los componentes FreePBX, VTiger y A2Billing del sistema. Una vez digitada la clave, avance a la siguiente pantalla seleccionando Aceptar.

Contrasea de Elastix y sus componentes

Al igual que en el caso anterior, usted deber confirmar la clave anteriormente ingresada para Elastix y sus componentes. Luego de ingresarla nuevamente, presione Aceptar para continuar.

Confirmacin de contrasea de Elastix y sus componentes

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Finalizar la instalacin
El proceso de instalacin culminar cuando usted reciba la pantalla de invitacin a ingresar a la consola principal del servidor, tal como se muestra en la figura siguiente.

Autenticacin para ingreso a la consola de Elastix

Para acceder a la consola de Elastix, simplemente ingrese root en el prompt de pbx login. La contrasea es la que usted eligi durante el proceso de instalacin. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_5/5.1_Instalando_desde_CD.htm[24/11/2011 10:21:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

5.2 Instalando Elastix sobre un soft-RAID


Una configuracin muy til que Elastix ha heredado de Linux es la posibilidad de agregar tolerancia a fallos de disco duro por medio de RAID (discos redundantes) por software. Hacer esto nos permite agregar un nivel mnimo de redundancia a bajo costo. Generalmente es comn configurar RAID nivel 1 oespejo que nos permite tener duplicada la informacin de las particiones en sendos discos duros. El sistema operativo Linux hace que Elastix adicionalmente soporte RAID niveles 0 y 5. Es importante recalcar que no es estrictamente necesario que todas las particiones sean agregadas al arreglo. Sin embargo, es recomendable que si se tienen 2 discos duros, se haga un espejo de todas las particiones. Un esquema de particionamiento tpico en un servidor sin RAID consiste en una particin de 100MB para /boot, una particin de 2GB para la memoria swap y el resto del espacio del disco en una particin para la raz /. Si se sigue este mismo esquema pero con un arreglo RAID de nivel 1 se debern crear las tres particiones mencionadas en ambos discos duros. De esta forma, al final se tendrn seis particiones.. La configuracin del RAID por software (existe hardware que implementan RAID tambin) se la realiza durante el proceso de instalacin del Elastix. En el men de Tipos de Particionamiento debemos escoger la opcin de Crear diseo personalizado. Aqu es donde tendr la oportunidad de crear las particiones de tipo RAID y luego los dispositivos RAID que agrupan a estas particiones. Para empezar la instalacin de Elastix con RAID por software, empecemos con la instalacin de Elastix de manera habitual.

Pantalla de instalacin inicial

Al igual que en el proceso de instalacin comn se deber seleccionar el idioma del proceso de instalacin y el tipo de teclado de acuerdo al idioma.

Particiones del disco duro


http://www.elastixbook.com/es/capitulos/capitulo_5/5.2_Instalando_Elastix_sobre_un_soft-RAID.htm[24/11/2011 10:21:58 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Dentro de poco el programa instalador mostrar una pantalla preguntando el tipo de particionamiento que se va a realizar.

Opciones de tipo de particionamiento

Aqu usted debe elegir la opcin Crear diseo personalizado y asegurarse de que ambos discos duros del servidor estn listados y seleccionados. La pantalla de particionamiento mostrar el listado de discos duros con las particiones que se vayan creando.

Herramienta muestra discos duros an sin particionar

El primer paso ser crear todas las particiones de tipo RAID para lo cual se elige la opcin Nuevo.

http://www.elastixbook.com/es/capitulos/capitulo_5/5.2_Instalando_Elastix_sobre_un_soft-RAID.htm[24/11/2011 10:21:58 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Creando una particin RAID

En la pantalla siguiente se llenarn los siguientes parmetros: - Punto de montaje: No importa que opcin se escoja aqu, ya que se deshabilitar cuando se elija software RAID en el campo siguiente. - Tipo de sistema de archivos: Seleccione software RAID - Unidades admisibles: Escoja un disco a la vez (seleccionndolo con la barra espaciadora). - Tamao: Especifique el espacio en el disco duro que ser reservado para esta particin. - Forzar a particin primaria: No seleccionar. Cree tres particiones en cada uno de los discos. Para el tamao escriba 100 para la particin que luego ser asignada al directorio /boot y 2000 para la particin que luego ser asignada a la particin tipo swap. Para la particin que luego ser asignada al directorio raz o /, escriba 1 y seleccione la opcin ocupar todo el tamao disponible. Esto har que esta particin ocupe el resto del espacio en el disco duro. Una vez llenados los parmetros seleccione Aceptar. A medida que vaya creando las particiones se irn mostrando en la pantalla como se muestra a continuacin.

Particin tipo RAID por software en disco hda

Cuando se hayan creado las seis particiones (tres en cada disco duro), se debera tener un listado como el que se muestra debajo. Para nuestro ejemplo hemos usado un disco duro de 8GB de tal modo que la nica diferencia debe ser el tamao en la ltima particin.

Particiones de RAID por software

http://www.elastixbook.com/es/capitulos/capitulo_5/5.2_Instalando_Elastix_sobre_un_soft-RAID.htm[24/11/2011 10:21:58 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

En la figura anterior se aprecia que el particionamiento es exactamente igual para los dos discos duros.

Dispositivos RAID
El siguiente paso es la creacin de los dispositivos RAID en s. Para ello se selecciona la opcin de RAID.

Creacin de arreglo RAID

Ahora debemos crear los dispositivos RAID y que asociaran a las particiones en cada disco que sern replicadas. Para tal efecto debemos crear tres dispositivos accediendo a la pantalla de Crear un dispositivo RAID y llenando los parmetros de la manera siguiente: Punto de montaje: Escriba /boot para el primer dispositivo RAID, no escriba nada para el segundo dispositivo RAID (ya que ser de tipo swap) y escriba / para el tercer dispositivo. Tipo de sistema de archivos: Seleccione ext3 para el primer dispositivo RAID, swap para el segundo dispositivo y ext3 para el ltimo. Nivel de RAID: Seleccione RAID1 para los tres dispositivos. Miembros del RAID: Escoja el par de particiones que han sido creadas en cada uno de los discos duros respectivamente. Estas particiones se replicarn entre s. En nuestro caso hemos elegido hda1 del primer disco duro con hdb1 del segundo disco duro para el dispositivo RAID que ser montado como /boot. De la misma forma hemos apareado hda2 con hdb2 para el dispositivo swap y hda3 con hdb3 para el dispositivo /. Nmero de reservas: Este parmetro es aplicable en casos donde se cuenta con ms de dos discos duros. En nuestro caso solo tenemos dos discos as que el valor de 0 es la nica opcin. Desea formatear las particiones?: Este campo debe ser seleccionado.

Una vez creados los tres dispositivos RAID, el listado de particiones lucir muy similar al que se muestra en la figura siguiente.

http://www.elastixbook.com/es/capitulos/capitulo_5/5.2_Instalando_Elastix_sobre_un_soft-RAID.htm[24/11/2011 10:21:58 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Particionamiento final de RAID nivel 1 por software

Seleccione la opcin Aceptar para continuar con la instalacin. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_5/5.2_Instalando_Elastix_sobre_un_soft-RAID.htm[24/11/2011 10:21:58 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

6
Introduccin a Elastix
Los que dicen imposible no deberan interrumpir a los que estn intentando -- Proverbio Chino La intencin del presente captulo es la de hacer un sobrevuelo rpido por Elastix, tratando de aclarar los conceptos bsicos antes de abordar temas ms avanzados. Como el lector podr notar no se trata de un captulo muy tcnico sino ms bien informativo a nivel general.

6.1 Qu es Elastix?
Elastix es una distribucin de software libre de Servidor de Comunicaciones Unificadas que integra diferentes tecnologas de comunicaciones en un solo paquete como: PBX Fax Email Mensajera Instantnea (IM) Calendario Colaboracin Al decir distribucin nos referimos al concepto de distro. Es decir, un conjunto de paquetes de software que se distribuyen juntos en un mismo medio, en este caso un CD, incluyendo el instalador y el sistema operativo. Una vez instalada la distro tendremos un Servidor de Comunicaciones Unificadas listo para produccin. Elastix implementa gran parte de su funcionalidad sobre cuatro programas de software muy importantes como son
http://www.elastixbook.com/es/capitulos/capitulo_6/6.1_Que_es_Elastix.htm[24/11/2011 10:21:59 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Asterisk, Hylafax, Postfix y Openfire. Estos programas brindan las funciones de PBX, Fax, Email y Mensajera Instantnea, respectivamente. El sistema operativo se basa en la popular distribucin de Linux orientada a servidores llamada CentOS. A continuacin se muestra una figura donde se pueden observar los componentes de Elastix y su relacin entre s.

Esquema general de los componentes de Elastix

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_6/6.1_Que_es_Elastix.htm[24/11/2011 10:21:59 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

6.2 Breve historia del proyecto


Elastix fue creado y actualmente es mantenido por la compaa ecuatoriana PaloSanto Solutions. Elastix fue liberado como software libre por primera vez en Marzo de 2006. Inicialmente no se trataba de una distro sino ms bien de una interfaz para mostrar registros de detalles de llamadas para Asterisk (CDRs). Fue recin a finales de Diciembre de 2006 cuando se lo lanz como una distribucin que contena diversas herramientas administrables bajo una misma interfaz Web y que llam la atencin por su usabilidad. Desde entonces hasta la fecha Elastix no ha parado de crecer en popularidad, habiendo superado en 2010 su primer milln de descargas.

Galardones
En 2007 el proyecto estuvo nominado en 2 categoras para los premios Community Choice Awards (CCA) de SourceForge y volvi a ser nominado en 2008 y 2009. En Febrero de 2011 recibi el premio a Mejor Producto del ao 2010 otorgado por la compaa de medios TMC, quienes adems publican la revista Internet Telephony. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_6/6.2_Breve_historia_del_proyecto.htm[24/11/2011 10:22:00 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

6.3 Caractersticas de Elastix


Es difcil enlistar todas las caractersticas de Elastix debido a que constantemente se aaden ms funcionalidades. Sin embargo, las ms sobresalientes basados en Elastix 2.0 son las siguientes:

PBX
Voicemails va Web o email Grabacin de llamadas IVR completo y altamente flexible Parqueo de llamadas Colas de atencin Soporte de sntesis de voz Identificacin de llamadas Horarios de atencin Provisin automtica de telfonos va Web Creacin de lotes de extensiones Soporte para video va H.263 y H.264 Deteccin automtica de hardware de telefona Servidor DHCP embebido Reporte de detalle de llamadas (CDRs) Tarifacin con reportacin de consumo por destino Reporte de uso de canales por tecnologa (SIP, ZAP, IAX, Local, H323) Soporta protocolos SIP, IAX, H323, MGCP, iLBC, entre otros Soporta codecs ADPCM, G.711 (A-Law & -Law), G.722, G.723.1 (pass through), G.726, G.729, GSM, iLBC, entre otros Soporte para interfaces anlogas FXS/FXO Soporte para interfaces digitales E1/T1/J1 (PRI/BRI/R2) Soporte para grupos de troncales Follow-me, grupos de ringado, paging, DISA, Call back, PINes de seguridad, entre otros

Fax
Servidor de Fax administrable desde Web Visor de Faxes integrado con descargas en PDF Integracin fax-a-email Envo de fax va Web Control de acceso para clientes de fax Capacidad de integracin con WinprintHylafax para permitir imprimir-a-fax desde Windows.

http://www.elastixbook.com/es/capitulos/capitulo_6/6.3_Caracteristicas_Elastix.htm[24/11/2011 10:22:01 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Email
Servidor de Email multi-dominio administrable va Web Soporte para SMTP saliente Configuracin de email relay Cliente de Email basado en Web Soporte para cuotas en las cuentas de email Funcionalidad de listas de distribucin va Mailman

Mensajera instantnea (IM)


Servidor de mensajera instantnea basado en OpenFire integrado Llamada va PBX a usuarios conectados Configuracin completamente basada en Web Interconexin simultnea a Yahoo, MSN Messenger, GTalk, ICQ, entre otros Soporta conexiones server-to-server para compartir usuarios Reporte de sesiones de usuarios Soporte para plugins Soporte para LDAP

Calendario
Interfaz de calendario va Web Recordatorios de voz Envo de invitaciones a eventos va email Exportacin de calendario a formato iCalendar

Colaboracin
Libreta telefnica (Phone Book) con capacidad para click-to-call Funcionalidad de CRM integrada va vTigerCRM Soporte para teleconferencias de audio configurable va Web Funcionalidad de conferencias Web va Addons

Call Center
Soporte para agentes con logon/logoff Marcacin predictiva Formularios genricos para ingreso de datos Disponibilidad de reportes detallados por agente

http://www.elastixbook.com/es/capitulos/capitulo_6/6.3_Caracteristicas_Elastix.htm[24/11/2011 10:22:01 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

General
Ayuda en lnea embebida Interfaz Web con soporte multi-lenguaje Visualizacin del sistema va Dashboard Configuracin de fecha/hora/uso horario Configuracin de parmetros de red Configuracin de usuarios y permisos Configuracin de respaldos Configuracin de temas o skins Actualizacin centralizada de software Apagado y encendido remoto va Web Visualizacin del sistema en tiempo real va Operator Panel Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_6/6.3_Caracteristicas_Elastix.htm[24/11/2011 10:22:01 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

6.4 Licenciamiento
Elastix es software libre distribuido bajo la licencia GPL versin 2. Es decir que puede ser usado, copiado, estudiado, modificado y redistribuido libremente segn los lineamientos de esta licencia. Para acceder al texto completo de la licencia el lector puede seguir el siguiente vnculo. http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_6/6.4_Licenciamiento.htm[24/11/2011 10:22:01 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

6.5 Elastix.org: Sitio oficial del proyecto


El principal recurso al que puede acceder el usuario en busca de informacin acerca de Elastix es el sitio Web oficial del proyecto ubicado en http://www.elastix.org En este sitio el usuario puede encontrar herramientas de soporte tiles como: Foros Wiki Chat en vivo Suscripcin a listas de correo Links a descargas

Foros
Una de las herramientas ms importantes en el sitio Web Elastix.org son los foros. Los foros son muy activos y para participar en ellos basta registrarse gratuitamente como usuario. Sin duda esta es una buena manera de buscar solucin a problemas comunes y los desarrolladores de Elastix suelen visitar esta herramienta a la caza de posibles bugs. Sin embargo, el foro es un lugar pblico as que antes de participar hay que tener en cuenta algunas reglas de etiqueta de foros bsicas. Antes de preguntar en el foro busque si su problema ha sido resuelto antes. La mayora de problemas comunes ya han sido reportados antes. Si vuelve a preguntar es posible que no le contesten adecuadamente, recuerde que es un foro pblico. Los foros se encuentran organizados de cierta manera. Se debe tratar en todo momento de aadir un nuevo comentario a la categora correcta. Caso contrario se puede desorganizar el foro y el nuevo comentario podra ser ignorado. Use un lenguaje adecuado para no herir la susceptibilidad de nadie. Si su mensaje contiene lenguaje subido de tono, amenazante o mal intencionado, su mensaje puede ser eliminado permanentemente. La amabilidad es un buen ingrediente si desea que otras personas colaboren con su problema. El foro no es un espacio publicitario. No adjunte imgenes o archivos pesados. Si necesita subir un archivo mayor a 2 MB trate de subirlo a otro servidor y simplemente copie el vnculo. Use un ttulo de mensaje relevante y si en algn momento la discusin cambia de tpico, abra otro mensaje para tratar el nuevo tema. Esto ayudar a tener el foro ms legible. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_6/6.5_Elastix.org_Sitio_oficial_del_proyecto.htm[24/11/2011 10:22:02 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

6.6 La interfaz Web de Elastix


Finalmente lleg el momento de ingresar a la interfaz Web de Elastix. Bueno, realmente no creo que el lector haya llegado hasta aqu sin haber ingresado antes a la interfaz de administracin Web (por lo menos para curiosear), pero quera decirlo de esta manera para expresar la importancia de este momento. La interfaz Web de administracin es el componente que define a Elastix. Sin este componente Elastix no fuera lo que es, ya que uno de los objetivos del producto es la facilidad de uso. A menos que se trate de alguna configuracin personalizada desde aqu es posible administrar prcticamente todo. Se puede utilizar cualquier navegador de Internet para acceder a esta interfaz. Sin embargo, dado que el equipo de desarrollo de Elastix usa principalmente Firefox para sus pruebas, recomendamos el uso de este navegador. Para ingresar debemos apuntar a la direccin IP del servidor Elastix desde el navegador y veremos una pantalla como la siguiente.

Pantalla de ingreso a la interfaz Web de administracin

Al momento de instalacin el sistema gener de manera automtica un usuario llamado admin. Este usuario tiene privilegios de administrador y nos servir para ingresar por primera vez. Notar que el nombre de usuario se encuentra todo en minsculas. La contrasea para ingresar es la misma que se ingres durante el proceso de instalacin (ver captulo 5). Una vez validado el nombre de usuario y contrasea el sistema nos mostrar la interfaz de administracin. Lo primero que veremos ser el Dashboard que es bsicamente una pantalla de resumen con algo de estadstica de uso de recursos y estado actual de los procesos ms importantes del sistema.

El dashboard de Elastix
http://www.elastixbook.com/es/capitulos/capitulo_6/6.6_La_interfaz_Web_de_Elastix.htm[24/11/2011 10:22:04 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Lo siguiente es personalizar un poco la interfaz a nuestras necesidades. Algunas sugerencias son: asegurarnos que el idioma a utilizar sea el Espaol, que la fecha y hora del sistema, as como el huso horario, se encuentren correctos, e inclusive podramos jugar un poco cambiando el look-and-feel de la interfaz. Todo esto se puede hacer desde el men System -> Preferences.

Preferencias del sistema

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_6/6.6_La_interfaz_Web_de_Elastix.htm[24/11/2011 10:22:04 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

6.7 Configuracin de red


Usualmente la primera cosa importante que se debe configurar luego de ingresar al equipo por primera vez son los parmetros de red debido a que por omisin Elastix usa un servidor DHCP para obtener una direccin IP y esto no es lo ideal si vamos a montar un servidor de comunicaciones unificadas. Lo deseable es usar una direccin IP esttica. La configuracin de los parmetros de red puede hacerse desde el men Sistema -> Red. Aqu podremos configurar dos cosas: los parmetros generales de red y los parmetros asociados con cada una de las tarjetas de red que el servidor tenga instaladas, incluyendo las que vienen embebidas en la placa madre o mainboard.

Configuracin de parmetros de red

Para editar los parmetros generales de red damos clic en el botn Editar Parmetros de Red que aparece en la parte superior de la pantalla anterior. Esto nos conducir a otra pantalla que se muestra a continuacin.

Configuracin de parmetros bsicos de red

A continuacin se explica el significado de cada uno de los campos solicitados. Host: Nombre del Servidor, por ejemplo: pbx.example.com Puerta de Enlace: Direccin IP de la Puerta de Enlace (Gateway) DNS Primario: Direccin IP del Servidor de Resolucin de Nombres (DNS) Primario DNS Secundario: Direccin IP del Servidor de Resolucin de Nombres (DNS) Secundario o Alternativo. Para editar los parmetros asociados con cada tarjeta de red debemos dar clic el nombre de dicha interfaz. En nuestro ejemplo daremos clic donde dice Ethernet 0 y seremos conducidos a la siguiente pantalla.

http://www.elastixbook.com/es/capitulos/capitulo_6/6.7_Configuracion_de_red.htm[24/11/2011 10:22:05 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Edicin de los parmetros asociados con una tarjeta de red

Como podemos observar aqu podemos cambiar la asignacin de IP de DHCP a Esttica que es lo que queramos. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_6/6.7_Configuracion_de_red.htm[24/11/2011 10:22:05 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

6.8 Sobrevuelo por la interfaz de administracin Web de Elastix


La interfaz Web de Elastix es una aplicacin completa de administracin del servidor de comunicaciones unificadas escrita en su mayora en lenguaje PHP. En esta seccin haremos un sobrevuelo de la funcionalidad ms importante que podemos administrar desde esta interfaz. Adems explicaremos cmo se encuentran organizados los mens y mdulos con los que cuenta Elastix.

Mens y mdulos
La interfaz Web de Elastix se encuentra organizada en mens. As tenemos los mens de primer nivel como: Sistema, Agenda, Email, Fax, PBX, IM, etc., y tambin tenemos los mens de segundo nivel, tambin llamados sub-mens. Un men se puede entender como un contenedor que sirve para organizar la interfaz de Elastix. Un mdulo es cambio es un componente de Elastix que nos ofrece algn tipo de funcionalidad. Los mdulos son contenidos por mens o sub-mens para de esta forma ser organizados dentro de la interfaz Web y que el usuario pueda acceder a ellos navegando entre los mens. En el siguiente ejemplo se puede observar que el mdulo Fecha/Hora se encuentra contenido dentro del men (o sub-men) Preferencias, el cual a su vez se encuentra contenido dentro del men Sistema. La ubicacin del mdulo puede entonces ser referida como Sistema Preferencias Fecha/Hora.

Ejemplo de men, sub-men y mdulo

En ocasiones un mdulo puede estar contenido dentro de solo un men como en la siguiente figura.

http://www.elastixbook.com/es/capitulos/capitulo_6/6.8_Interfaz_de_administracion_Web_de_Elastix.htm[24/11/2011 10:22:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Otro ejemplo de men y mdulo

Nota: Es importante tener presente el concepto de mdulo y men, especialmente si se est interesado en modificar el cdigo de Elastix para realizar alguna personalizacin.

Navegando por la interfaz Web


A continuacin navegaremos por la interfaz Web de Elastix, explicando brevemente el significado de cada men y mdulo. Cada men de primer nivel aparecer encabezando la tabla y cada submen aparecer en negritas. Nota: Es importante mencionar que en el siguiente listado slo se incluyen los mens que se instalan por defecto. Es decir que no se incluyen mens que se instalan a travs de Addons como el mdulo de Call Center o el de Web Conference.

System Dashboard Dashboard es una especie de escritorio donde el usuario puede ver un resumen de la actividad en Elastix como sus ltimos emails, voicemails, faxes, y citas de calendario. El usuario administrador tiene una interfaz diferente donde adems puede monitorear el rendimiento del sistema y otras funciones tiles con solo aadir applets. Configuracin de parmetros de red Especificar direccin IP y mscara de red, gateway, nombre de host, servidores DNS, entre otros. Habilitar el servidor DHCP embebido que viene con Elastix Mostrar lista de clientes DHCP conectados Asignar direccin IP a un cliente especifico Administracin de usuarios de Elastix Especificar grupos de usuarios Administrar usuarios y asignarlos a grupos. Tambin permite asociar cuentas de email y extensiones telefnicas a los usuarios

Network Network Parameters

DHCP Server DHCP Client List Assign IP Address to Host User Management Groups Users

http://www.elastixbook.com/es/capitulos/capitulo_6/6.8_Interfaz_de_administracion_Web_de_Elastix.htm[24/11/2011 10:22:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Group Permissions

Shutdown Hardware Detector Updates Packages Repositories Backup/Restore Preferences Language Date/Time Themes Currency Dashboard Applet Admin

Configuracin de los permisos de acceso a los diferentes mdulos para un grupo determinado Apagar o reiniciar el servidor Deteccin de hardware telefnico Actualizacin de paquetes de software Listado de paquetes con la opcin de instalar o actualizar Configuracin de los repositorios en base a los cuales se realizan las actualizaciones Generar respaldos y restituir informacin para el servidor Elastix Especificar las varias preferencias del sistema Cambio del idioma de toda la interfaz Web de Elastix Cambio de la fecha, hora y zona horaria del servidor Cambio de los temas (skins) para darle a la interfaz de Elastix un look diferente Cambio del smbolo de la divisa que se muestra en los reportes de tarifacin Seleccin de los applets incluidos en el Dashboard del sistema

Agenda Calendar Agendar eventos en formato calendario que inclusive pueden generar llamadas telefnicas automticas Libreta de direcciones para contactos Grabacin de mensajes que se pueden asociar con eventos agendados en el mdulo Calendar

Address Book Recordings

Email Domains Accounts Creacin de dominios de email. Elastix soporta mltiples dominios Administracin de cuentas de email y asignacin de cuotas de espacio en disco duro Configuracin de relay permite usar Elastix para enviar email desde otras redes Cliente de email basado en Web va Roundcube Habilitar deteccin de correo SPAM y

Relay Webmail Antispam

http://www.elastixbook.com/es/capitulos/capitulo_6/6.8_Interfaz_de_administracion_Web_de_Elastix.htm[24/11/2011 10:22:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Remote SMTP Email list

especificar la sensibilidad Configurar salida de emails por medio de un servidor SMTP remoto Aadir soporte para listas de distribucin (mailing lists) va Mailman

Fax Virtual Fax Virtual Fax List New Virtual Fax Send Fax Fax Master Administracin de faxes virtuales Listado de extensiones de fax virtuales que recibirn faxes en formato PDF va email Creacin de extensiones de fax nuevas Envo de fax desde la interfaz misma como texto simple o documento adjunto Establecimiento de una direccin email que recibir notificaciones del funcionamiento del fax Configuracin de permisos de acceso para aplicaciones clientes de fax Visualizacin de faxes en formato PDF Configuracin de plantilla de email que se enviar cada vez que arribe un fax

Fax Clients Fax Viewer Email Template

PBX PBX Configuration Aplicacin FreePBX embebida permite la mayora de configuraciones a nivel de central telefnica Permite la visualizacin de extensiones, troncales y colas en uso en tiempo real Listado de voicemails. Se debe haber asociado previamente al usuario con una extensin telefnica para poder verlo Listado de grabaciones telefnicas. Se debe haber asociado previamente al usuario con una extensin telefnica para poder verlo Permite provisionar un gran nmero de telfonos en corto tiempo Generar teleconferencias de audio Permite crear un gran nmero de extensiones en corto tiempo Acceso a varias herramientas tiles Ejecucin de comandos del CLI Edicin de archivos de texto Conversin de texto a audio Alternativa de panel de operador basado en flash.

Operator Panel Voicemail

Monitoring

Endpoint Configurator Conference Batch of Extensions Tools Asterisk-Cli Asterisk File Editor Text to Wav Flash Operator Panel

http://www.elastixbook.com/es/capitulos/capitulo_6/6.8_Interfaz_de_administracion_Web_de_Elastix.htm[24/11/2011 10:22:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

VoIP Provider

Configuracin de troncales VoIP con plantillas para ciertos proveedores

IM OpenFire Interfaz embebida para administrar el servidor mensajera instantnea llamado Openfire

Reports CDR Report Channel Usage Reporte de detalles de llamadas (CDRs) con opciones de filtrado Reporte de uso de canales muestra grficos por diferentes tipos de tecnologa como SIP e IAX Especificacin de preferencias de tarifacin Establecer tarifas dependiendo de la troncal y del prefijo telefnico Tarifacin histrica con opciones de filtrado. Visualizacin de grfico de pastel de la distribucin para destinos por costo, duracin y nmero de llamadas Configuracin de las troncales habilitadas para la tarifacin y tarifa por defecto Reporte del sistema de Asterisk (log) con opciones de filtrado Visualizacin de datos generales de llamadas entrantes y salientes en formato grfico para extensiones, troncales y colas Resumen de llamadas entrantes, salientes y su duracin por cada extensin con reporte grfico

Billing Rates Billing Report Destination Distribution

Billing Setup Asterisk Logs Graphic Report

Summary by Extension

Extras vTigerCRM Calling Cards Downloads Softphones Fax Utilities Instant Messaging Permite integracin de Elastix con funcionalidad de CRM Brinda funcionalidad de tarjetas de llamadas va A2Billing Listado de descargas recomendadas Aplicaciones de softphones disponibles Aplicaciones de fax disponibles Aplicaciones de mensajera instantnea (IM) disponibles

http://www.elastixbook.com/es/capitulos/capitulo_6/6.8_Interfaz_de_administracion_Web_de_Elastix.htm[24/11/2011 10:22:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Addons Available Installed Anterior Listado de mdulos disponibles extender la funcionalidad de Elastix Listado de mdulos instalados Ir a ndice para

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_6/6.8_Interfaz_de_administracion_Web_de_Elastix.htm[24/11/2011 10:22:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

6.9 Administracin de usuarios


Como ya vimos antes en este mismo captulo, Elastix crea por omisin un usuario llamado admin que posee privilegios de administrador del sistema. Este usuario puede parecer todo lo que necesitamos en un principio pero Elastix nos da la posibilidad de crear nuevos usuarios con distintos niveles de privilegios, permitindonos de este modo que usuarios diferentes al administrador accedan a la interfaz pero con privilegios limitados. Por ejemplo, podramos crearle un usuario al recepcionista telefnico para que pueda tener acceso al panel de operador y contestar, parquear o transferir llamadas de una manera amigable. Tambin podramos crearle un usuario al departamento de auditora para que tenga acceso a diferentes reportes como el detalle de llamadas y pueda ver el consumo telefnico hacia destinos internacionales. Podramos tambin crearle un usuario al departamento de ventas para que puedan tener acceso al CRM integrado. En general Elastix nos proporciona un poderoso y flexible sistema de permisos que nos permitir crear un usuario inclusive a cada empleado de la empresa usuaria de Elastix.

Grupos de usuarios
Todo usuario de la interfaz Web de Elastix debe pertenecer a un grupo. Por ejemplo, el usuario admin que hemos usado antes pertenece a un grupo llamado administrator. Este grupo tiene acceso a todos los mens de Elastix. Elastix viene con 3 grupos creados por omisin: administrator, operator y extension. Como se puede deducir a simple vista estos grupos sirven para crear usuarios con privilegios de administrador, operador y extensin, respectivamente.

Administracin de grupos

Como podemos ver en la figura anterior tambin es posible crear nuevos grupos de usuarios. Cada grupo de usuarios tiene asociado una matriz de permisos que explicaremos ms adelante. Del mismo modo es posible cambiar la matriz de permisos asociada a los grupos creados por omisin. Es por esto que prrafos ms arriba hablbamos de un sistema de permisos flexible.

Permisos de grupo
Cada grupo de usuarios tiene una matriz de permisos que asocia el grupo de usuarios con los mdulos a los cuales dicho grupo tendr acceso. De este modo podemos configurar una matriz personalizada para cada necesidad,

http://www.elastixbook.com/es/capitulos/capitulo_6/6.9_Administracion_de_usuarios.htm[24/11/2011 10:22:08 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

nicamente seleccionando los mdulos adecuados. Esta matriz de permisos se configura desde Sistema Administrar Usuarios Permisos de Grupo.

Administracin de permisos de grupo

Creacin de usuarios
Ahora que ya se han explicado los conceptos de grupos de usuarios y permisos de grupo procederemos a crear un nuevo usuario para la interfaz Web de Elastix. El mdulo de usuarios se encuentra ubicado en Sistema Administrar Usuarios Usuarios. All veremos el listado de usuarios activos as como tambin un botn con la etiqueta Crear Nuevo Usuario. Damos clic en dicho botn y accederemos a la siguiente pantalla.

Pantalla de creacin de nuevo usuario

A continuacin una breve explicacin del significado de cada uno de los campos.

Login: El nombre de usuario (username). No debe contener espacios en blanco. Nombre: El nombre completo del usuario. Por ejemplo Juan Prez. Contrasea: La clave de acceso Confirmar Contrasea: Se debe introducir nuevamente la clave de acceso para verificar. Grupo: El grupo de usuarios al cual pertenecer el usuario. Extensin: La extensin de PBX que se asociar al usuario. De este modo cuando el usuario ingrese a la interfaz podr ver sus voicemails, grabaciones, detalles de llamadas y otra funcionalidad relacionada con su extensin. Usuario de Webmail: El nombre de usuario de correo electrnico creado en el propio Elastix.
http://www.elastixbook.com/es/capitulos/capitulo_6/6.9_Administracion_de_usuarios.htm[24/11/2011 10:22:08 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Dominio de Webmail: El nombre de dominio del servidor de correo electrnico. Contrasea de Webmail: La clave de la cuenta de correo electrnico. Reingrese contrasea de Webmail: Se debe introducir nuevamente la clave de la cuenta de correo electrnico para propsitos de verificacin. Ir a ndice Siguiente

Anterior

http://www.elastixbook.com/es/capitulos/capitulo_6/6.9_Administracion_de_usuarios.htm[24/11/2011 10:22:08 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

7
Configuracin Bsica de PBX
Educacin es elevar al hombre al nivel de su tiempo -- Jos Mart La caracterstica de PBX es una de las ms importantes de Elastix. En este captulo explicaremos cmo configurar una PBX bsica usando solamente la interfaz Web de Elastix. Una vez terminada la configuracin de la PBX podremos hacer llamadas entre extensiones y hacer uso de algunas caractersticas interesantes como voicemail o msica en espera. En los siguientes captulos aprenderemos cmo conectar esta PBX al mundo exterior para poder utilizarla en la prctica.

7.1 Creando una extensin


Definir y editar extensiones es probablemente la tarea ms comn realizada por un administrador de PBX. En la versin 2.0 de Elastix es posible la creacin de cinco tipos de dispositivos o tecnologas soportadas para definir una extensin: SIP, IAX2, DAHDI, Custom y Virtual. Para crear una Nueva extensin debemos ingresar al Men PBX. Por defecto se accede a la seccin PBX Configuration. En esta seccin escogemos del panel izquierdo la opcin Extensiones. Ahora podremos crear una nueva extensin. Primero escoja el dispositivo de entre las opciones disponibles:

http://www.elastixbook.com/es/capitulos/capitulo_7/7.1_Creando_una_extension.htm[24/11/2011 10:22:10 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Creando nueva extensin

Generic SIP Device: El SIP es el protocolo estndar para telfonos IP y ATAs. La mayora de telfonos IP soportan SIP. Generic IAX2 Device: IAX es el protocolo Inter Asterisk Exchange, un nuevo protocolo soportado actualmente por algunos dispositivos. Generic ZAP Device: Este dispositivo est asociado a los canales DAHDI. Es un dispositivo de hardware conectado al servidor Elastix. Other (Custom) Device: Custom nos permite escribir directamente una entrada en los archivos de configuracin y por ende esta entrada debe estar en formato de extensin entendible por Asterisk. Puede tambin ser utilizado para relacionar una extensin a un nmero externo. Por ejemplo, para encaminar la extensin 211 a nmero 1-800-555-1212, se puede crear una extensin Custom con nmero 211 y en la caja de texto del campo dial se puede ingresar: Local/18005551212@outbound-allroutes. None (virtual exten): Aade la capacidad de crear una extensin virtual. A continuacin nos aparecer un formulario que vara un poco dependiendo de lo que hayamos escogido previamente. Nosotros supondremos que el usuario ha escogido SIP pues es lo ms comn.

http://www.elastixbook.com/es/capitulos/capitulo_7/7.1_Creando_una_extension.htm[24/11/2011 10:22:10 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Formulario de creacin de nueva extensin SIP

Como podemos observar se pueden configurar aqu muchas cosas interesantes pero no todos los datos son necesarios para conseguir una extensin funcional as que explicaremos slo los ms importantes. User Extension: Debe ser nico. ste es el nmero que se puede marcar de cualquier otra extensin. Puede ser de cualquier longitud, pero convencionalmente se utiliza una extensin de tres o cuatro cifras. Display Name: Es el nombre del Caller ID para que las llamadas de este usuario puedan ser identificadas con un nombre. Slo debe ingresar el nombre, no la extensin. Secret: Esta es la contrasea usada por el dispositivo de telefona para autenticarse contra el servidor de Asterisk que viene en Elastix. Esto es configurado generalmente por el administrador antes de entregar el telfono al usuario y generalmente no se requiere que lo conozca el usuario. Si el usuario est utilizando un softphone, entonces necesitar saber esta contrasea para configurar su software.

Configuracin de telfono IP
Para probar si la extensin creada hasta aqu funciona correctamente debemos configurar un telfono IP para que se registre en el servidor Elastix (con las credenciales de acceso creadas). Si el lector desea probar esto ahora puede remitirse al captulo 9 de la presente obra, donde se explica en extenso cmo configurar tanto un telfono IP fsico como un softphone instalado en un computador. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_7/7.1_Creando_una_extension.htm[24/11/2011 10:22:10 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

7.2 Configuraciones generales


En esta seccin se configuran parmetros generales del sistema Elastix en lo que tiene que ver con telefona. Para acceder a la configuracin general debemos ir al men PBX Configuracin General. All nos aparecer la siguiente pantalla.

Formulario de modificacin de configuraciones generales

A continuacin se explicarn las opciones de dicha pantalla. Opciones del comando dial: Explicaremos esto ms al detalle en breve.

http://www.elastixbook.com/es/capitulos/capitulo_7/7.2_Configuraciones_generales.htm[24/11/2011 10:22:11 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Opciones para Company Directory Find users in the Company Directory by: El directorio de una empresa se puede escuchar marcando *411 # cuando se escucha un IVR. Esta opcin configura de qu modo se ubicarn los usuarios en el directorio. Existen 3 maneras: deletreando las 3 primeras letras del apellido, deletreando las 3 primeras letras del nombre, y deletreando las 3 primeras letras del apellido y nombre al mismo tiempo. Announce Extension: Activa el mensaje que reproduce: Por favor mantngase en la lnea mientras transfiero su llamada a la extensin XXX. Es decir, menciona la extensin a donde se va a transferir la llamada. Esto es til en casos donde el llamante no conoce previamente la extensin a la cual se le va a transferir, como por ejemplo cuando marca una opcin (Ej. Opcin 3) para ser transferido a un representante de ventas. En estos casos puede ser til que el llamante sepa la extensin a la que fue transferido para poder recordarla en futuras llamadas y saltarse el IVR. Operator Extension: Aqu se debe ingresar la extensin del operador, la cual ser el destino si un llamante presiona el cero 0. ste destino podra ser una extensin, un grupo de extensiones o inclusive un nmero telefnico externo. Security Settings: Permite a annimas llamadas SIP ser conectadas. El valor por omisin es no. Online updates: Permite revisar por actualizaciones disponibles. El valor por omisin es yes.

Opciones del comando Dial


Tal como se observa en la figura anterior la mayora de ocasiones este campo se llena con las letras tr. Realmente aqu se han ingresado dos opciones, la opcin t y la opcin r, lo que significa que la persona que recibe la llamada puede transferirla y que adicionalmente se enviar un tono de timbrado de vuelta al llamante. A continuacin se enlistan todas las opciones disponibles. A(X): Toca un anuncio a la persona llamada, usando X como archivo. D(dgitos): Enva la secuencia de dgitos DTMF luego que el destino ha contestado. h: Permite a la persona llamada colgar enviando el dgito *. H: Permite al llamante colgar enviando el dgito *. r: Enva un tono de timbrado a la parte llamante. T/t: Permite a la parte (llamante/llamada) transferir llamadas. W/w: Permitir a la parte (llamante/llamada) iniciar la grabacin de la llamada en curso, el cdigo por defecto para iniciar la grabacin de llamada es *1. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_7/7.2_Configuraciones_generales.htm[24/11/2011 10:22:11 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

7.3 Configuracin de colas


Las colas consisten en grupos de usuarios para los cuales se definen ciertas polticas (o estrategias) principalmente en lo que tiene que ver con llamadas entrantes. Las colas pueden ser creadas como una extensin ms. Los usuarios de las colas pueden ser estticos, llamados miembros (es decir que tienen un nmero de extensin fijo) o usuarios dinmicos, llamados agentes (es decir que pueden ingresar a la cola desde cualquier extensin). Una poltica o estrategia define la manera cmo se distribuyen las llamadas entrantes a la cola entre los miembros o agentes. Las polticas de cola que soporta Asterisk al momento son las siguientes: Sonar todos: Timbra las extensiones de todos los agentes hasta que uno conteste. Esta es la opcin por defecto. Agente con ltima llamada ms antigua: Timbra la extensin del agente que menos recientemente contest una llamada de esta cola. Agente con menos llamadas: Timbra la extensin del agente que menos llamadas haya atendido en esta cola. Aleatorio: Timbra las extensiones de manera aleatoria. Con memoria: Timbra la extensin de cada agente de manera secuencial, pero recuerda cul fue el agente que atendi la ltima llamada para proceder a timbrar la prxima llamada al siguiente agente. Linear: Timbra las extensiones de los agentes en el orden especificado, en el orden en que los agentes se han logoneado a la cola. Wrandom: Timbra las extensiones de los agentes de manera aleatoria pero utilizando una penalidad como medida de probabilidad. Para configurar una cola en Elastix tenemos que ir al Mdulo PBX y escoger en el men llamado Colas. Para aadir una nueva cola deberemos llenar el siguiente formulario.

http://www.elastixbook.com/es/capitulos/capitulo_7/7.3_Configuracion_de_colas.htm[24/11/2011 10:22:13 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Formulario para aadir nueva cola

Nmero de Cola: Este es el nmero que debe ser discado para ingresar a la cola. Nombre de Cola: Un nombre para la cola. Este es usado nicamente para propsitos de identificacin. Contrasea de Cola: A una cola se le puede poner una clave. Cualquier llamante que intente ingresar a la cola debe digitar dicha clave. Prefijo del nombre del CID: Como un agente puede iniciar sesin y atender llamadas de varias colas al mismo tiempo, es til colocarle un prefijo al Caller ID de las llamadas para que cuando el agente reciba la llamada entrante en su telfono, pueda saber a travs de este CallerID que la llamada pertenece a una cola determinada. Agentes Fijos: Estos son las extensiones que siempre atendern llamadas que lleguen a la cola. Agentes Dinmicos: Aqu se especifican los miembros que no usan una extensin fija para atender las llamadas de la cola, sino que deben iniciar sesin en la cola y atienden desde cualquier extensin que est disponible. Anuncio de Agente: Este es un anuncio que es reproducido al agente antes de que una llamada le sea transferida. Esto es til cuando los agentes no tienen deteccin de Caller ID en su telfono y se desea saber que una llamada proviene de una cola especifica.

http://www.elastixbook.com/es/capitulos/capitulo_7/7.3_Configuracion_de_colas.htm[24/11/2011 10:22:13 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Clase de Msica en espera: Hace posible la seleccin de qu clase de msica ser reproducida al llamante mientras est en la cola a la espera de que un agente lo atienda. Tiempo mximo de espera: Es el tiempo mximo que una llamada permanecer en la cola antes de ser desviada la llamada al destino en caso de fallo. La accin a tomar despus de este tiempo es configurada en la seccin Destino en caso de fallo. Llamantes Mximos: Es el mximo nmero de personas permitidas a esperar en la cola. Si este nmero es alcanzado, las llamadas en exceso sern desviadas al destinado configurado en Destino en caso de Fallas. Entrar si vaca: Si se desea que los llamantes ingresen a una cola vaca (sin agentes), entonces hay que cambiar este parmetro a yes. Esto no es recomendado. Salir cuando vaca: Se cambia a yes si se desea no dejar ingresar ms llamadas en el momento en que haya salido el ultimo agente de atencin en la cola. Estrategia de timbrado: Hay 7 tipos de estrategia de timbrado, la cuales fueron explicadas anteriormente: - Sonar todos - Agente con ltima llamada ms antigua - Agente con menos llamadas - Aleatorio - Con memoria - Linear - Wrandom Tiempo de espera de agente: El tiempo en que le sonar la extensin a cada agente miembro de la cola antes de enviar la llamada a otro agente. Reintentar: El tiempo que el sistema va a esperar luego de haber hecho sonar todas las extensiones de todos los agentes miembros antes de volver a llamarlos a todos. Wrap-up-time: Despus de una llamada exitosa, indica el nmero de segundos antes de declarar al agente libre y enviarle una nueva llamada, El valor por defecto es 0. Grabacin de llamadas: Opcin de grabar las llamadas entrantes a la cola. Destino en caso de falla: Este el destino si una llamada de la cola no pudo ser atendida.

http://www.elastixbook.com/es/capitulos/capitulo_7/7.3_Configuracion_de_colas.htm[24/11/2011 10:22:13 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_7/7.3_Configuracion_de_colas.htm[24/11/2011 10:22:13 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

7.4 IVR y sistema de grabacin


Grabacin de mensaje de bienvenida
Antes de Crear un IVR es necesario tener un mensaje ya grabado que ser reproducido cuando una llamada es atendida por dicho IVR. Usted tiene 2 opciones para este fin: grabar el mensaje desde su propia extensin o cargar un archivo de audio grabado anteriormente. La primera opcin sin duda es la ms cmoda puesto que podemos grabar desde el mismo telfono en un tiempo muy corto. Sin embargo la segunda opcin nos da la posibilidad de cargar un archivo de audio producido en estudio. Existen compaas que se dedican a brindar estos servicios de grabacin de voces para IVRs y dependiendo de nuestro presupuesto pueden incluir voces profesionales, msica de fondo, efectos de sonido, entre otras caractersticas. Para acceder a este mdulo dirjase al Men PBX, aparecer por defecto la seccin Configuracin PBX, en el panel izquierdo escoja la opcin Grabaciones del sistema.

Grabaciones del sistema

Como ya se mencion la primera opcin nos permite grabar el audio directamente desde una extensin ya funcional. Para esto ingresamos el nmero de extensin desde el cual queremos realizar la grabacin en el recuadro que dice Si desea realizar y comprobar grabaciones desde su telfono, por favor, escriba aqu su extensin, en este caso usaremos la extensin 201 y damos clic sobre el botn Ir. Luego de hacer esto, Asterisk estar esperando nuestra grabacin en la extensin 201, para continuar descolgamos el telfono de la extensin ingresada y marcamos *77, se escuchara un pitido el cual indicar que podemos comenzar a vocalizar nuestro mensaje, para indicarle al sistema que hemos concluido el mensaje presionamos la tecla # (numeral), caso contrario no se grabar el mensaje.

http://www.elastixbook.com/es/capitulos/capitulo_7/7.4_IVR_y_sistema_de_grabacion.htm[24/11/2011 10:22:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Para revisar nuestra grabacin desde el mismo telfono marcamos *99, a continuacin comenzar a reproducir el mensaje que acabamos de grabar. Si usted se encuentra conforme con el resultado, el siguiente paso ser asignar un nombre a la grabacin en el recuadro correspondiente y luego dar clic sobre el botn Guardar. La segunda opcin que tenemos es cargar una grabacin creada en otro medio, para ello debemos tener un archivo de audio con un formato soportado por Asterisk. En el mismo men anterior haga clic sobre el botn Examinar..., buscamos nuestro archivo, luego procedemos a darle un nombre a esta grabacin. Finalmente damos clic en Guardar.

Configurar un IVR de bienvenida


El IVR nos permite recibir una llamada entrante y reproducir un mensaje de bienvenida. Adems podemos tener un men interactivo por teclado telefnico, a travs de los 10 dgitos, y los smbolos # (numeral) y * (asterisco). Con esto es posible encaminar la llamada hacia otro destino o nuevamente hacia el IVR que envi el anuncio. Para acceder al mdulo IVR dirjase al Men PBX y aparecer por defecto la seccin Configuracin PBX. En el panel izquierdo escoja la opcin IVR. Para grabar un mensaje de bienvenida, como ya se explic en la seccin anterior, debe dirigirse al men de Grabaciones del sistema y proceder a la grabacin de un mensaje. Para la creacin de un IVR no es necesario llenar todos los campos, pues para nuestro caso (un IVR de bienvenida), no necesitaremos opciones. Los campos necesarios son los siguientes: Cambiar nombre: Etiquetar el IVR con un nombre distintivo. Tiempo de espera: Tiempo de espera (en segundos) antes de encaminar la llamada a un operador despus de haber sido reproducido el mensaje pregrabado. Habilitar marcacin directa: Opcin que permite a quien llama marcar una extensin interna directamente sin tener que esperar a que el operador conteste. Anuncio: Es el anuncio o mensaje de bienvenida que se grab anteriormente. Aparecer una lista con todos los mensajes disponibles. A continuacin se debe proceder a configurar cules sern los destinos de las llamadas de acuerdo con el dgito que el llamante presione en su telfono. Por ejemplo, generalmente el dgito 0 (cero) hace que la llamada sea enviada a la extensin del operador. Es posible configurar destinos para los nmeros del 0 al 9.

http://www.elastixbook.com/es/capitulos/capitulo_7/7.4_IVR_y_sistema_de_grabacion.htm[24/11/2011 10:22:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Formulario de creacin de IVR

Entre las opciones del men disponibles, en la parte izquierda existe un casillero donde se debe ingresar el dgito correspondiente a la opcin del IVR. Luego debe escoger cul ser el destino de la llamada. Aqu usted podr seleccionar entre varios mdulos disponibles en FreePBX, ya sea enviar la llamada a un cola de atencin ya definida, a otro IVR, a un grupo de timbrado, a un extensin especfica, etc. Finalmente grabamos el IVR haciendo clic en el botn de Guardar Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_7/7.4_IVR_y_sistema_de_grabacion.htm[24/11/2011 10:22:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

7.5 Salas de conferencias


Elastix puede administrar dos tipos de cuartos de conferencia: Los cuartos de conferencia permanentes y los cuartos de conferencia temporales. El primer tipo se puede administrar bajo el men PBX PBX Configuration Conferences, mientras que el segundo se puede administrar bajo el men PBX Conferencias. Los cuartos de conferencia no son otra cosa que una especie de extensin virtual en la que a travs de ella se pueden interconectar varias llamadas al mismo tiempo, dando con esto la ilusin de estar en una conferencia con muchas personas conversando al mismo tiempo. Un cuarto de conferencia permanente es aquel que tiene un numero definitivo preasignado. Por ejemplo, supongamos que queremos crear el cuarto 88999 y asignarlo al Gerente de Operaciones. De ahora en adelante las reuniones telefnicas de los lunes por las maanas se pueden realizar simplemente marcando 88999 cuando llegue la hora pactada y todos los participantes saben que ese nmero de cuarto no cambiara de lunes a lunes. Un cuarto de conferencia temporal se crea, como es obvio, para fines temporales. Por ejemplo la empresa va a participar de una exposicin de productos en el extranjero y quiere agendar una serie de reuniones entre los proveedores y asesores externos para que se pongan de acuerdo en diferentes tpicos. Por lo tanto se decide asignar un cuarto de conferencia para cada asesor con el fin de que ellos mismos coordinen las conferencias que crean necesarias. Lgicamente no queremos que estos cuartos sean permanentes sino ms bien que expiren luego de la feria ya que ellos no son trabajadores permanentes de la compaa.

Listado de conferencias

En el presente apartado explicaremos cmo administrar conferencias temporales. Al ingresar al mdulo de conferencias se podr observar todas las conferencias concurrentes. Para visualizar conferencias pasadas o futuras debe seleccionar la opcin correspondiente en el recuadro de Estado y haciendo clic en Mostrar. Adems se provee un filtro usado para los nombres de las conferencias. Para poder eliminar una o varias conferencias debemos seleccionarlas y dar clic sobre el botn Eliminar. Si desea agregar una nueva conferencia de clic sobre el botn Nueva Conferencia.

http://www.elastixbook.com/es/capitulos/capitulo_7/7.5_Salas_de_conferencias.htm[24/11/2011 10:22:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Creacin de nueva conferencia

Los campos requeridos para agregar una conferencia son: Nombre de la Conferencia: Necesario para identificar la conferencia Nmero de la conferencia: Se provee un nmero aleatorio para la conferencia. Usted puede cambiarlo si no est siendo usado por otra conferencia Tiempo Inicio (PST/PDT): Tiempo de inicio de la conferencia Mximo Participantes: No se podrn invitar ms participantes una vez se completo el nmero mximo de participantes. Para ver los detalles sobre una conferencia puede dar clic sobre el nombre de la conferencia. A continuacin se mostrar la manera de administrar las conferencias temporales. Para administrar una conferencia concurrente de clic sobre el enlace de participantes correspondiente a dicha conferencia. Para invitar a alguien a la conferencia debe escogerlo de la lista proporcionada (lista de extensiones disponibles) y dar clic sobre el botn Llamada a invitar. Deber esperar hasta que se conteste la llamada. Una vez que haya invitado a alguien a la conferencia irn apareciendo en el reporte. Si desea silenciar a uno o varios invitados seleccinelos en la columna Callado y de clic sobre este botn (Callado). Adems puede expulsar de la conferencia a uno o varios invitados seleccionndolos en la columna Botar y de clic sobre este botn (Botar). Si desea expulsar a todos los invitados de la conferencia de clic sobre Botar a Todos. Si alguien a quien invit no se muestra en la lista de invitados o alguien a quien expuls todava se muestra, de clic en el botn Actualizar. Este botn tambin actualizar el tiempo que lleva cada invitado en la conferencia. Note que una vez de clic sobre el botn Callado se actualizar el Estado del invitado, los estados posibles son: Muted (Callado), UnMuted (No Callado).

http://www.elastixbook.com/es/capitulos/capitulo_7/7.5_Salas_de_conferencias.htm[24/11/2011 10:22:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Para regresar a la interfaz de administracin de todas las conferencias de clic en Cancelar. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_7/7.5_Salas_de_conferencias.htm[24/11/2011 10:22:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

7.6 Parqueo de llamadas


Un lote de llamadas es una extensin virtual con msica en espera. Es decir que si se llama a esta extensin oiremos msica en espera. A esta accin se le llama parquear una llamada. Esta caracterstica es muy til cuando atendemos una llamada y debemos transferirla a una extensin de la que todava no sabemos el numero destino. Por ejemplo, ingresa una llamada importante para el gerente de la empresa y l no est en su oficina. Dada la importancia la operadora tiene que localizarlo, as que mientras lo busca puede transferir al llamante en un lote de parqueo para que espere confortablemente con msica en espera. Claro, muchos dirn que simplemente se lo pudo haber puesto on hold pero esto ocupara la extensin del telfono de recepcin impidiendo que nuevas llamadas puedan ser atendidas por la recepcionista. Una vez localizado al esquivo gerente se le puede comunicar que tiene una llamada parqueada en el lote 3434, por ejemplo. Luego, el mismo gerente puede des-parquear dicha llamada y reiniciar la conversacin desde su propia extensin o la extensin ms cercana.

Configuracin de un nuevo lote de parqueos

Habilitar caracterstica de aparcamiento: Seleccionando esta opcin con un visto se habilitar la funcionalidad de parqueo de llamadas. Extensin de aparcamiento: Indica la extensin a la cual deber llamarse para enviar una llamada al parqueo. Generalmente indica el primer slot de canales de parqueo. Dependiendo del nmero de slots de aparcamientos va a depender cuntas extensiones se tengan para este fin. Cantidad de aparcamientos: Indica el nmero de slots disponibles para parquear llamadas. De ste nmero depende cuantas extensiones se tengan disponibles para aparcar una llamada.

http://www.elastixbook.com/es/capitulos/capitulo_7/7.6_Parqueo_de_llamadas.htm[24/11/2011 10:22:17 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Tiempo mximo de aparcamiento: El perodo de tiempo que una llamada puede permanecer parqueada. Si una llamada cumple ese tiempo en el cuarto de parqueo se intentar retornar la llamada a la extensin desde donde se envi el parqueo.

Contexto del aparcamiento: Este es el contexto que regir el comportamiento de las llamadas parqueadas. Por defecto este contiene el contexto parkedcalls y no debera ser cambiado. Destination for Orphaned Parked Calls: Sirve para configurar el destino de una llamada cuando esta no puede ser enviada al parqueo y quienenvi originalmente la llamada tampoco puede ser alcanzado. Los destinos posibles pueden ser: Un anuncio, un IVR, terminar la llamada, una extensin, una cola, una conferencia una aplicacin personalizada. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_7/7.6_Parqueo_de_llamadas.htm[24/11/2011 10:22:17 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

7.7 Msica en espera


En esta seccin es posible configurar las categoras de Msica en espera que estarn disponibles para las diferentes colas de atencin. El usuario escuchar la reproduccin sucesiva de los archivos all definidos como fondo mientras espera que le atiendan. Enviar archivo WAV o MP3: Simplemente mediante el botn choose file se selecciona el archivo (en formato mp3 o wav). Luego se debe hacer clic en Enviar y debe aparecer el archivo disponible en la lista de archivos de MOH (Music-On-Hold) que se muestran debajo de la opcin de cargado de archivo. Es posible ajustar el volumen de los archivos cargados utilizando la opcin Ajuste de volumen que se encuentra abajo del botn de Enviar

Formulario de administracin de msica en espera

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_7/7.7_Musica_en_espera.htm[24/11/2011 10:22:19 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

7.8 Panel de Operador


A partir de Elastix 2.0, se ha incorporado el Elastix Operator Panel (EOP) que se presenta como una alternativa al existente Flash Operator Panel (FOP). La razn por la cual se introdujo el EOP se debe a que la nueva versin del FOP (FOP2) requiere un tipo de licencia que es incompatible con la actual licencia de Elastix (GPL versin 2). De manera general el panel de operador permite visualizar el estado de las extensiones, troncales, colas, cuartos de conferencias y cuartos de parqueo del sistema en tiempo real. Es una aplicacin muy til para una recepcionista. Para acceder al Elastix Operator Panel dirjase al Men PBX y haga clic en la utilidad Operator Panel.

Panel de operador Elastix

Adicionalmente, en Elastix 2.0 an se encuentra disponible el Flash Operator Panel en el men de PBX en el submen Flash Operator Panel.

Flash Operator Panel

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_7/7.8_Panel_de_Operador.htm[24/11/2011 10:22:20 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

7.9 Funciones de transferencia de llamadas


Por omisin en Elastix viene configurada la funcionalidad de transferencia de llamadas de la siguiente forma:

Transferencia ciega
Para trasferir una llamada de una manera ciega se debe digitar: ## seguido del nmero de extensin a donde se va a transferir la llamada.

Transferencia atendida
Para transferir una llamada de manera atendida se debe digitar: *2, seguido de la extensin. Si desea cambiar stos cdigos es necesario dirigirse al men de PBX PBX Configuration y escoger el men de Cdigos de funcionalidades. En la seccin Core usted tendr las opciones de In-Call Asterisk Attended Transfer e In-Call Asterisk Blind Transfer donde podr cambiar el cdigo asignado para las transferencias atendidas y ciegas respectivamente.

Cdigos de Caractersticas

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_7/7.9_Funciones_transferencia_de_llamadas.htm[24/11/2011 10:22:21 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

8
Configuracin de hardware
No siempre podemos agradar, pero siempre podemos tratar de ser agradables -- Voltaire A pesar de que Elastix puede funcionar sin necesidad de hardware telefnico instalado en el mismo servidor, es necesario su utilizacin si se requiere conexin directa a ciertos tipos de redes telefnicas como la PSTN. Su instalacin y configuracin se simplifica con Elastix gracias a que se dispone de una interfaz Web especializada que facilita esta tarea. En el presente captulo nos referiremos bsicamente a tarjetas PCI (o PCI express). Sin embargo pueden usarse otros dispositivos para conectarse a la PSTN como es el caso de los gateways, que funcionan a travs de IP o channel banks que pueden inclusive funcionar a travs de USB.

8.1 Tipos de tarjetas y fabricantes


En este apartado nos referiremos bsicamente a tarjetas telefnicas, tambin llamadas tarjetas de interfaz. Este hardware est disponible tanto para redes telefnicas analgicas como digitales y dentro de cada una de estas categoras existen bsicamente las siguientes subcategoras: Analgico FXO FXS Digital E1/T1/J1 BRI

http://www.elastixbook.com/es/capitulos/capitulo_8/8.1_Tipos_de_tarjetas_fabricantes.htm[24/11/2011 10:22:22 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Existen variadas opciones de hardware compatible con Elastix por lo que no tendremos problemas para encontrar una que se adapte a nuestras necesidades. Para facilitar todava ms la eleccin Elastix cuenta con un programa de certificacin de hardware que se encarga de someter cada modelo a diversas pruebas para determinar su compatibilidad con Elastix de acuerdo a los criterios del programa de certificacin. La lista de hardware certificado est disponible de manera pblica en el siguiente enlace: http://www.elastix.org/en/product-information/certified-hardware.html Aqu no solo encontraremos tarjetas de interfaz sino tambin telfonos IP, gateways, intercomunicadores, channel banks, cmaras de seguridad y appliances. Cabe resaltar que si un determinado modelo no se encuentra enlistado no necesariamente significa que no es compatible con Elastix. Debido a que el programa de certificacin estipula que el proceso de pruebas debe darse nicamente por solicitud explcita del fabricante, puede darse el caso de que el modelo que estamos buscando no haya sido propuesto por su fabricante para ser sometido al proceso de certificacin. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_8/8.1_Tipos_de_tarjetas_fabricantes.htm[24/11/2011 10:22:22 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

8.2 Instalacin de hardware de telefona en Elastix


Instalar hardware de telefona en Elastix es una tarea relativamente sencilla. Sin embargo, es necesario tener claros los conceptos antes de comenzar pues de lo contrario podramos confundirnos. Para instalar hardware de telefona en Elastix debemos seguir los siguientes pasos. 1) Instalar el hardware fsicamente 2) Detectar el hardware a nivel de drivers 3) Configurar el hardware a nivel de Asterisk Cada una de estas tareas se explicar a continuacin. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_8/8.2_Instalacion_de_hardware.htm[24/11/2011 10:22:23 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

8.3 Instalacin fsica de una tarjeta


Esto no involucra ninguna tarea complicada, solo las precauciones obvias al instalar tarjetas electrnicas en un computador, como haber apagado y desconectado completamente el equipo de la toma elctrica, usar un dispositivo de descarga electrosttica, entre otras. Nota: En caso de instalar hardware FXS es muy comn que se requiera conectar un cable de poder a la tarjeta pues hay que recordar que las interfaces FXS deben proveer potencia elctrica a los dispositivos que se conecten a ella.

Tarjeta telefnica analgica de tipo modular con 3 puertos FXO y 2 FXS instalados

En la figura anterior podemos observar en la parte inferior derecha el conector tipo molex que sirve para proveer de energa adicional a la tarjeta en caso de que usemos mdulos FXS. Luego de instalar la tarjeta encendemos el equipo y deberamos verla enlistada a nivel de bus PCI. Como ejercicio podramos utilizar el comando lspci antes y despus de instalar la tarjeta y ver la diferencia.

Hardware modular
Existen fabricantes que disean su hardware de manera modular, de tal forma que pueda ser expandible. Los mdulos por tanto no se encuentran soldados sino que pueden ser instalados a presin. Por ejemplo, demos un vistazo a la tarjeta analgica de la siguiente imagen que tiene capacidad de hasta 8 puertos. Se puede observar claramente los mdulos y que el fabricante los ha diferenciado: los mdulos FXO son de color rojo y los FXS son de color verde.

http://www.elastixbook.com/es/capitulos/capitulo_8/8.3_Instalacion_fisica_tarjeta.htm[24/11/2011 10:22:25 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

La misma tarjeta de la imagen anterior a la cual se le ha extrado un mdulo FXS

Existen tambin otro tipo de tarjetas donde inclusive el cancelador de eco es un mdulo que se puede instalar a presin. De este modo se puede adquirir la tarjeta con o sin cancelador de eco por hardware. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_8/8.3_Instalacion_fisica_tarjeta.htm[24/11/2011 10:22:25 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

8.4 Deteccin de hardware


Una vez que la tarjeta ha sido instalada es hora de que los drivers la detecten. El driver de telefona ms importante en Elastix recibe el nombre de DAHDI (realmente se trata de un conjunto de drivers). No entraremos en muchos detalles de DAHDI por ahora puesto que la interfaz Web de administracin nos permitir abstraernos de la labor de los drivers. Sin embargo, ms adelante explicaremos un poco ms a fondo el funcionamiento de DAHDI y cmo se relaciona con Asterisk. Nota: Cabe mencionar que DAHDI no es el nico driver de telefona existente en Elastix. Si bien la mayora de fabricantes de hardware de telefona usan DAHDI (o han integrado sus drivers dentro de DAHDI), existen otros fabricantes que proveen drivers diferentes como es el caso de Sangoma o Rhino Equipment. Estos otros drivers tambin se encuentran integrados dentro de Elastix. En las primeras versiones de Elastix la tarea de detectar el hardware se hacia manualmente ejecutando algunos comandos desde la consola del equipo. Actualmente se cuenta con una interfaz Web que detecta el hardware de manera automtica y nos muestra grficamente el hardware detectado. Esta interfaz se puede acceder desde el men System Hardware Detector. Para detectar nuevo hardware basta con presionar el botn Detectar Nuevo Hardware.

Deteccin de Hardware Elastix 2.0

En dicho men se tienen las siguientes opciones: Replace file chan_dahdi.conf: Esta opcin crea un archivo /etc/asterisk/chan_dahdi.conf adicionalmente a los necesarios que se requieren para el sistema DAHDI (/etc/dahdi/modules.conf y /etc/dahdi/system.conf) que ser procesado por Asterisk, conteniendo la informacin de configuracin de las tarjetas que se detecten. Detect Sangoma Hardware: Esta opcin activa el funcionamiento del demnico de wanrouter provisto por el fabricante SANGOMA para reconocimiento de su hardware y su integracin con los modulos de DAHDI. Detect ISDN hardware: Esta es una opcin heredada de versiones anteriores de Elastix, utilizada exclusivamente para deteccin de hardware del tipo mISDN. Comnmente se utiliza esta opcin para la deteccin de tarjetas BRI de Digium y sus clnicas.

http://www.elastixbook.com/es/capitulos/capitulo_8/8.4_Deteccion_de_hardware.htm[24/11/2011 10:22:26 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Para las tarjetas de telefona analgica y digitales se encuentra disponible la herramienta para configurar el tipo de cancelacin de eco (basado en software) que se utilizar para cada puerto de la tarjeta. Para configurar el cancelacin de eco haga clic en el cono que parece una rueda. A continuacin se ingresar a la configuracin particular de la tarjeta mostrando cada uno de los puertos de la misma y un men desplegable para la eleccin del algoritmo requerido por cada puerto. Los algoritmos soportados son: OSLEC, MG2, KBL, SEC, SEC2. Nota: El algoritmo ms usado es OSLEC. Se puede encontrar ms explicacin acerca de los canceladores de eco y OSLEC en el captulo 13.

Algoritmos de cancelacin de eco por puerto

Para las tarjetas de telefona digital, se encuentra disponible una utilidad para configurar los parmetros de sincronizacin necesarios y particulares para lneas E1 T1 en forma grfica. Para acceder a dicha utilidad debe hacer clic en el cono que tiene la forma de dos conectores. A continuacin se ingresar a la configuracin particular de la tarjeta con un men de opciones desplegables. La eleccin de los valores de las opciones depender del tipo de interfaz digital y el servicio que su proveedor de telefona le haya instalado.

Configuracin de parmetros de sincronizacin en tarjeta telefona digital

En la seccin siguiente se explicarn con ms detalles todos los parmetros necesarios para la sincronizacin para tarjetas digitales. Una vez ejecutada la accin de reconocimiento de hardware, Elastix crea archivos de configuracin con la informacin suministrada y aadiendo informacin adicional que la considera como usualmente correcta, denominada por defecto.
http://www.elastixbook.com/es/capitulos/capitulo_8/8.4_Deteccion_de_hardware.htm[24/11/2011 10:22:26 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

A partir de sta configuracin por defecto el usuario podra modificar ciertos parmetros ms especficos para su ambiente, para que el hardware de telefona se ajuste a su situacin particular. Estas configuraciones a bajo nivel se explicarn en la siguiente seccin. Nota: Al momento de escribir este libro si se presiona el botn para detectar hardware TODAS las tarjetas sern re-detectadas y su configuracin por defecto re-escrita. Si ya se haba configurado una tarjeta previamente esta configuracin ser re-escrita. No se olvide de hacer los respaldos necesarios. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_8/8.4_Deteccion_de_hardware.htm[24/11/2011 10:22:26 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

8.5 Configuracin del hardware de telefona a nivel de Asterisk


Hasta este momento el hardware que hemos configurado no se encuentra relacionado con Asterisk de ninguna manera (a menos que se haya presionado el botn de Replace chan_dahdi.conf). Asterisk por omisin no sabe si hardware nuevo ha sido detectado por DAHDI a menos que se le haya especificado a travs del archivo /etc/asterisk/chan_dahdi.conf. Hay que entender que Asterisk y DAHDI son dos paquetes de software separados y no saben nada el uno del otro a menos que nosotros los comuniquemos explcitamente. Veamos a continuacin un vista simplificada de cmo se comunican Asterisk y DAHDI.

Diagrama simplificado de cmo se relaciona Asterisk con DAHDI

Podemos ver en el diagrama anterior que Asterisk se relaciona con DAHDI a travs de un mdulo (mdulo de Asterisk) llamado chan_dahdi.so y que este mdulo necesita del archivo /etc/asterisk/chan_dahdi.conf para saber cmo comunicarse con DAHDI correctamente. Nota: Ms adelante entraremos en detalles acerca del archivo /etc/dahdi/system.conf mostrado en el diagrama anterior. Antes de entrar en detalles de configuracin del archivo chan_dahdi.conf debemos mencionar que una manera sencilla y automtica de configurar nuestro hardware a nivel de Asterisk es presionar el botn Replace chan_dahdi.conf. Como el lector podr suponer esta accin reemplaza el archivo chan_dahdi.conf por uno genrico. Sin embargo, en la mayora de los casos la configuracin escrita en este archivo slo nos ser de utilidad como ejemplo o punto de inicio debido a que Elastix no tiene manera de conocer cmo queremos agrupar los

http://www.elastixbook.com/es/capitulos/capitulo_8/8.5_Configuracion_del_hardware.htm[24/11/2011 10:22:28 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

canales telefnicos u otros parmetros que dependen de nuestro ambiente especfico y que se configuran en dicho archivo. A continuacin explicaremos cmo configurar adecuadamente el archivo chan_dahdi.conf

Configuracin del archivo chan_dahdi.conf


Asterisk cuenta con un mdulo llamado chan_dahdi.so que sirve para comunicarse con los drivers de DAHDI y de esta manera conectar Asterisk con hardware telefnico. Este mdulo se configura a travs del archivo chan_dahdi.conf En el archivo chan_dahdi.conf bsicamente se configura la sealizacin de los canales de voz y se relacionan los canales de Asterisk con los circuitos o lneas telefnicas definidos en la configuracin de los drivers. Estos canales se pueden agrupar en lo que se conoce como troncales. Nota: La configuracin de los drivers de DAHDI reside principalmente en el archivo /etc/dahdi/system.conf. Este archivo se escribi automticamente cuando realizamos la deteccin de hardware desde la interfaz Web. Es decir que si tengo 15 circuitos o lneas telefnicas que terminan en hardware telefnico de mi servidor los puedo controlar desde Asterisk y troncalizarlas. Por ejemplo podra dividir esas lneas en 3 troncales debido a que mi cliente tiene 3 departamentos: ventas, soporte y financiero. Veamos primero un archivo chan_dahdi.conf sencillo para ver los parmetros ms importantes y despus continuaremos explicando algunos de estos parmetros.
[trunkgroups] [channels] context=from-pstn signalling=fxs_ls ; trunk #0 group=0 language=es callprogress=no context=from-pstn channel=1-5 ; trunk #1 group=1 language=es callprogress=no context=from-pstn channel=6-10 ; trunk #2 group=2 language=es callprogress=no context=from-pstn
http://www.elastixbook.com/es/capitulos/capitulo_8/8.5_Configuracion_del_hardware.htm[24/11/2011 10:22:28 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

channel=11-15

Como vemos arriba hemos configurado tres troncales. Cada troncal comienza con la palabra group y se le asigna un identificador numrico. Por lo general se empieza con el nmero cero. Dentro de cada troncal se pueden repetir los valores globales (es decir los que se encuentran en el encabezado, fuera de la definicin de las troncales) y estos valores sobrescriben a los anteriores. Por ejemplo, se podra sobrescribir la sealizacin para una troncal especfica. Algunos parmetros importantes

signaling Este parmetro define la sealizacin de cada canal o grupo de canales. Lo ms comn que veremos para circuitos analgicos ser fxs_ls y para circuitos digitales pri_cpe. A continuacin la tabla de posibles valores para este parmetro. em: E & M Immediate Start em_w: E & M Wink Start em_e1: E & M CAS signalling for E1 lines featd: Feature Group D (The fake, Adtran style, DTMF) featdmf_ta: Feature Group D (The real thing, MF (domestic, US)) through a Tandem Access point fgccama: Feature Group C-CAMA (DP DNIS, MF ANI) fgccamamf: Feature Group C-CAMA MF (MF DNIS, MF ANI) featdmf: Feature Group D (The real thing, MF (domestic, US)) featb: Feature Group B (MF (domestic, US)) fxs_ls: FXS (Loop Start) fxs_gs: FXS (Ground Start) fxs_ks: FXS (Kewl Start) fxo_ls: FXO (Loop Start) fxo_gs: FXO (Ground Start) fxo_ks: FXO (Kewl Start) pri_cpe: PRI signalling, CPE side pri_net: PRI signalling, Network side (for instance, side that provides the dialtone) sf: SF (Inband Tone) Signalling sf_w: SF Wink sf_featd: SF Feature Group D (The fake, Adtran style, DTMF) sf_featdmf: SF Feature Group D (The real thing, MF (domestic, US)) sf_featb: SF Feature Group B (MF (domestic, US)) e911: E911 (MF) style signalling. Originating switch goes off-hook, far-end winks, originating sends KP911-ST, far-end gives answer supervision, Originating-end sends KP-0-ANI-ST The following are used for Radio interfaces: fxs_rx: Receive audio/COR on an FXS kewlstart interface (FXO at the channel bank) fxs_tx: Transmit audio/PTT on an FXS loopstart interface (FXO at the channel bank) fxo_rx: Receive audio/COR on an FXO loopstart interface (FXS at the channel bank) fxo_tx: Transmit audio/PTT on an FXO groundstart interface (FXS at the channel bank)
http://www.elastixbook.com/es/capitulos/capitulo_8/8.5_Configuracion_del_hardware.htm[24/11/2011 10:22:28 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

em_rx: Receive audio/COR on an E&M interface (1-way) em_tx: Transmit audio/PTT on an E&M interface (1-way) em_txrx: Receive audio/COR AND Transmit audio/PTT on an E&M interface (2-way) em_rxtx: same as em_txrx (for our dyslexic friends) sf_rx: Receive audio/COR on an SF interface (1-way) sf_tx: Transmit audio/PTT on an SF interface (1-way) sf_txrx: Receive audio/COR AND Transmit audio/PTT on an SF interface (2-way) sf_rxtx: same as sf_txrx (for our dyslexic friends)

switchtype Este parmetro es para circuitos digitales y especifica el tipo de switch PRI usado. Lo ms comn es national y euroisdn, dependiendo de en qu pas nos encontremos claro est. Este dato lo debe proporcionar la compaa telefnica as que sintmonos en la libertad de preguntar. Los valores posibles son los siguientes. national: ISDN nacional tipo 2 ni1: ISDN nacional tipo 1 dms100: Nortel DMS100 4ess: AT&T 4ESS 5ess: Lucent 5ESS euroisdn: EuroISDN qsig: Protocolo usado en ISDN Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_8/8.5_Configuracion_del_hardware.htm[24/11/2011 10:22:28 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

8.6 Configuracin de interfaces digitales utilizando los archivos de configuracin DAHDI


La herramienta de deteccin de hardware basada en Web que incorpora Elastix nos permite detectar el hardware de manera sencilla. Sin embargo, a pesar de que la herramienta puede configurar exitosamente el hardware digital en muchos casos, hay que tener en cuenta que la herramienta realiza su trabajo asumiendo parmetros por defecto que pueden ser personalizados de acuerdo al ambiente real de su servidor. Los cambios necesitan ser hechos directamente en los archivos de configuracin, por lo tanto se requerir tener conocimiento ms profundo a este nivel. Nota: En este apartado nos referiremos bsicamente a circuitos T-Carrier y E-Carrier basados en los drivers de DAHDI.

Configuracin de drivers DAHDI


El hardware de telefona que instalemos en el servidor Elastix debe ser reconocido en primera instancia por los drivers (Ej.: DAHDI) y luego ser activado en la configuracin de Asterisk. DAHDI lee su configuracin principalmente del archivo /etc/dahdi/system.conf. Para interfaces digitales, en el archivo /etc/dahdi/system.conf se deben definir los spans. Un span es un grupo de canales digitales. Usualmente un span representa un puerto digital de la tarjeta. Por ejemplo, si la tarjeta contiene 4 puertos E1 entonces usualmente deberamos definir 4 spans, uno por cada puerto. Un span define en una sola lnea, la cual tiene el siguiente formato.
span=(spannum),(timing),(LBO),(framing),(coding)

Spannum Es un identificador numrico nico para etiquetar el span. Se debe empezar con el nmero 1 e ir incrementando este identificador secuencialmente de uno en uno. Timing Es un dgito que define la forma en la cual se manejar la sincronizacin del span. Los posibles valores son los siguientes. Valor 0 Significado NO usar el span (telco) como fuente de sincronizacin. DAHDI proveer la sincronizacin y la enviar al otro lado. Esto es ms comn cuando se conecta a travs de este span una PBX antigua a la cual hay que proveerle sincronizacin.

http://www.elastixbook.com/es/capitulos/capitulo_8/8.6_Configuracion_de_interfaces_digitales.htm[24/11/2011 10:22:29 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

1 2 3,4,5,,n

Normalmente si nos conectamos a una compaa telefnica no deberamos tener ningn span con este valor de timing Usar el span (telco) como fuente primaria de sincronizacin Usar el span (telco) como fuente secundaria de sincronizacin Usar el span (telco) como fuente de sincronizacin tercera, cuarta, quinta, etc

Nota: Solo el valor 0 puede ser repetido. Los dems valores del uno en adelante NO se deben repetir. LBO (Line Build Out) Es un dgito que representa la longitud del cable entre la tarjeta y el equipo (modem) provisto por la compaa telefnica. Casi siempre se puede dejar en 0 sin problemas. Sin embargo si tenemos un cable muy largo habr que revisar la tablita siguiente. Valor 0 1 2 3 4 5 6 7 Longitud del cable o nivel de atenuacin 0 dB / 0 - 133 pies 133 - 266 pies 266 - 399 pies 399 - 533 pies 533 - 655 pies -7.5 dB -15 dB -22.5 dB

Framing Como recordaremos, los protocolos de comunicacin digital T-Carrier y E-Carrier dividen la informacin en frames, donde cada frame transporta un nmero determinado de timeslots. Estos frames pueden ser de diferentes formatos y eso es lo que se define aqu. Los valores posibles para T1 son d4 o esf, mientras que para E1 son cas o ccs. Coding Es necesario codificar la informacin enviada para hacerla menos susceptible a errores. Esto es as porque la propia data se suele usar como fuente de sincronizacin (o reloj) y si se transmiten tramas largas de ceros (largos segmentos sin variacin de voltaje) se puede perder dicha sincronizacin. Para evitar esto se codifica la data para evitar transmitir estas tramas largas de ceros. Por ejemplo la codificacin b8zs significa Bipolar with 8 Zeros Substitution. Los valores posibles para T1 son ami o b8zs, mientras que para E1 son ami o hdb3. En E1 tambin se puede necesitar aadir chequeo de errores crc4 (Control de Redundancia Cclica de 4 bits o Cyclic Redundancy Check 4bits). Luego de realizar los cambios en el archivo system.conf ser necesario reiniciar el demnico de DAHDI. Si todo ha sido correctamente configurado, DAHDI cuenta con el comando lsdahdi, el cual al ser ejecutado desde la consola del sistema operativo mostrar las tarjetas configuradas y el respectivo estado de sus canales. Si a pesar de que todo se encuentre correctamente configurado y se reciban seales de alarma o errores debe asegurarse que no exista algn problema con el cableado fsico o que el proveedor de la troncal digital tenga un
http://www.elastixbook.com/es/capitulos/capitulo_8/8.6_Configuracion_de_interfaces_digitales.htm[24/11/2011 10:22:29 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

problema en su lado. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_8/8.6_Configuracion_de_interfaces_digitales.htm[24/11/2011 10:22:29 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

8.7 Detalles de DAHDI


En esta seccin se detallan los nombres de los archivos importantes que vienen como parte del sistema DAHDI y una breve descripcin de cada uno de ellos.

Archivos de configuracin Archivos DAHDI /etc/dahdi/system.conf Descripcin Archivo de configuracin donde se define la sealizacin de cada uno de los puertos de telefona. Este archivo realmente es un archivo de configuracin de Asterisk que se utiliza para decirle a Asterisk con qu canales DAHDI se debe comunicar y cmo. Este es un archivo utilizado por el script de inicio de DAHDI (/etc/init.d/dahdi). Este archivo contiene los nombres de los drivers de DAHDI que se encuentran presentes en nuestro sistema. (recordemos que DAHDI est compuesto por varios drivers). Este archivo es leido por el script de inicio de DAHDI para saber qu drivers debe cargar y de este modo no cargar todos los drivers sino solo los necesarios.

/etc/asterisk/chan_dahdi.conf

/etc/dahdi/init.conf /etc/dahdi/modules

Mdulos de kernel de DAHDI Mdulo DAHDI en Kernel dahdi.ko dahdi_dummy.ko Descripcin Mdulo de kernel (driver) que contiene la funcionalidad principal de DAHDI Driver necesario para proveer de una fuente de timing a Asterisk cuando no tenemos tarjetas instaladas, debido a que las tarjetas poseen una fuente de timing va hardware

Mdulos de Asterisk de DAHDI Mdulo DAHDI en Asterisk Descripcin

http://www.elastixbook.com/es/capitulos/capitulo_8/8.7_Detalles_de_DAHDI.htm[24/11/2011 10:22:30 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

chan_dahdi.so app_dahdibarge.so

app_dahdiscan.so

Mdulo de Asterisk que se comunica con los drivers de DAHDI Mdulo de Asterisk que prove la aplicacin DAHDIBarge a nivel de plan de marcado. Esta aplicacin sirve para monitorear (escuchar) un canal de DAHDI. Mdulo de Asterisk que provee la aplicacin DAHDIScan a nivel de plan de marcado. Esta aplicacin sirve para navegar entre canales y monitorearlos.

Comandos DAHDI Comando DAHDI dahdi_cfg dahdi_monitor dahdi_scan dahdi_speed dahdi_test dahdi_tool dahdi_genconf Anterior Descripcin Configura el hardware a partir del archivo de configuracin /etc/dahdi/system.conf Monitorea los niveles de entrada y salida de un canal DAHDI Imprime la configuracin de los spans DAHDI Realiza pruebas de desempeo sobre hardware DAHDI Prueba si el temporizador de DAHDI est funcionando correctamente Muestra el estado de las interfases DAHDI. Muy til para hacer depuracin. Genera de manera automtica archivos de configuracin para el hardware DAHDI Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_8/8.7_Detalles_de_DAHDI.htm[24/11/2011 10:22:30 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

8.8 Antes de DAHDI: equipos que usaban Zaptel


A partir de Elastix 1.5 el paquete Zaptel fue reemplazado por el paquete DAHDI. Debido a que es un cambio relativamente reciente es probable que en la prctica nos encontremos con estos equipos que todava usan Zaptel. Para que podamos configurar adecuadamente dichos equipos en esta seccin presentamos un resumen de las diferencias ms importantes entre estos dos paquetes de drivers.

Algunos cambios de nombre a tener en cuenta


Si bien uno de los cambios ms obvios de la migracin de Zaptel a DAHDI es el cambio de nombre de los canales de ZAP a DAHDI; existen otros cambios de nombre que son importantes tener en cuenta y que se describen a continuacin.

Cambios en archivos de configuracin Archivo DAHDI /etc/dahdi/system.conf /etc/asterisk/chan_dahdi.conf /etc/dahdi/init.conf y /etc/dahdi/modules Archivo Zaptel /etc/zaptel.conf /etc/asterisk/zapata.conf /etc/sysconfig/zaptel

Cambios de nombre de mdulos de kernel Mdulo DAHDI dahdi.ko dahdi_dummy.ko Mdulo Zaptel zaptel.ko ztdummy.ko

Cambios de nombre de mdulos de Asterisk Mdulo DAHDI chan_dahdi.so app_dahdibarge.so app_dahdiscan.so Mdulo Zaptel chan_zap.so app_zapbarge.so app_zapscan.so

Cambios de nombre de algunos comandos Comando DAHDI dahdi_cfg dahdi_monitor dahdi_scan Comando Zaptel ztcfg ztmonitor ztscan

http://www.elastixbook.com/es/capitulos/capitulo_8/8.8_Antes_de DAHDI_.htm[24/11/2011 10:22:31 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

dahdi_speed dahdi_test dahdi_tool dahdi_genconf Anterior

ztspeed zttest zttool zapconf o genzaptelconf Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_8/8.8_Antes_de DAHDI_.htm[24/11/2011 10:22:31 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

9
Configuracin de telfono IP
Es difcil despertar a aquel que simula estar dormido -- Proverbio navajo La configuracin de un telfono IP suele ser bastante sencilla. Como mnimo un telfono IP necesita 3 valores para funcionar: El IP del servidor PBX (en este caso el IP del servidor Elastix), el nombre de usuario (comnmente la extensin) y la contrasea de registro de dicho usuario. Aqu mostraremos al detalle cmo configurar un telfono IP fsico y otro basado en software ya que los softphones se han vuelto bastante populares en los ltimos tiempos. En estos telfonos se usar tecnologa SIP para su configuracin puesto que es la tecnologa ms popular en la actualidad, pero tenga la seguridad que la configuracin de telfonos soportando protocolo IAX no difiere mucho de lo aqu mostrado. De forma general, en este libro se usar el protocolo SIP en la mayora de los ejemplos con excepcin de los casos donde los telfonos no se encuentren conectados dentro de la red local, en cuyo caso ser preferible la utilizacin del protocolo IAX, ya que no es susceptibles a problemas relacionados con la traslacin de direcciones IP (NAT). Al final del captulo se detallar la manera de configurar una gran cantidad de telfonos IP de manera gil y sencilla. Este mtodo nos permite pre-configurar los telfonos desde una herramienta llamada ndpoint e configurator disponible en Elastix.

9.1 Configuracin de softphone


Actualmente el uso de telfonos en software o softphones se ha popularizado en gran medida ms que nada por el hecho del ahorro que puede significar al no tener que adquirir telfonos fsicos. El ahorro es mayor mientras ms extensiones se requieran, por lo que sta alternativa es muy comn en call centers.

http://www.elastixbook.com/es/capitulos/capitulo_9/9.1_Configuracion_softphone.htm[24/11/2011 10:22:33 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Por supuesto antes de empezar a configurar el softphone habr que crear una extensin desde Elastix. A manera de ejemplo vamos a suponer que se ha creado la extensin 5678 la cual utiliza tecnologa SIP como protocolo VoIP y su secret asignado es 8765. El softphone que vamos a configurar ser el Zoiper que est disponible en versin gratuita y comercial. La versin gratuita es suficiente para que podamos hablar cmodamente de un punto a otro as que basaremos nuestro ejemplo en esta versin. Para descargar el Zoiper debemos visitar el sitio http://www.zoiper.com Suponemos que el lector tiene la habilidad suficiente para instalar el software sin problemas. Una vez instalado lo ejecutamos y aparecer una ventana como la siguiente.

Pantalla inicial del software ZoIPer

A continuacin presionamos el botn con la figura de herramienta y accederemos al men de opciones. Se desplegar una pantalla con opciones para configurar nuevas extensiones SIP y tambin IAX, pues el Zoiper cuenta con soporte para ambos protocolos. En nuestro ejemplo configuraremos una extensin SIP, as que veremos una pantalla como la siguiente.

Configurando una cuenta SIP

http://www.elastixbook.com/es/capitulos/capitulo_9/9.1_Configuracion_softphone.htm[24/11/2011 10:22:33 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Llenaremos dicha pantalla con los siguientes datos: Domain: La direccin IP o nombre de dominio del servidor Elastix. Username: 5678 Password: 8765 Caller ID Name: El nombre que aparecer en los telfonos que reciban nuestras llamadas Luego de presionar el botn OK, volvemos a la pantalla inicial del Zoiper. Para proceder a registrar la extensin recientemente configurada en la central Elastix, debemos seleccionar la extensin creada en el combo de la parte inferior y dar clic en el botn Register.

Antes de registrar la cuenta SIP

Si Zoiper se registra correctamente observaremos que junto al nombre de nuestra cuenta Test aparecer la palabra Registered.

Luego de que la cuenta SIP ha sido registrada

Puede repetir este proceso para configurar otro softphone Zoiper en otra PC utilizando una extensin diferente creada en el mismo Elastix y luego comprobar que es posible establecer llamadas VoIP entre estas dos extensiones. En el ejemplo la extensin 5678 recibe la llamada de la extensin 2222.

http://www.elastixbook.com/es/capitulos/capitulo_9/9.1_Configuracion_softphone.htm[24/11/2011 10:22:33 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Llamada ingresando a nuestro softphone

Nota: Asterisk ofrece la posibilidad de comprobar el funcionamiento de extensiones recientemente creadas a travs de una extensin de ECO. Esta extensin contestar automticamente y reproducir el mismo audio que enviemos. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_9/9.1_Configuracion_softphone.htm[24/11/2011 10:22:33 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

9.2 Configuracin de telfono IP


Para configurar un telfono IP debemos tener en cuenta dos aspectos: 1. Configuracin de red 2. Registro del dispositivo con el servidor Elastix Para ilustrar de mejor manera los puntos mencionados utilizaremos a manera de ejemplo un telfono Polycom SoundPoint IP 330.

El telfono Polycom 330 que configuraremos

Configuracin de red
La configuracin de red puede realizarse considerando que por defeco el telfono obtendr su IP mediante DHCP, pero tambin es posible configurar un direccin IP fija. Explicaremos los dos mtodos. Luego de la configuracin IP del equipo, se accesar a la interfaz Web de administracin del mismo para completar el proceso ingresando los parmetros restantes. DHCP Mediante esta opcin, el telfono obtendr una direccin IP de manera automtica. Debe tomar en cuenta que la red debe contar con un servidor DHCP funcional, que es quin asignar en su la direccin IP. Elastix trae disponible un servidor DHCP embebido que se puede activar fcilmente desde la interfaz Web.
http://www.elastixbook.com/es/capitulos/capitulo_9/9.2_Configuracion_telefono_IP.htm[24/11/2011 10:22:36 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

A continuacin se detalla cmo verificar en el telfono IP cul fue la direccin IP que le fue asignada. Presionar "Menu Status Network TCP/IP Parameters En la pantalla LCD se mostrar la direccin IP. Anotmosla para luego poder acceder al telfono desde la interfaz Web.

IP esttica Si usted necesita contar con un registro exacto de las direcciones IP de sus telfonos y/o si desea colocar sus dispositivos IP en segmentos especficos de su red, debe utilizar direcciones IP estticas en sus telfonos. Para configurar una direccin IP en el telfono, deber ingresar los parmetros de IP, mscara de red, gateway y DNSs en un men diferente. A continuacin las instrucciones de cmo ingresar cada uno de ellos. Direccin IP Dado que por defecto el telfono viene configurado para recibir su direccin IP va DHCP, a continuacin mostramos la manera de cambiar dicho comportamiento a uso de IP fijo. En la interfaz del telfono Presionar "Menu Settings Advanced (ingresar clave. Por omisin es 456) Admin Settings Network Configuration DHCP Client Editar Disabled Phone IP Address" Aqu procederemos a ingresar la direccin IP. Mscara de red Si usted no ingresa una mscara de red adecuada, su telfono IP no podr registrarse con su central Elastix. Esos problemas ocurren con mayor frecuencia cuando los telfonos IP estn dentro de diferentes segmentos de redes que la central Elastix, es ah donde se debe seleccionar la mscara adecuada. Seleccionar "Subnet Mask (Ingresar la mscara de red) Puerta de enlace En el caso de que su telfono se necesite conectar en un segmento de red IP diferente al que se encuentra conectado el servidor Elastix, el telfono deber contar con la direccin IP de la puerta de enlace (por lo general es un router) correspondiente, de lo contrario su telfono no podr registrarse en la central Elastix. Seleccionar "IP Gateway (Ingresar la direccin IP de la puerta de enlace) Luego de cualquier cambio debemos seleccionar "Exit" y luego "Save Config". Debemos esperar a que el telfono termine de reiniciarse.

Configuracin de registro contra el servidor Elastix


Esta configuracin se la pueda realizar desde el mismo telfono o desde un navegador Web. En este caso utilizaremos el navegador Firefox.
http://www.elastixbook.com/es/capitulos/capitulo_9/9.2_Configuracion_telefono_IP.htm[24/11/2011 10:22:36 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Dado que ya conocemos la direccin IP de nuestro telfono la accedemos desde el navegador Web. En el siguiente ejemplo la direccin IP de nuestro telfono es la 192.168.1.235

Barra del navegador Firefox

Antes de ingresar a la interfaz de configuracin Web un cuadro de dilogo nos solicitar el usuario y la clave del telfono. El usuario y clave de fbrica son Polycom y 456 respectivamente.

Dilogo de autenticacin va usuario y contrasea

IP Servidor Elastix Para ingresar los parmetros de registro contra el servidor Elastix, comenzaremos ingresando los parmetros que se muestran en la pestaa SIP. En esta pantalla se podrn configurar una parte de los parmetros SIP, como lo son el servidor SIP, es decir la direccin IP de la central Elastix y el Outbound Proxy que viene a ser lo mismo en nuestro caso. La configuracin adecuada se muestra en la siguiente figura, donde se supone que la direccin IP del servidor Elastix es la 192.168.1.160

http://www.elastixbook.com/es/capitulos/capitulo_9/9.2_Configuracion_telefono_IP.htm[24/11/2011 10:22:36 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Interfaz Web de configuracin de parmetros SIP del telfono

Debemos tomar en cuenta de que la direccin de la central Elastix puede pertenecer o no a nuestro segmento de red IP, puesto que la central se encuentra en el Internet, igual ser posible llegar a ella a travs de la puerta de enlace configurada. En esta misma pantalla tambin es posible cambiar el puerto utilizado para sealizacin SIP contra la central Elastix. Si usted cambia a otro valor diferente al de omisin (5060 UDP) debe asegurarse que este cambio tambin haya sido hecho en la central Elastix. Extensin Para ingresar los parmetros especficos a la extensin asignada al telfono IP, seleccione la pestaa de "Lines" y configure aqu su extensin como se muestra en la siguiente figura. El parmetro Auth Password debe ser igual al parmetro secret que se ingres cuando se cre la extensin en la interfaz Web del Elastix.

http://www.elastixbook.com/es/capitulos/capitulo_9/9.2_Configuracion_telefono_IP.htm[24/11/2011 10:22:36 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Configuracin de la lnea SIP

Configuracin Opcional En esta seccin veremos cmo configurar el Polycom para que muestre la fecha y hora del Elastix. En el men debemos dar clic en la pestaa "General" y en el campo "SNTP Server" (bajo la seccin time) ingresar la direccin IP del servidor Elastix. Adicionalmente debemos seleccionar el valor adecuado de su zona horaria en "GMT Offset"

http://www.elastixbook.com/es/capitulos/capitulo_9/9.2_Configuracion_telefono_IP.htm[24/11/2011 10:22:36 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Configuracin del servidor de tiempo

Nota: Si al intentar digitar alguna de las extensiones disponibles en la central Elastix (desde el telfono que estamos configurando) escuchamos una seal de ocupado an cuando ni siquiera se han terminado de digitar todos los dgitos de la extensin destino, revise la opcin "Digitmap", dentro de la seccin "Local Settings" dentro del men "SIP", o en su defecto elimnela por completo.

Cambiando el mapa de dgitos

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_9/9.2_Configuracion_telefono_IP.htm[24/11/2011 10:22:36 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

9.3 Utilizando el Endpoint Configurator


En ocasiones la instalacin de telfonos IP se complica cuando son muchos y ms an cuando la configuracin no es tan trivial como la que se realiza para el softphone. Como ya se mostr en la seccin anterior algunos modelos de telfonos se pueden configurar desde una interfaz Web embebida en el propio telfono y tambin existen otros que se tienen que configurar a travs de una sesin telnet. La distro Elastix cuenta con una interfaz que nos permitir configurar muchos telfonos de una manera ms sencilla y gil. Esta herramienta recibe el nombre de Endpoint Configurator. El mdulo Endpoint Configurator primero realiza un rastreo (scan) de la red o subred que se le suministre. Algo de notar es que cuando se ingresa al mdulo, la red o subred por omisin es aquella que se encuentra configurada en la propia central Elastix; el scan que se ejecuta sobre dicho segmento de red obtiene internamente informacin de MAC e IP de los dispositivos de red conectados.

Rastreando la red en busca de endpoints

Nota: La direccin MAC le sirve al endpoint configurator como identificador nico del telfono. Si se usara la direccin IP sta podra cambiar con el tiempo, pero con la direccin MAC no ocurre esto. Luego de obtener la informacin de todos los endpoints del segmento de red, el mdulo de forma inteligente trata de identificar los equipos que pudieran ser telfonos IP y de la misma forma trata de recabar informacin acerca del fabricante y modelo para elegir cules puede configurar consultando su base de datos interna de modelos de telfonos. Cuando ya se tiene el grupo de telfonos a configurar se presenta la informacin en la interfaz Web de Elastix. Se mostrara algo como se ilustra en la figura siguiente.

http://www.elastixbook.com/es/capitulos/capitulo_9/9.3_Endpoint_Configurator.htm[24/11/2011 10:22:39 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Listado inicial de telfonos encontrados en la red. Sin configurar an.

Como se puede observar en la figura anterior se muestra una lista de todos los telfonos que se han encontrado en el segmento de red dado y que el Elastix conoce o podr configurar segn su base de datos. Como podr notar el reporte muestra las columnas Direccin MAC, Direccin IP y Fabricante, las que nos ayudarn a reconocer de cual telfono IP se trata y con esto podremos relacionar mentalmente su ubicacin fsica.

Vista acercada de campos MAC, direccin IP y Fabricante

Luego existen dos columnas llamadas Modelo de Telfono y Extension de Usuario. Estas columnas sirven para asociar una extensin (previamente creada en Elastix) con un telfono fsico. En la lista llamada Modelo de Telfono podr elegir el modelo del telfono que se desea asociar con la extensin y solo se listaran aquellos que Elastix sabe configurar y reconocer. Tener en cuenta que para configurar los telfonos se deben haber creados previamente extensiones desde el men PBX PBX Configuration. Nota: Una limitante de esta herramienta es que las extensiones deben ser SIP y no estnsoportadas extensiones de ningn otro protocolo. Actualmente el grupo de desarrollo de Elastix est trabajando en incorporar soporte para otros protocolos.

Configuracin de un telfono ATCOM, modelo AT-530


A continuacin explicaremos paso a paso cmo configurar un telfono marca ATCOM, modelo AT-530. Este es un modelo de telfono de bajo costo que soporta tanto SIP como IAX.
http://www.elastixbook.com/es/capitulos/capitulo_9/9.3_Endpoint_Configurator.htm[24/11/2011 10:22:39 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Para configurarlo primero elegimos el modelo y la extensin a configurar del listado mostrado en el Endpoint Configurator. Cuando un telfono es configurado por primera vez mediante este mdulo, ste presenta un estatus No Configurado lo que significa que todava la central Elastix no tiene configuracin acerca del l.

Lnea correspondiente al telfono AT-530 detectado en la red

Debe elegir la casilla ubicada en el lado izquierdo de la pantalla, y luego presionar el botn Configurar. Inmediatamente aparece la ventana de confirmacin en la cual si se est seguro se acepta y el proceso de configuracin empezar. Esto puede tomar algo de tiempo dependiendo del nmero de telfonos que haya elegido, en este caso por ser un ejemplo hay solo un telfono a configurar.

Vista amplificada con los datos del telfono AT-530

Luego del proceso vamos a ver que el reporte se actualiz y el estatus del telfono es Configured without incident. Esto indica que la central Elastix hizo varias cosas. Primero cre el (o los) archivos de configuracin necesarios en la ruta /tftpboot/ (ruta en la central Elastix) y en caso de este ejemplo solo se cre el archivo atc0009455765aa.cfg donde 0009455765aa representa la direccin MAC del telfono. Segundo cre un registro en la base de datos de Elastix para mantener un historial del telfono configurado. Tercero, mediante conexin telnet (solo para los ATCOM), realiz acciones de cargar el archivo de configuracin al telfono, guardar al archivo y reiniciar. Por ello usted podr notar que el telfono se va ha reiniciar.

Telfono AT-530 configurado

Hay que tener ciertas consideraciones en cuanto a la conexin telnet en los telfonos ATCOM y es que para poder establecerse es necesario de un usuario y contrasea que por efectos de simplicidad en Elastix se usan los que vienen por omisin de fbrica. Para el caso del modelo AT-530 son usuario admin con clave admin y para el caso del AT-320 la clave es 12345678.

http://www.elastixbook.com/es/capitulos/capitulo_9/9.3_Endpoint_Configurator.htm[24/11/2011 10:22:39 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Regresando a interpretar los Status del telfono tenemos. Estatus No Configurado Configured without incident Color Naranja Verde Descripcin No configurado aun por la central Elastix La central configur el telfono sin problemas Es necesario actualizar. La razn es porque ha cambiado la clave en la central (FreePBX) y en la base de endpoint.db aun se mantiene la anterior

UPDATE: Secrets no equals Rojo in FreePBX and Endpoint

Si no hay incidentes entonces ahora nuestro telfono IP ya esta configurado desde la central Elastix y cuando se desee cambiar de extensin slo vamos al endpoint configurator, hacemos un par de clics y listo. Nota: Existe el botn Desconfigurar. La accin que ejecuta ste es slo a nivel del mdulo. La central Elastix borra el registro histrico relacionado con el telfono IP de la base de su base de datos interna y borra los archivos de configuracin relacionados en la ruta /tftpboot/. Esto indica que el telfono va a mantener la configuracin que le fue entregada desde la ltima actualizacin desde esta herramienta.

Configuracin de un telfono Polycom SoundPoint IP 501


A continuacin mostraremos un ejemplo de cmo configurar un telfono Polycom SoundPoint IP501. Primero elegimos el modelo y la extensin a configurar. Como en el caso del telfono ATCOM podemos partir de que es la primera vez que se lo va a configurar desde la central Elastix y por ende notamos el Status No Configurado.

Lnea correspondiente al telfono Polycom detectado en la red

En la parte izquierda vamos a elegir la casilla, y luego presionamos el botn Configurar. Inmediatamente aparece la ventana de confirmacin en la cual si esta seguro se acepta y el proceso de configuracin empezar. Esto puede tomar algo de tiempo dependiendo del nmero de telfonos que haya elegido, en este caso por tratarse de un ejemplo hay solo un telfono a configurar.

Vista amplificada con los datos de nuestro telfono Polycom IP501

http://www.elastixbook.com/es/capitulos/capitulo_9/9.3_Endpoint_Configurator.htm[24/11/2011 10:22:39 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Luego del proceso vamos a ver que el reporte se actualiz y el estatus del telfono es Configured without incident, esto indica que la central Elastix realiz varias acciones. Primero creo los archivos de configuracin necesarios en la ruta /tftpboot/ (ruta en la central Elastix). Estos archivos para el caso de los telfonos Polycom se detallan en la tabla abajo mostrada.. Archivo 0004f21aeb17.cfg Descripcin El 0004f21aeb17 representa la direccin MAC y este archivo es un encabezado que le indica al telfono lo que se va a hacer durante el proceso de actualizacin y configuracin 0004f21aeb17reg.cfg Contiene informacin de la (o las) extensiones que va ha poseer el telfono Polycom Realmente es una carpeta que posee a su vez otras carpetas llamadas contacts, logs y overrides server.cfg Configuracin relacionada con servidor de proxy y SIP sip.cfg Todos los parmetros adicionales que se deseen configurar. Para esto es bueno revisar un manual de Usuario Polycom Segundo, en estos telfonos no se realiza ninguna conexin a telnet y hasta el momento no se conoce como reiniciar y enviar los archivos de configuracin desde la central Elastix como una accin centralizada. Por ende es necesario ejecutar lo siguiente desde el propio telfono Polycom: Elegir que el tipo de aprovisionamiento es TFTP. Ingresar la IP de la central Elastix. Elegir que lea la configuracin por TFTP. Reiniciar el telfono Polycom. Estos pasos son iguales en todos los modelos Polycom que Elastix soporta. As mismo como en el caso de los telfonos marca ATCOM se genera un historial en la base de datos interna de Elastix acerca de la configuracin del telfono Polycom. Si no hay incidentes entonces ahora el telfono IP ya est configurado desde la central Elastix y cuando se desee cambiar de extensin slo debemos ir al mdulo Endpoint Configurator, hacer un par de clics y listo.

Actualizacin por TFTP


TFTP es el protocolo usado en este caso para proveer aprovisionamiento. Significa Trivial FTP y es un protocolo que no requiere de ningn tipo de autenticacin, es decir que no necesitamos ni un usuario o contrasea para realizar algn proceso. La mayora de telfonos IP soportan este tipo de provisionamiento para poder transferir los archivos de configuracin desde la central Elastix hasta los endpoints y viceversa, como el caso de los telfonos Polycom que lo usan para descargar la lista de contactos y escribir logs. La central Elastix trae embebido el servicio encargado de escuchar y aceptar transferencias utilizando protocolo TFTP. Es en el archivo de configuracin /etc/xinetd.d/tftp donde se personaliza el directorio para uso de tftp. En nuestro caso es /tftpboot/.
http://www.elastixbook.com/es/capitulos/capitulo_9/9.3_Endpoint_Configurator.htm[24/11/2011 10:22:39 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Personalizando los archivos de configuracin


Existen ocasiones en que es necesario personalizar ciertos parmetros en los archivos de configuracin para los telfonos IP. Es posible que en versiones superiores a Elastix 2.0 se cuente con una herramienta basada en Web para realizar estas tareas, pero por ahora el lector podr hacerlo editando los archivos de plantillas de configuracin que estn en la ruta de la central Elastix /var/www/html/modules/endpoint_configuration/libs/vendors/. En esta ruta vamos a encontrar lo siguiente. Archivo Atcom.cfg.php Descripcin En este archivo se encuentra la configuracin para algunos modelos ATCOM. Para cambiar alguna configuracin se recomienda revisar manuales del archivos de configuracin para ATCOM En este archivo se encuentra la configuracin para algunos modelos Polycom. Ya que el contenido de los archivos son XML esto hace que se puedan usar el mismo XML para algunos modelos. En este archivo se encuentra la configuracin para algunos modelos Linksys. Hay que notar que tambin tienen formato XML En este archivo se encuentra la configuracin para los modelos de telfonos Cisco soportados En este archivo se encuentra la configuracin para los modelos de telfonos Aastra soportados

Polycom.cfg.php

Linksys.cfg.php

Cisco.cfg.php,

Aastra.cfg.php Grandstream.cfg.php En este archivo se encuentra la configuracin para los modelos de telfonos Grandstream soportados Snom.cfg.php En este archivo se encuentra la configuracin para los modelos de telfonos Snom soportados

Al hacer cambios en estos archivos plantilla, la prxima vez que use el mduloEndpoint Configuration su personalizacin de configuracin ser reflejada al configurar o actualizar los telfonos. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_9/9.3_Endpoint_Configurator.htm[24/11/2011 10:22:39 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

10
Configuracin avanzada de PBX
Si espero perder la audacia de la juventud -- Alejandro Magno

10.1 Ruteo de llamadas


Rutas Entrantes
Esta opcin permite configurar el destino de las llamadas que ingresan por una determinada troncal. Cuando una llamada ingresa al servidor, Asterisk puede fijarse en el DID, en el CallerID el nmero de puerto por donde est recibindose dicha llamada en el caso de que se cuente con troncales tipo DAHDI..

http://www.elastixbook.com/es/capitulos/capitulo_10/10.1_Ruteo_llamadas.htm[24/11/2011 10:22:41 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Formulario de creacin de nueva ruta entrante

Description: Etiqueta que identifica la ruta entrante. DID Number: Para un peer del tipo SIP IAX, el DID ( Destination-Inward-Dial) es el nmero destino de la llamada, es asignado por el proveedor y generalmente est asociado al nmero de cuenta. Por ejemplo si su cuenta es '85679432', ingresando se nmero en el campo DID, las llamadas entrantes destinadas a esa cuenta deberan coincidir con esta informacin y dirigirse al destino configurado. Si deja este campo en blanco se estar haciendo referencia a las llamadas entrantes con cualquier nmero como destino. Caller ID Number: El CID Number es el Caller ID o nmero telefnico desde donde se origina la llamada que es recibido por Elastix. Este dato no es confiable ya que puede ser fcilmente burlado por hackers. Al dejar este campo en blanco se estar haciendo referencia a las llamadas entrantes con cualquier Caller ID. Alert Info: Puede ser usado para activar la caracterstica de rings distintivos soportada en algunos de dispositivos SIP. Requiere de conocimientos particulares de la marca y modelo del dispositivo SIP. Pause Before Answer:
http://www.elastixbook.com/es/capitulos/capitulo_10/10.1_Ruteo_llamadas.htm[24/11/2011 10:22:41 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

En esta opcin se define el nmero de segundos que deberamos esperar antes de contestar la llamada entrante. El primer propsito para esta opcin es permitir que dispositivos conectados en paralelo en esta lnea, como lo pueden ser mquinas de fax o dispositivos de seguridad electrnica puedan timbrar primero antes de que la central procese la llamada entrante. Privacy Manager: Si se activa esta opcin, toda llamada que no llegue con un Caller ID vlido no podr ser enrutada al destino final de la llamada si antes no se ingresa manualmente el Caller ID, es decir, al llamante se le solicitar que utilizando su teclado del telfono ingrese el nmero de origen. Language: Mediante este campo se configura el idioma de los mensajes que sern reproducidos para el tratamiento de la llamada. Escriba es para el espaol. Detect Faxes: Si se habilita esta opcin Asterisk tratar de reconocer un tono de fax en la llamada, si reconoce un tono de fax, la llamada ser enviada a la extensin por defecto de fax que se configura en Configuracin General. Set destination: Mediante el set destination podemos especificar dnde queremos que la llamada sea terminada, siendo esto: un IVR, una extensin, un miscelaneous destination, colgar la llamada a un contexto personalizado.

Rutas Salientes
Mediante las rutas salientes podemos indicar por que troncal troncales deben ser enviadas las llamadas que originan desde alguna extensin interna de la central Elastix.

Formulario de creacin de nueva ruta saliente

Route Name:

http://www.elastixbook.com/es/capitulos/capitulo_10/10.1_Ruteo_llamadas.htm[24/11/2011 10:22:41 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

En este campo se especifica un nombre descriptivo para la troncal para poder facilitar la administracin de las mismas. Route CID: En este campo es posible especificar un nmero que ser utilizado por la llamada como nmero de origen. Esta caracterstica de cambiar el nmero origen a discrecin del administrador de la central debe estar soportada por el proveedor de las troncales utilizadas para realizar la llamada. Route Password: Si llenamos este campo, cada vez que una llamada intente utilizar esta troncal, al llamador le ser solicitada que ingrese ese mismo patrn como clave. Si la clave es ingresada correctamente la llamada es conectada, caso contrario la llamada es descartada. Solo es permitido el ingreso de dgitos. Emergency Dialling: Con esta opcin podemos especificar que la ruta es para llamadas de emergencia. Se puede especificar un diferente Caller ID. Dial Patterns: El patrn de marcado es el conjunto patrn de dgitos que Asterisk usa para discriminar si el nmero marcado por la extensin interna hace juego con el patrn configurado en la ruta saliente y de este modo determinar el canal por donde debe enviar la llamada. Existen reglas de cmo especificar los patrones de marcados, las cuales indicamos a continuacin: Patrn X Z N [1237-9] . | Descripcin Representa cualquier dgito de 0-9 Representa cualquier dgito de 1-9 Representa cualquier dgito de 2-9 Representa cualquier dgito entre corchetes Representa uno o ms caracteres Separa el nmero ubicado a la izquierda del nmero marcado. Por ejemplo: 9|NXXXXXX debera representar los nmeros marcados como 92234567 pero slo debera pasar 2234567

Trunk Sequence: Se lista e indica el orden en que se debe intentar el uso de las troncales. Cuando un nmero digitado por un llamador hace juego con el patrn de marcado especificado, Asterisk intentar realizar la llamada por las troncales especificadas en esta opcin en el orden en que son listadas. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_10/10.1_Ruteo_llamadas.htm[24/11/2011 10:22:41 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

10.2 Troncales
Una troncal es aquella que permite terminar una llamada a otro sistema externo de comunicacin VoIP. Alguno de los tipos de troncales son: DAHDI IAX2 SIP ENUM DUNDi Custom Veamos algunos de los parmetros a configurar en una troncal DAHDI.

Creacin de nueva troncal tipo DAHDI

Trunk Description: Con este campo se le asigna un nombre distintivo a la troncal. Outbound Caller ID: En esta opcin es posible especificar el nmero de origen o Caller ID que la llamada usar cuando use esa troncal. Es necesario que el proveedor de la lnea telefnica conectada a ese puerto DAHDI permita el cambio de CallerID. El formato utilizado es: Nombre del llamador <###########>

http://www.elastixbook.com/es/capitulos/capitulo_10/10.2_Troncales.htm[24/11/2011 10:22:43 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Si no se quiere usar un caller ID dejar en blanco esta opcin Maximum channels: Esta opcin limita el nmero de canales que pueden ser usados en una troncal. Al decir canales se refiere al nmero de llamadas simultneas que se pueden hacer, tanto entrantes como salientes. Dial Rules: Las reglas de marcado indican cmo Asterisk debera marcar para hacer la llamada en una troncal. Esta opcin puede ser usada para adicionar remover prefijos. Si un nmero marcado no hace juego con los patrones colocados en estas reglas, es marcado como fue digitado. Las reglas pueden ser especificadas mediante la siguiente sintaxis: Patrn X Z N [1237-9] . | Descripcin Representa cualquier dgito de 0-9 Representa cualquier dgito de 1-9 Representa cualquier dgito de 2-9 Representa cualquier dgito entre corchetes Representa uno o ms caracteres Separa el nmero ubicado a la izquierda del nmero marcado. Por ejemplo: 9|NXXXXXX debera representar los nmeros marcados como 92234567 pero slo debera pasar 2234567 Adiciona un prefijo al nmero marcado. Por ejemplo: 001+NXXNXXXXXX debera agregar el 001 al nmero 3058293438 cuando este es marcado

Troncales de tipo IAX y SIP


Adems de las configuraciones arriba mostradas, se deben especificar configuraciones entrantes y salientes que generalmente son provistas por el proveedor de servicios de voz. Las configuraciones pueden incluir username, password, codec utilizado, el host con el cual debe de registrarse, etc. Ejemplo de configuracin de los detalles del Peer:
allow=ulaw&alaw&gsm&ilbc&g726&adpcm&lpc10 canreinvite=no disallow=all dtmfmode=info fromuser=myusername host=nyc.voicepulse.com qualify=5000 secret=mypassword sendrpid=yes type=peer username=myusername
http://www.elastixbook.com/es/capitulos/capitulo_10/10.2_Troncales.htm[24/11/2011 10:22:43 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Adems es posible que se requiera una cadena de registro que tiene la siguiente sintaxis: myusername:mypassword@host

Troncales de tipo DAHDI


Las troncales de tipo DAHDI son las asociadas a hardware de telefona instalado en la mquina y usa el mdulo chan_dahdi.so. Los archivos asociados a este tipo de troncales son el /etc/asterisk/chan_dahdi.conf y los archivos bajo la carpeta /etc/dahdi/ Las troncales DAHDI son creadas mediante un nmero asociado a la posicin del canal en el hardware.

Troncales personalizadas.
Estas troncales son creadas cuando se usan protocolos no muy comunes en Asterisk como H323, CAPI, etc. Se debe especificar un string de marcado. Por ejemplo:
CAPI/XXXXXXX

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_10/10.2_Troncales.htm[24/11/2011 10:22:43 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

10.3 Tarifacin
La utilidad Rates del Men Billing dentro de la pestaa de Reports del Elastix nos permite visualizar y configurar las tarifas que se usarn para la facturacin de llamadas.

Listado de tarifas definidas

Visualizar, Editar y Eliminar


El enlace Ver nos llevar a una pantalla donde se mostrar los datos de la tarifa. Para eliminar una tarifa, de clic en el botn Eliminar. Puede adems modificar los valores de la tarifa dando clic en el botn Editar. Los nicos valores que puede cambiar son: Nombre, Tarifa y Tarifa de Conexin.

Formulario de edicin de tarifa

Crear Tarifa
Para agregar una nueva tarifa dar clic en el botn Crear Nueva Tarifa. Se mostrar un formulario en el que se ingresarn los siguientes campos: Prefijo: Prefijo telefnico al cual se aplicar la tarifa Nombre: Nombre para la tarifa Tarifa: Valor de la tarifa Tarifa de Conexin: Valor de conexin Troncal: Troncal de la cual se tomar las contabilizacin de las llamadas.

http://www.elastixbook.com/es/capitulos/capitulo_10/10.3_Tarifacion.htm[24/11/2011 10:22:46 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Creacin de nueva tarifa

Reporte de Facturacin
La opcin Billing Report del Men Billing del Elastix nos permite visualizar el detalle de las llamadas con su respectivo costo y tarifa aplicada. El reporte cambiar dependiendo de los valores de filtrado: Fecha Inicio: Fecha a partir de la cual se seleccionarn las llamadas. Fecha Fin: Fecha hasta la cual se seleccionarn las llamadas. Campo: Campos adicionales de filtrado: Fuente, Destino, Canal Destino.

Reporte de tarifacin

Distribucin de Destinos
La opcin Destination Distribution del Men Billing del Elastix nos permite visualizar mediante un grfico la distribucin de las llamadas salientes agrupadas por tarifa. El grfico cambiar dependiendo de los valores de filtrado:

http://www.elastixbook.com/es/capitulos/capitulo_10/10.3_Tarifacion.htm[24/11/2011 10:22:46 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Fecha Inicio: Fecha a partir de la cual se seleccionarn las llamadas Fecha Fin: Fecha hasta la cual se seleccionarn las llamadas Criterio de distribucin: Distribucin por Tiempo, Distribucin por Nmero de Llamadas, Distribucin por Costo

Distribucin por Tiempo La opcin de distribucin por tiempo muestra un grfico de pastel del tiempo traficado para cada troncal. Adems muestra una lista de las troncales que ms tiempo han traficado.

Grfico de pastel que muestra la distribucin de destinos en base a tiempo de uso

Distribucin por Nmero de Llamadas Muestra un grfico de pastel del nmero de llamadas para cada troncal. Adems muestra una lista de las troncales con ms nmero de llamadas traficadas.

Distribucin de destinos en base a nmero de llamadas

Distribucin por Costo Muestra un grfico de pastel dividido por el costo resumido por troncal. Es decir que para cada troncal se computa el costo de todas las llamadas traficadas. Este clculo de costo est basado en las tarifas ingresadas en el men Tarifas (rates).
http://www.elastixbook.com/es/capitulos/capitulo_10/10.3_Tarifacion.htm[24/11/2011 10:22:46 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Configurar Facturacin
Dentro de esta opcin tenemos dos secciones que explicaremos a continuacin.

Configuracin de Tarifa por Omisin La opcin Configuracin de Tarifa por Omisin del Men Billing del Elastix nos permite determinar el costo por minuto y de conexin para la ruta por omisin o dicho de otra manera la tarifa que se aplicar cuando no se encuentre otra tarifa que aplicar a una llamada.

Tarifa por omisin

Configuracin de Troncales para Facturacin La opcin Configuracin de Troncales del Men Billing del Elastix nos permite determinar cules sern las troncales que se usarn para obtener las llamadas para el proceso de facturacin. El listado muestra todas las troncales registradas, deber seleccionar las que se usarn para la facturacin y luego dar click en el botn Habilitar para Facturar.

Troncales habilitadas para tarifacin seleccionadas con visto

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_10/10.3_Tarifacion.htm[24/11/2011 10:22:46 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

10.4 Reportes
Reporte CDR
CDR es la abreviacin de Call Detail Record o Registro de Detalle de Llamada. La opcin Reporte CDR en la pestana de Reportes del Elastix nos permite visualizar un listado con el detalle de las llamadas.

Reporte de CDRs

El reporte cambiar dependiendo de los valores de filtrado: Fecha Inicio: Fecha a partir de la cual se seleccionarn las llamadas Fecha Fin: Fecha hasta la cual se seleccionarn las llamadas Campos adicionales de filtrado: Fuente, Destino, Canal Destino Estado de la llamada: ANSWERED, BUSY, FAILED, NO ANSWER Nota: Este reporte es exportable a formato CSV (separado por comas). Este formato se puede abrir desde una hoja de clculo para realizar las manipulaciones matemticas que se estime conveniente como por ejemplo sacar promedios de tiempo de llamada por extensin.

Uso de Canales
La opcin Uso de Canales del Men Reportes del Elastix nos permite visualizar grficamente el nmero de llamadas simultneas para cada canal.

http://www.elastixbook.com/es/capitulos/capitulo_10/10.4_Reportes.htm[24/11/2011 10:22:47 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Reporte de uso de canales

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_10/10.4_Reportes.htm[24/11/2011 10:22:47 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

10.5 Configuracin DISA


El mdulo DISA (Direct Inward System Access) permite que los usuarios puedan acceder telefnicamente a los servicios provistos por la central Elastix desde el exterior, el acceso se realiza obteniendo un tono "interno" de marcado.. Con este tono "interno" puedo tener acceso a las mismas facilidades que desde dentro. Por ejemplo, podra realizar llamadas internacionales (si es permitido). Normalmente el soporte DISA no est disponible para todos los empleados de una compaa y es necesaria una clave para poder obtener el tono "interno". Para poder ingresar la clave algunas compaas proveen de una opcin oculta en el IVR principal de la compaa. En todo caso hay que tomar las precauciones para que el acceso DISA no pueda ser quebrantado por usuarios indeseados, quienes podran aprovecharlo para hacer llamadas a costa de la compaa. Para configurar un acceso DISA debemos ir al men "PBX -> PBX Configuration -> DISA" y obtendremos una pantalla como la siguiente.

Formulario para crear un nuevo acceso DISA

Nombre de DISA: Nombre distintivo del acceso DISA. PIN: La clave para que el usuario acceda al soporte DISA (tono interno) Tiempo de espera para la respuesta: Tiempo mximo que la aplicacin DISA espera para que el usuario complete el PIN Tiempo de espera de marcado: Mximo tiempo entre dgitos. Pedir Confirmacin: Solicita confirmacin antes de solicitar la contrasea. Identificador de llamante: Si es utilizado este campo, todas las llamadas salientes originadas desde esta DISA utilizarn este nmero como CallerID. Contexto: Contexto que utilizarn las llamadas de la DISA.

http://www.elastixbook.com/es/capitulos/capitulo_10/10.5_Configuracion_DISA.htm[24/11/2011 10:22:49 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Permite Colgar: Si se habilita esta opcin, el usuario que realiza una llamada por esa DISA tiene la posibilidad de colgar la llamada presionando ** para obtener un nuevo tono de marcado y poder realizar una nueva llamada. Luego, para que ste acceso DISA est disponible desde el IVR principal debemos modificar dicho IVR y asociar una opcin con el acceso DISA recientemente creado. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_10/10.5_Configuracion_DISA.htm[24/11/2011 10:22:49 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

10.6 Condiciones de tiempo


El uso de condiciones de tiempo es una caracterstica muy til para muchos negocios que quieren modificar el comportamiento de su PBX dependiendo de la hora del da, da de la semana e inclusive el da del ao. Por ejemplo, la compaa X desea que en la noche las llamadas a ventas no vayan a la cola de ventas sino que se reproduzca un mensaje indicando el horario de atencin y diciendo tambin que pueden contactar a un nmero alternativo para casos urgentes; o tambin la compaa Z que quiere reproducir un IVR de bienvenida distinto al habitual durante los fines de semana ya que tienen promociones de fin de semana. Las condiciones de tiempo son funcionalidad provista gracias a la integracin de Elastix con el software FreePBX. Para configurar una condicin de tiempo, es necesario saber que se debe implementar ingresando a dos mens. El primer men llamado Grupo Horario se utiliza para definir los distintos horarios que se necesitarn para discriminar las condiciones de tiempo, y luego el men Condiciones de Tiempo que ser utilizada para determinar el destino de la llamada de acuerdo al grupo horario anteriormente definido. Para ingresar a la utilidad de Grupo Horario, debe dirigirse a la pestaa de PBX -> PBX Configuration -> Grupo Horario. Aqu accederemos a un formulario que nos permitir establecer el rango de tiempo que ser utilizado luego en el men de Condiciones de Tiempo..

Aadiendo un nuevo grupo horario

Luego de definir el Grupo Horario es necesario ingresar a la utilidad de Condiciones de Tiempo para relacionar este grupo horario con una entidad como por ejemplo un IVR, una extensin, una cola, un voicemail, etc.

http://www.elastixbook.com/es/capitulos/capitulo_10/10.6_Condiciones_de_tiempo.htm[24/11/2011 10:22:50 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Aadiendo una nueva condicin de tiempo

Una vez configurada, no olvide seleccionarla dentro de sus rutas entrantes. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_10/10.6_Condiciones_de_tiempo.htm[24/11/2011 10:22:50 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

11
Funcionamiento interno de FreePBX
La libertad no se implora, se conquista -- Eloy Alfaro

11.1 Fundamentos de FreePBX


FreePBX es un software de configuracin de Asterisk que ha sido integrado como parte de la distro Elastix. Bsicamente este software se encarga de generar los archivos de configuracin requeridos por Asterisk a partir de la configuracin ingresada por el usuario desde la interfaz Web. Para realizar esta tarea FreePBX la divide en dos pasos: 1. Recaba la configuracin deseada por el usuario en una base de datos de configuracin. En el caso de Elastix se usa el motor de base de datos MySQL. 2. Convierte la informacin almacenada en MySQL en archivos de configuracin va la herramienta retrieve_conf Para ilustrar este proceso veamos la siguiente figura.

http://www.elastixbook.com/es/capitulos/capitulo_11/11.1_Fundamentos_FreePBX.htm[24/11/2011 10:22:52 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Funcionamiento y componentes de FreePBX

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_11/11.1_Fundamentos_FreePBX.htm[24/11/2011 10:22:52 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

11.2 Organizacin de archivos


FreePBX lee y escribe informacin en algunos directorios para su correcto funcionamiento. A continuacin se encuentra una lista de los ms importantes. Directorio /var/www/html/admin/ /etc/asterisk/ /var/lib/asterisk/agi-bin/ Descripcin Lugar donde reside el GUI de FreePBX Archivos de configuracin de Asterisk modificados por FreePBX Lugar donde residen los scripts AGI de Asterisk. FreePBX cuenta con algunos scripts en esta carpeta como el dialparties.agi Algunos binarios o vnculos simblicos correspondientes que son utilizados por FreePBX. El script amportal se encuentra aqu ya que solo puede ser manipulado por root Sonidos que se utilizan en el plan de marcado por FreePBX Sonidos que han sido creados por el usuario. Por ejemplo cuando se crea un IVR de bienvenida Lugar donde se almacenan los voicemails Lugar donde se almacenan las grabaciones de voz Lugar donde se escriben los CDRs en formato texto Ir a ndice Siguiente

/var/lib/asterisk/bin/

/usr/local/sbin/ /var/lib/asterisk/sounds/ /var/lib/asterisk/sounds/custom/

/var/spool/asterisk/voicemail/ /var/spool/asterisk/monitor/ /var/log/asterisk/cdr-csv/

Anterior

http://www.elastixbook.com/es/capitulos/capitulo_11/11.2_Organizacion_de_archivos.htm[24/11/2011 10:22:52 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

11.3 Configuracin
amportal.conf
El archivo /etc/amportal.conf es un archivo de texto plano que contiene informacin general de configuracin y es ledo por FreePBX. Es decir, este es el principal archivo de configuracin de FreePBX y puede ser editado manualmente en caso de requerirse. En este archivo de configuracin se encuentra la informacin de acceso a la base de datos (usuario y contrasea) al igual que el tipo de autenticacin que FreePBX usar para con sus usuarios Web. Este archivo est bien documentado por lo que no entraremos en detalles sobre las opciones o directivas de configuracin. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_11/11.3_Configuracion.htm[24/11/2011 10:22:53 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

11.4 retrieve_conf: Generador del plan de marcado


retrieve_conf es un programa escrito en PHP que se encarga de generar el plan de marcado a partir de la informacin almacenada en la base de datos (MySQL en nuestro caso). Este programa usualmente se ejecuta desde el Web a travs de un script PHP cada vez que damos clic en la barrita roja de FreePBX que dice Apply Configuration Changes Here. Sin embargo, retrieve_conf puede ser invocado inclusive desde la lnea de comandos. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_11/11.4_retrieve_conf.htm[24/11/2011 10:22:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

11.5 dialparties.agi
Este es un script AGI escrito en PHP que se invoca desde el plan de marcado cuando se quiere hacer una llamada. Su principal tarea es la de revisar el estado de la extensin a la que se est llamando, as como tambin ciertas opciones que pudieran estar configuradas en dicha extensin ( all waiting, call forward, do not disturb). c Finalmente, el script retorna dicha informacin para que se pueda tomar una accin acorde como por ejemplo devolver al llamante un tono de ocupado en el caso de DND o rutear la llamada a otra extensin en el caso de call forward. Si la extensin est disponible y no se encuentran opciones activadas la llamada transcurre sin inconvenientes. Para realizar su trabajo dialparties.agi consulta la base de datos de Asterisk (en el archivo /var/lib/asterisk/astdb). A continuacin algunas lneas de diagnstico que aparecen en el CLI cuando se intenta hacer una llamada. Estas lneas son devueltas por el script dialparties.agi.
dialparties.agi: Caller ID name is 'Pedro Paramo' number is '5454' dialparties.agi: Methodology of ring is 'none' -- dialparties.agi: Added extension 1616 to extension map -- dialparties.agi: Extension 1616 cf is disabled -- dialparties.agi: Extension 1616 do not disturb is disabled dialparties.agi: Extension 1616 has ExtensionState: 0 -- dialparties.agi: Checking CW and CFB status for extension 1616 -- dialparties.agi: dbset CALLTRACE/1616 to 5454 -- dialparties.agi: Filtered ARG3: 1616

Nota: Este script puede ser sobrescrito por el propio FreePBX por uno nuevo por lo que si se realizan cambios en su cdigo se debe tener este hecho en cuenta. dialparties.agi est ubicado en la ruta /var/lib/asterisk/agi-bin/dialparties.agi. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_11/11.5_dialparties.agi.htm[24/11/2011 10:22:54 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

11.6 Estructura de un mdulo de FreePBX


Esta seccin tiene como propsito el que podamos entender mejor el funcionamiento de FreePBX con miras a solucionar posibles problemas. Los mdulos de FreePBX tienen la siguiente estructura mnima de archivos. Nombre del archivo module.xml page.<mdulo>.php Descripcin Contiene informacin del mdulo en formato XML Archivo principal del mdulo conteniendo la funcionalidad necesaria. Como es de imaginar, la palabra <mdulo> debe ser reemplazada por el respectivo nombre del mdulo. Librera de funciones PHP tanto para uso del mdulo como para que puedan ser compartidas por otros componentes de FreePBX Contiene sentencias SQL que se ejecutarn sobre la base de datos al instalar el mdulo. Bsicamente para crear las tablas necesarias para el mdulo Contiene las sentencias SQL necesarias para desinstalar el mdulo. Bsicamente para remover las tablas creadas Script PHP para ser ejecutado al momento de instalacin del mdulo Script PHP para ser ejecutado al momento de desinstalacin del mdulo Ir a ndice Siguiente

functions.inc.php

install.sql

uninstall.sql

install.php uninstall.php

Anterior

http://www.elastixbook.com/es/capitulos/capitulo_11/11.6_Estructura_modulo_ FreePBX.htm[24/11/2011 10:22:55 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

12
Conectando Servidores Elastix
Cualquier poder, si no se basa en la unin, es dbil -- Jean de la Fontaine

12.1 Interconexin entre dos servidores Elastix


Una de las ventajas de usar Elastix es que fcilmente podemos interconectar dos servidores Elastix de tal manera que lugares remotos se puedan comunicar con un solo plan de marcado. A continuacin veremos cmo interconectar dos servidores Elastix mediante una troncal de tipo SIP. Supongamos que queremos interconectar un servidor Elastix localizado en un punto A con otro servidor Elastix en un punto B. El resultado debe ser que un telfono conectado al servidor Elastix en el punto A pueda comunicarse marcando simplemente la extensin del telfono conectado al servidor Elastix en el punto B, y viceversa.

http://www.elastixbook.com/es/capitulos/capitulo_12/12.1_Interconexion_servidores_Elastix.htm[24/11/2011 10:22:56 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Interconectando dos Elastix

Para implementar esto se requiere definir dos cosas: 1. La troncal SIP entre los servidores Elastix 2. Las rutas salientes en cada servidor Elastix Toda la configuracin se puede realizar desde la interfaz Web de Elastix desde el men PBX -> PBX Configuration

Definiendo la troncal SIP


Definimos el nombre de la troncal, el cual en nuestro caso servir de username para el proceso de registro. Debemos crear la troncal del Elastix en el punto A como pointA y la del punto B como pointB. Ver captulo 10 para detalles sobre la creacin de troncales SIP. Luego definimos los detalles del peer que en este caso sern los siguientes:
host=dynamic secret=welcome trunk=yes type=friend

Esta configuracin de la seccin de peer se debe repetir en ambos servidores Elastix. En este ejemplo hemos definido como la palabra welcome como secret. Ahora debemos definir el register string (cadena de registro) usando pointA o pointB como username segn sea el caso. Para el servidor Elastix en el punto A debemos tener:
pointB:welcome@192.168.1.240

Para el servidor Elastix en el punto B debera ser:

http://www.elastixbook.com/es/capitulos/capitulo_12/12.1_Interconexion_servidores_Elastix.htm[24/11/2011 10:22:56 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

pointA:welcome@192.168.1.239

Una vez establecida esta configuracin en ambos Elastix podemos verificar desde el Asterisk CLI si las troncales SIP se encuentran registradas. Al ejecutar el comando sip show registry en el servidor Elastix del punto A deberamos ver algo como lo que sigue:
elastix*CLI> sip show registry Host Username Refresh State Reg.Time 192.168.1.240:5060 pointB 105 Registered Fri,11 Apr 2008 10:29:43

El siguiente paso es definir los detalles del user en la misma pantalla de creacin de troncales SIP anterior. La seccin de user establece donde se quiere terminar la llamada. En este caso queremos que sea accesible a extensiones locales, as que bastar con colocar el contexto primario from-internal. Esto indica que cuando la llamada entre por la troncal se iniciar en el contexto aqu especificado. La configuracin es como sigue:
context=from-internal host=192.168.1.240 insecure=very type=friend

Definiendo las rutas salientes


Ver captulo 10 para detalles sobre la creacin de rutas salientes. Primero determinamos el nombre de la ruta saliente. En este caso, especificaremos la ruta saliente en el servidor del punto A como: ElastixB Luego definimos el patrn de marcado. En este caso usaremos el siguiente patrn de marcado: 2|XXX. Estamos asumiendo que para marcar a las extensiones conectadas al servidor Elastix en el punto B se debe marcar con el nmero 2 adelante. Finalmente escogemos la troncal por la cual debe irse la llamada. En este caso escogemos la troncal SIP/pointA Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_12/12.1_Interconexion_servidores_Elastix.htm[24/11/2011 10:22:56 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

12.2 Conexin con proveedores de llamadas va IP


La popularidad de los proveedores de servicios de voz (Voice Service Providers o VSP) ha crecido increblemente en los ltimos aos. Estas compaas proveen conexiones SIP o IAX para llamadas locales o internacionales por Internet a bajo costo. En esta seccin estableceremos una conexin SIP con un proveedor que nos permitir hacer llamadas dentro de los Estados Unidos. Nuestra meta es registrar nuestra troncal de tipo SIP con un VSP que nos permita realizar llamadas a USA desde cualquier telfono IP conectado a nuestro servidor Elastix. Para implementar esto se requiere definir dos cosas: 1. La troncal SIP del servidor Elastix 2. La ruta saliente en el servidor Elastix

Definiendo la troncal SIP


Como vimos anteriormente, lo primero que se debe hacer es definir el nombre de la troncal. En este caso le llamaremos: VP-SIP-NYC. Ver captulo 10 para detalles sobre la creacin de troncales SIP. Ahora debemos definir las caractersticas del peer. Esta informacin debe ser proporcionada por el VSP. Generalmente, los VSP entregan esta misma informacin para todos sus usuarios con la nica diferencia del username y el password. Como ejemplo, nuestro VSP nos pidi que configuremos la troncal SIP de la siguiente forma.
allow=ulaw&alaw&gsm&ilbc&g726&adpcm&lpc10 canreinvite=no disallow=all dtmfmode=info fromuser=myusername host=nyc.voicepulse.com qualify=5000 secret=mypassword sendrpid=yes type=peer username=myusername

Luego agregamos la cadena de registro que en nuestro caso sera la siguiente.


myusername:mypassword@nyc.voicepulse.com

http://www.elastixbook.com/es/capitulos/capitulo_12/12.2_Conexion_proveedores_de_llamadas_via_IP.htm[24/11/2011 10:22:57 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Definiendo la ruta saliente


Ver captulo 10 para detalles sobre la creacin de rutas salientes. Primero determinamos el nombre de la ruta saliente. En este caso la nombraremos: INTERNACIONAL Luego definimos el patrn de marcado. En este caso usaremos el siguiente patrn de marcado: 00. Estamos asumiendo que para marcar un nmero al exterior se requiere anteponer los dos ceros. Finalmente escogemos la troncal por la cual debe irse la llamada. En este caso escogemos la troncal SIP/VPSIP-NYC Una vez establecida esta configuracin podemos verificar desde el Asterisk CLI si la troncal SIP se encuentra registrada. Al ejecutar el comando sip show registry en el servidor Elastix deberamos ver algo como lo que sigue:

elastix*CLI> sip show registry Host Username nyc.voicepulse.com:5060 myusername

Refresh State 105 Registered

Reg.Time Fri,11 Apr 2008 10:29:43

Al marcar un nmero internacional como 0018773527849 la llamada debe establecerse por medio de este VSP. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_12/12.2_Conexion_proveedores_de_llamadas_via_IP.htm[24/11/2011 10:22:57 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

12.3 Conexin predefinida con proveedores de llamadas va IP


Existe otra forma de crear troncales SIP para interconectar el servidor Elastix con un VSP. La interfaz de VoIP Provider nos permite ingresar los parmetros de peer y cadena de registro directamente en un formulario. Adems, podemos seleccionar entre los proveedores ms comunes los cuales ya cuentan con parmetros predeterminados de configuracin. La siguiente imagen muestra la configuracin de una troncal SIP con un VSP predefinido.

Interfaz Web para configurar VSPs

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/...los/capitulo_12/12.3_Conexion_predefinida_con_proveedores_de_llamadas_via_IP.htm[24/11/2011 10:22:59 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

13
Calidad de voz
Calidad es hacer las cosas bien cuando nadie est controlando -- Henry Ford

13.1 Sntomas de los problemas de voz


Enumerar los problemas que afectan la calidad de voz es difcil pues influye mucho la percepcin de la persona. Las causas del deterioro de la calidad de voz son variadas y difcil de categorizar. En esta seccin revisaremos los ms comunes explicando sus causas y posibles soluciones.

Eco
El eco es uno de los sntomas ms comunes y es muy fcil reconocerlo. Se produce cuando una parte de la seal de ida se refleja en la seal de vuelta. El eco consiste en la repeticin una o ms veces la conversacin con cierto desfase de tiempo. Hay algunas causas del eco pero una de las ms comunes se produce en las lneas analgicas cuando se combinan las seales en el convertidor hbrido o convertidor de 2 4 hilos (Ver capitulo 1 para ms detalles). Esto sucede porque es muy difcil separar las seales de ida y de vuelta de manera eficaz. El problema se agrava cuando la impedancia de la lnea telefnica vara mucho. Muchas de las tarjetas telefnicas disponibles para Asterisk no disponen de un buen mecanismo para el ajuste dinmico de la impedancia de la lnea con la impedancia de la tarjeta. Por esta razn una parte de la onda se refleja causando eco. Nota: hay que recordar que para que un receptor absorba eficientemente la potencia de la seal recibida,
http://www.elastixbook.com/es/capitulos/capitulo_13/13.1_Sintomas_problemas_de_voz.htm[24/11/2011 10:22:59 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

su impedancia debe coincidir con la de la lnea. Sin embargo, existe una forma de acoplar estas impedancias lo mejor posible. Esto se puede realizar con programa llamado fxotune disponible en Elastix desde la lnea de comandos. Lamentablemente esta utilera se debe ejecutar manualmente y con el servicio Asterisk apagado. Para lneas con problemas de eco se recomienda ejecutarlo en horas no laborables una vez por semana debido a que puede llevarse un tiempo considerable. El comando es el siguiente.
fxotune -i 5

El comando fxotune prueba enviando una seal pura por la lnea y escuchando el retorno. Esto lo hace muchas veces por cada lnea hasta encontrar el mejor valor de ganancia. Al final, este software escribe el valor de la ganancia en el archivo /etc/fxotune.conf Al finalizar su ejecucin se debe instruir a DAHDI que cargue los valores nuevos de ganancia. Esto lo podemos hacer con el siguiente comando:
fxotune -s

Esto lo debemos ejecutar siempre antes de arrancar Asterisk por lo que se recomienda incluirlo al final del script de arranque de DAHDI ubicado en la ruta /etc/init.d/dahdi para no tener que hacerlo manualmente cada vez. Nota: Es muy importante hacer notar que si se utiliza fxotune para tratar de acoplar las lneas no se deben configurar las variables txgain o rxgain en el chan_dahdi.conf ya que sobrescribirn el trabajo del fxotune. Ahora solo resta encender Asterisk nuevamente. Finalmente, otra causa del eco es de naturaleza acstica provocado cuando la seal de sonido se retroalimenta desde el micrfono al audfono. Esto es ms notable cuando hablamos por altavoz. Por supuesto el diseo del telfono hace mucha diferencia y hay modelos que introducen menos eco acstico que otros.

Bajo nivel de volumen


Muchas redes telefnicas de baja calidad atenan la seal de manera significativa haciendo que escuchemos un volumen muy bajo. Esto obviamente afecta la calidad de voz, haciendo que la conversacin muchas veces sea inentendible o haciendo que no se puedan detectar los tonos de DTMFs. Tanto el volumen de recepcin como el de transmisin pueden ser amplificados mediante parmetros en el archivo chan_dahdi.conf. Sin embargo se debe tener mucho cuidado pues en ocasiones un volumen bajo significa una lnea mal acoplada y por ende la mejor solucin es utilizar la utilera fxotune para corregir el problema. Si modificamos los parmetros de ganancia arbitrariamente podramos conseguir empeorar el eco en la lnea. El parmetro que modifica la ganancia de la seal de transmisin se llama txgain y el de recepcin se llama rxgain. Ambos se pueden editar en el archivo chan_dahdi.conf.

http://www.elastixbook.com/es/capitulos/capitulo_13/13.1_Sintomas_problemas_de_voz.htm[24/11/2011 10:22:59 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Retardo de voz
El retardo de voz no es otra cosa que la demora que experimenta la voz en llegar a su destino. Usualmente el retardo es menor a un segundo y si es menor a 200 ms pasa desapercibido. Cuando el retardo es mayor a 500 ms los interlocutores tienden a interrumpirse y la conversacin se traslape. Esto es irritante para la comunicacin.. Es casi imposible eliminar el retardo a nivel del servidor pues en la gran mayora de los casos este es un sntoma de problemas inherentes en la red de comunicaciones. Es decir que si se quiere eliminarlo habr que analizar posibles cambios en la red de comunicaciones.

Distorsin de voz
En esta categora recaen diferentes problemas. El ms comn de ellos es el de la voz robotizada. Cuando se utiliza un codec para optimizar el uso de ancho de banda (Ej: gsm) y la conectividad experimenta problemas entonces la perdida de informacin causa la distorsin. En estos casos es recomendable cambiar de codec a uno que ofrezca menor compresin de voz.

Comunicacin entrecortada
Este problema tan molestoso normalmente est relacionado con la prdida de paquetes en la red. Las causas principales de la prdida de paquetes son una latencia elevada o un ancho de banda limitado, entre otros. La comunicacin entrecortada tambin puede ser ocasionada por un jitter elevado. Estudiaremos ms sobre el jitter en la siguiente seccin. En todo caso lo normal es buscar la causa de este problema primero en la red y luego en el servidor. El entrecorte de la voz puede ser producto de problemas con el servidor cuando el consumo de los recursos como memoria y CPU se encuentran muy elevados. Por lo general si la latencia mxima (absoluta, no promedio) de la red es 150 ms y el canal de comunicaciones no se encuentra saturado podemos estar tranquilos de que los problemas de comunicacin entrecortada no nos quitarn el sueo. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_13/13.1_Sintomas_problemas_de_voz.htm[24/11/2011 10:22:59 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

13.2 Parmetros relacionados con la calidad de voz en redes de paquetes


Retardo de red
Hay que distinguir aqu que no estamos hablando del retardo de voz sino del retardo de los paquetes en la red. Una manera sencilla de calcular (aproximadamente) el retardo de la red es utilizando el comando ping. Este comando enva paquetes de prueba a un destino y nos presenta un pequeo resumen estadstico de los paquetes enviados. El resumen luce como el siguiente.
--- ping statistics --6 packets transmitted, 6 received, 0% packet loss, time 5004ms rtt min/avg/max/mdev = 73.055/74.181/74.852/0.710 ms

Aqu podemos ver algunos parmetros como el retardo mnimo, promedio, mximo y su desviacin.

Prdida de paquetes
En algunas ocasiones ciertos de los paquetes que componen un mensaje no llegan a su destino. Pueden existir muchas razones para que suceda esto como equipos defectuosos o saturados, prdidas en el medio de transmisin (cables mal terminados, ruido elctrico elevado), entre otros. En el resumen del comando ping en la seccin de retardo de red vemos que tambin se nos reporta porcentualmente las prdidas de paquetes. Lo deseable es que no existan prdidas de paquetes en lo absoluto (0%). Si existen, hay que investigar el por qu. Inclusive prdidas de menos del 1% pueden afectar a las conversaciones de voz sobre IP. Este problema es an mayor cuando usamos codecs de gran compresin.

Jitter
El jitter es un parmetro muy importante cuando se habla de calidad de voz en redes de paquetes. El jitter se define como la variabilidad del retardo de red y normalmente est en el orden de los milisegundos. Este parmetro es necesario para analizar la calidad de voz ya que tener un promedio de retardo de red bajo no es suficiente para garantizar una buena calidad. Cuando existe un promedio de retardo de red aceptable pero muy variable existe mayor probabilidad de que los paquetes lleguen en desorden a su destino o con retardos excesivos. Debido a que la comunicacin de voz es en tiempo real no se puede esperar a que lleguen todos los paquetes y habr que descartar los que se demoren ms de lo necesario. Por tanto, si tenemos un jitter elevado es ms probable que se descarten paquetes y por lo tanto oigamos una conversacin entrecortada.
http://www.elastixbook.com/...lo_13/13.2_Parametros_relacionados_con_calidad_de_voz_en_redes_de_paquetes.htm[24/11/2011 10:23:00 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Nota: Muchas personas confan ciegamente en el comando ping para obtener el retardo de una red e incluso para calcular el jitter haciendo clculos manuales. Pese a que ping puede usarse en situaciones de apremio, el comando ping no enva paquetes de voz sino trfico ICMP el cual no recibe el mismo tratamiento en la red. Inclusive en ciertas redes este protocolo puede tener una limitacin de ancho de banda totalmente diferente al de los paquetes de voz. La manera ms exacta de calcular el jitter es con paquetes RTP reales y esto se puede analizar con un sniffer.

Jitter buffers Para minimizar los efectos negativos del jitter algunos fabricantes de soluciones de VoIP han pensado en esperar por paquetes de voz extraviados antes de volver a ensamblar la seal de voz en el destino. A medida que estos paquetes lleguen sern reordenados para reconstruir el mensaje original. Esta solucin no est libre de problemas ya que con esta accin estamos tambin aumentando el retardo de red al hacer que el mensaje llegue a su destino despus del reordenamiento. Sin embargo la idea es buena y prctica. Quizs si esperamos slo el tiempo justo es probable que lleguen una buena parte de los paquetes perdidos sin afectar significativamente el retardo. Un jitter buffer entonces es un pequeo registro donde se almacenan temporalmente todos los paquetes de voz durante un corto tiempo para esperar por posibles paquetes perdidos. El tiempo de espera se denomina tamao del buffer. Asterisk soporta el concepto de jitter buffer y este parmetro es configurable a nivel de protocolos IAX y SIP. Este parmetro se puede configurar en los archivos de tecnologa correspondientes (iax.conf y sip.conf). Si se quiere estar seguro de que el jitter buffer est habilitado se puede aadir las siguientes opciones en los archivos de tecnologa. En el sip.conf:
jbenable=yes jbmaxsize=200 ; Opcional (define el tamanio del buffer)

En el iax.conf:
jitterbuffer=yes maxjitterbuffer=200 ; Opcional (define el tamanio del buffer)

http://www.elastixbook.com/...lo_13/13.2_Parametros_relacionados_con_calidad_de_voz_en_redes_de_paquetes.htm[24/11/2011 10:23:00 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Esquema de funcionamiento de un jitterbuffer

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/...lo_13/13.2_Parametros_relacionados_con_calidad_de_voz_en_redes_de_paquetes.htm[24/11/2011 10:23:00 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

13.3 Cmo medir la calidad de voz


Medir la calidad de voz siempre ha sido un rompecabezas para los ingenieros. La complejidad radica en que la calidad de voz es en parte un parmetro subjetivo de la persona que escucha. Incluso muchos conceptos como la comprensin de una conversacin telefnica varan dependiendo del idioma que usemos. Adicionalmente, nuestra mente juega una serie de trucos con nosotros para facilitarnos la vida que hacen que ciertas mediciones de la calidad de voz sean ms difciles de obtener. Si la voz se distorsiona justo antes de terminar la conversacin es probable que las personas califiquen la calidad de la llamada de manera diferente a que si los errores ocurrieron al principio de la llamada. Esto ocurre porque nuestra mente le da mas importancia a eventos ms recientes que a los lejanos. Tambin hay personas que justifican inconscientemente cierta falta de calidad de voz en pro de las ventajas o conveniencias personales percibidas. Un ejemplo de esto es que las personas no se quejan mucho de la calidad de voz en telfonos celulares en pro de la ventaja de la movilidad. Sin embargo, si la misma calidad la escucharan en una lnea fija es probable que llamen a la compaa telefnica a quejarse porque su lnea tiene mala calidad. Dicho de otra manera, como seres humanos inconscientemente estamos justificando esa disminucin en la calidad de voz del telfono celular. Esto es solo la punta del iceberg pues para calificar la calidad de voz hay una serie de parmetros subjetivos un tanto difciles de cuantificar. Lo importante de este ejemplo es ilustrar la difcil tarea que se tiene al tratar de medir la calidad de voz. Aun as, existen algunos intentos de estandarizar la medicin de la calidad de voz. Uno de los ms conocidos es la escala MOS que se basa en mediciones subjetivas. Tambin podemos mencionar el modelo E que ya pone en el tapete algunos parmetros objetivos como el retardo de red o la prdida de paquetes. Algo interesante de este ltimo modelo es que contempla la conversin de sus resultados a la escala MOS lo que permite obtener una escala estndar para calificar la calidad de voz.

Escala MOS
La escala MOS es realmente una recomendacin de la ITU. Especficamente la recomendacin ITU-T P.800. Esta escala escribe una escala de calidad de voz basada en la toma de muestras subjetivas que se realizan con una serie de tcnicas conocidas como Absolute Category Rating (ACR). Para tal efecto se rene a un grupo de personas y se les pide que califiquen la calidad de voz de manera subjetiva. Antes de iniciar la evaluacin se hacen escuchar algunos ejemplos que previamente han sido definidos por la recomendacin de manera que los usuarios tengan algn marco referencial. Una vez hecho esto se transmite una serie de frases (tambin pre-definidas por la recomendacin) por la lnea telefnica y los usuarios proceden a calificar la calidad de voz. El siguiente es un resumen de la escala MOS. Calificacin MOS 5 4 Calidad Excelente Buena Esfuerzo No hace falta esfuerzo alguno Es necesario prestar atencin pero no es necesario un esfuerzo apreciable

http://www.elastixbook.com/es/capitulos/capitulo_13/13.3_Como_medir_la_calidad_de_voz.htm[24/11/2011 10:23:02 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

3 2 1

Aceptable Pobre Mala

Esfuerzo moderado Gran esfuerzo No es posible entender

Una desventaja de usar la escala MOS es sin duda la cantidad de tiempo necesaria para determinar la calidad de voz de una simple lnea. Imaginmonos tratando de coordinar toda una serie de pruebas con un gran grupo de personas a quienes previamente tendremos que entrenar, y solo para evaluar la calidad de voz de una lnea.

Modelo E
El modelo E es un modelo ms matemtico y objetivo de medicin de la calidad de voz basado en algunos parmetros de red como el retardo de red, prdida de paquetes, y el jitter. Nota: Al decir que es un mtodo objetivo el lector no debe pensar necesariamente que este es un mejor mtodo de medicin de la calidad de voz. La calidad de voz contiene un importante componente subjetivo como lo hemos mencionado anteriormente. Sin embargo, muchas veces es ms prctico medir los parmetros de red y hacer un clculo matemtico para aproximar la medida de la calidad de voz en la escala MOS. El modelo E tambin fue recomendado por el ITU y se trata de la recomendacin ITU-T G.107. Esta recomendacin dice que la calidad de voz queda representada por un parmetro R que se calcula de la siguiente manera:

R = R0 IS Id Ie + A
Donde,

R 0 representa la relacin seal-a-ruido (signal-to-noise ratio) I S representa la degradacin que sufre la seal en su conversin a paquetes I d representa el retardo de red I e representa la degradacin introducida por los equipos de red y depende del codec y de las prdidas de paquetes A representa el margen de seguridad
Frmula simplificada La recomendacin ITU nos provee de una frmula ms simplificada para calcular el parmetro R. Se trata de una aproximacin menos precisa que la expresin anterior pues supone algunos valores por omisin. Esta frmula es la siguiente:

R = 94,2 I d I e
Nota: Si somos observadores notaremos que el valor mximo que podra tomar R es de 94,2. Ya hemos definido los parmetros Id e Ie como el retardo de red y la prdida de paquetes respectivamente. Sin embargo, antes de ingresar estos valores en la frmula debemos normalizar estos valores de acuerdo a la
http://www.elastixbook.com/es/capitulos/capitulo_13/13.3_Como_medir_la_calidad_de_voz.htm[24/11/2011 10:23:02 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

recomendacin ITU. El parmetro Id representa el retardo de red y se normaliza con la siguiente frmula.

I d = 0.024 d + 0.11 (d 177.3) H(d 177.3)


Donde d es el retardo de red en s expresado en milisegundos y H( ) es la funcin de Heavyside: H(x) = 0 para x < 0 y 1 para x 0. Al analizar la frmula de I d notaremos a primera vista que hay un valor de inflexin en los 177.3 ms. Esto quiere decir que a valores mayores que ste la calidad de voz se ve afectada a un ritmo ms severo. Esto es un dato interesante ya que nos permite bosquejar una regla emprica de siempre mantener el retardo de red por debajo de 170 ms (aproximadamente). Finalmente debemos calcular Ie para poder reemplazar este valor en la frmula y calcular R. Ie depende principalmente de la prdida de paquetes y del codec usado. Para mantener las cosas relativamente simples usaremos un grfico con el cual podremos determinar el valor aproximado de Ie dependiendo de los dos factores mencionados. La tabla es la siguiente:

Ie (y) vs. prdida de paquetes (x)

Este grfico fue generado a partir de la siguiente tabla de valores aproximados. El eje vertical representa el parmetro Ie mientras que el eje horizontal representa la prdida de paquetes. Prdida de paquetes Ie [G.711] % 0 0 1 3 2 5 4 7 8 9 16 20 Ie [G.723.1] 11 15 18 20 22 24 Ie [G.729A] 15 18 20 25 28 30

Podemos observar que mientras ms compresin involucre el uso de determinado codec, mayor es la contribucin

http://www.elastixbook.com/es/capitulos/capitulo_13/13.3_Como_medir_la_calidad_de_voz.htm[24/11/2011 10:23:02 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

al parmetro Ie y por lo tanto menor la calidad de voz. Incluso podemos observar que con cero prdidas de paquetes ya algunos codecs merman la calidad de voz.

Traduciendo R a la escala MOS Habiendo calculado el valor de R procedemos a explicar cmo traducirlo a la ms conocida escala MOS. La frmula es la siguiente:

MOS = 1 MOS = 1 + 0.035 R + 7 R (R 60) (100 R) 10 -6 MOS = 4.5

;R<0 ; 0 < R < 100 ; R > 100

Ahora tenemos una manera prctica y objetiva de medir la calidad de voz en una instalacin de voz sobre IP. De esta manera podremos hacer los ajustes necesarios para mejorar la satisfaccin de los usuarios telefnicos. Ejemplo Supongamos que hemos realizado mediciones en un punto de la red y queremos determinar la calidad de voz en dicho punto conociendo que usamos el codec G.711. El retardo de red es de 143 ms y la prdida de paquetes llega al 7%. Cul es la medida de calidad de voz segn la escala MOS? Despus de manipular los valores de acuerdo a las expresiones expuestas anteriormente, llegaremos a un valor similar al siguiente.

R = 94.2 0.024 143 7.2 R = 83.57


Traduciendo R a la escala MOS obtenemos:

MOS = 4.15
Lo cual es un resultado aceptable (4.15/5.00) pues todava encontraremos usuarios satisfechos. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_13/13.3_Como_medir_la_calidad_de_voz.htm[24/11/2011 10:23:02 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

13.4 Canceladores de eco


Funcionamiento de canceladores de eco
Es muy importante saber cmo funcionan los canceladores de eco para entender cmo sacarles provecho el mximo y quizs para disear el nuestro propio o modificar alguno existente en caso de ser cdigo abierto. Existen implementaciones de canceladores de eco tanto en hardware como en software. Generalmente se prefiere que la cancelacin de eco sea implementada en hardware para no sobrecargar el procesador del servidor. Los principios de cancelacin de eco rigen de igual forma para cualquiera de las dos implementaciones. Un cancelador de eco parte de un principio lgico muy sencillo: Si el eco significa que una parte de la seal de ida se refleja en la de regreso, entonces para eliminar el eco debera bastar con restar la seal de ida (en cierta proporcin) de la seal de regreso. Debido a que el eco es una seal reflejada que se encuentra atenuada, la clave est en estimar adecuadamente dicha atenuacin. Por ejemplo, supongamos que la seal de eco es un 20% de la seal original. Entonces si podemos predecir que debemos restar a la seal de regreso un 20% de la seal de ida, habremos eliminado el eco completamente. Al menos en teora claro est. Esta prediccin del factor de atenuacin es una parte clave de todo algoritmo de cancelacin de eco y recibe el nombre de algoritmo adaptativo o filtro adaptativo (adaptive filter). Se llama as porque debe adaptar el valor constantemente para obtener los mejores resultados. En la siguiente figura supondremos que la atenuacin de la seal reflejada est denotada por la letra . La seal recibida es Rx, la seal transmitida es Tx y la seal transmitida con el componente de eco es Txe.

Funcionamiento bsico de un cancelador de eco

Sin embargo, no todo es tan sencillo como se explica aqu. El eco no es solo una seal reflejada atenuada sino que tambin puede estar desplazada en el tiempo con cierto retardo. Por lo tanto, tambin tenemos que predecir este retardo para poder sustraer la seal de eco. Predecir el retardo no es una tarea sencilla y por lo general los
http://www.elastixbook.com/es/capitulos/capitulo_13/13.4_Canceladores_de_eco.htm[24/11/2011 10:23:03 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

canceladores de eco tienen limitantes. Revisar la seal en busca de retardo por grandes lapsos de tiempo conlleva demasiado trabajo y los canceladores de eco pueden dejar de funcionar. Nota: Hay que hacer un pequeo parntesis para recordar que los canceladores de eco deben funcionar en tiempo real y por lo tanto no pueden perder el tiempo en clculos complejos ya que dejaran de ser veloces y retrasaran el envo de la voz. Los valores tpicos de retardo que un cancelador de eco puede manejar son 64 ms o 128 ms.Obviamente que mientras menor sea el retardo, menor es el trabajo para el cancelador de eco (en trminos de uso de CPU) pero mayor podra ser la imprecisin. Este tiempo mximo de retardo que un cancelador de eco puede tolerar se denomina comnmente cola o tail.

El estndar G.168
Hace algunos aos el ITU lanz una especificacin que define los parmetros de lo que debe ser un cancelador de eco. Se podra decir que el documento es una recomendacin. Por lo tanto, si un cancelador de eco est en concordancia con dicha recomendacin se dice que es G.168 compatible (compliant with G.168). Sin embargo, G.168 es una especificacin tcnica compleja y es fcil determinar si un cancelador de eco es compatible o no. Inclusive existen empresas que se dedican al tedioso trabajo de revisar si un cancelador de eco es compatible o no con G.168. No vamos a explicar aqu los detalles de G.168 pues sale del alcance del presente libro. Para mayor informacin sobre detalles tcnicos de G.168 recomendamos visitar el sitio del ITU (http://www.itu.int).

OSLEC
Elastix incorpora un interesante cancelador de eco por software de libre distribucin conocido como OSLEC (http://www.rowetel.com/ucasterisk/oslec.html). Este cancelador de eco es parte de DAHDI y se puede configurar independientemente para cada canal de manera sencilla desde la interfaz Web de Elastix. Esta es una imagen de la interfaz de deteccin de hardware desde donde podemos activar el soporte para cancelacin de eco.

Configuracin de cancelador de eco en interfaz de Elastix


http://www.elastixbook.com/es/capitulos/capitulo_13/13.4_Canceladores_de_eco.htm[24/11/2011 10:23:03 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_13/13.4_Canceladores_de_eco.htm[24/11/2011 10:23:03 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

14
Protocolos VoIP al descubierto
Cualquier persona, en mar o en tierra, con un aparato sencillo y barato que cabe en un bolsillo, podra recibir noticias de cualquier parte del mundo o mensajes particulares destinados slo al portador, la Tierra se asemejara, pues, a un inconmensurable cerebro, capaz de emitir una respuesta desde cualquier punto. -- Nikola Tesla, 1905

14.1 Protocolo SIP


Session Initiation Protocol (SIP) es un protocolo de sealizacin (application-layer control) creado para administrar sesiones multimedia entre dos o ms partes. Contrario a lo que se pueda pensar, este protocolo no es quien transporta la voz propiamente dicha sino que se encarga de la comunicacin necesaria para establecer, modificar y finalizar una llamada. El protocolo SIP fue diseado con la premisa de la simplicidad en mente. Se trata de un protocolo de texto con mensajes de comunicacin sencillos. Inclusive SIP comparte algunos cdigos de estatus con HTTP como el familiar 404: Not found. SIP es un protocolo peer-to-peer. Es decir que prcticamente toda la lgica es almacenada en los puntos de terminacin de la llamada o endpoints.

Detalles del protocolo


Usa a su vez dos importantes protocolos: RTP transmite la voz y el video SDP negociar las capacidades de los endpoints
http://www.elastixbook.com/es/capitulos/capitulo_14/14.1_Protocolo_SIP.htm[24/11/2011 10:23:05 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

La ltima versin del estndar es la RFC3261. Permite entender fcilmente los mensajes transmitidos al enviarlos como texto, lo que facilita la depuracin (debugging).

Sealizacin SIP
El protocolo SIP utiliza mtodos y respuestas para cumplir con su funcin. Un mtodo es el mecanismo empleado para convenir una accin. La respuesta, como su nombre lo indica, contiene la respuesta a un mtodo.

Mtodos Mtodo INVITE ACK Descripcin Invita a un usuario a una llamada Abreviacin de acknowledgement (acuse de recibo) enviada para indicar que se ha recibido un mensaje Termina una conexin entre usuarios o rechaza una llamada Termina el requerimiento o bsqueda de un usuario Solicita informacin acerca de las capacidades del servidor SIP Registra la ubicacin de un usuario Intercambia informacin de sealizacin en el transcurso de la sesin

BYE CANCEL OPTIONS REGISTER INFO

Respuestas 1xx Informational (e.g. 100 Trying, 180 Ringing) 2xx Successful (e.g. 200 OK, 202 Accepted) 3xx Redirection (e.g. 302 Moved Temporarily) 4xx Request Failure (e.g. 401 Unauthorized, 404 Not Found, 482 Loop Detected) 5xx Server Failure (e.g. 501 Not Implemented) 6xx Global Failure (e.g. 603 Decline)

Registracin
El siguiente diagrama ilustra la registracin de un enpoint SIP contra un servidor SIP. Debe tenerse en cuenta que esta es una vista simplificada ya que en el proceso de registracin tambin se debe negociar el cdec que ser usado adems de otros parmetros.

http://www.elastixbook.com/es/capitulos/capitulo_14/14.1_Protocolo_SIP.htm[24/11/2011 10:23:05 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Registracin SIP

Esta registracin debe llevarse a cabo peridicamente de tal forma que durante la sesin no se tenga que enviar informacin de autenticacin.

Sesin
Luego de registrarse, el endpoint SIP puede iniciar una sesin (en nuestro caso una llamada telefnica). En la siguiente imagen ilustraremos el caso especfico de una conversacin entre dos endpoints SIP. Se han omitido intencionalmente mensajes como ACKs para mejorar la legibilidad.

Sesin SIP entre dos telfonos IP

Hay que notar que SIP se encarga de la sealizacin solamente. La voz propiamente dicha se transmite por el protocolo RTP, el cual explicaremos con mayor detalle al final de este captulo. Como podemos observar toda la comunicacin recala en el servidor Elastix. Es decir, Elastix hace las veces de mediador (SIP Proxy).

SIP y Asterisk
http://www.elastixbook.com/es/capitulos/capitulo_14/14.1_Protocolo_SIP.htm[24/11/2011 10:23:05 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Algunos detalles que debemos tener en cuenta cuando se usa el protocolo SIP con Asterisk son los siguientes: Versiones anteriores de Asterisk (hasta 1.4 inclusive) limitaban el funcionamiento del protocolo SIP a UDP. En versiones actuales Asterisk ya podemos hacer uso de SIP inclusive sobre TCP. Por omisin se usa el puerto 5060 para el servicio SIP aunque este parmetro se puede modificar en el archivo sip.conf SIP adolece de problemas de Network Address Translation (NAT) aunque se puede combatir este problema con parmetros como externip, localnet y nat en el archivo sip_nat.conf En Asterisk es posible hacer diagnstico del protocolo SIP. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_14/14.1_Protocolo_SIP.htm[24/11/2011 10:23:05 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

14.2 Protocolo IAX


El Inter-Asterisk eXchange (IAX) es un protocolo de sealizacin creado por Mark Spencer, el mismo creador de Asterisk. Su objetivo es el de solucionar los problemas existentes con otros protocolos. Este protocolo todava no es un estndar en la industria pero pretende serlo a travs de un proceso de estandarizacin en la IETF. En esencia IAX presenta dos ventajas muy interesantes sobre otras alternativas de protocolo como SIP. Consume menos ancho de banda Soluciona mejor los problemas de NAT y firewalls Revisemos cada una de estas ventajas. Consume menos ancho de banda Mientras SIP es un protocolo basado en texto, IAX es un protocolo binario. Esto es una ventaja desde el punto de vista del consumo de ancho de banda puesto que en binario se desperdiciarn menos bytes. Adems, el protocolo IAX permite la troncalizacin de varios canales de audio en el mismo flujo de datos. Es decir que en un mismo datagrama se pueden enviar varias sesiones al mismo tiempo. Esto significa una reutilizacin de datagramas y por consiguiente un ahorro adicional de ancho de banda. Soluciona mejor los problemas de NAT y firewalls SIP transmite sealizacin por el puerto 5060 y usa pares de puertos entre el 10000 y 20000 para la voz en s. Esta separacin de puertos tiende a causar problemas al pasar la comunicacin de voz por un firewall. En cambio IAX transmite en UDP y usa solamente el puerto 4569 para transmitir tanto la sealizacin como la voz. Esto permite conducir comunicaciones a travs de firewalls con mucha ms facilidad. El administrador debe asegurarse de abrir un solo puerto en el firewall. Adems, el endpoint IAX no necesita saber nada sobre la red en la cual est operando. Esta combinacin de atributos hace que se elimine el caso donde la llamada se completa pero el audio no pasa. Si reflexionamos acerca de estas ventajas nos daremos cuenta rpidamente que resultan perfectas para troncalizacin entre dos servidores Elastix. En otras palabras, cuando se trata de interconectar dos o ms servidores Elastix entre s el uso de IAX es altamente recomendable.. La versin actual del protocolo IAX es la 2. La anterior ha quedado obsoleta por lo que es comn ver el nombre IAX2 como sinnimo de IAX.

Fases de una llamada IAX


Una llamada IAX tiene tres fases que se explican a continuacin.

Establecimiento de la llamada

http://www.elastixbook.com/es/capitulos/capitulo_14/14.2_Protocolo_IAX.htm[24/11/2011 10:23:06 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Para iniciar una llamada el equipo que la inicia (equipo A) le enva un mensaje NEW al equipo que la recibe (equipo B). ste ltimo responde con un mensaje ACCEPT. Luego de esto el equipo B timbrar su campana esperando que el usuario levante el auricular. Si esto sucede, el equipo B enviar un mensaje ANSWER al equipo A para notificar que el usuario contest. Nota: Se han omitido intencionalmente algunos mensajes ACK en esta explicacin para aadir claridad a la explicacin.

Establecimiento de una llamada IAX

Llamada en curso Una vez contestada la llamada por el equipo B se inicia el intercambio de audio mediante unos paquetes llamados frames. Estos frames se envan dentro del mismo flujo de comunicacin que la sealizacin inicial.

Colgado Cualquiera de las partes involucradas en la conversacin puede enviar un mensaje HANGUP para terminar la llamada en cualquier momento.

Colgado de una llamada IAX

http://www.elastixbook.com/es/capitulos/capitulo_14/14.2_Protocolo_IAX.htm[24/11/2011 10:23:06 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Frames
Para intercambiar el audio entre los participantes de una llamada se pueden utilizar dos tipos de frames especficos para IAX llamados full y mini. Tambin se les suelen llamar F y M por sus iniciales. Una conversacin est compuesta en su mayora por frames de tipo mini, cuya virtud es (como su nombre lo sugiere) ser pequeos y ligeros. Esto quiere decir que tienen una cabecera pequea de 4 bytes, lo cual ayuda a ahorrar ancho de banda. De cuando en cuando se intercambian frames tipo full, los cuales conllevan adicionalmente informacin de sincronizacin para mantener sincronizados a ambos puntos.
1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |F| Nmero de Origen |R| Nmero de Destino | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | time-stamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | OSeqno | ISeqno | Tipo Frame |C| Subclass | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | : Data : | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Frame de tipo full

1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |F| Nmero de Origen | time-stamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | : Data : | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Frame de tipo mini

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_14/14.2_Protocolo_IAX.htm[24/11/2011 10:23:06 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

14.3 Protocolo RTP


RTP es el protocolo que se encarga de transportar la voz propiamente dicha. Muchas personas se confunden y piensan que ese es el trabajo de SIP pero no es as. Como ya lo hemos visto anteriormente en este captulo, una vez que SIP establece una llamada es RTP quien toma la posta para transportar la voz a su destino. RTP trabaja sobre UDP y por lo tanto no hay mucho control de transmisin. Es decir que el equipo emisor enva la voz hacia el otro extremo con solo la esperanza de que llegue. Por tanto no espera recibir confirmacin del mensaje recibido ya que la voz necesita ser transmitida en tiempo real y cualquier demora puede comprometer la calidad de voz. Si un paquete de voz se pierde en el camino simplemente se rellenar ese espacio con un silencio. Lo que tcnicamente se llama ruido confortable (comfort noise). Es por esta necesidad de transmitir la informacin en tiempo real que resulta obvio que RTP sea un acrnimo de Real Time Protocol. RTP cuenta con la ayuda de otro protocolo llamado RTCP. Este protocolo no es del todo indispensable pero proporciona valiosa ayuda al momento de transportar la voz de manera ptima ya que proporciona estadsticas e informacin de control. Esta informacin a su vez le permite a los equipos de voz involucrados en la conversacin tomar decisiones para mejorar la transmisin en caso de ser posible. Para este efecto los paquetes RTCP se transmiten peridicamente.

Estructura de un paquete RTP


Un paquete RTP se compone de un encabezado y la data o payload. El siguiente diagrama ilustra la estructura del encabezado de los paquetes RTP. Byte 1 P X Byte 2 CC M Byte 3 Byte 4 Nmero de Secuencia

V=2

PT Timestamp Fuente de Sincronizacin (SSRC) Fuente Contribuyente (CSRC) Extensin (Opcional dependiendo del bit X) Data

Estos campos se definen de la siguiente forma. V es el nmero de versin. Este campo es de 2 bits de longitud y su valor siempre es el nmero 2. P es un bit que indica si hay relleno o padding al final de la data. El relleno no es otra cosa que bytes adicionales al final del payload utilizados para ciertos algoritmos de encriptacin que esperan un payload de tamao fijo. X o extensin es un bit que indica si hay extensin del encabezado CC es un identificador de 4 bits que indica el conteo CSRC M o marcador de un bit

http://www.elastixbook.com/es/capitulos/capitulo_14/14.3_Protocolo_RTP.htm[24/11/2011 10:23:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

PT o tipo de carga til (payload type) es un identificador de 7 bits que nos indica el tipo de carga til que contiene este paquete RTP. Ejemplos de tipos son G729, GSM, PCMU (G711 u-law), entre otros. Nmero de Secuencia (sequence number) es un nmero entero que identifica cada paquete del presente flujo de datos. Este es un identificador secuencial que se incrementa en uno con cada paquete transmitido. Ocupa 16 bits. Timestamp representa el instante de tiempo en el que se comenz a muestrear la data que est siendo transmitida en el payload. Ocupa 32 bits. SSRC identifica la fuente de sincronizacin ya que el mismo equipo puede estar comunicndose con diferentes fuentes de paquetes RTP. Es un nmero aleatorio de 32 bits por lo que hay la posibilidad (aunque sea baja) de que este nmero se repita entre dos fuentes. Existen mecanismos para resolver este problema. CSRC es un nmero de 32 bits que identifica las fuentes contribuyentes para el payload. Extensin es un campo de longitud variable que permite extender la funcionalidad de la cabecera. Esta informacin solo se adjunta a la cabecera RTP si el bit X lo indica. Luego de la cabecera se deben transmitir los datos que no son otra cosa que el audio propiamente dicho convertido a digital y codificado. Cabe recordar que RTP utiliza dos puertos para la comunicacin, uno de ida y otro para el retorno. Este par de puertos es negociado mientras se establece la llamada entre los puntos pero en el caso de Asterisk est dentro del rango 10000 a 20000. Sin embargo, esto es configurable en el archivo /etc/asterisk/rtp.conf. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_14/14.3_Protocolo_RTP.htm[24/11/2011 10:23:07 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

14.4 Protocolo SRTP


SRTP o RTP seguro (Secure Real-time Protocol) es, como su nombre lo indica, un alternativa a RTP cuando necesitamos cifrar la informacin transmitida. En nuestro caso se vuelve muy til cuando se necesita garantizar que una llamada no podr ser escuchada por un interceptor de la misma, manteniendo la informacin confidencial. Desde el punto de vista de un protocolo de tiempo real se hace un poco difcil concebir un cifrado de datos que no aada retardo a la comunicacin. Si cada paquete debe ser encriptado en el origen y des-encriptado en destino, sin duda esto debe aadir un retardo adicional, dependiendo de la potencia de nuestro CPU que es quien realizar la matemtica necesaria para el cifrado de datos. Adems tambin podemos pensar que el uso de algoritmos de cifrado aadir ancho de banda adicional, lo cual siempre es indeseable. Todos los temores anteriores son vlidos y tambin estuvieron en la mente de quienes disearon el protocolo. Es por eso que si leemos el documento oficial donde se define este protocolo (RFC 3711) veremos que aparte de los objetivos obvios de SRTP (confidencialidad de informacin e integridad de datos) se definen estos otros: Bajo impacto en el ancho de banda Bajo costo computacional En general podemos decir que hicieron un buen trabajo y el protocolo no aade un costo computacional o ancho de banda significativo por lo que en la gran mayora de escenarios podremos implementar SRTP sin ningn temor. SRTP est disponible de manera nativa en Asterisk recin desde la versin 1.8 y habilitarlo es bastante sencillo. Por ejemplo, si la comunicacin es SIP basta aadir a la configuracin de cada endpoint el parmetro encryption=yes Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_14/14.4_Protocolo_SRTP.htm[24/11/2011 10:23:08 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

15
Diagnstico bsico de problemas
Si hubiera preguntado a mis clientes qu necesitaban, habran dicho un caballo mejor -- Henry Ford, fundador de Ford Motor Company

15.1 Interpretando el log


Es muy importante entender cmo leer los archivos de log de Asterisk puesto que de all podemos extraer informacin muy valiosa en nuestro proceso de diagnstico. El nivel de detalle as como el tipo de informacin que se escribe en los archivos de log son controlados desde el archivo /etc/asterisk/logger.conf. Este es un archivo de texto plano donde se definen tanto el nombre de los archivos de log como el nivel de detalle de la informacin que se escribir en ellos. Esto se hace en una sola lnea con la siguiente sintaxis.
Nombre de archivo => Niveles de debugging

Donde los niveles de debugging son separados por coma y pueden ser los siguientes: debug notice warning error verbose

http://www.elastixbook.com/es/capitulos/capitulo_15/15.1_Interpretando_el_log.htm[24/11/2011 10:23:10 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Nota: Hay un tipo especial de nombre de archivo que se encuentra reservado y que se llama "console". Este nombre representa la consola de Asterisk, o sea lo que se muestra en el Asterisk CLI. El siguiente es un fragmento del contenido del archivo logger.conf que se distribuye con Elastix.
; Directory for log files is configures in asterisk.conf ; option astlogdir ; [logfiles] ; ; Format is "filename" and then "levels" of debugging to be included: ; debug ; notice ; warning ; error ; verbose ; ; Special filename "console" represents the system console ; ;debug => debug ; The DTMF log is very handy if you have issues with IVRs ;dtmf => dtmf ;console => notice,warning,error ;console => notice,warning,error,debug ;messages => notice,warning,error full => notice,warning,error,debug,verbose

En el ejemplo anterior vemos algunas lneas comentadas y bsicamente un solo archivo de log activado llamado full. Este, al igual que los dems archivos definidos de esta manera reside en la ruta /var/log/asterisk/.

El archivo /var/log/asterisk/full
Acorde al archivo logger.conf, Elastix habilita por defecto el archivo de log llamado full donde Asterisk escribe informacin de su funcionamiento. Cada lnea de este archivo tiene el siguiente formato. [HORA FECHA] NIVEL[PID] NOMBRE_DE_ARCHIVO: MENSAJE A continuacin veremos un ejemplo del archivo de log de Asterisk.

http://www.elastixbook.com/es/capitulos/capitulo_15/15.1_Interpretando_el_log.htm[24/11/2011 10:23:10 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Archivo de log /var/log/asterisk/full

Monitoreo del log Es muy importante dar seguimiento en tiempo real a la actividad del servidor Elastix. Muchas veces nos veremos haciendo esto mientras realizamos o recibimos una llamada para tratar de averiguar qu ha fallado. El siguiente es un mtodo til para revisar interactivamente el archivo de log full a medida que se va escribiendo con mensajes de Asterisk.
tail -f /var/log/asterisk/full

Si queremos ver interactivamente solo los errores podemos aadir el siguiente filtro.
tail -f /var/log/asterisk/full | grep ERROR

Si queremos adems ver las advertencias podemos modificar ligeramente el filtro de la siguiente manera.
tail -f /var/log/asterisk/full | grep -E "(ERROR|WARNING)"

Nota: Si queremos examinar todo el log en lugar de hacerlo interactivamente debemos reemplazar el comando tail -f por el comando cat

Qu informacin nos puede indicar el campo MENSAJE?


El MENSAJE se refiere a la informacin que viene a la derecha de cada lnea del log luego del nombre del archivo. Si se trata de una lnea de ERROR o WARNING encontraremos aqu una breve descripcin del error ocurrido o de la advertencia. Sin embargo existen otras lneas con mensajes menos obvios y que simplemente describen el procesamiento de una llamada a travs del plan de marcado. Estas lneas normalmente se encuentran macadas con nivel VERBOSE pues son simplemente informativas. Estas lneas de nivel VERBOSE (adems de otras lneas informativas) nos proveen de informacin muy til para diagnosticar problemas.
http://www.elastixbook.com/es/capitulos/capitulo_15/15.1_Interpretando_el_log.htm[24/11/2011 10:23:10 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Especialmente tiles son las que empiezan con la palabra Excecuting ya que a continuacin mencionan el contexto y la prioridad en el que Asterisk est procesando el plan de marcado. La sintaxis de estas lneas es la siguiente. [TIME DATE] VERBOSE[PID] [extension@contexto:prioridad] MAS_TEXTO logger.c: -Excecuting

MAS_TEXTO puede contener informacin acerca de la aplicacin que fue ejecutada junto con los parmetros que le fueron pasados. Veamos un ejemplo de esto.
[Oct 28 17:52:34] VERBOSE[22034] logger.c: -- Executing [s@macro-dial:7] Dial("Local/502@from-internal-e27c,2", "SIP/502|21|trTWuwM(auto-blkvm)") in new stack

En este ejemplo vemos que cuando se escribi esta lnea en el log nos encontrbamos dentro del contexto macrodial (una macro, ya que empieza con la palabra macro). Adems, la extensin era la s y la prioridad era 7. Tambin podemos observar que se est tratando de marcar mediante la aplicacin Dial() usando ciertos parmetros. En fin, podemos observar que hay mucha informacin til que podemos obtener de cada lnea escrita en el log.

Nmero de proceso (PID)


Asterisk es un software multiproceso. Esto quiere decir que puede crear varias instancias de s mismo que trabajen de manera coordinada entre s para ejecutar diferentes tareas al mismo tiempo. Cuando Asterisk escribe una lnea en el log tambin anota el nmero de proceso (PID) que la escribi. Esto nos provee valiosa informacin puesto que podemos tener una visin ms exacta del hilo de la llamada. Para hacer esto podemos filtrar el PID si es que lo conocemos.
cat /var/log/asterisk/full | grep 38484

Con el comando anterior estamos filtrando la salida para mostrar el proceso 38484. Por supuesto que tambin podremos haber capturado alguna cadena de caracteres que coincida fortuitamente con el patrn 38484. Sin embargo estas lneas son irrelevantes y se las puede eliminar manualmente. Gracias a este procedimiento podremos filtrar el hilo de una llamada y aislarlo para encontrar errores. Esto es particularmente til en un ambiente con alto nmero de llamadas simultneas debido a la gran cantidad de informacin que Asterisk escribe en el log. Nota: Algo importante a tener en cuenta es que una llamada puede tener ms de un proceso (y por consiguiente PID) involucrado. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_15/15.1_Interpretando_el_log.htm[24/11/2011 10:23:10 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

15.2 Diagnstico a travs del CLI


Desde el Asterisk CLI podemos ver en tiempo real el funcionamiento de Asterisk. Es algo similar a hacer un "tail -f /var/log/asterisk/full" pero con la ventaja de poder ver el texto de salida resaltado (para mejor legibilidad). Adems el CLI nos permite interactuar simultneamente con Asterisk al poder ejecutar algunos comandos desde la consola. Elastix nos brinda una interfaz directa al Asterisk CLI ubicada en PBX->Tools y basada en Web. Usar el CLI desde la interfaz Web puede resultar muy cmodo al no tener que iniciar una sesin SSH, la cual muchas veces se encuentra restringida para conexiones remotas. Lo que hay que tener en cuenta es que desde la interfaz Web no es posible tener un CLI interactivo. Esta es la principal diferencia de ejecutar el CLI desde la lnea de comandos a ejecutarlo desde Web. Para acceder al CLI desde la lnea de comandos es necesario ejecutar lo siguiente.
asterisk -r

A continuacin un ejemplo de ejecucin del comando help desde la interfaz Web de Elastix.

Ejecutando el CLI a travs de la interfaz Web de Elastix

Anterior

Ir a ndice

Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_15/15.2_Diagnostico_a_traves_del_CLI.htm[24/11/2011 10:23:11 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

15.3 Sniffing
El trmino sniffing describe la forma de capturar paquetes de red en su formato original para su posterior anlisis. Existen herramientas especializadas para este fin y algunas cuestan una verdadera fortuna. Por suerte hay soluciones de cdigo abierto que hacen un gran trabajo como es el caso de Wireshark. Wireshark era anteriormente conocido como Ethereal. Este poderoso sniffer contiene herramientas de anlisis avanzadas que nos permitirn analizar paquetes RTP y SIP entre otras cosas. Para capturar los detalles de una llamada y analizarla debemos primero definir la tarjeta de red del servidor en la cual queremos escuchar si existe ms de una. La captura de paquetes en s es muy sencilla y solo debemos ejecutar Wireshark de acuerdo a sus instrucciones. Finalizada la captura lo ms probable es que junto con los paquetes de voz hayamos capturado otros paquetes que circulaban por la red. Muchos de estos paquetes como ICMP, DNS, y SMTP no son de nuestro inters pero con algo de prctica aprenderemos a filtrar estos paquetes irrelevantes. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_15/15.3_Sniffing.htm[24/11/2011 10:23:12 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

16
Control externo de Asterisk
Ms que exigirlo, el respeto es algo que uno se gana -- Annimo Muchas veces editar el plan de marcado no es suficiente y hace falta algn mecanismo ms flexible para lograr lo que la empresa necesita. En otras ocasiones quisiramos inclusive poder controlar Asterisk en tiempo real a travs de alguna aplicacin remota. Para expandir el comportamiento de Asterisk ms all del plan de marcado existen dos interfaces muy tiles llamadas AGI y AMI., Estas interfaces nos permiten interactuar con Asterisk a un nivel mucho ms poderoso que el logrado hasta ahora.

16.1 Asterisk AGI


Asterisk Gateway Interface (AGI) establece una manera de interactuar con Asterisk desde un programa de lnea de comandos. Este programa puede ser escrito en prcticamente cualquier lenguaje de programacin y es invocado por Asterisk desde el plan de marcado o dialplan. Al momento de la invocacin de un programa AGI se le pasan ciertos parmetros y este a su vez responde con comandos AGI que son entendidos por Asterisk. La utilidad de AGI es enorme y nos permite desarrollar funcionalidad extra para nuestra central telefnica. Un ejemplo muy comn de esto es el desarrollo de aplicaciones de consulta telefnica a bases de datos. Los programas o scripts AGI gozan de mucha popularidad. Elastix viene por defecto con algunos de estos scripts preinstalados en la carpeta /var/lib/asterisk/agi-bin/
http://www.elastixbook.com/es/capitulos/capitulo_16/16.1_Asterisk_AGI.htm[24/11/2011 10:23:13 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Ejecucin de scripts AGI


Los scripts AGI se comunican con Asterisk a travs de los descriptores de archivos STDIN, STDOUT y STDERR. Esto quiere decir que deberan poderse ejecutar desde la misma lnea de comandos. Algo muy importante de mencionar es que los scripts AGI deben tener permisos de ejecucin para el usuario asterisk y el grupo del mismo nombre para que puedan correr. Podemos asignar los permisos de la siguiente forma.
# chown asterisk.asterisk script_prueba.agi # chmod 755 script_prueba.agi

Luego de esto ya podemos ejecutar el script AGI desde el dialplan para que haga algo til. Esto se lo hace gracias a la funcin AGI(). A continuacin un ejemplo.
exten => 6789,1,Answer exten => 6789,2,AGI(script_prueba.agi)

Como vemos en el ejemplo anterior le hemos dicho a Asterisk que ejecute el script llamado script_prueba.agi. Este script se ejecutar cuando el usuario digite la extensin 6789. Por omisin Asterisk asume que el script se encuentra en la ruta /var/lib/asterisk/agi-bin/ aunque se puede especificar otra ruta en la funcin AGI().

Parmetros enviados al script AGI


Como habamos dicho antes, Asterisk le enva cierta informacin al script AGI al momento de su invocacin. A continuacin un ejemplo de la informacin enviada al script dialparties.agi que es un componente de FreePBX cuando lo ejecutamos.
agi_request: dialparties.agi agi_channel: SIP/4444-08d6ab60 agi_language: en agi_type: SIP agi_uniqueid: 1222117320.271 agi_callerid: 4444 agi_calleridname: Edgar Landivar agi_callingpres: 0 agi_callingani2: 0 agi_callington: 0 agi_callingtns: 0 agi_dnid: 216 6 agi_rdnis: unknown agi_context: macro-dial agi_extension: s agi_priority: 3 agi_enhanced: 0.0 agi_accountcode:

http://www.elastixbook.com/es/capitulos/capitulo_16/16.1_Asterisk_AGI.htm[24/11/2011 10:23:13 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Adicionalmente a la informacin que Asterisk le enva al script AGI por omisin, nosotros podramos enviarle informacin adicional invocando la funcin AGI() con ciertos parmetros de la siguiente manera.
exten => 6789,1,Answer exten => 6789,2,AGI(script_prueba.agi,param1,param2,param3)

En el ejemplo anterior se le envan los parmetros adicionales param1, param2 y param3 al script. El script puede recibir tantos parmetros como sean necesarios.

Comandos AGI
Para la referencia del lector, a continuacin mostramos un listado de los comandos AGI disponibles en la ltima versin de Elastix. Este listado ha sido generado con el comando agi show commands desde el CLI. Comando answer asyncagi break channel status database del database deltree database get database put exec get data get full variable get option get variable hangup noop receive char receive text record file say alpha say digits say number say phonetic say date say time say datetime send image send text Descripcin Contesta el canal Interrumpe el Async AGI Retorna el estado del canal conectado Elimina clave/valor de la base de datos Elimina clave de rbol/valor de la base de datos Obtiene un valor de la base de datos Aade/actualiza un valor de la base de datos Ejecuta una aplicacin Escucha por tonos DTMF en un canal Evala una expresin de canal Stream de archivo, escucha por DTMF, con timeout Obtiene una variable de canal Cuelga el canal actual No hace nada Recibe un caracter de los canales que lo soporten Recibe texto de los canales que lo soporten Graba a un archivo Vocaliza una cadena de caracteres Vocaliza una cadena de dgitos Vocaliza nmeros Vocaliza una cadena de caracteres fonticamente Vocaliza una fecha Vocaliza una hora Vocaliza una hora en un formato especifico Enva imgenes a canales que lo soporten Enva texto a canales que lo soporten

http://www.elastixbook.com/es/capitulos/capitulo_16/16.1_Asterisk_AGI.htm[24/11/2011 10:23:13 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

set set set set set

autohangup callerid context extension music

set priority set variable stream file control stream file tdd mode verbose wait for digit speech create speech set speech destroy speech speech speech speech speech gosub load grammar unload grammar activate grammar deactivate grammar recognize

Auto-cuelga el canal despus de un tiempo Especifica el callerid para el canal actual Especifica el contexto para el canal Cambia la extensin del canal Habilita/Deshabilita el generador de msica de espera Especifica la prioridad en el plan de marcado para el canal Especifica una variable de canal Enva un archivo de audio en el canal Enva un archivo de audio en el canal y permite al receptor controlar el stream Cambia el modo de TDD (para sordos) Escribe en mensaje en el archivo de log verbose de Asterisk Espera el ingreso de un digito Crea un objeto de reconocimiento de voz (speech) Especifica una opcin del motor de reconocimiento de voz Destruye un objeto de reconocimiento de voz (speech) Carga un vocabulario Descarga un vocabulario Activa un vocabulario Desactiva un vocabulario Reconoce la voz Ejecuta una subrutina del plan de marcado

Libreras AGI
A pesar de que un script AGI puede ser escrito prcticamente en cualquier lenguaje, existen algunos lenguajes que ya cuentan con libreras para facilitar las labores de desarrollo. Algunos de estos lenguajes son los siguientes. Perl PHP Python Ruby C .NET Para mayor informacin sobre las libreras o frameworks disponibles para estos lenguajes recomendamos revisar el siguiente vnculo: http://www.voip-info.org/wiki-Asterisk+AGI En nuestro caso utilizaremos una librera para PHP llamada phpAGI con la que codificaremos un sencillo script

http://www.elastixbook.com/es/capitulos/capitulo_16/16.1_Asterisk_AGI.htm[24/11/2011 10:23:13 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

AGI de ejemplo en la siguiente seccin.

Ejemplo sencillo de script AGI


Para ilustrar mejor el funcionamiento de un script AGI, codificaremos algo muy bsico. Este script vocaliza un nmero cuando marcamos una extensin determinada. A continuacin el cdigo en PHP.
#!/usr/bin/php -q <?php echo "SAY NUMBER 1234 \n"; sleep(4); ?>

Este cdigo lo podemos guardar como simple.agi en la ruta estndar /var/lib/asterisk/agi-bin/ Una vez guardado debemos estar seguros que el script pueda ser ejecutado por el usuario asterisk del grupo asterisk. Como lo hemos explicado anteriormente, esto se consigue de la siguiente manera.
chown asterisk.asterisk /var/lib/asterisk/agi-bin/simple.agi chmod 755 /var/lib/asterisk/agi-bin/simple.agi

Finalmente debemos modificar el plan de marcado para invocar nuestro script AGI cuando se marque una extensin determinada. Usaremos la extensin 6789 para este ejemplo.
exten => 6789,1,Answer exten => 6789,2,AGI(simple.agi) exten => 6789,3,Hangup

Estas instrucciones podran ubicarse al final del archivo /etc/asterisk/extensions_custom.conf, ya que este archivo no es sobrescrito por FreePBX. Listo! Marque la extensin 6789 y escuchar el cdigo decir one two three four. Anterior Ir a ndice Siguiente

http://www.elastixbook.com/es/capitulos/capitulo_16/16.1_Asterisk_AGI.htm[24/11/2011 10:23:13 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

Siguiente

16.2 Asterisk AMI


El Asterisk Manager Interface (AMI) establece una manera de comunicarse con Asterisk a travs del protocolo IP. Digamos que es un concepto similar al AGI pero orientado para su ejecucin desde equipos remotos. Es esto ltimo lo que lo convierte en una herramienta poderosa. Con la funcionalidad que provee AMI se pueden desarrollar poderosas aplicaciones cliente que pueden ejecutarse en otros computadores liberando de carga al servidor Asterisk. Un ejemplo de lo que se puede hacer con AMI es el mdulo para call centers que forma parte del proyecto Elastix. Este mdulo de Elastix est codificado en gran parte usando AMI. Debido a que AMI permite que equipos remotos controlen el funcionamiento de Asterisk, se requiere que estos equipos se autentiquen. Los usuarios, claves y permisos se definen en un archivo llamado /etc/asterisk/manager.conf A continuacin reproducimos parte del archivo manager.conf que se distribuye con Elastix por defecto.
; ; AMI - Asterisk Manager interface ; [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 [admin] secret = elastix456 deny=0.0.0.0/0.0.0.0 permit=127.0.0.1/255.255.255.0 read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate #include manager_additional.conf #include manager_custom.conf

En este archivo se define un usuario llamado admin con clave elastix456 que puede conectarse desde la direccin IP 127.0.0.1 con mscara 255.255.255.0. Luego de esto se definen ciertos permisos para este usuario.

Probando desde telnet


Para probar la interaccin con AMI no es necesario de un programa sofisticado. Una manera sencilla de hacerlo es a travs del programa telnet disponible en cualquier computador. Veamos un ejemplo ejecutando este comando desde el propio servidor Elastix y suponiendo el archivo de configuracin anterior. Primero nos conectamos al propio servidor Elastix a travs de una sesin telnet. Para esto ejecutamos lo siguiente desde la lnea de comandos.
[root@elastix ~]# telnet 127.0.0.1 5038 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. Asterisk Call Manager/1.1

http://www.elastixbook.com/es/capitulos/capitulo_16/16.2_Asterisk_AMI.htm[24/11/2011 10:23:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Como podemos ver el servidor nos ha contestado con un mensaje indicando que el AMI est escuchando y nos dice tambin que se trata de la versin 1.1 del protocolo. A continuacin nos autenticamos con el usuario y clave especificado en el archivo manager.conf. Bsicamente debemos escribir los siguiente en el terminal.
Action: Login ActionID: 1 Username: admin Secret: elastix456

Es importante conocer que luego de escribir lo anterior y para enviar el comando debemos ingresar dos retornos de carro. Es decir que debemos presionar Enter dos veces para enviar la peticin de autenticacin anterior. Luego de esto AMI nos contestar con un mensaje de xito o error. El siguiente es el mensaje que obtenemos como exitoso.
Response: Success ActionID: 1 Message: Authentication accepted

De ahora en adelante comenzarn a aparecer mensajes de registro que el AMI enva a nuestra sesin cada vez que ocurre un evento. Por ejemplo, recibimos estos mensajes cuando una llamada se termina o si una extensin est timbrando. Una vez autenticada la sesin podemos ejecutar comandos, tambin llamados acciones, directamente va AMI.

Tipo de paquetes AMI


En la comunicacin por AMI se pueden identificar tres tipos de paquetes de informacin. Accin: Un comando enviado por el cliente al servicio AMI para que sea procesado. Respuesta: La respuesta de Asterisk a la accin requerida por el cliente. Evento: La informacin de un evento asincrnico ocurrido en Asterisk. Por ejemplo, la llegada de una llamada telefnica. Para relacionar las respuestas con las acciones se puede incluir un ActionID en cada accin. Asterisk devolver este parmetro en la respuesta.

Comandos o acciones AMI


El siguiente listado de comandos AMI se obtiene al ejecutar el comando manager show commands desde el CLI de Elastix. Comando Privilegios Descripcin Especifica el timeout absoluto Especifica que un usuario ha dejado de estar autenticado Enlista los agentes y sus estados Aade un comando AGI

AbsoluteTimeout

system,call,all

AgentLogoff

agent,all

Agents

agent,all

http://www.elastixbook.com/es/capitulos/capitulo_16/16.2_Asterisk_AMI.htm[24/11/2011 10:23:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

AGI Atxfer

agi,all call,all

para ejecucin con Async AGI Transferencia atendida Conecta dos canales presentes en el PBX Genera reto (challenge) para autenticacin de MD5 Cambia archivo monitoreo un canal el de de

Bridge

call,all

Challenge

<none>

ChangeMonitor

call,all

Command

command,all

CoreSettings

system,reporting,all

Ejecuta un comando del CLI Muestra configuracin del core del PBX (versin, etc) Enlista los canales activos actualmente Muestra las variables de estado del core del PBX Crea un archivo vaco en el directorio de configuracin Marcar sobre un canal DAHDI mientras est en offhook Cambia el estado de no molestar (DND) del canal DAHDI a OFF Cambia el estado de no molestar (DND) del canal DAHDI a ON Termina el canal DAHDI Reinicia completamente los canales DAHDI

CoreShowChannels

system,reporting,all

CoreStatus

system,reporting,all

CreateConfig

config,all

DAHDIDialOffhook

<none>

DAHDIDNDoff

<none>

DAHDIDNDon DAHDIHangup

<none> <none>

http://www.elastixbook.com/es/capitulos/capitulo_16/16.2_Asterisk_AMI.htm[24/11/2011 10:23:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

DAHDIRestart

<none>

DAHDIShowChannels DAHDITransfer

<none> <none>

(termina todas las llamadas) Muestra el estado de los canales DAHDI Transfiere un canal DAHDI Elimina un registro de la base de datos Elimina un rbol de la base de datos Obtiene un registro de la base de datos Ingresa un registro en la base de datos Controla flujo de evento el un

DBDel

system,all

DBDelTree

system,all

DBGet

system,reporting,all

DBPut

system,all

Events

<none>

ExtensionState GetConfig

call,reporting,all system,config,all

Verifica el estado de una extensin Obtiene la configuracin Obtiene la configuracin en formato JSON Obtiene variable canal Termina canal una de el

GetConfigJSON

system,config,all

Getvar Hangup

call,reporting,all system,call,all

IAXnetstats IAXpeerlist IAXpeers

system,reporting,all system,reporting,all system,reporting,all

Muestra las estadsticas de red de IAX Enlista los peers de IAX Enlista los peers de IAX Muestra la registraciones de IAX Enlista las categoras del archivo de configuracin Enlista los comandos de manager (AMI) disponibles Inicia la sesin del Manager Termina la

IAXregistry

system,reporting,all

ListCategories

config,all

ListCommands Login

<none> <none>

http://www.elastixbook.com/es/capitulos/capitulo_16/16.2_Asterisk_AMI.htm[24/11/2011 10:23:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Logoff

<none>

MailboxCount MailboxStatus

call,reporting,all call,reporting,all

sesin del Manager Revisa el nmero de mensajes en el buzn Revisa el buzn Enlista los participantes en una conferencia Calla usuario Meetme un de

MeetmeList

reporting,all

MeetmeMute

call,all

MeetmeUnmute

call,all

Permite hablar a un usuario de Meetme Verifica si un mdulo est cargado Carga mdulo un

ModuleCheck ModuleLoad Monitor Originate Park

system,all system,all call,all originate,all call,all

Monitorea un canal Origina llamada Parquea canal una un

ParkedCalls

<none>

Enlista las llamadas parqueadas Pausa monitoreo un canal el de

PauseMonitor

call,all

Ping

<none>

PlayDTMF

call,all

Comando para mantener activa la conexin Reproduce seal DTMF en un canal especfico Aade una interface a la cola Aade un record personalizado en el queue_log Establece un miembro de una cola como temporalmente no disponible Establece la penalidad para un miembro de una cola

QueueAdd

agent,all

QueueLog

agent,all

QueuePause

agent,all

QueuePenalty

agent,all

http://www.elastixbook.com/es/capitulos/capitulo_16/16.2_Asterisk_AMI.htm[24/11/2011 10:23:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

QueueReload

<none>

Recarga una cola, colas, o cualquier subseccin de una cola o colas Elimina una interface de la cola Vaca las estadsticas de la cola Reglas de la cola Colas Estado de la cola Resumen de la cola Redirige (transfiere) una llamada Enva evento recarga un de

QueueRemove

agent,all

QueueReset QueueRule Queues QueueStatus QueueSummary

<none> <none> <none> <none> <none>

Redirect

call,all

Reload

system,config,all

SendText

call,all

Enva un mensaje de texto al canal Establece una variable de canal Enlista el plan de marcado Enva una notificacin de SIP Enlista los peers de SIP (formato texto) Muestra los peers de SIP (formato texto) Muestra los peers de SIP (formato texto) Muestra las registraciones SIP (formato texto) el del el de

Setvar ShowDialPlan

call,all config,reporting,all

SIPnotify

system,all

SIPpeers

system,reporting,all

SIPqualifypeer

system,reporting,all

SIPshowpeer

system,reporting,all

SIPshowregistry

system,reporting,all

Status

Enlista estado system,call,reporting,all canal Termina monitoreo un canal

StopMonitor

call,all

UnpauseMonitor

call,all

Libra de pausa el monitoreo de un canal Actualiza la configuracin

http://www.elastixbook.com/es/capitulos/capitulo_16/16.2_Asterisk_AMI.htm[24/11/2011 10:23:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

UpdateConfig

config,all

bsica Enva un evento arbitrario Enlista toda la informacin de usuarios de voicemail Espera a que un ocurra evento Ir a ndice Siguiente

UserEvent

user,all

VoicemailUsersList call,reporting,all

WaitEvent Anterior

<none>

http://www.elastixbook.com/es/capitulos/capitulo_16/16.2_Asterisk_AMI.htm[24/11/2011 10:23:14 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

Anterior

Ir a ndice

A
Archivos de configuracin de Asterisk distribuidos con Elastix
Archivo a2billing.conf additional_a2billing_iax.conf additional_a2billing_sip.conf adsi.conf Descripcin Archivo general de configuracin de A2billing. Configuracin de IAX para A2billing. Configuracin de SIP para A2billing. Archivo de configuracin para ADSI (Interfaz Anloga para servicios de Display por sus siglas en Ingls). Con ADSI se puede interactuar entre Asterisk y los displays de telfonos anlogos. Archivo de configuracin que permite tener soporte de Voz sobre Frame Relay Archivo de configuracin que permite manejar los agentes de las colas. Sirve para configurar la aplicacin AlarmReciever(). Configura el driver de sonido con los drivers de ALSA. Se utiliza para deteccin automtica de mquinas contestadoras. Bsicamente aqu se incluye plan de marcado. Los contextos aqu incluidos se les puede denominar aplicaciones y sus nombres empiezan con la cadena app-. Archivo principal de configuracin de adtranvofr.conf agents.conf alarmreceiver.conf alsa.conf amd.conf applications.conf

asterisk.conf

http://www.elastixbook.com/es/capitulos/Apendice.htm[24/11/2011 10:23:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

cbmysql.conf

cdr.conf cdr_custom.conf cdr_manager.conf

cdr_mysql.conf

cdr_odbc.conf

cdr_pgsql.conf

cdr_tds.conf

chan_dahdi.conf

chan_dahdi_additional.conf

cli.conf codecs.conf

dahdi-channels.conf

dnsmgr.conf

dundi.conf enum.conf

Asterisk. Aqu se configuran los directorios de trabajo de Asterisk as como algunas opciones generales. Archivo de configuracin del mdulo de Asterisk llamado CBMySQL (Conference Bridge MySQL) usado para manejar las conferencias en Elastix. El archivo principal de configuracin de la reportacin de CDRs. Este archivo define lo que se escribe en los CDRs de Asterisk. Este archivo controla si se deben enviar CDRs a travs del AMI (Asterisk Manager Interface). Archivo de configuracin del mdulo cdr_mysql que permite registrar los CDRs en la base de datos MySQL. Aqu se configura el mdulo que permite registrar CDRs a travs del driver ODBC de base de datos. Aqu se configura el mdulo que permite registrar CDRs en la base de datos PostgreSQL. Con este archivo podemos configurar el mdulo que permite registrar CDRs a travs de los drivers de freeTDS. Por ejemplo, con este mdulo podemos registrar CDRs en la base de datos MS-SQL. Este archivo contiene la configuracin de los canales tipo DAHDI. Este archivo tambin incluye los archivos chan_dahdi_additional.conf y dahdi-channels.conf. Este archivo lo sobreescribe FreePBX principalmente cuando se crean extensiones tipo DAHDI. Archivo de configuracin de la consola de Asterisk. En este archivo se configuran algunas opciones que controlan el funcionamiento de algunos codecs. Este archivo se encuentra incluido en el chan_dahdi.conf y se trata de un archivo generado automticamente por el Hardware Detector de Elastix a travs de la herramienta dahdi_genconf. Este archivo define si Asterisk debe realizar peticiones DNS regularmente y cada cunto tiempo. Archivo de configuracin de DUNDI (Distributed Universal Number Discovery). Archivo de configuracin de ENUM.

http://www.elastixbook.com/es/capitulos/Apendice.htm[24/11/2011 10:23:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

extconfig.conf

extensions.ael extensions.conf

extensions_a2billing.conf extensions_additional.conf

extensions_custom.conf

features.conf

features_applicationmap_additional.conf

features_applicationmap_custom.conf

features_featuremap_additional.conf

features_featuremap_custom.conf

features_general_additional.conf features_general_custom.conf

festival.conf followme.conf func_odbc.conf

Permite configurar lo que se llama configuracin externa. Es bsicamente una funcionalidad que permite mapear cualquier archivo de configuracin con una entidad externa como una base de datos. Plan de marcado en formato AEL (Asterisk Extension Language). No se usa en Elastix. Archivo de configuracin que incluye a extensions_additional.conf y a extensions_custom.conf. Plan de marcado adicional para la aplicacin A2Billing. Archivo de configuracin de Asterisk modificado por FreePBX donde no se debe editar a mano porque los cambios se perdern. Archivo donde se pueden crear contextos personalizados de Asterisk sin que FreePBX los sobre escriba. Aqu se pueden configurar algunas caractersticas de Asterisk como parmetros de transferencias y captura de llamadas. Archivo incluido desde el features.conf que contiene configuracin de la seccin applicationmap y que es sobrescrito por FreePBX. Archivo incluido desde el features.conf que contiene configuracin de la seccin applicationmap y que puede ser sobrescrito por el usuario ya que no lo sobrescribe FreePBX. Archivo incluido desde el features.conf que contiene configuracin de la seccin featuremap y que es sobrescrito por FreePBX. Archivo incluido desde el features.conf que contiene configuracin de la seccin featuremap y que puede ser sobrescrito por el usuario ya que no lo sobrescribe FreePBX. Archivo de configuracin general de features que sobrescribe FreePBX. Archivo de configuracin general de features que puede ser escrito por el usuario ya que FreePBX no lo sobrescribe. Archivo de configuracin de Festival. Configuracin de la funcionalidad followme. Permite configurar parmetros de conexin con una base de datos a travs del driver ODBC para poder hacer consultas en caliente a travs del mismo plan de

http://www.elastixbook.com/es/capitulos/Apendice.htm[24/11/2011 10:23:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

globals_custom.conf

gtalk.conf

h323.conf

http.conf

iax.conf iax_additional.conf iax_custom.conf iax_general_additional.conf

marcado. Permite al usuario definir variables globales que no sern sobrescritas por FreePBX. Este archivo es incluido desde el extensions_additional.conf. Archivo de configuracin para que Asterisk funcione como cliente del servicio Google Talk. Archivo de configuracin para protocolo H.323 segn la implementacin basada en el proyecto Open H.323. Existen otras implementaciones. Configuracin de mini servidor Web embebido en Asterisk. Por omisin este servicio est apagado as que tener cuidado de no levantarlo en el mismo puerto que el servidor Apache que viene integrado en el Elastix. Archivo principal de IAX que incluye a los otros. Configuracin de IAX generada por FreePBX no se debe editar. Configuracin de IAX que se puede editar ya que no la sobrescribe FreePBX. Archivo complementario al iax.conf donde FreePBX escribe configuracin general. Esto es porque en la actualidad el archivo iax.conf ha quedado como un simple archivo de inclusin, o sea que incluye a otros archivos. Similar al iax_general_additional.conf pero aqu puede escribir informacin el usuario ya que este archivo no es sobrescrito por FreePBX. Similar al iax_registrations.conf pero este archivo no es sobrescrito por FreePBX, permitiendo almacenar configuracin del usuario sin temor a que se sobreescriba. Archivo utilizado por FreePBX para almacenar informacin de cadenas de registro con otras centrales o proveedores VoIP que usan protocolo IAX. Archivo utilizado par actualizar el firmware de dispositivos IAX. Archivo para configurar la definicin de tonos. Estos tonos pueden variar de un pas a otro o de una compaa telefnica a otra. Archivo que permite configurar el soporte XMPP en Asterisk. Esto es porque Asterisk se puede conectar como cliente a un servidor XMPP (El nombre Jabber es el

iax_general_custom.conf

iax_registrations_custom.conf

iax_registrations.conf

iaxprov.conf indications.conf

jabber.conf

http://www.elastixbook.com/es/capitulos/Apendice.htm[24/11/2011 10:23:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

jingle.con

localprefixes.conf logger.conf

manager.conf manager_additional.conf manager_custom.conf

meetme.conf meetme_additional.conf mgcp.conf misdn.conf modem.conf

modules.conf musiconhold.conf

musiconhold_additional.conf musiconhold_custom.conf

muted.conf

osp.conf

oss.conf

anterior nombre del protocolo XMPP). Archivo de configuracin de Jingle. Jingle es una extensin del protocolo XMPP que permite soportar multimedia a travs de este protocolo. Archivo que permite configurar reglas de marcado basadas en prefijos. En este archivo se puede configurar el logging de Asterisk. Ver la seccin de diagnstico para mayor informacin. Archivo de configuracin del servicio de Asterisk Manager Interface. Informacin de configuracin de AMI que puede ser sobrescrita por FreePBX. Informacin de configuracin de AMI para uso del usuario, o sea que este archivo no es sobrescrito por FreePBX. Configuracin de los cuartos de conferencia permanentes. Configuracin de cuartos de conferencia escrita por FreePBX. Configuracin de protocolo MGCP. Archivo de configuracin del canal chan_misdn en Asterisk. Archivo de configuracin del soporte para modems e ISDN usando los drivers de ISDN4Linux o CAPI4Linux. Este archivo le dice a Asterisk cules mdulos se cargan y cules no. Aqu se configura la msica en espera. Asterisk es muy flexible e inclusive soporta streaming de audio. Archivo para configuracin de msica en espera que sobrescribe FreePBX. Definicin de msica en espera definida por el usuario. Este archivo no lo sobrescribe FreePBX. Permite enviar audio a ciertos canales y reducir el volumen de dicho audio mientras estos canales estn activos. Permite configurar soporte para protocolo OSP (Open Settlement Protocol). Este protocolo nos permite intercambiar informacin (como accounting y uso) con proveedores que soporten dicho protocolo. Permite configurar canales tipo OSS (Open Sound System). OSS es un driver de audio (o un conjunto de drivers de audio) y nos permite configurar canales en la propia de tarjeta de sonido.

http://www.elastixbook.com/es/capitulos/Apendice.htm[24/11/2011 10:23:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

parking_additional.inc

phone.conf

phpagi.conf privacy.conf

queues.conf

queues_additional.conf

queues_custom_general.conf

queues_custom.conf

queues_general_additional.conf queues_post_custom.conf res_mysql.conf

res_odbc.conf res_pgsql.conf res_snmp.conf rpt.conf

rtp.conf

say.conf sip.conf

Algo similar al soporte ALSA. Archivo que almacena cierta informacin de lotes de parqueo. Este archivo se escribe automticamente por el mdulo Parkinglot. Permite configurar canales tipo phone que se basan en una implementacin de canal para el proyecto Linux Telephony que soporta este tipo de dispositivos en Linux. Configura algunos parmetros bsicos para el soporte de la librera PHPAGI. Bsicamente este archivo define el nmero de intentos que tiene un usuario para intentar ingresar un nmero de telfono vlido en la aplicacin PrivacyManager(). Archivo general de configuracin para colas. Si desea editar las colas en archivos de texto, se recomienda modificar queues_custom.conf. Archivo que crea colas generado desde FreePBX. No se debe modificar manualmente porque se pueden perder los cambios. Archivo de configuracin general de colas escrito por el usuario, es decir que no lo sobrescribe FreePBX. Archivo de configuracin de colas que puede ser modificado por los usuarios sin que FreePBX lo borre. Archivo de configuracin general de colas escrito por FreePBX. Actualmente FreePBX no usa este archivo. Permite a Asterisk obtener la configuracin de la base de datos MySQL. El concepto se denomina Asterisk Realtime. Permite a Asterisk obtener configuracin de bases de datos a travs del driver ODBC. Permite a Asterisk obtener configuracin de la base de datos PostgreSQL. Permite configurar soporte SNMP en Asterisk. Archivo de configuracin de repetidora de radio. Esto le permite a Asterisk comunicarse va VoIP utilizando tecnologa de repeticin de radio. Configuracin del protocolo RTP. Aqu se puede configurar el rango de puertos RTP que Asterisk utilizar. Define ciertos parmetros de internacionalizacin. Archivo de configuracin de SIP que incluye a los otros.

http://www.elastixbook.com/es/capitulos/Apendice.htm[24/11/2011 10:23:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

sip_additional.conf

sip_custom.conf

sip_general_additional.conf

sip_general_custom.conf

sip_nat.conf

sip_notify.conf

sip_registrations_custom.conf

sip_registrations.conf

skinny.conf

sla.conf smdi.conf

udptl.conf

unicall.conf users.conf

Configuracin de SIP generada por FreePBX y que no se debe editar manualmente. Configuracin de SIP que se puede modificar y no es sobre escrita por FreePBX. Archivo complementario al sip.conf donde FreePBX escribe configuracin general. Esto es porque en la actualidad el archivo sip.conf ha quedado como un simple archivo de inclusin, o sea que incluye a otros archivos. Similar al sip_general_additional.conf pero aqu puede escribir informacin el usuario ya que este archivo no es sobrescrito por FreePBX. Configuracin para trabajar con SIP a travs de NAT (Network Address Translation). Utilizado para configurar el soporte que permite reiniciar algunos telfonos SIP remotamente. Similar al sip_registrations.conf pero este archivo no lo sobrescribe FreePBX permitiendo almacenar configuracin del usuario sin temor a que se borre. Archivo utilizado por FreePBX para almacenar informacin de cadenas de registro con otras centrales o proveedores VoIP. Permite configurar el protocolo SCCP (Skinny Client Control Protocol) en Asterisk. Configuracin de SLAs (Shared Line Appearances). Permite configurar soporte SMDI (Station Message Desk Interface) que le permite a Asterisk funcionar como un sistema de voicemail para centrales que soportan este protocolo. Le permite a Asterisk soportar paquetes UDPTL. Estos paquetes son utilizados por el protocolo T.38 para fax. Aqu se puede configurar el mdulo chan_unicall. Este archivo se utiliza para definir el concepto de usuario que puede tener asociado opcionalmente un telfono (o extensin). Esto modela mejor el hecho de que un mismo usuario puede cambiar de dispositivo telefnico y desde cualquier dispositivo se puede autenticar.

http://www.elastixbook.com/es/capitulos/Apendice.htm[24/11/2011 10:23:16 p.m.]

Comunicaciones Unificadas con Elastix Vol. 1

vm_email.inc

vm_general.inc voicemail.conf vpb.conf

Plantilla de email que se enva para notificar al usuario de la llegada de un nuevo correo de voz. Algunos parmetros generales relacionados con el voicemail. Archivo de configuracin de los casilleros de voz. Archivo de configuracin de tarjetas VoiceTronix.

El siguiente grupo de archivos puede ser encontrado en versiones de Elastix menores a 2.0, cuando todava se utilizaban los drivers de Zaptel. Los enlistamos aqu como referencia. Archivo zapata_additional.conf Descripcin Archivo que sobrescribe FreePBX y que se incluye en el zapata.conf. Se utiliza bsicamente cuando se crean extensiones tipo ZAP. Archivo escrito por el script genzaptelconf y por el detector de hardware de Elastix para agregar configuracin al zapata.conf. Configuracin de las tarjetas de telefona que usan los drivers de Zaptel.

zapata-channels.conf

zapata.conf

Anterior

Ir a ndice

http://www.elastixbook.com/es/capitulos/Apendice.htm[24/11/2011 10:23:16 p.m.]

Unified Communications with Elastix Vol. 1

http://www.elastixbook.com/[24/11/2011 10:23:18 p.m.]

Unified Communications with Elastix Vol. 1

Index
Cover Index Introduction 1. Introduction to telephony 1.1 A brief history of telephony The dawn of telephony The problem with the patents The development of telephonic technology 1.2 The basics of voice transmission Frequency range of the human voice The microphone Bandwidth and information capacity 1.3 Voice digitization Nyquist's theorem 1.4 Circuit-oriented networks 1.5 Packet-oriented networks 1.6 Public Switched Telephone Network (PSTN) 1.7 Analog circuits Analog signaling DTMFs The Analog Telephone 1.8 Digital circuits Base DS-0 T-carrier and E-carrier circuits SONET optical circuits 1.9 Digital signaling protocols Channel Associated Signaling (CAS) Common Channel Signaling (CCS) 2.Introduction to VoIP 2.1 VoIP: a protocol soup Classifying VoIP protocols 2.2 IP Protocol The Internet What is IP protocol? IP Address IP packet IP routing 2.3 Transport protocols TCP protocol UDP protocol 2.4 Voice codification
http://www.elastixbook.com/en/Index.htm[24/11/2011 10:23:19 p.m.]

Unified Communications with Elastix Vol. 1

Codecs 2.5 Protocol overload Comparing codecs 3. Linux for Elastix Administrators 3.1 Introduction 3.2 The Linux Terminal 3.3 Basic Commands 3.4 File System Organization Permissions 3.5 RPMs and updates via Yum Yum to the rescue 4. Asterisk: Essential Concepts 4.1 What is Asterisk? 4.2 A Brief History of Asterisk 4.3 Functionality Provided by Asterisk 4.4 Asterisk Operation Asterisk directories Modular structure 4.5 The DAHDI Project A Brief History of DAHDI 4.6 Asterisk Configuration Configuration files Comments on the Configuration Files 4.7 Dial plan Contexts Extensions Variables Most common applications 4.8 Asterisk CLI CLI Commands 5. Installing Elastix 5.1 Installing from a CD 5.2 Installing Elastix over a soft-RAID 6. Introduction to Elastix 6.1 What is Elastix? 6.2 A brief history of the project Awards 6.3 Elastix features PBX Fax Email Instant Messaging (IM)
http://www.elastixbook.com/en/Index.htm[24/11/2011 10:23:19 p.m.]

Unified Communications with Elastix Vol. 1

Calendar Collaboration Call Center General 6.4 Licensing 6.5 Elastix.org: Official project site Forums 6.6 The Elastix Web interface 6.7 Network configuration 6.8 Overview of the Elastix Web administration interface Menus and modules Navigating the Web interface 6.9 User administration User groups Group permissions User creation 7. Basic PBX Configuration 7.1 Creating an extension IP telephone configuration 7.2 General configurations Dial Options 7.3 Queues configuration 7.4 IVR and the recording system Recording of the welcome message Configuring a welcome IVR 7.5 Conference rooms 7.6 Call parking 7.7 Music on Hold 7.8 Operator panel 7.9 Call transfer operations Blind transfer Attended transfer 8. Hardware configuration 8.1 Types of cards and manufacturers 8.2 Hardware installation for telephony hardware in Elastix 8.3 Physical installation of a card Modular hardware 8.4 Hardware detection 8.5 Telephony hardware configuration on the Asterisk level Configuration of the chan_dahdi.conf file 8.6 Digital interface configuration using the DAHDI configuration files DAHDI driver configuration 8.7 DAHDI details

http://www.elastixbook.com/en/Index.htm[24/11/2011 10:23:19 p.m.]

Unified Communications with Elastix Vol. 1

8.8 Before DAHDI: machines using Zaptel Some name changes to take into account 9. IP telephone configuration 9.1 Softphone configuration 9.2 IP telephone configuration Network configuration Configuration for registration on the Elastix server 9.3 Using the Endpoint Configurator Configuration of an ATCOM telephone, model AT-530 Configuring a Polycom Soundpoint IP 501 telephone TFTP updating Customizing configuration files 10. Advanced PBX Configuration 10.1 Call routing Incoming routes Outgoing routes 10.2 Trunks IAX and SIP type trunks DAHDI trunks Custom trunks 10.3 Billing Visualizing, Editing, and Deleting Creating a rate Billing report Destination Distribution Billing Setup 10.4 Reports CDR Report Channel Usage 10.5 DISA Configuration 10.6 Time conditions 11. FreePBX internal operation 11.1 FreePBX basics 11.2 File organization 11.3 Configuration amportal.conf 11.4 retrieve_conf: Dial plan generator 11.5 dialparties.agi 11.6 Structure of a FreePBX module 12. Connecting Elastix Servers 12.1 Interconnection between two Elastix servers Defining the SIP trunk Defining outgoing routes

http://www.elastixbook.com/en/Index.htm[24/11/2011 10:23:19 p.m.]

Unified Communications with Elastix Vol. 1

12.2 Connection with call providers via IP Defining the SIP trunk Defining the outgoing route 12.3 Predefined connection with call providers via IP 13. Voice quality 13.1 Voice problem symptoms Echo Low volume level Voice delay Voice distortion 13.2 Parameters related to voice quality in packet networks Network delay Packet loss Jitter 13.3 How to measure voice quality MOS scale Model E 13.4 Echo cancellers Operation of echo cancellers G.168 standard OSLEC 14. Uncovering VoIP Protocols 14.1 SIP Protocol Protocol details SIP signalization Asterisk and SIP 14.2 IAX Protocol Phases of an IAX call Frames 14.3 RTP protocol Structure of an RTP packet 14.4 SRTP Protocol 15. Basic problem diagnostics 15.1 Interpreting the log The /var/log/asterisk/full file What information can the MESSAGE field give us? Process number (PID) 15.2 Diagnostics through the CLI 15.3 Sniffing 16. Asterisk external control 16.1 Asterisk AGI Execution of AGI scripts Parameters sent to the AGI() script

http://www.elastixbook.com/en/Index.htm[24/11/2011 10:23:19 p.m.]

Unified Communications with Elastix Vol. 1

AGI commands AGI libraries Example of a simple AGI script 16.2 Asterisk AMI Testing from telnet AMI packet types AMI actions or commands Appendix A: Asterisk configuration files distributed with Elastix

http://www.elastixbook.com/en/Index.htm[24/11/2011 10:23:19 p.m.]

Unified Communications with Elastix Vol. 1

Go to Index

Unified Communications with Elastix


Volume 1 Second edition

Edgar Landvar
Copyright (c) 2008-2011 Edgar Landvar The following work is licensed under the terms of the Creative Commons Attribution-Share

http://www.elastixbook.com/en/Cover.htm[24/11/2011 10:23:22 p.m.]

Unified Communications with Elastix Vol. 1

Alike 3.0 license. For a copy of the license, visit http://creativecommons.org/licenses/by-sa/3.0/; or send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA. Second Edition

To Danielita, because of her smile...

Acknowledgment
Making this book involved a huge amount of work that was made easier thanks to the generous collaboration of some people to whom I am enormously grateful. My most special thanks to: Jos Landvar and Alfredo Salas of ElastixDepot LLC, for their careful revision of Volume 1, paragraph by paragraph. To my wife, for her understanding during the time that I had to dedicate to the writing of this book.

To Paul Estrella, our Channel Manager, for exerting the necessary pressure so that this work would be finished. To Bob Fryer for his commited work reviewing the English version of this book.

The book online


From the second edition, this book has its own website at http://www.elastixbook.com. From here, the reader will be able to access the book in HTML format.

Where to buy this book?


http://www.elastixbook.com/en/Cover.htm[24/11/2011 10:23:22 p.m.]

Unified Communications with Elastix Vol. 1

You can buy the printed edition from Lulu.com and the digital version, available for Kindle readers, from Amazon.com. A hyperlink is available at http://www.elastixbook.com.

Feedback
As always, any suggestion will be well received. The reader should not hesitate in writing an email to elastixbook@palosanto.com Go to Index

http://www.elastixbook.com/en/Cover.htm[24/11/2011 10:23:22 p.m.]

Unified Communications with Elastix Vol. 1

Go to Index

Introduction
Many things have changed in Elastix since the year 2008, when this work was published for the first time. I must admit that I thought initially that updating the book would be an easy task, but I quickly realized that it entailed an enormous amount of work. Being immersed day by day in the development of a product, I had not noticed the great amount of changes that occurred since that October of 2008, when the first version was launched. The initial easy task took 4 times longer than planned, delaying the date of publication more than once. That first edition launched in 2008, was for me, a much bigger success than I had hoped. From the first day, my inbox was filled with many thanks and suggestions for the next versions. The book turned into an official textbook for Elastix' training and certification and even won a sales prize at Lulu.com, something that, I must admit, was a big and welcome surprise. Despite this, the most important thing is that that first edition left me with the indescribable personal satisfaction of feeling like a writer. While I wrote it, I could not perceive this, since I was more concentrated in writing a book that would be useful for the Elastix user community. However, soon after its publishing, when I started to receive the first feedback from interested readers, I knew that I had done something important, not only for Elastix users, but for myself. In regards to the changes in this second edition, I must mention that I have tried to keep the chapters in this work faithful to the original structure to make reading easier for those that read the prior edition. However, a lot of content has been updated or improved. Some chapters have been almost rewritten, while in others the retouching has only been superficial. I have nothing left but to invite you to explore the fascinating world of Unified Communications and of course, using Elastix.

-- Edgar Landivar Elastix Project Leader Go to Index

http://www.elastixbook.com/en/Introduction.htm[24/11/2011 10:23:23 p.m.]

Unified Communications with Elastix Vol. 1

Go to Index

Next

1
Introduction to telephony
I dont care if I die, others will finish my work... -- Mark Twain

1.1 A brief history of telephony


Without a doubt, the invention of what we today know as telephony must have been an amazing act in its time, almost like magic. To hear in real time the voice of someone standing at a remote spot come out of a mysterious box, in a time in which this was only possible in science fiction, must have been a unique and almost fantastical experience. Surely the idea of a talking device was already in the minds of many inventors since ancient times. However, only until the beginnings of the 19th century did it seem like something reachable, since electricity had already been discovered, the telegraph had been invented, and some were already experimenting with radio waves.

The dawn of telephony


In the middle of the 19th century, there was an interesting movement in what we know now as the telephone. In 1849, Antonio Meucci, Italian doctor considered by many as the inventor of the telephone, made a demonstration of a device able to transmit voice in Havana, Cuba. A few years later, in 1854, Meucci himself made a new demonstration of his invention in the city of New York, USA. While Meucci dedicated himself to the tasks of being an inventor, others were also pursuing the idea of building a talking telegraph and that is how in 1860 the German Johann Philipp Reis built a device capable of transmitting
http://www.elastixbook.com/en/chapters/chapter_1/1.1_A_brief_history_of_telephony.htm[24/11/2011 10:23:25 p.m.]

Unified Communications with Elastix Vol. 1

voice. Charles Bourseul, who described the building of that device in 1854 but never actually built it, based this device on the original idea. Reis continued improving his device and one year later, he was already transmitting voice at a distance of more than 100 meters.

Reis' telephone

A couple of years later Innocenzo Manzetti built the long awaited talking telegraph that he himself had envisioned since 1844, but he was not interested in patenting it.

The problem with the patents


Until that moment in history, there already existed some prototypes of the telephone, but no one had patented them. The first to try to patent the invention was Meucci, who in 1871 subscribed a document of patent notice, but due to his economic condition was never able to pay the money to finish the procedure and his document expired a few years later. Meucci was never able to commercialize and cash-in on his invention. In 1875, one year after Meucci's patent expired, Alexander Graham Bell, a Scotsman living in the United States, was able to patent a similar device and was the first to do so. Bell had been previously experimenting with some ideas to conceive his telephonic device until one day he was able to generate some sounds using electricity. History says that the first call he made was to tell his assistant the famous phrase Mr. Watson, come here. I want to see you. An interesting fact that provoked some controversy was that another inventor named Elisha Gray tried to patent a similar invention only a few hours after Bell. The two inventors entered a well-known legal dispute, which was finally won by Bell. Thanks to the patent, Bell was able to turn the idea of the telephone into a viable business and has the merit of having developed the idea and turned into something practical for society.

http://www.elastixbook.com/en/chapters/chapter_1/1.1_A_brief_history_of_telephony.htm[24/11/2011 10:23:25 p.m.]

Unified Communications with Elastix Vol. 1

Illustration of two people talking on the phone in the late 19th century

It is said that at some time or another Bell tried to sell his patent to Western Union for $100 thousand dollars but Western Unions president declined because he thought that the telephone was nothing more than a toy. Only two years later, the same director from Western Union told his colleagues that if he could get Bell's patent for $25 million dollars he would consider it a bargain! This gives us an idea of how Bell's business was starting to grow in those times. In 1886, there were already more than 150,000 telephone users in the United States. From then on, telephony started turning, little by little, into a basic service of today's society.

The development of telephonic technology


As it always happens with technological advances, telephony continued to evolve. At the beginning for a user to communicate with another, he had to solicit a call from an operator. This operator would manually connect the cables to connect one point to the other. In 1891, the automatic telephone was invented, which allowed one to dial directly. At the beginning, Bell was the only company exploiting this technology, due to their patents. However, when these expired hundreds of little companies were born that started to sell this service, most in rural areas where Bell still did not reach. Little by little, these companies started to grow and at the beginning of the 20th century together, they had more users than Bell itself. Competition did its thing and telephonic technology accelerated in its evolution. By the end of World War II, the telephone service had reached millions of users. It should be mentioned that users would rent the telephone device from the telephone company as part of their contract. In 1947, the scientists at Bell invented the transistor and changed the course of humanity's history. In 1948, they won the Nobel Prize for their work. In the 1960's the first communications satellites were launched and communications between continents were made easier. It should be mentioned that this would not have been possible without the previous invention of the transistor. In 1982, the department of Justice of the United States won a trial against AT&T (Bell's new name) in which they
http://www.elastixbook.com/en/chapters/chapter_1/1.1_A_brief_history_of_telephony.htm[24/11/2011 10:23:25 p.m.]

Unified Communications with Elastix Vol. 1

won an accord to dismantle the company into seven regional telephone companies known as Regional Bell Operating Companies (RBOCs) or Baby Bells. All of this in exchange for the rights to enter the computer market. After this and other legal decisions, users could buy their own telephone devices, which ended up diminishing AT&T's monopoly. The company lost a large part of its value and got into deep financial trouble. The irony is that in 2005, AT&T ended up being acquired by one of the Baby Bells, SBC Communications. Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_1/1.1_A_brief_history_of_telephony.htm[24/11/2011 10:23:25 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

1.2 The basics of voice transmission


The human voice is composed of acoustic waves that travel through the air at the speed of sound, 1,244 km/h (or 340 m/s). This is faster than a commercial plane. But this speed does not mean that you can easily communicate with distant points since the human voice will diminish quickly, losing energy as it travels. After a few meters, we cannot listen to a conversation. The human voice is of the same nature as the rest of acoustic waves, something that was well known from before the invention of the telephone. Before the invention of the telephone, it was known that other types of waves called electric waves could be transmitted through a metal conductor like a copper cable. This second type of wave has a different nature compared to acoustic waves and travels at the speed of light, or approximately 300,000 km/s. This is faster than we can imagine and for practical purposes, we can say that these waves will travel almost instantly from one point to the other. Another interesting aspect is that we can control how these waves diminish and make them travel great distances. Since these facts were already known in the mid-19th century, it is easy to understand how many pursued the idea of transforming acoustic waves into electric waves to be able to then transmit them great distances through metallic conductors. The problem was inventing a device to make that transformation and there was the key to the whole thing. This device, known as a microphone in our days, is an important part of any telephonic device.

Frequency range of the human voice


Another important feature of human voice is that the vocal chords will modulate the voice in a wide spectrum of frequencies that go from the low to high in a range of approximately 200Hz to 7kHz. A really wide range of sounds! This makes us assume that a microphone has to be able to capture and transmit all of this range of frequencies. However, now we know that to transmit an understandable voice, it's not necessary to transmit in all the frequencies but only in a much smaller range, which has its advantages since it makes transmission easier as we'll see farther ahead. So commercial telephones only transmit an approximate range from 400Hz to 4kHz. This distorts the voice somewhat although it is still possible to understand. That's why when we hear someone on the phone, his voice will sound slightly different from real life, but we can still understand the conversation.

The microphone
The microphone was a key element in the invention of the telephone since it converts mechanical waves into electrical waves. Many types of microphones operate on different principles. One that was used for a long time in telephones was made of carbon, which consisted of a capsule filled with carbon grains between two metallic plates. One of the plates was a membrane that would vibrate with light pressure from the voice waves. In this way, the electric resistance of the capsule would change with the voice and it would generate the corresponding electrical signal.

http://www.elastixbook.com/en/chapters/chapter_1/1.2_The_basics_of_voice_transmission.htm[24/11/2011 10:23:27 p.m.]

Unified Communications with Elastix Vol. 1

Carbon microphone extracted from a rotary telephone

Another kind of microphone that is very common today is the dynamic or electromagnetic microphone, which consists of a spool of copper wire rolled around a center made out of magnetic iron. This center is attached to a diaphragm that vibrates with the pressure of the voice waves. In this way, a light electric current is induced in the spool, which is later amplified inside the telephone.

Diagram of an electromagnetic microphone

Bandwidth and information capacity


Bandwidth can be a term that is hard to understand at first since it is a very wide concept. In general, we can say that bandwidth is the measure of the amount of information that we can transmit through a medium per unit of time. Due to it being a measure of time, many times it is associated with speed. But we have to careful with not confusing the two. A common measure to express bandwidth is bits per second. This measure can be abbreviated as bits/s, bps or bauds. Bandwidth is an important term when we talk about telephony since in real time communication there is a minimum bandwidth required to deliver communication to its destination.
http://www.elastixbook.com/en/chapters/chapter_1/1.2_The_basics_of_voice_transmission.htm[24/11/2011 10:23:27 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_1/1.2_The_basics_of_voice_transmission.htm[24/11/2011 10:23:27 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

1.3 Voice digitization


Digital networks of voice and data transmission are common in our time. They were created because they have certain advantages over analog networks; for instance, they preserve the signal almost unaltered throughout its whole journey. That is to say, it is harder for the communication to be affected by external factors such as electric noise. Also, it gives us methods to periodically verify the integrity of the signal, among other advantages. Simply put, digitizing a voice signal is simply taking samples (at regular time intervals) of the analog signal's amplitude and transforming this information into binary code (1s and 0s). This process is called sampling.

Nyquist's theorem
In 1928 Henry Nyquist, a Swiss engineer that worked for AT&T, solved the dilemma of the minimum number of samples necessary to be able to rebuild a wave to its original shape. The proposed theorem reads that the sampling frequency must be at a minimum twice the highest frequency in the signal. This is better reflected in the following expression:

fm 2 BWs
Let us make a brief calculation to see what would be the sampling frequency to convert the signal of a human voice (analog) into digital and then being able to rebuild it at its destination. We had already said that for the human voice to be understandable it is enough to transmit in a range of frequencies between 400Hz and 4kHz. So, according to Nyquist's theorem, we should sample twice the higher frequency as a minimum, which would be 8kHz. Further ahead, we will see that the frequency of sampling of 8,000Hz is the one that is used in most codecs. Thanks Nyquist! Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_1/1.3_Voice_digitization.htm[24/11/2011 10:23:28 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

1.4 Circuit-oriented networks


Circuit-oriented networks (circuit switched) are those in which an exclusive or dedicated circuit is established between both nodes before the users can communicate. Once a circuit is established between two points that want to communicate, the result is the equivalent of physically connecting a pair of cables from one end to the other. This circuit is exclusively reserved for one conversation and cannot be used by others. In each circuit, delay is constant, which is an advantage. However, these kinds of networks are expensive because a dedicated circuit is necessary for the conversations of each individual user. This kind of networks is traditionally used today by telephone companies around the world, and is the same one that Bell used in its beginnings, obviously considering the technological distance. It is common that certain people confuse circuit networks with analog networks, but it is necessary to make clear that circuit networks can very well transport digital data. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_1/1.4_Circuit-oriented_networks.htm[24/11/2011 10:23:29 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

1.5 Packet-oriented networks


Packet-oriented networks (packet switched) are those in which different information flows are transmitted simultaneously in the same medium. To do this, the traffic of each flow of information is divided into fragments or packets, which are sent, interspersed. Then, at their destination, the packets are reassembled to reproduce the original message.

Graphic simulation of information flow in a packet-oriented network

The Internet is an example of this type of network, where a single connection can transmit different flows of information. In this same way, we can attend a videoconference while at the same time sending an email or surfing the Web. In these types of networks, we can even have simultaneous information flowing to different IP addresses destinations. Unlike circuit-oriented networks, in these kinds of networks bandwidth is not fixed since it depends on the network traffic at a given time. In addition, each packet of a single flow of information is not required to follow the same path to reach its destination. Due to this, the packets that were originally generated in sequence can reach their destination out of order. It is important to take these kinds of factors into account when one utilizes voice on a packet network, since they affect the quality of the call. Packet networks have become popular, mainly because they optimize resources due to being able to use the same medium to send several flows of information. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_1/1.5_Packet-oriented_networks.htm[24/11/2011 10:23:30 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

1.6 Public Switched Telephone Network (PSTN)


The public switched telephone network or PSTN is essentially a circuit-based network. This network covers landlines as well as mobile telephones and is what makes it possible for us to communicate with any person in our city or around the world. Originally, it was an analog network although now it is mostly a digital network. It is important to check both kinds of circuits: analog and digital. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_1/1.6_Public_Switched_Telephone_Network.htm[24/11/2011 10:23:30 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

1.7 Analog circuits


Analog circuits are commonly copper pairs that reach users of the phone service and that transmit the electric signal of the voice in an analog manner. The same circuit additionally carries the signaling necessary to establish, maintain and end a call. These analog circuits must connect a telephone switch charged with directing the communication between users. Now, analog circuits are in decline since telephone companies have found many advantages in digital communications. For this reason, although today we still see some analog circuits, this is really their last mile. In a certain point of the telephone network is turned digital and transmitted to a digital telephone switch. Analog circuits are commonly associated with the term: traditional telephony. Since originally it was more common for phones to be located in rural areas with no electric supply, it was decided early on that telephone lines contain a certain voltage. That is why some analog telephones do not need to be connected to an electric current. In any case, the Central Office (CO / Telephone Exchange) generates 48 volts of direct current to feed its users' phones. Strictly speaking, we should say -48 volts since this voltage is measured in respect to one of the conductors. However to be practical, we will use interchangeably 48V or -48V to refer to the same thing in this book.

Analog signaling
For telephone lines to work correctly it is necessary to count with indications or electric signals that allow us to interchange information between the user and the CO. In short, we will see what the most common signals consist of. The industry has developed three methods of analog signaling through the years. This are called loop start, ground start and kewlstart. Its important when configuring a telephone device that is connected to an analog line to choose the correct method of signaling or we will find strange problems on the line like having it hang up unexpectedly, or not being able to hang it up correctly, among other things. The difference between loop start and ground start is in the way the telephone requires a dial tone from the CO (a process also known as seizure). Ground start requires a dial tone when it lands (hence the term ground) on one of the conductors of the telephone line while that loop start does so making a short circuit between both conductors (creating a loop). Kewlstart is an evolution of loop start that adds a bit more intelligence to the disconnection detection (call hang up) but is still a loop start. Due to the ground start not being very common today, we will usually find ourselves using the loop start. Below we will explain in more detail the analog signaling for the most common events. To do so we will base ourselves in the progress of a typical call using loop start signaling. The progress of a call can be divided into six

http://www.elastixbook.com/en/chapters/chapter_1/1.7_Analog_circuits.htm[24/11/2011 10:23:32 p.m.]

Unified Communications with Elastix Vol. 1

instances: on-hook, pick-up, dialing, commutation, ringing and conversation.

On-hook While the telephone is hung up, the CO provides a voltage of DV 48 volts. The phone maintains an open circuit with the telephone line; in other words, it acts as if it is not connected so current does not flow through the line.

Pick-up When the user picks up the telephone receiver, the phone sends a signal to the CO. This signal consists in closing the circuit. The phone connects both cables of the telephone line through an electrical resistor. As soon as the CO realizes this, it sends a dial tone to the phone. This dial tone tells the user that he can then dial the number. In most of America, the dial tone consists of two sinusoidal waves sent simultaneously. These waves are 350 Hz and 440 Hz. In Europe, the dial tone consists of a single 425 Hz wave. However, there are countries where these values could be different. Note: As a teenager, we would tune a guitar listening to the dial tone of a telephone since 440 Hz is the frequency of the musical note A, which corresponds to the fifth string of a guitar.

Dialing Dialing can be by pulses or by tones. Pulses are almost not used anymore and were popular back in the days of rotary phones. Tones are pairs of frequencies associated with telephone digits. These frequencies are transmitted to the CO, which translates these tones into numbers. Further ahead, we will explain more about these tones under the title DTMF's.

Commutation Once the digits are received, the CO will try to associate the dialed number with the circuit of a user. In case the destination is not a local user, it will send the call to another telephone switch so it can be completed. It should be said that today commutation is a completely automated process unlike the past in which it was an operator's job.

Ringing Once the CO finds the destination user, it will try to ring him. The ring signal is a sinusoidal wave of 20 Hz and 90

http://www.elastixbook.com/en/chapters/chapter_1/1.7_Analog_circuits.htm[24/11/2011 10:23:32 p.m.]

Unified Communications with Elastix Vol. 1

volts of amplitude. Note: An observant person will see that the ring signal has considerable amplitude of 90 volts. We should also remember that the line already has an additional component of 48 DC volts. This is the reason why if we manipulated bare telephone wires in the precise moment in which it rings we may receive a small electric discharge and a good scare. Apart from the ring signal the CO sends to the destination, a notification to the party who originated the call is also sent. This audible tone is known as ring-back, which consists of two sinusoidal waves superimposed, 440 Hz and 480 Hz. These waves are interspersed with periods of silence. In case the destination is in the middle of an active call then instead of the ring-back, a busy tone is returned to the originator of the call. This busy signal consists of two sinusoid waves superimposed, 480 Hz and 620 Hz interspersed with periods of silence of half a second. Without a doubt, all the readers have heard about ring-back and a busy tone at some point of their lives.

Conversation If the destination decided to answer the phone call, it will close the telephone circuit (in the same way that happened when the telephone that originated the call picked up the receiver.) This signal will tell the CO that the destination decided to answer and will complete the connection. The telephone call is finally established.

DTMFs
Many times it is necessary to send digits through the phone line to both, dial and while in the middle of a conversation. This is why DTMFs were implemented. DTMF is an acronym for Dual-Tone Multi-Frequency. Each DTMF is really two tones that are mixed and sent simultaneously through the phone line. This is done this way to diminish errors.

The pairs of frequencies for each digit are illustrated below. 1209 Hz 1 4 7 * 1336 Hz 2 5 8 0 1477 Hz 3 6 9 # 1633 Hz A B C D

697 Hz 770 Hz 852 Hz 941 Hz

As you can see in the table there are also correspondences for the signs * and # as well as for the letters A, B, C, and D.

The Analog Telephone

http://www.elastixbook.com/en/chapters/chapter_1/1.7_Analog_circuits.htm[24/11/2011 10:23:32 p.m.]

Unified Communications with Elastix Vol. 1

It is important to talk about this essential component of a telephonic network. Let us remember that its invention marked the development of the telephony business. The analog phone is still the most common kind of phone on the planet and the understanding of its operation will allow us to understand further ahead some key concepts, like echo, for example. The analog telephone, in its most basic form, is a simple device that is made up of several components. Receiver Microphone Switch for hanging up and picking up Two to four string converter (also called a hybrid) Dialer Bell or ringing device

Diagram of components of an analog telephone

Most components are self-explanatory. However, some readers will ask themselves about the 2 to 4 wire converter, also known as a hybrid.

2 to 4 wire converter An important part of an analog phone is the converter from 2 to 4 wires, also known as a 2H/4H device, hybrid coil or simply hybrid. This device is necessary to separate the outgoing audio signal from the incoming audio signal since they are both part of one conversation and there is only one pair of cables. If there were three or four cables (2 outgoing and 2 incoming), the converter would not be necessary, but this would probably raise the cabling costs and telephone companies would rather deal with the coupling problems that this converter introduces instead of raising their costs. In general, a perfect 2 to 4 wire converter does not exist since it is very hard to completely separate incoming and outgoing signals. That is why this device is historically one of the causes of echo in badly coupled telephone lines. We will talk more about this in the chapter on Voice quality. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_1/1.7_Analog_circuits.htm[24/11/2011 10:23:32 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

1.8 Digital circuits


The PSTN also provides its users with digital circuits. These circuits offer the advantage of being able to multiplex more than one line in the same medium, which results attractive to users with a need for a great number of phone lines, usually businesses.

Base DS-0
To put it simply, DS-0 is a digital 64Kbit/s channel. A DS-0 is a standard channel measure or unit that allows us to define greater multiples like the circuits that will be discussed below.

T-carrier and E-carrier circuits


T-carrier circuits were designed as a nomenclature for multiplexed digital circuits and were developed by Bell Labs more than fifty years ago. E-carrier circuits are the European equivalent. The T1 (and its counterpart, the E1) is the most popular among the T-carrier circuits. A T-1 is a digital circuit composed of 24 DS-0's while an E1 is composed of 32 DS-0's. If we do the math, we will realize that a T1 supports 1.544 Mbit/s while an E1 supports 2.048 Mbit/s. There are higher multiples of T1, such as T2, T3 and T4, which related to each other in the following proportions: 1 T4 = 6 T3 = 42 T2 = 168 T1

SONET optical circuits


SONET (Synchronous optical networking) was developed with the objective of counting with a nomenclature similar to T-carriers but using fiber-optic technology. SONET uses multiples of T3 for its bandwidths and its circuit base is the OC-1 equivalent to one T3. OC-1 has higher multiples such as OC- 3, OC-12, OC-24, and OC-48 among others. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_1/1.8_Digital_circuits.htm[24/11/2011 10:23:33 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

1.9 Digital signaling protocols


Signaling protocols are used to transmit information on the state of the communications channel (such as disconnected, ringing, answered,) control information and digital information such as DTMFs, caller ID, among others. These protocols can be grouped into two types called Channel Associated Signaling (CAS) and Common Channel Signaling (CCS.) The difference is in that, while CAS transmits the signaling in the same channel in which the information travels, CCS transmits it separately. This is why with CAS the available bandwidth is slightly reduced for communications, since a part of it is being used for signaling. Most phone companies have adopted CCS due to this as one of the reasons. Note: The reader should not confuse CAS and CCS with signaling protocols. They are only types of protocols that are explained here to make the categorizing or grouping of them simpler.

Channel Associated Signaling (CAS)


CAS protocol is better known as robbed-bit and is used by T1 and E1 circuits around the world. Robbed-bit takes (or robs, hence its name) the eighth-bit from each communications channel every six frames and replaces it with signaling information. The original robbed bit is simply lost. Note: As an example for the reader, each T1 frame consists of 193 bits, 8 bits for each of the 24 channels plus 1 framing bit. It should be noted that this is possible due to the voice not being very sensible to the loss of that bit of information since it is the least significant bit. However, when we transport data (as opposed to voice) the loss of one bit cannot be overlooked and the quality of transmission will degrade in a significant manner. Another CAS type protocol that is used in our times is R2. This protocol was popular in the 1960s. Actually, R2 is a family of protocols in which each implementation is called a variant. There are variants for each country and even between each telephone company, which offers it. Note: Before version 1.6, Elastix supported R2 protocol using the Unicall library (http://www.soft switch.org/unicall/installing-mfcr2.html), but since Elastix 1.6, the support was changed so that the openR2 project developed by Moiss Silva could be implemented (www.libopenr2.org).

Common Channel Signaling (CCS)


The best example of CCS type protocol is the Integrated Services Digital Network (ISDN). This protocol allows us to transmit voice and data simultaneously over copper telephone pairs with a quality superior to analog telephone lines.
http://www.elastixbook.com/en/chapters/chapter_1/1.9_Digital_signaling_protocols.htm[24/11/2011 10:23:33 p.m.]

Unified Communications with Elastix Vol. 1

The objective of ISDN was to simplify digital connections to be able to offer a wide array of integrated services to the users. ISDN establishes two types of interfaces to meet this end. BRI: Basic Rate Interface PRI: Primary Rate Interface A BRI supposes 2 usable channels (also called B channels) of 64Kbit/s each, plus one signaling channel of 16Kbit/s (also called D channel) that in total adds up to 144Kbit/s. BRI was intended to be a popular standard for homes but it did not work out this way and had a poor reception in this market segment in the United States. In Europe, the situation was different and it is now used in many countries of this continent. PRI is the ideal option for bigger users, like businesses or companies since it can join up more B channels. Today it is very popular and is transmitted over T-carrier and E-carrier circuits. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_1/1.9_Digital_signaling_protocols.htm[24/11/2011 10:23:33 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

2
Introduction to VoIP
I never did anything by accident, nor did any of my inventions come by accident; they came by work -- Thomas Edison Voice over IP or VoIP, consists in transmitting voice over the IP protocol. Said like this it can sound simple, but IP networks were mainly designed for data and many of the advantages of IP networks for data are a disadvantage when it comes to voice. This is because the voice is very sensitive to delays and transmission problems, even if they are small. As such, transmitting voice over the IP protocol required many technical problems to be solved. Fortunately, technology has evolved and due to the abilities of some talented engineers, it has resulted in solutions that remove the need for us to deal with those problems inherent to IP networks that can damage voice quality. The evolution in the quality of voice communications over IP in the last years has been really surprising. Today we can say that voice transmission on the Internet is a viable alternative within the reach of most of us.

2.1 VoIP: a protocol soup


There are many protocols involved in voice transmission over IP. There already are network protocols involved such as IP itself and other transport protocols such as TCP or UDP. On top of that, you have voice signaling protocols. If this were not enough, many more signaling protocol options are available, which can make everything sound a bit confusing at first.

http://www.elastixbook.com/en/chapters/chapter_2/2.1_VoIP_a_protocol_soup.htm[24/11/2011 10:23:35 p.m.]

Unified Communications with Elastix Vol. 1

VoIP protocol soup

Classifying VoIP protocols


To simplify things we can classify the protocols used in VoIP in three groups: signaling protocols, voice transport protocols and IP platform protocols. Signaling protocols VoIP signaling protocols perform functions that are similar to their counterparts in traditional telephony, such as session establishment tasks, call progress control, amongst others. These protocols are found in the session layer (layer 5) of the OSI model. There are some signaling protocols that have been developed by different manufacturers and organizations such as ITU or IETF, and which are supported by Asterisk. Some of them are: SIP IAX H.323 MGCP SCCP Among the most popular in regards to Asterisk are SIP and IAX. Further ahead in this book, we will go into more details about the SIP protocol.

Voice transport protocols

http://www.elastixbook.com/en/chapters/chapter_2/2.1_VoIP_a_protocol_soup.htm[24/11/2011 10:23:35 p.m.]

Unified Communications with Elastix Vol. 1

We should not confuse voice transport protocols with low-level transport protocols such as TCP and UDP. Here we are referring to the protocol that transports the voice as such or what is commonly known as the packet. This protocol is called RTP (Real-time Transport Protocol) and its function is simple: to transport the voice with as little delay as possible. This protocol starts to function once the signaling protocol has established the call between the participants.

IP platform protocols In this category, we will group protocols from basic to IP networks, which form the basis of the addition of other voice protocols. Among these protocols, we can mention Ethernet, IP, TCP and UDP. Note: In the present chapter, we will emphasize the explanation of this group of protocols so we can bring up to speed those without solid knowledge in Networking. However, the other protocol groups will be examined in more detail in a chapter that is specially dedicated to this purpose.

Protocols involved in a SIP call. The case of IAX is very similar.

In the above figure, we can observe a curious fact in that although SIP supports both UDP and TCP we can only see it on top of UDP. This is not a mistake but it is because until Asterisk 1.4 the SIP implementation is only available for UDP. Starting in Asterisk 1.6 (Elastix 2.0) SIP is available on TCP as well as on UDP. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_2/2.1_VoIP_a_protocol_soup.htm[24/11/2011 10:23:35 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

2.2 IP Protocol
IP protocol is without a doubt one of the most popular ever implemented, mainly because of the great network of networks called the Internet that uses this protocol for its routing. For this reason, before we go into detail about IP protocol we will use a pair of paragraphs to summarize the origins of the Internet.

The Internet
The internet had its origins in the 1960's as a project created by the Department of Defense of the United States with the goal of creating a robust network that could connect some public sector facilities with universities. The idea behind this network, originally called ARPANet, was that if any of the nodes stopped working this would not significantly impair the operation of the network. For this a decentralized network was created that could handle more than one route between two points. In short, it was about building a fail-proof network (let us remember this was during the Cold War) that was also low-cost. Thanks to this goal, ARPANet evolved into what we know today as the Internet, such a big and powerful communications network that has made an impact in our cultures without a doubt. Without its existence, the Elastix project would never have existed and you would not be reading this now.

What is IP protocol?
IP protocol (Internet Protocol) works at a network level where information is sent in packets called IP packets. This protocol offers a service without guarantee, also known as a best effort service. That is, nothing guarantees that the packets will reach their destination, although the best effort will be made to have them arrive.

IP Address
An IP address is a unique number, which also gives information on the location of the machine that has it. To ensure the uniqueness of this number, an authority controls the assigning of IP addresses called IANA (Internet Assigned Numbers Authority.) This unique number is binary and has 32 bits. This number is shown as four decimal number separated by periods for practical considerations and for easy understanding by humans. Each of the four decimal numbers can have a value from 0 to 255. An example of an IP address is 172.16.254.1

Translation from decimal notation to binary (32 bits) of an IP address

IP packet
http://www.elastixbook.com/en/chapters/chapter_2/2.2_IP_Protocol.htm[24/11/2011 10:23:37 p.m.]

Unified Communications with Elastix Vol. 1

As we said before, IP protocol is the protocol that divides information into packets, which are sent to its destination. The advantage of having information in packets is that each of these packets can take a different route to reach its destination. That is, there is a redundancy in the number of routes and it is less likely for packets to be lost. Some readers will ask themselves: What do these so-called packets look like? The format of an IP packet is designed to carry information that allows it to be dissected to its destination and obviously to be reassembled with other packets at the destination to recover useful information. The figure below represents an IP packet header.

IP packet header

IP routing
Routing allows the optimal route to be determined so that an IP packet reaches its destination. To know where a single packet wants to go, we have to examine the IP address of the destination in the Destination Address field in the heading of an IP packet. The devices in charge of routing the packets to their destinations are known as routers. They contain routing tables with information on how to reach other networks. That is, when a packet reaches a router, the router examines the IP address of the destination and tries to determine what network this IP address belongs to. Determining the network where a single packet wants to go is not hard because that information is part of the IP address. That is because each IP address can be divided into two parts: the part that identifies the network and another one that identifies the device (also known as the host.) Identifying each of these parts is not a trivial matter since there exist networks of different sizes and the number of bits that correspond to the network and the host vary respectively. The solution to this is an additional parameter known as the network mask.

Network mask and network address calculation Let us see then how to obtain the information of to what network does a device belongs to based on its IP address so that a router can correctly send a packet to that destination. The network mask is a 32-bit number like the IP address. It is called a mask because if it is superimposed over the
http://www.elastixbook.com/en/chapters/chapter_2/2.2_IP_Protocol.htm[24/11/2011 10:23:37 p.m.]

Unified Communications with Elastix Vol. 1

IP address it allows us to identify which part corresponds to the network address and which one corresponds to the host address. Let us imagine that we have the IP address 130.5.5.26 with a mask of 255.255.255.0. To show how the mask is applied to the IP address we will turn this data into binary as is shown in the diagram below.

Mask application to obtain the network and host information

Now we can see more clearly that the number one (1) in the mask marks the limit between the network part and the host, so the network address is (in binary): 10000010.00000101.00000101.00000000 All the binary numbers to the right of the network part in the mask are filled with zeros. Let us now turn the above network address into decimal. We will get: 10000010.00000101.00000101.00000000 130.5.5.0

This implies that the IP address 130.5.5.26 belongs to the network 130.5.5.0. Now the router can decide to which network to send our IP packet. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_2/2.2_IP_Protocol.htm[24/11/2011 10:23:37 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

2.3 Transport protocols


Note: We should not confuse these protocols with voice transport protocols RTP. RTP is a more specialized protocol that even can be mounted on UDP (A protocol that will be explained here). The transport protocols covered here are for general purposes and rest directly on top of the IP protocol.

TCP protocol
As we had said, the IP protocol does not guarantee that data will reach its destination. It only makes the best effort to ensure that it will arrive. Due to this best effort, a protocol was needed to be responsible for the data transmission. The Transmission Control Protocol or simply TCP was designed for this reason. This transport protocol is transmitted on top of the IP protocol. TCP helps by making sure that the transmitted data is free of errors and is received by the applications in the same order it was sent. If data is lost in the way, TCP introduces a mechanism so that this data can be resent. Obviously, this implies an extra load of information on the data flow since there is additional control information to be sent. That is why TCP is a good protocol for session control but not so good for real-time information transmissions like voice. However, TCP plays an important role in many protocols related to the Elastix server. TCP introduces the concept of a port that is nothing else but an abstraction to be able to relate data flows with specific network services (or higher-level protocols). For example, port 80 is associated with the Web service or HTTP protocol, while port 25 is associated with email service or SMTP protocol.

UDP protocol
UDP (User Datagram Protocol) is another transport protocol. It is different from TCP, as this protocol does not care if the data arrives with or without errors and does not care if it arrives in sequence. The question is then, where and why is this protocol used? Well, a transport protocol does not necessarily have to guarantee that the information reaches its destiny or that it arrives in sequence. This is just an extra feature. It is somewhat like a merchandise transport service. Let us imagine a fleet of motorcycles that offers transport services in a city and let us imagine that that fleet is hired for transporting a great shipment of files from one office to the other. The company will be in charge of dividing our shipment of files and distributing it into quantities or packets that can be transported in each vehicle. The fleet will do whatever it needs to make sure the shipment reaches its destination. This is in essence what a transport service does. However, we can choose two kinds of services: one that guarantees that the merchandise arrives safely and one that does not. These two services are analogous to the two kinds of transport protocols that we are describing here: UDP and TCP. In the end, UDP divides the data into packets, also called datagrams, to be transported inside the IP packets to its destination.

http://www.elastixbook.com/en/chapters/chapter_2/2.3_Transport_protocols.htm[24/11/2011 10:23:38 p.m.]

Unified Communications with Elastix Vol. 1

Since it is not necessary to include too much control information, the UDP protocol reduces the quantity of information necessary in the packets, which makes it a faster protocol than TCP. This makes it suitable for the transmission of information that must be sent in real time, such as voice. This is why VoIP voice applications are transmitted with this protocol. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_2/2.3_Transport_protocols.htm[24/11/2011 10:23:38 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

2.4 Voice codification


It is clear that to transport voice there are some protocols used such as SIP, IAX and others such as RTP or RTCP. But voice is an analog wave that needs to be transformed into a digital format before being transmitted. Logically we could try to transmit it just as it results from an analog to digital conversion (ADC) but we are in a packet network so we need to packetize this information. There also exists the possibility of compressing the result of ADC conversion with an algorithm so not to waste network resources. The search for an optimal compression format generated some alternative transmission formats called codecs. Note: Codecs are not really exclusive of VoIP since they are also used in other kinds of digital communications.

Codecs
The word codec comes from abbreviating the words codification and decodification. Its main purpose is to adapt the digital information of the voice to obtain some benefit. This benefit in many cases is the compression of the voice in such a way that we can use less bandwidth than was necessary. Some of the codecs supported by Asterisk and commonly used in VoIP communications are G.711, G.722, G.729, GSM, and iLBC among others. Let us briefly look at four of them: G.711, G.722, G.729 and GSM.

G.711 G.711 is one of the most used codecs of all time and comes from ITU-T standard that was released in 1972. It comes in two varieties called u-law and a-law. The first version is used in the United States and the second is used in Europe. One of its characteristics is its voice quality since it hardly compresses it. It uses an 8 bit - 8kHz sampling, resulting in 64kbit/s. It is the recommended codec for LAN networks, but you should think twice about using it for remote links due to the large amount of bandwidth that it consumes. The support for this codec is a default setting in Elastix.

G.722 G.722 offers a sampling rate of 14 bits at 16 kHz, much higher than G.711. In other words, it recovers more data from the audio signal, which results in a superior voice quality. In fact, the codec is used in many VoIP telephones marked as high definition (HD.)

http://www.elastixbook.com/en/chapters/chapter_2/2.4_Voice_codification.htm[24/11/2011 10:23:38 p.m.]

Unified Communications with Elastix Vol. 1

Something very interesting about G.722 is that despite having a sampling rate that is higher than G.711's and the fact that the resolution of each sample is also higher than G711, the bandwidth consumed is almost the same, 64kbit/s. This is possible due to G.722 codec using a different algorithm. If we look quickly at the human voice bandwidth that this codec can capture (according to Nyquist's theorem seen in the last chapter), we will see that the sampling rate of 16kHz allows us to digitize frequencies of up to 8kHz. That is, twice the bandwidth of G.711, including high frequencies. These high frequencies contain high tones that make the voice clearer and more understandable. With the recent arrival in the market of phones that claim to have High Definition Audio (HD), we have seen an increase in the use of this codec. The reader may think that this is a new technology; however, G.722 is a 1988 standard.

G.729 This is also an ITU recommendation whose implementation has been historically licensed. This means that usually you have to pay for them. The advantage in using G.729 lies mainly in its high compression and the resulting low consumption of bandwidth. This makes it attractive for Internet communications. Despite its high compression, G.729 does not deteriorate voice quality significantly and for this it reason has been widely used over the years by many manufacturers of VoIP products. G.729 uses 8kbit/s on each channel. If we compare this to the value in G.711 (64kbit/s) we'll see that it consumes 8 times less bandwidth, which at a glance if a significant saver of our resources. Note: There exists a variation of G.729 that use 6.4kbit/s and 11.8kbit/s. To use G.729 channels in Elastix a license must be acquired for each channel.

GSM Many people correctly assume that the GSM codec has something to do with cell phone communication standards. The standard that defines cell-phone technology GSM (Global System for Mobile communications) includes this codec. The advantage of this codec is also its compression. However, the voice quality is deteriorated compared to other codecs. You will notice this when you talk through a GSM cell phone at some point. GSM compresses approximately at 13kbit/s and comes ready to be used by default in Elastix. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_2/2.4_Voice_codification.htm[24/11/2011 10:23:38 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

2.5 Protocol overload


By what we have seen above, transporting voice from one place to the other in a packet network requires the help of some protocols. In addition, we have noticed that these protocols transmit additional data that uses up bandwidth apart from the actual voice. Some of them are Ethernet, IP, UDP, and RTP. All this makes the real bandwidth required to transmit voice to be higher than the actual codec. For example, to transmit voice using G.711, in theory we should be using 64Kbps (according to the codec) when in reality we are using 95.2Kbps of bandwidth. In other codecs with more compression, the overload is even more significant (percentage-wise.) Let us do a simple exercise using as an example the G.711 codec. Let us see the following figure to illustrate the exercise better:

Illustration of protocol overcharge using G.711

Let us calculate the bandwidth for G.711 basing ourselves in the above figure, which shows us the waste or overhead of each protocol. Let us add up all of these sent bytes. Bytes transmitted for each 20ms of audio = 38 + 20 + 8 + 12 + 160 = 238 bytes Bits transmitted for each 20ms of audio = 238 bytes * 8 bits/byte = 1904 bits Bits transmitted each second = 1904 bits/20ms * 1000 ms/sec. = 95,200 bits/s = 95.2Kbps!

Comparing codecs
Below we show a table that shows the overhead for some of the most popular codecs supported by Asterisk.

http://www.elastixbook.com/en/chapters/chapter_2/2.5_Protocol_overload.htm[24/11/2011 10:23:40 p.m.]

Unified Communications with Elastix Vol. 1

Codec G.711 iLBC G.729A Previous

Codec Bandwidth 64 Kbps 15.2 Kbps 8 Kbps

Real Ethernet Bandwidth 95.2 Kbps 46.4 Kbps 39.2 Kbps Go to Index

Overhead Percentage 48.75% 205.26% 390% Next

http://www.elastixbook.com/en/chapters/chapter_2/2.5_Protocol_overload.htm[24/11/2011 10:23:40 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

3
Linux for Elastix Administrators
Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it -- Linus Torvalds, Linux creator

3.1 Introduction
This chapter will review some useful Linux concepts, which will make work easier for Elastix administrators. If you already know how to manage Elastix from the Linux terminal, you can skip this chapter and go straight to the next. Since this is not a Linux manual, we will not go too deeply into the subject or talk about the history of Linux or its advantages. When Reading this chapter, if you think we are looking at the topic too broadly, that is the intention Even though this chapter is a good start for the reader with no Linux experience, we recommend learning to administer it since that will, without a doubt, make tasks easier as an Elastix administrator. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_3/3.1_Introduction.htm[24/11/2011 10:23:40 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

3.2 The Linux Terminal


A very comfortable way to administer Elastix is from the Linux terminal. The Linux terminal allows us to get the most out of our server of unified communications We can enter the terminal directly by connecting a monitor and a keyboard to the machine in which Elastix is installed. Alternately, we can connect remotely though the SSH protocol. If we are on a Windows machine, we will need to download a client so we can connect remotely. The program we recommend is named PuTTY. Do a Google search for its name you will find the download site. Just make sure to do so from the official site.

PuTTY application

After entering the parameters of the Elastix server and starting our session, we can execute commands as if we were directly connected with a monitor and keyboard.

http://www.elastixbook.com/en/chapters/chapter_3/3.2_The_Linux_Terminal.htm[24/11/2011 10:23:42 p.m.]

Unified Communications with Elastix Vol. 1

Running PuTTY

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_3/3.2_The_Linux_Terminal.htm[24/11/2011 10:23:42 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

3.3 Basic Commands


The most commonly used basic commands in Linux are listed below. Command ls ls -la cd <directory> cd .. cat <file> pwd cp <file1> <file2> mv <file1> <file2> rm <file> tail -f <file> mkdir <directory> tar -xvzf <file>.tar.gz top Description Lists the files in the current directory Lists the files and their attributes Changes directory Changes to the home directory Shows the contents of a file onscreen Shows the route to the current directory Copies a file or a group of files Moves a file. Is also used to rename files Deletes a file Shows the last lines of a file dynamically Creates a directory Decompresses a tar.gz file Shows a real-time report of the processes running on the system. Can be ordered by memory consumption or CPU. Very useful for diagnostics. Allows you to search for files in a particular directory Program for editing files in plain text Shows information on the different network interfaces and allows them to be modified temporarily. Shows a report of the processes that are being run on the server. Reboots the machine Shuts the machine down

find <directory> -name <file> vim <file> ifconfig

ps -aux reboot shutdown -h now

http://www.elastixbook.com/en/chapters/chapter_3/3.3_Basic_Commands.htm[24/11/2011 10:23:44 p.m.]

Unified Communications with Elastix Vol. 1

Example of the top command

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_3/3.3_Basic_Commands.htm[24/11/2011 10:23:44 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

3.4 File System


In Linux the organization of the file, system is very important. This organization gives Linux its resilience and interoperability since programs can better predict exactly where certain files are for them to work correctly. Also, it allows processes to write files in a way that other components will understand. This minimizes conflicts and, along with a permission system, it makes the operating system more secure.

Organization
The directory organization that we will see below is not arbitrary. It is the product of years of evolution from the first versions of UNIX until reaching what we know today as Linux. This folder structure is found in what is called the root directory, or main directory. This root directory is the highest-level directory in the file system and is represented with a slash /. The directories listed in the following table are all on the root directory Directory sbin bin Description Includes binaries that can only be executed by an administrator Contains binaries necessary for the correct functioning of the system. The binaries in this folder can also be used by the systems users Contains the kernel and other files necessary for startup Includes files that represent hardware devices. Lets remember that in Linux practically everything is a file Basically contains configuration files for the whole system Here are the user directories. For example, /home/Jorge/ is the directory for the user named Jorge Contains the shared libraries required by programs. Its somewhat analogous to the .dll files in Windows If for some reason the file system is corrupted and needs to be repaired, the results of this repair are saved in this directory This is a common place for mounting other file systems or devices. For example, a CDROM drive or a USB drive

boot dev

etc home

lib

lost+found

mnt

http://www.elastixbook.com/en/chapters/chapter_3/3.4_File_System.htm[24/11/2011 10:23:45 p.m.]

Unified Communications with Elastix Vol. 1

opt proc

root tmp usr

var

Contains software packages that are normally not part of the original installation This is a virtual directory (since it actually resides in the memory) where the kernel and drivers write files so that other programs can read them. For example, here is where the DAHDI drivers write certain files in the path /proc/dahdi Contains files for the user root since this doesnt have a path of the /home/root type Saves temporary files Is one of the most important directories and contains information to be shared with system users. That is, here are the programs along with the necessary documentation and even the related libraries. Usually, this directory doesnt contain data that changes constantly Contains data that is constantly changing, like logs or email tails. For example, here is where the Asterisk log resides, in the path /var/log/asterisk/full

Permissions
In Linux, each directory or file has access permits, these permits can be of 3 types: Reading Writing Executing The permissions can be applied to the files owner, to a group of users of the system, or globally to all of the systems users. For each of these entities there can be established different permissions. With that said, we can establish the following matrix for permissions that would be valid for any one file in the system: owner x x x group x x Other users x x

Reading Writing Executing

In the above example, the owner has all of the permissions on the file while the group and global users only have permissions for reading and executing. There is an easier notation to express this information. This notation is composed of 10 characters that simplify the display of permissions information and allows showing them in a single line. This is very useful when you want to see the permissions on a group of files, although it takes time to get used to it. For example, the permissions matrix from the above example can be expressed in the following way (we have included the position of each permission
http://www.elastixbook.com/en/chapters/chapter_3/3.4_File_System.htm[24/11/2011 10:23:45 p.m.]

Unified Communications with Elastix Vol. 1

with a number from 0 to 9):

-rwxr-xr-x 0123456789
Where, The character in the 0 position represents the kind of file. If it has a letter d, that means that this is a directory. The characters in the 1, 2 and 3 positions represent the reading, writing and executing permissions for the files owner. The characters in the 4, 5, and 6 positions represent the reading, writing and executing permissions for the files group. The characters in the 7, 8, and 9 positions represent the permissions for reading, writing and execution for all users. Now let us see an example of a listing where we can appreciate different permissions:
$ ls -la drwxrwxr-x -rw-rw-r--rw-rw-r-drwxrwxr-x drwxrwxr-x drwxrwxr-x -rw-rw-r--rwxrw-r--rw-rw-r-drwxrwxr-x -rw-rw-r-drwxr-xr-x -rw-rw-r-drwxrwxr-x -rw-rw-r--rw-rw-r--rw-rw-r--rw-rw-r-drwxr-xr-x -rw-rw-r--rw-rw-r--rw-rw-r--

4 1 1 3 2 3 1 1 1 3 1 4 1 3 1 1 1 1 18 1 1 1

edgar edgar edgar edgar edgar edgar root root test prueba edgar edgar edgar edgar edgar edgar user4 101 edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar edgar

4096 2008-09-01 21:20 Codigo 53058 2008-08-04 01:31 comohemo.mid 22785270 2008-08-07 12:09 dlj173.pdf 4096 2008-08-26 17:21 elastix 4096 2008-09-11 13:03 flashingfop 4096 2008-08-04 22:18 fpbx 398439 2008-08-19 19:19 gforge_manual.pdf 102135 2008-09-07 18:53 index2.html 3535 2008-08-19 23:20 install-ceros 4096 2008-08-03 01:52 installers 6860 2008-08-19 23:12 ksraid.cfg 4096 2008-08-06 12:14 lw 1020152 2008-07-30 14:00 Magic Button.pdf 4096 2008-09-02 17:25 monitoring 14341913 2008-08-12 01:59 prbx1.zip 7195354 2008-08-03 01:51 rotron1.7.1.tar.bz2 25343 2008-08-13 00:25 roundcube.diff 12167 2008-08-01 23:03 src-php.tar.bz2 4096 2008-08-13 09:38 wanpipe-3.2.7 16106184 2008-08-29 17:40 wanpipe-3.2.7.1.tgz 20525 2008-09-08 17:14 xorcom_test.txt 9277 2008-09-08 02:10 Xorcom_logo.png

Examples of file permissions

Numeric representation of permissions Apparently, we will complicate things a bit more here, but later on we will see the usefulness of being able to represent the permissions matrix in a more condensed form called a numerical or octal permissions representation. The idea is that the three characters that define the permissions for each one of the three entities involved (owner, group and others) can be represented by a single number. In this way, all the permissions information for a file can be represented with three of these numbers. For example, 755. Where the first digit represents the owners permissions, the second digit the groups permissions and the third digit the permissions for other users or global permissions

http://www.elastixbook.com/en/chapters/chapter_3/3.4_File_System.htm[24/11/2011 10:23:45 p.m.]

Unified Communications with Elastix Vol. 1

At first, it can be hard to understand but, without a doubt, it is a more condensed format. Let us see the next example:

-rwxr-xr-x

is equivalent to

755

Each of the three characters that represent a permission for an entity can be replaced by a 1 or a 0 in such a way that we get a binary number. This number is translated to its decimal equivalent (we really should say octal here) as we see below:

-rwxr-xr-x
Transformed to binary, it would be made up of the following trios (without taking into account the 0 position that corresponds to the directory):

111

101

101

And now its decimal equivalent:

755
For those that do not like to calculate in binary, perhaps the following table will be useful: Text version ----x -w-wx r-r-x rwrwx Binary version 000 001 010 011 100 101 110 111 Octal version 0 1 2 3 4 5 6 7

Now you are probably wondering, what is this numerical notation for? Well, this way it is much easier to manipulate the permissions for files with commands, which is precisely what we will see below:

Changing file permissions and owner The permissions and owner changing tasks can be executed easily thanks to the commands chmod and chown respectively. chmod takes as parameters the permissions in a numerical mode and the name of the file which you want to change. For example:
$ ls -la test_file

http://www.elastixbook.com/en/chapters/chapter_3/3.4_File_System.htm[24/11/2011 10:23:45 p.m.]

Unified Communications with Elastix Vol. 1

-rw-rw-r-- 1 edgar edgar 0 2008-09-19 04:21 test_file $ chmod 755 test_file $ ls -la test_file -rwxr-xr-x 1 edgar edgar 0 2008-09-19 04:22 test_file

The chmod command can also be used recursively to change the permissions for all of the files in a folder. This is done with the R option. For example: chmod R 755 folder_name/ To change the owner and group associated with a specific file we can use the chown command. For example, to change the permissions for the above file to the user and root group we execute the following (note the separation between user and group by a period .):
# ls -la test_file -rwxr-xr-x 1 edgar edgar 0 2008-09-19 04:23 test_file # chown root.root test_file # ls -la test_file -rwxr-xr-x 1 root root 0 2008-09-19 04:24 test_file

As with the chmod command, the chown command also supports the recursive option with R. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_3/3.4_File_System.htm[24/11/2011 10:23:45 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

3.5 RPMs and updates via Yum


The software packages that are included in Elastix come in a format called RPM. This is a format inherited from Red Hat and its name means Red Hat Package Manager. This means that the installers of many additional software packages can be installed in Elastix in an easy way using compressed packages usually with the .rpm extension. RPMs also allow us to update software packages and they solve the necessary dependencies so that these packages do not problems in the system. This can be done because the RPM system maintains an internal database of all the installed packages with their respective dependencies and versions. It also gives us a very useful command to manipulate installs, uninstalls, upgrades, and other important tasks. Below are some common options for the rpm command: Action RPM installation RPM upgrade Deletes an RPM Gets information from an RPM file Obtains a listing of all installed RPM files on the system Command rpm -ivh <package>.rpm rpm rpm rpm rpm -Uvh <package>.rpm -e <package>.rpm qpi <package>.rpm -qa

Yum to the rescue


Manual installation of RPMs with the rpm command is fine for many tasks. However, there are times when installing RPMs in this way is tedious and complicated. For example, we install complex packages that have many dependencies. At the moment of installation, we will notice that we are required to install another package having to search on the Internet for it. Many times an RPM has dozens or even hundreds of dependencies that, of course, would take us hours to manually solve. Apart from this dependencies problem there is another problem, their reliability. That is, after hours on end of installing our packages manually we realize that one of them overwrote an important system file and corrupted our Elastix server. What a headache! The solution is a utility named yum. This program allows us to install RPM packets from repositories and does it in a very user-friendly way. Most of the popular distributions, and Elastix is not the exception, maintain repositories of official software packages that can be accessed free on the Internet. They make their best effort so that these packages do not have dependency problems with one another. Also, the packages from the official repositories are tested to avoid incompatibility as much as possible. It is for this reason that if Elastix is used, it is advisable to install the packages from the official repository.

http://www.elastixbook.com/en/chapters/chapter_3/3.5_RPMs_and_updates_via_Yum.htm[24/11/2011 10:23:46 p.m.]

Unified Communications with Elastix Vol. 1

Below are the some useful yum commands: Command yum update yum update <package> yum install <package> Description Upgrades the whole system Upgrades only the specified package and all its dependencies. Installs the specified package and all of its dependencies

Note: It should be mentioned that Elastix gives us a user-friendly Web interface to upgrade packages and administer repositories. That means that the manual upgrade procedures here described are saved for exceptional cases. It is recommended to use the Web interface whenever possible. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_3/3.5_RPMs_and_updates_via_Yum.htm[24/11/2011 10:23:46 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

4
Asterisk: Essential Concepts
If at first, the idea is not absurd, then there is no hope for it -- Albert Einstein

4.1 What is Asterisk?


Asterisk is telephone exchange (PBX) software with VoIP capability that is distributed with free licensing. Parting from this very basic concept, Asterisk is not just any PBX; it is a PBX rich in features that before were only accessible by purchasing expensive products. This has resulted in many businesses considering Asterisk as a serious option when planning their telephone project and, for this reason; Asterisk has been very well received around the world. Seeing this business opportunity, many manufacturers have started to offer telephone hardware that is compatible with Asterisk, mostly electronic cards for PSTN connection. This has caused Asterisk-based PBXs offerings to rapidly grow in recent times. Asterisk is one of the most important components in Elastix and it provides most of the distributions telephone features. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_4/4.1_What_is_Asterisk.htm[24/11/2011 10:23:47 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

4.2 A Brief History of Asterisk


Asterisk was conceived and developed by Mark Spencer. At first, it was because of a personal need, since he needed a PBX for the small support business he was founding, Linux Support Services. At first, he thought about acquiring a PBX but he soon realized that it was far too much for his budget. So, after some thought, he decided to create his own and started to code what we now know as Asterisk. In 1999, when he had a functioning program, he decided to make it free under a GPL license. One may not think it, but Mark was no newcomer to the world of open-source software. He had already participated actively in the development of the messaging client Gaim, now known as Pidgin, one of the most popular pieces of open-source software. In 2002, Linux Support Services turned into Digium, which today offers Asterisk-related products and services and handles the development of this software. We should point out that right at the beginning Mark realized that his software needed to interact with telephone hardware. That is when he discovered the Zaptel project, an open-source project created by Jim Dixon. Zaptel had the aim of creating open drivers for computer telephone cards. From then on, Asterisk and Zaptel would walk hand in hand to the point where today both services are maintained by Digium. In 2008, Digium decided to rename the project they maintained with Zaptel to DAHDI. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_4/4.2_A_Brief_History_of_Asterisk.htm[24/11/2011 10:23:47 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

4.3 Functionality Provided by Asterisk


As we have said before, Asterisk is a PBX software that is rich in features. While writing this book, the most relevant supported features are listed below: Automatic call answering Call transference Do not disturb option Call parking Call pickup Call monitoring and recording Voicemail Conferencing Call reporting Waiting lines Call waiting Caller ID Caller ID blocking Outgoing and incoming fax Interactive extensions directory listing Interactive voice response (IVR) Music on Hold Behavior management by schedule Follow me

Automatic call answering Asterisk provides the ease in configuring an automatic answering service that helps manage the flow of incoming calls by answering them automatically with no need for a live operator. This feature has been designed for businesses that receive a high call flow and that do not possess the necessary staff to manage the traffic of incoming calls. The answering service responds to the digits that are entered into the number pad by the person calling, sending the calls to specific extensions, providing access to pre-recorded information and can take messages 24 hours per day.

Call transfer There are two methods in Asterisk to transfer calls: attended transfer and blind transfer. In attended transfer the person at the destination is called first to notify him that a call will be transferred to him. In blind transfer, the call is simply transferred without previously speaking with the person at the destination.

Do not disturb option


http://www.elastixbook.com/en/chapters/chapter_4/4.3_Functionality_Provided_by_Asterisk.htm[24/11/2011 10:23:48 p.m.]

Unified Communications with Elastix Vol. 1

This option allows the user to configure the extension so that it will not receive calls for a period. Any incoming calls to that extension will be automatically rerouted to that same extensions voice mail.

Call parking Call parking allows the user that receives a call to send it to a parking space, so he can take it again from another extension. This kind of action is useful in many situations, like when a technician receives a call at his desk that requires him to be in front of a server that is three stories above. In this case, the option is to send the call to a virtual room or parking space where the caller will listen to the configured music on hold. The technician can retake the call once he arrives at the server.

Call pickup This option allows one to take a call that is ringing at an extension that is not ones own.

Call monitoring and recording Asterisk allows the monitoring and recording of calls. Monitoring is usually used in quality control for telephone operators and sales agents. For this, there is the feature in which by typing in a predetermined code, one is able to listen in on a conversation taking place on any one extension. Additionally, it allows the recording of conversations from any extension randomly or previously programmed. These recordings will be stored in the Asterisk servers hard drive for later revision.

Voicemail Voicemail is an application that allows messages left by callers that were not answered to be stored and listened to. To access the voicemail inbox you must enter a predetermined password. Asterisk will ask for the password and then you will have access to the available messages.

Conferencing A conference is nothing more than a phone call in which several participants can speak at the same time. To access this feature, conference rooms are created. Each room is associated with a number, as if it were an extension. Then, to access a conference all you have to do is dial the corresponding number for that conference room. It is possible to configure some interesting settings for a determined conference room, for example limiting the number of speakers, asking for a password, and moderating the conference room.

Call reporting

http://www.elastixbook.com/en/chapters/chapter_4/4.3_Functionality_Provided_by_Asterisk.htm[24/11/2011 10:23:48 p.m.]

Unified Communications with Elastix Vol. 1

Asterisk generates Call Detail Records (CDRs) and can store them in a database. By accessing this database, reports can be generated that detail what numbers are dialed by each extension, whether a call was answered or not, how long the call lasted, or through what port or phone line the call was made

Queues This feature allows a great number of callers to stay on hold until a representative or resource is available to assist them. This ensures that callers will not go automatically to voicemail, which can ensure that a caller always has the opportunity of being assisted by a person. The time the user stays on hold can be used to let him know of the companys services or products, special offers, informative messages or there can simply be music on hold.

Call waiting This feature allows the person that receives a call while being on another call to temporarily interrupt the current conversation to answer the incoming call. To alert that person that a second call is coming in, there is a characteristic sound. In some scenarios this sound is not desirable, for example in telephone connections for data transfer (i.e. fax.) In these cases, you can choose to turn this feature off, since it creates fax transmission errors.

Caller ID This signal is sent in between ring signals, or during the call establishment process, before it is answered. Asterisk takes advantage of this and completely supports its use at an IP extensions level. However, at the level of public commutated phone networks, the provider must turn on or provide this feature.

Caller ID blocking This feature prevents someone with caller ID to see the number from which you are calling. This caller ID hiding feature can be total or selective. Not all public telephone networks support this feature. In Asterisk, this feature also includes blocking an incoming call according to the ID.

Incoming and outgoing fax Asterisk allows automatic detection of when a caller is trying to send a fax. As a part of the welcome message for the PBX, you can add a phrase that says, If you want to send a fax, send it now. This allows us to eliminate paper, to do without machines or telephone ports exclusively dedicated to fax and to digitize the information received as fax. After being digitized, this document can be emailed to a specific account for review.

Interactive listing of the extensions directory Asterisk has the telephone directory for all of the company staff (first name, last name, and extension) in its database. This feature allows the person calling to enter the first four letters of the first or last name of the person with whom he wants to speak. This can give callers an alternative if they do not know the extension of the person they are trying to reach and only know their first or last name.

Interactive voice response (IVR)


http://www.elastixbook.com/en/chapters/chapter_4/4.3_Functionality_Provided_by_Asterisk.htm[24/11/2011 10:23:48 p.m.]

Unified Communications with Elastix Vol. 1

Through this feature, access is provided to telephonic options that improve the way a telephone system receives and distributes calls. With an IVR menu, it is possible to distribute incoming calls in a precise way. This will help raise employee performance and customer satisfaction, since it speeds up access to the services and data possessed by the company. With this feature, automatic processes can be put into place that in certain cases can even allow working without a receptionist. With the use of this feature, you can create number or voice command activated menus to even look up data in other computer systems or databases.

Music on hold Asterisk allows the use of any mp3 or wav file as background music. This will be played when an internal or external caller is waiting to be attended by a representative of the company. These files can even be grouped by categories to produce different melodies for different caller groups.

Behavior management by schedule It is possible to configure Asterisk so that it will have a different treatment for calls (both incoming and outgoing) depending on the time of day, day of the month, or month of the year. The most basic example is when you want the incoming calls received outside of office hours to receive a message suggesting them to call again the next day. Follow me This feature, allows to predefine a sequence of simultaneous or sequenced calls to locate a user. For example, you could define that when the company managers extension rings and is not answered the call should be rerouted to his cell phone and other contact numbers. You can specify grace periods before the next number is dialed. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_4/4.3_Functionality_Provided_by_Asterisk.htm[24/11/2011 10:23:48 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

4.4 Asterisk Operation


Asterisk directories
Asterisk organizes its files by distributing them among several directories. The most important of these are the following: Directory /etc/asterisk/ /usr/lib/asterisk/modules/ /usr/sbin/ /var/lib/asterisk/agi-bin/ /var/lib/asterisk/mohmp3 /var/lib/asterisk/sounds /var/spool/asterisk/ Description Where the Asterisk configuration files reside Contains Asterisks modules Includes Asterisks binary Where the AGI scripts reside Contains the Music On Hold mp3 files Includes the sounds that Asterisk uses as voice prompts Where Asterisk saves the files generated by its operation, such as voicemails and call recordings Saves files with process information (PIDs) Where the Asterisk log files reside, such as CDRs or /var/log/asterisk/full

/var/run/ /var/log/asterisk/

Modular structure
Asterisk uses the idea of modules to extend its functionality. The functionality residing in the modules is so important that without them Asterisk alone would not perform any interesting functions. These modules are in the folder /usr/lib/asterisk/modules/ and are files with the .so extension Modules can be controlled through the configuration file /etc/asterisk/modules.conf. This file tells Asterisk whether to load a specific module through the directives load and noload. By default in Elastix, all modules try to load. The following is a fragment of the file modules.conf that comes by default with Elastix. Here you can observe how it tells Asterisk not to load some modules during startup.
; ; DON'T load the chan_modem.so, as they are obsolete in * 1.2 noload => chan_modem.so noload => chan_modem_aopen.so noload => chan_modem_bestdata.so
http://www.elastixbook.com/en/chapters/chapter_4/4.4_Asterisk_Operation.htm[24/11/2011 10:23:49 p.m.]

Unified Communications with Elastix Vol. 1

noload => chan_modem_i4l.so ; Ensure that format_* modules are loaded before res_musiconhold ;load => format_ogg_vorbis.so load => format_wav.so load => format_pcm.so load => format_au.so

Additionally, you can load modules in real time through the Asterisk console (not to confuse this with the Linux terminal) with the command: module load <module> Further ahead we will see some more about the Asterisk console or CLI. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_4/4.4_Asterisk_Operation.htm[24/11/2011 10:23:49 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

4.5 The DAHDI Project


Even though it is a great piece of software, Asterisk cannot do all the work by itself. One of the software packages that complement it is called DAHDI. DAHDI is a group of drivers to control telephonic hardware like PCI or PCI Express cards, which allow us to connect to the PSTN. These drivers communicate with Asterisk through an Asterisk module called chan_dahdi.so that is configured through the configuration file /etc/asterisk/chan_dahdi.conf. Additionally DAHDI has its own configuration files, independent from Asterisk, which are found in the folder /etc/dahdi/. Note: In versions of Elastix before 1.5, the software from project Zaptel is used instead of DAHDI. This means that the configuration files for the telephony drivers have different names. In these cases, it is recommended, as reference, to consult the first edition of this book.

Simplified diagram of the interaction between Asterisk and DAHDI

A Brief History of DAHDI


Regardless of the name change from Zaptel to DAHDI and all the confusion that this generated at the beginning, we cannot forget that DAHDIs origin was in the Zaptel project. First, because the people working on the original project deserve their due credit, second because we should not forget history. Following is a brief summary of that history.

http://www.elastixbook.com/en/chapters/chapter_4/4.5_The_DAHDI_Project.htm[24/11/2011 10:23:50 p.m.]

Unified Communications with Elastix Vol. 1

In the year 2000, Jim Dixon started project Zaptel, whose name was an abbreviation of the Zapata Telephony Project. He named it in honor of Emiliano Zapata, hero of the Mexican revolution. The drivers were launched with a GPL license so that anyone could have access to the code. Initially Zaptel had the drivers for the Tormenta (Spanish word for Storm) cards, made by Zapata Telephony. It was not long before Digium started to improve the drivers and extended support for new hardware models, among them those manufactured by Digium itself. That is how Digium became Zaptels main developer. After a few years of maintaining Zaptel, Digium realized that Zaptel was a registered brand by a card selling company and to avoid any future confusion, decided to change the name of its drivers. The name chosen was DAHDI, which is an acronym for Digium Asterisk Hardware Device Interface. Digium ended official Zaptel support after Asterisk version 1.6 Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_4/4.5_The_DAHDI_Project.htm[24/11/2011 10:23:50 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

4.6 Asterisk Configuration


Configuration files
Asterisk can be configured through some configuration files found on the path /etc/asterisk. There are dozens of configuration files in this directory and they are in plain text to make their modification easier. Due to this, we can use the vim editor or the command line editor of our preference to edit them. Even though all files are important, not all of them are necessary. Elastix has already preconfigured some of them to prevent further modification. The most important are explained in the following table: File extensions.conf Description Defines the dialing plan. In Elastix, there are other files to better organize the dialing plan. These additional files start with the term extensions_ Configures SIP devices Configures IAX devices Defines configuration for DAHDI-type channels

sip.conf iax.conf chan_dahdi.conf

Comments on the Configuration Files


Asterisk configuration files can contain comments. A comment starts with a semicolon. Once this character is written, the rest of the line turns into a comment. That is, this line is ignored by Asterisk when reading the file. Let us see an example of a comment.
; ; ; ; ; ; ;

The following is a comment block. As you can see, I can write anything in here because it will be ignored by Asterisk. Comments are very useful for writing notes and information relative to the configuration we are writing.

; Now I will continue with the directives. . . ; #include #include #include #include sip_general_custom.conf sip_nat.conf sip_registrations_custom.conf sip_registrations.conf

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_4/4.6_Asterisk_Configuration.htm[24/11/2011 10:23:51 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

4.7 Dial plan


The dial plan in Elastix is mainly in the file extensions.conf. From this, one there are other important files included which also contain portions of the dial plan. The most important are: extensions_additional.conf: Here is where the variable plan written for FreePBX resides, an important component of Elastix. If changes are made manually to this file, these changes will be lost when they are overwritten by FreePBX. extensions_custom.conf: Here the user can manually define a dial plan. This file is not touched by FreePBX so it is safe to edit it without fear of losing any changes. All of the dial plan files are in plain text in a format defined by Asterisk. The content of these files is divided into sections called contexts.

Contexts
Contexts group the logic of the dial plan. Contexts also can include other context with the clause include or redirect the flow of execution of the dial plan to other contexts depending on the conditions. For example, after examining the prefix of the dialed telephone number, a context can contain the necessary logic to route the call to the corresponding main line. A context can group the logic necessary for the application of an alarm clock. It can also include the logic to have access to voicemail or to authenticate a PIN number. In general, practically the whole dial plan is grouped into contexts. Contexts are the groupers and organizers of the dial plan. Each context must have a unique name and this name is between the symbols [ and ]. You can observe two contexts called app-pickup and ext-test in the example below:

[app-pickup] include => app-pickup-custom exten => _**.,1,Noop(Attempt to Pickup ${EXTEN:2}) exten => _**.,n,Pickup(${EXTEN:2}) [ext-test] include => ext-test-custom exten => 7777,1,Goto(from-pstn,s,1) exten => 666,1,Goto(ext-fax,in_fax,1) exten => h,1,Macro(hangupcall,)
Fragment of the file extensions_additional.conf to illustrate contexts.

Reserved contexts There are two context names that are reserved for a special purpose which are [general] and [globals].

http://www.elastixbook.com/en/chapters/chapter_4/4.7_Dial_plan.htm[24/11/2011 10:23:52 p.m.]

Unified Communications with Elastix Vol. 1

Extensions
Contexts contain instructions, known as extensions. These extensions are lines from the dial plan that have the following syntax:
exten => extension_name, priority, application

Note: We usually associate the word extension with phone numbers, but in Asterisk, the term extension goes beyond what we normally know. An extension is a logic series of the dial plan. Whats more, when we dial a number from our telephone it does not necessarily have to ring another telephone since we can create the logic we want for that given number. For example, we can simply make the call hang up, to reproduce a given message or functions that are more complex. A typical extension looks like the following:
exten => 4567,1,Answer()

Extension name The extension name is a numeric identifier for the extension. Let us call it telephone number for now to simplify the matter. There is a special non-numerical extension called extension s, to which we will give special attention. Extension s means any extension. The letter s comes from the word start. An example of the use of extension s is the following:
[test] exten => s,1,Answer() exten => s,2,noOp(Test)

Extension s is used when the user that made the call has not pressed the extension number. For example, this is the case for an incoming call still listening to the IVR welcome.

Priority Priority indicates the order in which an extension is executed inside a context. It is necessary to name the first priority 1 so that when Asterisk reads a context the first thing it looks for is this priority. There also exists a special priority, which is priority n. Priority n means that the priority of the previous instruction is added to one. This is very useful for making easier the writing of the dial plan. For example, let us check the following dial plan:

http://www.elastixbook.com/en/chapters/chapter_4/4.7_Dial_plan.htm[24/11/2011 10:23:52 p.m.]

Unified Communications with Elastix Vol. 1

exten => s,1,NoOp(Hello, this is just an example) exten => s,2,NoOp(to demonstrate) exten => s,3,NoOp(how to use priority n)

This dial plan could be written in the following manner using priority n:
exten => s,1,NoOp(Hello, this is just an example) exten => s,n,NoOp(to demonstrate) exten => s,n,NoOp(how to use priority n)

Priorities can also contain tags to make their identifying easier since if we always use priority n it will be difficult to access a determined location determined inside the context. This can be done with the syntax n(tag_name).

Application It is in applications where the real power resides of the Asterisk dial plan. To make an analogy, the applications are the equivalent to the functions in a programming language. The applications will allow us to answer or hang up a call, play waiting music, and jump to other contexts, among many other functions. Applications can also receive parameters. For example, the application Dial( ) needs you to indicate which number to dial so that it can do its work. Further ahead in the present article, we will explain in detail the most common applications in the dial plan.

Variables
Variables in the dial plan are a similar concept to variables in the a programming language. That is, they are abstractions that can store information of a variable nature. A variable has the following syntax: ${NAME} Here NAME is the name of the variable. Variables can be of three kinds: Global, Channel, and Predefined. Global They are the variables defined in the [globals] section of the file /etc/asterisk/extensions.conf. The word global means that they can be referenced from anywhere.

Channel They are the variables that can be defined using the command (or application) Set( ).

Predefined Asterisk administrates some variable names on its own. These names are predefined and contain certain

http://www.elastixbook.com/en/chapters/chapter_4/4.7_Dial_plan.htm[24/11/2011 10:23:52 p.m.]

Unified Communications with Elastix Vol. 1

information depending on the behavior of the call and other factors. Some predefined variables are: ${CALLERID(all)} ${CALLERID(name)} ${CALLERID(num)} ${CHANNEL} ${CONTEXT} ${EPOCH} ${EXTEN} ${SIPUSERAGENT} ${UNIQUEID} Note: There is an additional kind of variable introduced in Asterisk 1.6 called a shared variable. This variable allows two or more channels to have access to what would otherwise be a channel variable. Below we reproduce a segment of the file extensions.conf that is distributed by default with Elastix. Here we can see some predefined variables like ${UNIQUEID}, ${BLINDTRANSFER} and ${EPOCH}, and channel variables like ${CALLFILENAME}.
[macro-record-enable] exten => s,1,GotoIf($[${LEN(${BLINDTRANSFER})} > 0]?2:4) exten => s,2,ResetCDR(w) exten => s,3,StopMonitor() exten => s,4,AGI(recordingcheck,${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)},${UNIQUEID}) exten => s,5,Noop(No recording needed) exten => s,999,MixMonitor(${CALLFILENAME}.wav)

Most common applications


Answer Syntax: Answer([delay]) Answers a channel immediately if its ringing. It can optionally receive a delay parameter that tells Asterisk that it must wait a determined number of milliseconds after answering the call to go to the next application.

Background Syntax: Background(filename1[&filename2...][|options[|langoverride][|context]]) Plays a list of audio files in the background and returns control to Asterisk, which can continue to execute the dial plan while the audio is played. When its done playing the last file, its execution ends so if you want it to keep waiting for an extension you should use the application WaitExten() with it. This application is typically used to reproduce the welcome message of an IVR. The Background application can receive some options:
http://www.elastixbook.com/en/chapters/chapter_4/4.7_Dial_plan.htm[24/11/2011 10:23:52 p.m.]

Unified Communications with Elastix Vol. 1

Option s n m

Description Skip the audio playing if the channel isnt answered Dont answer the channel before playing the files Stop playing audio if a dialed digit coincides with an existing extension in the destination context.

Playback Syntax: Playback(filename1[&filename2...][,options]) Plays one or more audio files. The difference with the Background application is that Playback plays the whole file until the end and does not return control until it finished playing. Note: It is not necessary to specify the audio files extension in this function. The audio files are searched for in the directory /var/lib/asterisk/sounds

Hang-up Syntax: Hang-up() Hangs up the channel and returns the -1 value.

Goto Syntax: Goto([[context|]extension|]priority) Skips the execution of the dial plan and goes to a defined context, extension and priority. If there is only one parameter, it is understood that it is a priority inside the same context.

Dial Syntax: Dial(type/identifier, timeout, options, URL) This command is responsible for dialing a specified channel and links it to the current channel. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_4/4.7_Dial_plan.htm[24/11/2011 10:23:52 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

4.8 Asterisk CLI


Asterisk CLI is the name for the Asterisk console. That is, the command line interface to control Asterisk directly. To enter the CLI we must execute the following command from the Linux terminal:
# asterisk -r Asterisk 1.6.2.16.1, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.6.2.16.1 currently running on elastix (pid = 17080) Verbosity is at least 3 elastix*CLI>

As we can see, we get a CLI> prompt from which we can execute a series of commands that we will go into briefly. CLI can also give us real time information about Asterisks activity. In addition, we can control the degree of detail with which we want to see that information with some commands. The most used ones are the following:
elastix*CLI> core set debug 9 Core debug was 3 and is now 9 elastix*CLI> core set verbose 9 Verbosity is at least 9

The higher the levels of the variables debug and verbose, the more detailed the displayed information. By default, the level of debug is 0 and for verbose it is 3 in Elastix. Note: Due to the great deal of information that can be generated with these commands, it is important to reestablish the values for the debug and verbose variables their minimum when we are done with our diagnostic tasks. Otherwise, Asterisk will continue to generate this detailed information when we do not really need it, which is extra work that consumes system resources. In systems with a lot of activity, this additional consumption can be significant and can affect the quality of the calls.

CLI Commands
Below we provide a brief list of the most common CLI commands. A complete command list can be found in Appendix B. Command agi set debug on core set debug channel Description Allows the debug of AGI scripts. Its turned off with agi set debug off Allows debug in a specific channel

http://www.elastixbook.com/en/chapters/chapter_4/4.8_Asterisk_CLI.htm[24/11/2011 10:23:53 p.m.]

Unified Communications with Elastix Vol. 1

core set debug

core set verbose core show channels dialplan reload dialplan show help iax2 set debug

iax2 show peers

iax2 show registry

module reload

pri set debug on core restart gracefully

core restart now core restart when convenient

sip set debug ip sip set debug peer sip show peers sip show registry core stop gracefully

core stop now core stop when convenient

Allows changing of the debugging level. Its turned with core set debug off Raises the intensity of logging. Very useful in diagnostic. Shows updated information in active channels. Reloads the whole dial plan Shows the dial plan Shows a listing of all available CLI commands Starts debug at the IAX level. Is turned off with the command iax2 set debug off Shows the defined peers and some additional information like the IP address from which theyre connecting, among other data. Shows information from the IAX registry and other information like the status and IP address to which you are connecting. Reloads all Asterisk modules. Is useful to apply changes made to the configuration files. Starts debug of the PRI interface spans. It turned off with pri set debug off Reboots Asterisk in an ordered manner. That is, it doesnt allow new calls to start and it waits for existing call to end before proceeding with the restart. Reboots Asterisk immediately Restarts Asterisk when there is no activity in the Central. Adequate for production environments in which we have no other option but to restart central but dont want to cut existing calls short. Sets SIP debug at the level of a specific IP address Sets SIP debug at the level of a specific peer Shows a list of all configured SIP peers and information for each one, like their status. Shows a list with the SIP registry and relevant information for each one. Stops Asterisk in an ordered manner. That is, it does not allow new calls and it waits for existing calls to end before stopping Asterisk. Stops Asterisk immediately Stops asterisk when there is no activity in the central. It is adequate for production

http://www.elastixbook.com/en/chapters/chapter_4/4.8_Asterisk_CLI.htm[24/11/2011 10:23:53 p.m.]

Unified Communications with Elastix Vol. 1

dahdi show status dahdi show channels

environments in which we have no other option but to turn off central but do not want to cut existing calls short. Shows a listing of DAHDI channels and a report of alarms and errors Shows a listing of DAHDI channels and some operating parameters

elastix*CLI> dahdi Chan Extension pseudo 1 2 3 4 5 6 7 8 elastix*CLI>

show channels Context default from-pstn from-pstn from-pstn from-pstn from-pstn from-pstn from-pstn from-pstn

Language

MOH Interpret default default default default default default default default default

DAHDI channel listing, result of the command dahdi show channels

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_4/4.8_Asterisk_CLI.htm[24/11/2011 10:23:53 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

5
Installing Elastix
There are men who struggle for a day, and they are good. There are others who struggle for a year, and they are better. There are some who struggle many years, and they are better still. But there are those who struggle all their lives, and these are the indispensible ones. -- Bertolt Bretch

5.1 Installing from a CD


Before beginning, make sure you have a copy of the latest stable version of Elastix (the present work is based on version 2.0.) This can be downloaded from the download page of the Elastix Project at www.elastix.org. Choose the appropriate version depending on whether your machine has a 32 or a 64-bit processor.

Loading from CD
Elastix is distributed as an ISO image file, which can be burned to a CD with any CD recording software. Once this image is burned on the CD, insert it into your drive and turn your computer on. Make sure that your computer starts up from the CD-ROM drive otherwise, you need to set this option from the BIOS. If everything goes alright, you should get a screen like this one:

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

Initial installation screen

Note: The Elastix installation CD will format ALL of the hard drive during the installation process so make sure that you do not have any data that you will need on your hard drive. The installation process will start automatically after ten seconds. You can press the Enter key if you do not wish to wait that long.

Preferences and welcome


After loading some programs necessary for the installation, the process will ask us to enter the language for the installation. Choose the language using the arrow keys on your keyboard. Using TAB, move the cursor on OK and press the Enter key.

Language selection for the installation

After that, go on to choose your keyboard type according to its layout. If your keyboards layout is from the United States, select the us option.

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

Keyboard-type selection

Hard disk partitions


The following is the critical step in the installation since it will configure the hard drive partitions. If you are an experienced administrator, you can choose Use a custom design. Otherwise, choose Remove all partitions on selected drives and create default layout. In this example, we will select the latter option.

Hard drive partitioning

Partitioning Confirmation

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

Now the installation process will ask us if we want to review and modify the partitioning layout. Select the No option and press the Enter key to continue.

Review/Modify partitioning layout

Network parameter configuration


Now it is time for the network parameter configuration. The installation program will ask if you wish to configure these parameters in the network cards of your server. Select Yes.

Network configuration

For each network card installed, it will ask if you wish to activate it during startup and which IP support you will activate in it. The IP protocol we recommend you choose support for is IPv4. Press OK.

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

Parameter activation on the network card eth0

If you have a Dynamic Host Configuration Protocol (DHCP) server in your network for the dynamic assigning of IP addresses, select the option Dynamic IP configuration. Otherwise, you will have to assign an IP address manually selecting the option Manual TCP/IP configuration.

IP address configuration and network mask

The next screen will ask us to enter additional network parameters such as the gateway, primary DNS and secondary DNS.

Gateway and DNS configuration

Now we need to name our server with a hostname. It must be taken into account that a correct host name has the

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

form name.domain. Your network administrator will know what host name to use. If you do not have one, enter a fake name since later it is possible to change it. Choose OK to continue.

Hostname configuration

Time zone, root password and packages


In the next screen choose the time zone for your region and press OK to continue.

Time zone selection

We are now going to enter a series of high-level passwords for your Elastix system. It is strongly recommended that you clearly note down each password, especially as you should be using complex passwords. Do not take this suggestion lightly as even seasoned installers of Elastix have had to re-install Elastix because they failed to write these important passwords down. It is time to specify the root password that will be used to access the linux prompt via the console or SSH. Remember that this password is a critical part of the systems security. Due to the importance of this step, you have to confirm the password by entering it again. Press OK to continue with the installation.

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

Specifying the administrator password (root)

Formatting and file copying


From here, the installer program will partition and format the servers hard drive and all the data stored previously on the hard drive will be lost forever. In addition, all of the files necessary to run Elastix will be copied onto the hard drive.

File copying to the hard drive

Once the package copying to the hard drive is finished, the server will restart automatically. At this point, the server will eject the CD, please remove it. If you dont it will try to boot off of the CD and not the hard drive where we now want to boot from.

Automatic restart and various passwords


Let the system start up by itself while making sure not to press any keys at the next screen.

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

Elastix startup screen

After loading the programs needed for its operation, Elastix will ask you for passwords for the important components that make up your system. This password entry phase will only happen on the first startup after installation. The first password that it asks for is for the MySQL database administrator. Enter a password and continue with the OK button.

MySQL administration password

You will have to confirm the password previously entered for MySQL administration in the next screen.

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

MySQL administration password confirmation

The next password will be used to enter with administrator privileges into the Elastix graphic interface. In addition, the same password will be used to enter the FreePBX, VTiger and A2Biliing system components. Once the password is entered, advance to the next screen by pressing OK.

Elastix password and its components

As in the last case, you will need to confirm the password previously entered for Elastix and its components. After entering it once more, press OK to continue.

Confirming the password for Elastix and its components

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

Ending the installation


The installation process will end when you get an invitation screen to enter the main server console, like is shown in the following figure:

Authentication for entering the Elastix console

To access the Elastix console, simply enter root at the pbx login prompt. The password is the one you chose during the installation process. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_5/5.1_Installing_from_a_CD.htm[24/11/2011 10:23:59 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

5.2 Installing Elastix over a soft-RAID


A useful configuration that Elastix has inherited from Linux is the possibility of adding resilience against hard disc errors with RAID (redundant discs). Doing this allows us to add a minimum level of redundancy at a low cost. In general, it is common to configure RAID level 1 or mirror which allows us to have data duplicated in the partitions of various hard drives. The Linux operating system allows Elastix to additionally support RAID levels 0 and 5. It is important to insist that it is not strictly necessary for all partitions to be included in this arrangement. However, it has recommended that if there are two hard drives, that a mirror is made of each partition. A typical partitioning scheme in a server without RAID consists in a 100MB partition for /boot, a 2GB partition for swap memory and the rest of the disc space in a partition for the root /. If you follow this scheme, but with a RAID arrangement at level 1, you will need to create the three mentioned partitions in both hard drives. In this way, in the end you will have six partitions. RAID configuration through software (there is hardware that also implements RAID) is implemented during the Elastix installation process. In the Partitioning types menu we must choose the option to Create a custom layout. Here is where you will have the opportunity to create RAID-type partitions and then the RAID devices that group these partitions. To begin the Elastix installation with RAID with software, let us start the Elastix installation in the usual way.

Initial installation screen

Just as in the normal installation process, you will have to choose a language for the installation process and the type of keyboard according to your location.

Hard disk partitions


Soon the installer program will show a screen asking for the type of partitioning that you will be doing.
http://www.elastixbook.com/en/chapters/chapter_5/5.2_Installing_Elastix_over_a_soft-RAID.htm[24/11/2011 10:24:02 p.m.]

Unified Communications with Elastix Vol. 1

Partition type options.

Here you must choose the option Create a custom layout and ensure that both hard drives in the server are ready and selected. The partitioning screen will show a listing of hard drives with the partitions that are being created.

The tool shows hard drives that are yet to be partitioned

The first step will be to create all the RAID-type partitions for which you choose the option New.

Creating a RAID partition

In the next screen, you will fill out the following parameters:

http://www.elastixbook.com/en/chapters/chapter_5/5.2_Installing_Elastix_over_a_soft-RAID.htm[24/11/2011 10:24:02 p.m.]

Unified Communications with Elastix Vol. 1

- Mount Point: It does not matter what you choose here, it will be removed when you select RAID software in the next point. - File System type: Choose RAID software - Allowable Drives: Choose a disk at a time (selecting it with the space bar). - Size: Specify the space in the disk drive that is reserved for this partition. - Force to be a primary partition: Do not select this. Create three partitions in each one of the drives. For the size write 100 for the partition that will be assigned to the /boot directory and the double of the RAM our system has for the partition that will be assigned to the swap-type partition (in this example our system had 500MB of RAM so we wrote 1000). For the partition that will be assigned to the root directory ( / ) write 1 and select the option Fill all available space. This will make the partition take up the remaining space on the hard drive. After creating the six partitions (three in each hard drive), you will see a list as shown below. For our example, we have used a 5GB hard disk so that the only difference should be the size of the last partition.

RAID partitions with software

In the above figure, you can see how the partitioning is exactly the same in both hard disks.

RAID Devices
The following step is the creation of the actual RAID devices. For that, you choose the RAID option.

RAID arrangement creation

Now we need to create the RAID devices that will be associated to the partitions in each disk that will be replicated. For this, we need to create three devices by accessing the Create a RAID device screen and filling in the
http://www.elastixbook.com/en/chapters/chapter_5/5.2_Installing_Elastix_over_a_soft-RAID.htm[24/11/2011 10:24:02 p.m.]

Unified Communications with Elastix Vol. 1

parameters in the following way: - Mount Point: Write /boot for the first RAID device, dont write anything for the second RAID device (since it will be a swap type) and write / for the third device. - File System type: Select ext3 for the first RAID device, swap for the second device and ext3 for the last. - RAID Level: Select RAID1 for the three devices. - RAID Members: Choose the partition pairs that have been created in each one of the hard disks respectively. These partitions will replicate one another. In our case we have chosen hda1 from the first hard disk with hb1 from the second hard disk for the RAID device that will be mounted as /boot. In the same way we have paired hda2 with hba2 for the swap device and hda3 and hdb3 for the / device. - Number of spares?: This parameter is applicable in cases in which there are more than two hard disks. In our case, we only have two disks so the value 0 is the only option. - Format partition?: This field must be selected. Once the three RAID devices are created, the partition list will look very similar to the one shown in the following figure:

Final partitioning of software RAID level 1

Select the OK option to continue with the normal installation process. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_5/5.2_Installing_Elastix_over_a_soft-RAID.htm[24/11/2011 10:24:02 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

6
Introduction to Elastix
The person who says it cannot be done should not interrupt the person doing it. -- Chinese Proverb The idea behind this chapter is to do a quick overview of Elastix, trying to clear up some basic concepts before we go into more advanced topics. As the reader will notice, this is not a very technical chapter; rather it is informative on a general level.

6.1 What is Elastix?


Elastix is an open source distribution of a Unified Communications Server that integrates different communications technologies in a single package, such as: PBX Fax Email Instant Messaging (IM) Calendar Collaboration When we say distribution (or distro), we are referring to a group of software packages that are distributed together, in this case on a CD, including the installer and operating system. Once the distribution CD is installed, we will have a Unified Communications Server ready for production. Elastix implements a great deal of its operation on four very important programs, which are Asterisk, Hylafax,
http://www.elastixbook.com/en/chapters/chapter_6/6.1_What_is_Elastix.htm[24/11/2011 10:24:04 p.m.]

Unified Communications with Elastix Vol. 1

Postfix and Openfire. These programs respectively give the PBX, Fax, Email and Instant Messaging functionality. The operating system is based on the popular Linux server-focused distro called CentOS. The different Elastix components and their relationship to each other can be observed in the following figure:

General schematic of Elastix components

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_6/6.1_What_is_Elastix.htm[24/11/2011 10:24:04 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

6.2 A brief history of the project


Elastix was created and maintained today by the Ecuadorian company PaloSanto Solutions. Elastix was released as free software for the first time in March of 2006. Initially it was not a distro but an interface to show Call Detail Records (CDR) for Asterisk. It was towards the end of December 2006 when it was launched as a distro, which contained many diverse administrative tools under the same Web interface, and from this point forward, it started gaining attention because of its usability. Since then, Elastix has not stop growing in popularity, having reached its first million downloads in 2010.

Awards
In 2007, the project was nominated in 2 categories for the SourceForge Community Choice Awards (CCA) and was nominated again in 2008 and 2009. In February of 2011 it received the award for best Product of 2010 given out by the media company TMC, which also publishes the magazine Internet Telephony. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_6/6.2_A_brief_history_of_the_project.htm[24/11/2011 10:24:04 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

6.3 Elastix features


Its difficult to list all of the features in Elastix because new ones are constantly added. However, the most outstanding, based in Elastix 2.0, are the following:

PBX
Voicemail via Web or email Call recording Complete and highly flexible IVR Call parking Call Queueing Voice synthesis support Caller ID Business hours scheduling Automatic provision of phones via web Extensions batch creation Support for video via H.263 and H.264 Automatic detection of telephony hardware Embedded DHCP server Call detail records (CDRs) Billing with reporting of calls by destination Channel usage report by technology (SIP, ZAP, IAX, Local, H323) Supports SIP, IAX, H323, MGCP, iLBC, protocols, among others Supports ADPCM, G.711 (A-Law & -Law), G.722, G.723.1 (pass through), G.726, G.729, GSM, iLBC, codecs, among others. Supports analog interfaces FXS/FXO Supports digital interfaces E1/T1/J1 (PRI/BRI/R2) Supports mainline groups Follow-me, ring groups, paging, DISA, Callback, Security PINs, among others.

Fax
Fax server that can be administered from the Web Integrated Fax viewer with PDF downloads Fax-to-email implementation Fax sending via Web Access control for fax clients Integration capacity with Winprint Hylafax to allow printing-to-fax from Windows.

http://www.elastixbook.com/en/chapters/chapter_6/6.3_Elastix_features.htm[24/11/2011 10:24:05 p.m.]

Unified Communications with Elastix Vol. 1

Email
Multi-domain Email server that can be administered from the Web Outgoing SMTP support Relay email configuration Web-based Email client Quota support in email accounts Distribution list functionality via Mailman

Instant Messaging (IM)


Instant Messaging server based on integrated OpenFire Server Calls via PBX to connected IM users Completely Web-based configuration Simultaneous interconnection to Yahoo, MSN Messenger, Gtalk, ICQ, and others. Server-to-server connection support for user sharing User sessions report Plugin support LDAP support

Calendar
Calendar interface via Web Voice reminders Event invitations sending via email Calendar exporting to iCalendar format

Collaboration
Phone book with click-to-call capacity CRM functionality integrated via vTigerCRM Audio teleconferencing support configurable via Web Web conferencing functionality via Addons

Call Center
Agent support with logon/logoff Predictive dialing Generic forms for data entry Detailed reports by agent

http://www.elastixbook.com/en/chapters/chapter_6/6.3_Elastix_features.htm[24/11/2011 10:24:05 p.m.]

Unified Communications with Elastix Vol. 1

General
Embedded online help Web interface with multi-language support System visualization via Dashboard Date/Time/Time Zone configuration Network parameter configuration User and permissions configuration Backup configuration Skins configuration Centralized software updates Remote on/off switch via Web Real-time system visualization via the Operator Panel Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_6/6.3_Elastix_features.htm[24/11/2011 10:24:05 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

6.4 Licensing
Elastix is free software distributed under a GPL version 2 license. That is, it can be freely used, copied, modified and studied according to the contents of this license. To have access to the complete text of this license, the reader can follow the following link: http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_6/6.4_Licensing.htm[24/11/2011 10:24:06 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

6.5 Elastix.org: Official project site


The main resource to which a user can have access when looking for information about Elastix is the official project Web site found at http://www.elastix.org In this site the user can find useful support tools, such as: Forums Wiki Live chat Email subscriber lists Download links

Forums
One of the most important tools of the Elastix.org website is the forum. The forums are very active and all that is needed to participate is to register as a user (which is free). Without a doubt, this is the best way to search for answers to common problems and the developers of Elastix visit this forum on their search for possible bugs. However, the forum is a public place. Therefore, before you participate you have to take into consideration some basic forum etiquette rules: Search to check if your problem has already been solved before asking in the forum. Most common problems have been reported before. Remember this is a public forum. It is possible that you will not get a good answer. Forums are organized a certain way. You should always try to add new comments to the correct category. Otherwise, the forum would be disorganized and the new comment could be ignored. Use correct language to avoid offending anyone. If your message contains offensive language, threatening or badly intentioned, your message may be eliminated permanently. Civility is a good thing to have if you wish for other people to collaborate on your problem. The forum is not an advertising space. Do not attach images or heavy files. If you wish to upload a file bigger than 2 MB, try uploading it to another server and copying the link. Use a relevant topic title and if during the discussion the topic changes, open another message to address the new topic. This will help keep the forum legible. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_6/6.5_Elastix.org_Official_project_site.htm[24/11/2011 10:24:07 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

6.6 The Elastix Web interface


Its finally time to enter the Elastix Web interface. Well, I didnt really think the reader has gotten all the way here without ever entering the administration interface on the Web (at least to look around) but I wanted to say it in this way to express the importance of this moment. The Web administration interface is the component that defines Elastix. Without this component, Elastix wouldnt be what it is, since one of the product goals is the ease of use. Unless its some sort of personalized configuration, its possible from here to administrate practically everything. You can use any Internet browser to access this interface. However, since the Elastix development team mainly uses Firefox for its tests, we recommend you use this browser. When you installed your Elastix system you were asked for an IP address for your Elastix system, you need this address now. If you cant remember the address or you selected DHCP (automatically obtain an address from your router or other DHCP server) then you need to login as root at the console with the password you set. Once you do this, the system will provide you with the IP address of your Elastix system. Now enter this address into your address bar of your Internet Browser, and a screen like the one below should appear.

Login screen for the web administration interface

At the moment of installation, the system automatically generated a user named admin. This user has administration privileges and will allow us to enter for the first time. Take note that the user name is completely in lower case. The password is the same as the one you entered during the installation process (see chapter 5.) Once the name and password are confirmed, the system will show us the administration interface. The first thing well see is the Dashboard, which is basically a summary screen with some usage statistics and the actual status for the most important system processes.

http://www.elastixbook.com/en/chapters/chapter_6/6.6_The_Elastix_Web_interface.htm[24/11/2011 10:24:08 p.m.]

Unified Communications with Elastix Vol. 1

The Elastix dashboard

What we need to do next is to personalize the interface to our needs. Some suggestions are to check the language, date, system time and time zone are correct, and we could even play around a bit changing the interfaces lookand-feel. All this can be done from the menu System -> Preferences.

System preferences

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_6/6.6_The_Elastix_Web_interface.htm[24/11/2011 10:24:08 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

6.7 Network configuration


Usually the first important thing that needs to be configured after entering for the first time are the network parameters due to Elastix using a DHCP server to get IP addresses by default, and this is not ideal if we are going to implement a unified communications server. It is desirable that we use a static IP address. Configuring the network parameters can be done from the System->Network menu. Here we can configure two things, general network parameters and parameters associated to one of the network cards installed on the server, including those embedded on the mainboard.

Network parameter configuration

To edit the general network parameters click on the Edit Network Parameters button that appears on the top part of the previous screen. This will take us to another screen that is shown below:

Basic network parameter configuration

Below the meaning of each of the required fields is explained: Host: Default Gateway: Primary DNS: Secondary DNS: Server name, for example: pbx.example.org IP address for the gateway IP address for the primary Domain Name System (DNS) IP address for the secondary DNS

To edit the parameters associated with each network card we must click on the name of each interface. In our example well click where it says Ethernet 0 and well be taken to the following screen.

http://www.elastixbook.com/en/chapters/chapter_6/6.7_Network_configuration.htm[24/11/2011 10:24:10 p.m.]

Unified Communications with Elastix Vol. 1

Editing parameters associated with a network card

As we can observe here we can change the IP assigning from DHCP to static, which is what we wanted. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_6/6.7_Network_configuration.htm[24/11/2011 10:24:10 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

6.8 Overview of the Elastix Web administration interface


The Elastix Web administration interface is a complete server administration application for Unified Communications written mostly in the PHP language. In this section, we will do an overview of the most important operations that we can administrate from this interface. Also, well explain how the menus and modules in Elastix are organized.

Menus and modules


The Elastix Web interface is organized into menus. So we have the first level menus like: System, Schedule, Email, Fax, PBX, IM, etc. and we also have the second level menus, also called sub-menus. A menu can be understood as a container that serves to organize the Elastix interface. A module, however, is an Elastix component that offers us some sort of functionality. The modules are accessible by menus or sub-menus. In this way, they can be organized inside the Web interface and the user can access them by navigating through the menus. In the following example you can observe that the module Date/Time is contained inside the menu (or sub-menu) Preferences, which is contained inside the menu System. The location of the module can then be referred to as System Preferences Date/Time.

Example of a menu, sub-menu and module

On occasion the module can be contained inside a single menu, as is shown in the following figure:

http://www.elastixbook.com/en/chapters/chapter_6/6.8_Overview_of_the_Elastix_Web_administration_interface.htm[24/11/2011 10:24:12 p.m.]

Unified Communications with Elastix Vol. 1

Another example of menu and module

Note: Its important to understand the concepts of module and menu, especially if you are interested in modifying the Elastix code to perform any customization.

Navigating the Web interface


Below well navigate through the Elastix Web interface briefly explaining the meaning of each menu and module. Each first-level menu will appear at the top of a table and each sub-menu will appear in bold type. Note: Its important to mention that the following listing only includes the menus installed by default. That is, it doesnt include the menus installed through Addons like the Call Center module, or Web Conference.

System Dashboard Dashboard is a kind of desktop where the user can see a summary of Elastixs activity like the last emails, voicemails, faxes and calendar dates. The administrator has a different interface where he can also monitor the system performance and other useful functions by adding applets.

Network Network Parameters

DHCP Server DHCP Client List Assign IP Address to Host User Management Groups Users

Group Permissions

Network parameters configuration Specify IP address and network mask, gateway, host name, DNS servers, and others. Habilitates the embedded DHCP server included with Elastix Shows the list of connected DHCP clients Assigns an IP Address to a specific client Elastix User Management Specify User groups Administer users and assign them to groups. Also allows to associate email accounts and telephone extensions to users Configuration for the access permissions to the different modules by a determined

http://www.elastixbook.com/en/chapters/chapter_6/6.8_Overview_of_the_Elastix_Web_administration_interface.htm[24/11/2011 10:24:12 p.m.]

Unified Communications with Elastix Vol. 1

Shutdown Hardware Detector Updates Packages Repositories Backup/Restore Preferences Language Date/Time Themes Currency Dashboard Applet Admin

group Shuts down or reboots the server Telephony hardware detection Software package updating Package list with the option to install or update Repository configuration against which updates are made Generates backups and allows restoring of information for the Elastix server Specifies various system preferences Changes the language for the whole Elastix Web Interface Changes the date, time, and time zone Changes the themes (skins) to give the Elastix interface a different look Changes the currency symbol that is shown in billing reports Selection of the applets that are included in the system dashboard

Schedule Calendar Address Book Recordings Schedule events in calendar format that can even generate automatic telephone calls Contact address book Message recording that can be associated with events scheduled in the Calendar module

Email Domains Accounts Relay Webmail Antispam Remote SMTP Email list Email domain creation. Elastix supports multiple domains Email account administration and hard disk space quota assignment Relay configuration that allows you to use Elastix to send email from other networks Web based email client via Rouncube Allows SPAM detection in emails and adjusts its sensibility Configure email sending through a remote SMTP server Add mailing list support via Mailman

http://www.elastixbook.com/en/chapters/chapter_6/6.8_Overview_of_the_Elastix_Web_administration_interface.htm[24/11/2011 10:24:12 p.m.]

Unified Communications with Elastix Vol. 1

Fax Virtual Fax Virtual Fax List New Virtual Fax Send Fax Fax Master Fax Clients Fax Viewer Email Template Virtual Fax administration Listing of virtual fax extensions that will receive faxes in PDF format via email Creation of new virtual fax extensions Sending of a fax from the interface as a simple text or attached document Establishment of an email address that will receive notifications of fax operations Configuration of access permissions for fax client applications Fax visualization in PDF format Configuration of an email template that will be sent each time a fax arrives

PBX PBX Configuration Operator Panel Voicemail Embedded FreePBX application that allows most of the configurations at the PBX level Allows the visualization of extensions, trunks and Queues being used in real-time Voicemail listing. To see it, it must be first be associated with a user with a telephone extension Phone recording listing. To see it, it must be first associated with a user with a telephone extension Allows provisioning of a large number of telephones automatically Generate audio teleconferences Allows the creation of a large number of extensions in a short time Access to various useful tools Execution of CLI commands Test file editing Conversion from text to audio Flash based operator panel alternative. Configuration of VoIP trunks with templates for certain providers

Monitoring

Endpoint Configurator Conference Batch of Extensions Tools Asterisk-Cli Asterisk File Editor Text to Wav Flash Operator Panel VoIP Provider

IM OpenFire Embedded interface for IM administration called Openfire server

http://www.elastixbook.com/en/chapters/chapter_6/6.8_Overview_of_the_Elastix_Web_administration_interface.htm[24/11/2011 10:24:12 p.m.]

Unified Communications with Elastix Vol. 1

Reports CDR Report Channel Usage Call detail report (CDRs) with filtering options Channel use reports shows graphs by different technology type, such as SIP and IAX Set preferences for billing Establishes rates depending of the mainline and telephonic prefix History of billing with filtering options. Visualization of a pie chart of the destination distribution by cost, duration and number of calls Configuration for habilitated mainlines for billing and default rates Asterisk logs with filtering options Visualization of general data of incoming and outgoing calls in graphic format for extensions, mainlines and waiting lines Summary of incoming calls, outgoing calls and their duration for each extension in a graphic report

Billing Rates Billing Report Destination Distribution

Billing Setup Asterisk Logs Graphic Report

Summary by Extension

Extras vTigerCRM Calling Cards Downloads Softphones Fax Utilities Instant Messaging CRM System with Elastix integration Allows calling card functionality via A2Billing Recommended download listing Available softphone applications Available fax applications Available instant messaging (IM) applications

Addons Available Installed Previous List of available modules to extend Elastix functionality Listing of installed modules Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_6/6.8_Overview_of_the_Elastix_Web_administration_interface.htm[24/11/2011 10:24:12 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

6.9 User administration


As we already saw in this chapter, Elastix creates by default a user named admin that has system administrator privileges. This user can seem, at first, to be everything we need, but Elastix gives us the possibility of creating new users with different levels of privileges, allowing, in this way, for different users apart from the administrator to access the interface, but with limited privileges. For example, we could create a telephone receptionist user that can have access to the operator panel and can answer, park and transfer calls in a friendly way. We could also create a user for the auditing department with access to the different reports like call details and telephone consumption to international destinations. We could also create a user for the sales department so that they could access the integrated CRM. In general, Elastix gives us a powerful and flexible permissions system that allows us to create a user for every single employee of the company using Elastix.

User groups
Every user of the Elastix Web Interface must belong to a group. For example, the user admin that we have used before belongs to the group called administrator. This group has access to all the Elastix menus. Elastix comes with 3 default groups: administrator, operator and extension. As can be seen at first glance these groups serve to create users with administrator, operator and extension privileges respectively.

Group administration

As we can see in the previous figure, it is also possible to create new user groups. Each user group is associated with a permissions matrix that we will explain further ahead. In the same way, it is also possible to change the associated permissions matrix for the default groups. That is why in the paragraphs above we talked about a flexible permissions system.

Group permissions
Each group of users has a permissions matrix that associated the user group with the modules to which that group will have access. In this way we can configure a custom matrix for each need, only by selecting the adequate modules. This permissions matrix is configured from System Administer users Group permissions.
http://www.elastixbook.com/en/chapters/chapter_6/6.9_User_administration.htm[24/11/2011 10:24:13 p.m.]

Unified Communications with Elastix Vol. 1

Group permissions administration

User creation
Now that the concepts of user groups and permission groups have been explained, well proceed to create a new user for the Elastix Web Interface. The users module is found in System User Management Users. There well see a listing of active users and a button with the label Create New User. We click on that button and access the next screen.

New User creation screen

The following explains the meaning of each field: Login: The username. It must not contain any blank spaces. Name: The users full name. For example John Smith Password: The access password. Retype password: The password must be entered again to be verified. Group: The user group to which this user will belong Extension: The PBX extension that will be associated with the user. In this way, when the user enters the interface hell be able to see his voicemails, recordings, call details and other operations related with his extension. Webmail User: The email user name created by Elastix. Webmail Domain: The name of the email servers domain. Webmail Password: The password for the email account. Retype Webmail password: The password for the email account must be entered again so it can be verified.

http://www.elastixbook.com/en/chapters/chapter_6/6.9_User_administration.htm[24/11/2011 10:24:13 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_6/6.9_User_administration.htm[24/11/2011 10:24:13 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

7
Basic PBX Configuration
Education is to elevate man to the level of his own time. -- Jos Mart The PBX feature is one of the most important in Elastix. In this chapter well explain how to configure a basic PBX using only the Elastix Web interface. Once done with the PBX configurations well be able to make calls between extensions and use some interesting features like voicemail or music-on-hold. In the following chapters well learn how to connect this PBX to the external world so we can use it in a practical way.

7.1 Creating an extension


Defining and editing extensions is probably the most common task done by a PBX administrator. In version 2.0 of Elastix its possible to create five kinds of devices or supported technologies to define an extension: SIP, IAX2, DAHDI, Custom and Virtual. To create a New Extension we must enter the PBX Menu. By default you enter into the PBX Configuration section when you select the PBX menu. In this section we choose from the left panel the option Extensions. Now we can create a new extension. First choose the device from among the available options:

http://www.elastixbook.com/en/chapters/chapter_7/7.1_Creating_extension.htm[24/11/2011 10:24:15 p.m.]

Unified Communications with Elastix Vol. 1

Creating a new extension

Generic SIP Device: SIP is the standard protocol for IP phones and ATAs. Most IP phones support SIP. Generic IAX2 Device: IAX is the Inter Asterisk Exchange protocol, a new protocol supported today by some devices. Generic ZAP Device: This device is associated with DAHDI channels. Its a hardware device connected to the Elastix server. Other (Custom) Device: Custom allows us to directly write an input into the configuration files, and it follows that this input must be in the format of an extension that Asterisk will understand. It can also be used to relate an extension to an external number. For example, to route the extension 211 to the number 1-800555-1212 you can create a Custom extension with the number 211 and in the text box of the dial field you can input: Local/18005551212@outbound-allroutes. None (virtual exten): Adds the capacity to create a virtual extension Below well see the a form that varies a bit depending on what weve chosen previously. Well assume that the user has chosen SIP since its the most common.

http://www.elastixbook.com/en/chapters/chapter_7/7.1_Creating_extension.htm[24/11/2011 10:24:15 p.m.]

Unified Communications with Elastix Vol. 1

New SIP extension creation form

As we can observe you can configure here many interesting things but not all the data is necessary to get a functional extension so we will only explain the most important ones. User Extension: It must be unique. This is the number that can be dialed from any other extension. It can be any length but, usually, an extension of two or three digits is used. Display Name: Its the Caller ID name so that the calls by this user can be identified by a name. You only need to enter the name, not the extension. Secret: This is the password used by the telephony device to authenticate with the Asterisk server in Elastix. This is configured generally by the administrator before giving the user the telephone and generally, its not required for the user to know it. If the user is using a softphone, then he will need to know this password to configure his software.

IP telephone configuration
To test if the extension created so far works correctly we need to configure an IP phone so that it will register on the Elastix server (with the created access credentials.) If the reader wants to try this now he can go the chapter 9 of this book, where its explained in detail how to configure a physical IP phone as well as a softphone installed on your computer. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_7/7.1_Creating_extension.htm[24/11/2011 10:24:15 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

7.2 General configurations


In this section, you can configure general parameters of the Elastix system in regards to telephony. To access general configuration we must go to the PBX General Configuration menu. Here we will see the following screen:

General configuration modification form

Below the options of this screen will be explained: Dial Options: Well explain this in detail briefly.

http://www.elastixbook.com/en/chapters/chapter_7/7.2_General_configurations.htm[24/11/2011 10:24:17 p.m.]

Unified Communications with Elastix Vol. 1

Company Directory options Find users in the Company Directory by: You can listen to the directory of a business by dialing *411 or # when you listen to an IVR. This option configures in which way the users in the directory are located. There are 3 ways: spelling the first 3 letters of the last name, spelling the 3 last letters of the first name, and spelling the 3 first letters of the first name and last name at the same time. Announce Extension: When activated the message plays: Please stay on the line while I transfer your call to extension XXX. That is, it mentions the extension to which the call will be transferred. This is useful in cases where the user doesnt previously know the extension to which he is being transferred, for example when the option to be transferred to a sales representative is dialed (ie, option 3). In these cases, it can be useful for the caller to know the extension to which he was transferred so he can remember for future calls so he can skip the IVR. Operator Extension: Here you must enter the operator extension, which will be the destination if the caller presses zero 0. This destination can be an extension, a group of extensions, or even an external telephone number. Security Settings: Allows Anonymous Inbound SIP calls. The default setting is no. Unless you know the security implications of this option, it is recommended that this be left as no. Online updates: Check for Updates. Allows automatic checking for available updates. The default setting is Yes.

Dial Options
As is observed in the previous figure, most of the time this field is filled with the letters tr. Here there have really been two options entered, the t option and the r option, which means that the person that receives the call can transfer it and that additionally a ring tone will be sent back to the caller. Below is a list of all available options. A(X): Plays a message to the called person, using X as the file. D(digits): Sends a sequence of DTMF digits after the destination has been answered. h: Allows the called person to hang up by sending the digit * H: Allows the caller to hang up by sending the digit * r: Sends a ring tone to the calling party. T/t: Allows the parties (caller/called) to transfer calls. W/w: Allows the parties (caller/called) to start recording of the ongoing call, the default code to start call recording is *1. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_7/7.2_General_configurations.htm[24/11/2011 10:24:17 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

7.3 Queues configuration


Queues consist of user groups for which there are certain policies (or strategies) defined, mainly in regards to incoming calls. Queues can be created as an extension. The Queue extensions can be static, called members (that is, they have a fixed extension number) or dynamic users, called agents (that is, they can enter the Queue from any extension.) A policy or strategy defines the way in which incoming calls are distributed to the Queues between members or agents. The Queue policies that Asterisk currently supports are the following: Ring All (ringall): Rings the extensions of all agents until one answers. This is the default option. Agent with least recent call (leastrecent): Rings the extension of the agent that answered a call least recently for this Queue. Agent with the fewest calls (fewestcalls): Rings the extension of the agent that has answered the least number of calls in this Queue. Random (random): Rings extensions randomly. Round Robin with Memory (rrmemory): Rings the extension of each agent in a sequential manner, but remembers which agent answered the last call to ring the next agent when the next call comes in. Linear (linear): Rings the agents extensions in the specified order or in the order in which the agents have logged into the Queue. Weighted Random (wrandom): Rings the agents extensions in a random manner but using a penalty as a probability measure. To configure the Queue in Elastix we must go to the PBX Module and choose the menu named Queues. To add a new Queue we must fill in the following form:

http://www.elastixbook.com/en/chapters/chapter_7/7.3_Queues_configuration.htm[24/11/2011 10:24:18 p.m.]

Unified Communications with Elastix Vol. 1

Form for adding a new waiting line

Queue Number: This is the number that must be dialed to enter the Queue. Queue Name: Name for the Queue. This is used only for identification purposes. Queue Password: A Queue can have a password. Any caller attempting to enter that Queue must dial that password. CID Name Prefix: Since an agent can start a session and answer calls from several Queues at once, its useful to add a Caller ID prefix to the calls so that when the agent receives the incoming call on his telephone, he can know through this CallerID that the call belongs to a determined Queue. Static Agents: These are the extensions that will always answer calls that arrive at the Queue. Dynamic Members: Here we specify members that dont use a fixed extension to answer calls from the Queue, but that must initiate their session in the Queue and then can answer from any extension that is available.

http://www.elastixbook.com/en/chapters/chapter_7/7.3_Queues_configuration.htm[24/11/2011 10:24:18 p.m.]

Unified Communications with Elastix Vol. 1

Agent Announcement: This is an announcement that is reproduced for the agent before a call is transferred to him. This is useful for when agents dont have Caller ID on the telephone and wish to know that a call comes from a specific Queue. Music on Hold Class: Makes it possible to choose what kind of music will be reproduced for the caller while he is in the Queue for an agent. Max Wait Time: It is the maximum time that a call will stay in the Queue. The action to be taken when this time is up is configured in the in case of failure destination section. Max Callers: It is the maximum number of people allowed to wait in the Queue. If this number is reached, the excess calls will be rerouted to the destination configured in in case of failure destination. Join Empty: If you wish callers to enter an empty Queue (without agents,) then you have to change this parameter to yes. This is not recommended. Leave When Empty: Change it to yes if you wish to stop more calls from coming in at the moment when the last attending agent has left the Queue. Ring Strategy: There are 7 types of ringing strategy, which were explained previously: - ringall - leastrecent - fewestcalls - random - rrmemory - linear - wrandom Agent Timeout: The time an extension will ring for each agent in the Queue before it is sent to another agent. Retry: The time the system will wait after having made all the extensions ring for all member agents before calling them all again. Wrap-Up-Time: After a successful call, indicates the number of seconds before declaring the agent free and sending him a new call. The default value is 0. Call Recording: Option to record calls coming into the Queue
http://www.elastixbook.com/en/chapters/chapter_7/7.3_Queues_configuration.htm[24/11/2011 10:24:18 p.m.]

Unified Communications with Elastix Vol. 1

Fail Over Destination: This is the destination if an agent couldnt attend a call in the Queue. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_7/7.3_Queues_configuration.htm[24/11/2011 10:24:18 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

7.4 IVR and the recording system


Recording of the welcome message
Before creating an IVR its necessary to already have a recorded message that will be reproduced when a call is attended by that IVR. You have two options for this: recording the message from your own extension or loading a previously recorded audio message. The first option is without a doubt the most comfortable since we can record from the same telephone if the time is short. However, the second option gives us the possibility of loading an audio file produced in a studio. There are companies dedicated to providing these voice recording services for IVRs and depending on our budget they can include professional voice actors, background music, sound effects, and other features. To access this module go to the PBX menu and youll get by default the PBX configuration section, choose in the left panel the option System Recordings.

System Recordings

As previously mentioned, the first option allows us to record the audio directly from a functioning extension. For this we enter the extension number from which we want to record into the box that says If you wish to make and check recordings from your phone, please enter your extension number here, in this case we will use the extension 201 and click on the Go button. After doing this, Asterisk will wait for our recording on extension 201. To continue, we pick up the phone on the

http://www.elastixbook.com/en/chapters/chapter_7/7.4_IVR_recording_system.htm[24/11/2011 10:24:20 p.m.]

Unified Communications with Elastix Vol. 1

entered extension and dial *77, a beep will be heard which indicates that we can start to record our message. When we are finished recording we press the # key (pound.). We do this for two reasons, one is that it sounds more professional than hanging up with the handset, as there is nothing worse than handset hangup noise at the end of the recording, and two, the system will provide you more options in relation to the recording which are described in the next paragraph To check our recording from this same telephone we dial *99 and it will playback the message as recorded. If you are happy with the result then the next step is to assign a name to the recording in the corresponding box and clicking on the Save button. The second option that we have is to load a recording created by another application. For this we need to have an audio file in a format supported by Asterisk. In the same previous menu click on the button Choose File so we can search for our file and then proceed to name this recording. Finally we click on Save.

Configuring a welcome IVR


The IVR allows us to receive an incoming call and produce a welcome message. We can also have an interactive menu through the telephone pad, through the 10 digits, the # symbol (pound) and * (asterisk). With this its possible to route the call to another destination or back to the IVR that sent the announcement. To access the IVR module, head to the PBX Menu and the PBX Configuration section will appear by default. In the left panel choose the IVR option. To record a welcome message, as was explained in the previous section, you must go to the System Recordings menu and proceed to the recording of a message. For the creation of an IVR its not necessary to fill in all the fields, since in our case (a welcome IVR), we won need options. The necessary fields are as follows: Change Name: Give the IVR with a distinctive name. Timeout: Waiting time (in seconds) before routing the call to an operator after having played the prerecorded message. Turn on direct dialing: This option allows the caller to dial an internal extension without having to wait for the operator to answer. Announcement: It's the announcement or message that you recorded previously. It will show up on a list with all available messages. Then you must proceed to configure what will be the destinations of the calls according to the digit that the caller pressed on his phone. For example, generally the digit 0 (zero) makes the call to be sent to the operator extension. Its possible to configure destinations for the numbers from 0 to 9.

http://www.elastixbook.com/en/chapters/chapter_7/7.4_IVR_recording_system.htm[24/11/2011 10:24:20 p.m.]

Unified Communications with Elastix Vol. 1

IVR creation form

Among the available menu options, in the left part there is a box in which you must enter the digit corresponding to the IVR option. Then you must choose which one will be the call destination. Here you can choose from among various modules that are available in FreePBX, sending the call to a Queue that is already defined, or to another IVR, to a ring group, a specific extension, etc. Note that only the options that you have configured already will show up as destinations. If you have not setup any ring groups, then Ring Groups will not show up as a destination. Finally we save the IVR just created by clicking on the Save button. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_7/7.4_IVR_recording_system.htm[24/11/2011 10:24:20 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

7.5 Conference rooms


Elastix can administrate two kinds of conference room: Permanent conference rooms and temporary conference rooms. The first kind can be administered under the PBX PBX Configuration Conferences menu, while the second can be administered under the PBX Conferences menu. Conference rooms are nothing else but a virtual extension through which you can interconnect several calls at the same time, giving the illusion of being in a conference with many people talking at the same time. A permanent conference room is one that has a definitive pre-assigned number. For example, lets suppose that we want to create the 88999 room and assign it to the Operations Manager. From now on the Monday morning telephone reunions can be realized simply by dialing 88999 when the agreed time comes and all the participants know that that room number wont change from Monday to Monday. A temporary conference room is created, as is obvious, for temporary ends. For example, the company will participate in a product demonstration abroad and wants to schedule a series of reunions between the suppliers and external assessors so that they can come to an agreement on different topics. So its decided to assign a conference room for each assessor so that they can coordinate the conferences that they think necessary. Logically we dont want the rooms to be permanent but to expire after the convention since theyre not permanent workers for the company.

Conference listing

In the present section well explain how to administrate temporary conferences. To enter the conference module you will be able to observe all the concurrent conferences. To visualize past or future conferences you must select the corresponding option in the State box and clicking on Show. Also provided is a filter used on the conference names. To delete one or more conferences we must select them and click on the Delete button. If you wish to add a new conference, click on the New Conference button.

http://www.elastixbook.com/en/chapters/chapter_7/7.5_Conference_rooms.htm[24/11/2011 10:24:21 p.m.]

Unified Communications with Elastix Vol. 1

Creation of a new conference

The required fields to add a new conference are: Conference Name: Necessary to identify the conference Conference Number: A random number is provided for the conference. You can change it if its not being used by another conference Start Time (PST/PDT): Starting time for the conference Max Participants: No more participants can be invited once the maximum number of participants is reached. To see a conferences details you can click on the conference name. Below well show the way to administer temporary conferences. To administer a concurrent conference click on the participants link corresponding to that conference. To invite someone to the conference you must chose them from the provided list (list of available extensions) and click on the Invite Caller button. You will have to wait until the call is answered. Once youve invited someone to the conference they will start to appear on the report. If you wish to silence one or various guests, select them in the Mute column and click on this button (Mute). You can also expel from the conference one of various guests by clicking on them in the Kick column and clicking on this button (Kick). If you wish to expel all the guests in the conference then click on Kick all. If someone you invited isnt showing up on the guest list or someone you kicked is still showing on it, click on the Update button. This button will also refresh the time each guest has been in the conference. Note that once you click on the Mute button the guests state will be refreshed, the possible states are: Muted and UnMuted. To return to the administration interface for all the conferences click on Cancel. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_7/7.5_Conference_rooms.htm[24/11/2011 10:24:21 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

7.6 Call parking


Call Parking is a virtual extension with waiting music. That is, if you call that extension you will hear music on hold. This action is called parking a call. This feature is very useful when we answer a call and must transfer it to an extension to which we still dont know the final destination number. For example, an important call comes in for the Business manager and he isnt in his office. Due to its importance, the operator has to find him, so while she looks for him she can transfer the caller to Call Parking extension so that the caller can wait comfortably with music on hold. Of course, many will say that it could simply be put on hold but this would occupy the receptionists telephone extension possibly blocking new calls from being answered by the receptionist. Once the missing manager is found he can be told that he has a call parked on extension 71, for example. Then, the manager himself can un-park that call by ringing that parked call extension and restart the conversation from his own extension or from the nearest extension.

Configuration of Call Parking

Enable Parking Lot Feature: By selecting this option you will authorize the call parking feature. Parking Lot Extension: Indicates the extension at which you must call to send a call to park it. Generally it indicates the first slot of call parking channels. Depending on the number of parking slots will be how many numbers you have for this feature. Number of Slots:

http://www.elastixbook.com/en/chapters/chapter_7/7.6_Call_parking.htm[24/11/2011 10:24:23 p.m.]

Unified Communications with Elastix Vol. 1

Indicates the number of slots available for call parking. This number represents how many extensions are available for parking a call. Parking Timeout: The period of time that a call can last parked. If the call reaches this time in the parking room the call will be returned to the extension from where it was sent to parking. Parking Lot Context: This is the context that will affect the behavior of parked calls. By default this contains the context parked calls and should not be changed. Destination for Orphaned Parked Calls: This is for configuring the destination of a call that exceeds the maximum time that a call can be parked (as configured in parking timeout). Some of the possible destinations can be: an announcement, an IVR, terminate the call, an extension, a queue, a conference or a personalized application. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_7/7.6_Call_parking.htm[24/11/2011 10:24:23 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

7.7 Music on Hold


In this section its possible to configure the Music On Hold categories that will be available for the different features that use Music on Hold (e.g. Queues, Calls put on Hold, Conference rooms, etc). The user will hear the successive playing of the files defined here as background music while they wait to be attended. To upload a WAV or MP3 file: Simply with the Choose File button you can select the file (in mp3 or wav format) from your local PCs hard disk. Then you must click on Upload and the file should appear on the MOH (Music-On-Hold) file list that is shown below the file loading option. Its possible to adjust the volume for loaded files using the option Volume Adjustment that is found under the Choose File button.

Music on Hold administration form

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_7/7.7_Music_on_Hold.htm[24/11/2011 10:24:24 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

7.8 Operator panel


Since Elastix 2.0 the Elastix Operator Panel (EOP) has been incorporated as an alternative to the existing Flash Operator Panel (FOP.) The reason why EOP was introduced was because the new version of FOP (FOP2) requires a license type that is incompatible with the present Elastix license (GPL version 2). In general the operator panel allows the visualization of the state of extensions, trunks, Queues, conference and parking rooms in the system, all in real-time. Its a very useful application for a receptionist. To gain access to the Elastix Operator Panel go to the PBX menu and click on the Operator Panel utility.

Elastix operator panel

Additionally, in Elastix 2.0 the original Flash Operator Panel is still available in the PBX menu in the Flash Operator Panel sub-menu.

Flash Operator Panel

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_7/7.8_Operator_panel.htm[24/11/2011 10:24:26 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

7.9 Call transfer operations


By default, in Elastix the call transfer operations are configured as follows:

Blind transfer
To transfer a call blindly you must dial ## followed by the extension number to which you will transfer the call.

Attended transfer
To transfer a call with attendance you must digit *2 followed by the extension. If you wish to change these codes go to the PBX PBX Configuration menu and choose the Feature Codes menu. There you will have the options In-Call Asterisk Attended Transfer and In-Call Asterisk Blind Transfer where you can change the assigned code for transfers both attended and blind respectively.

Feature codes

Note: The transfer methods provided above are the Asterisk standard methods of transferring a call. It should also

http://www.elastixbook.com/en/chapters/chapter_7/7.9_Call_transfer_operations.htm[24/11/2011 10:24:28 p.m.]

Unified Communications with Elastix Vol. 1

be noted that many IP Phones now have their own methods for transferring the calls as well which do not necessarily utilize the above codes. The IP phones that use their own transfer mechanisms are utilizing the SIP Transfer commands. You can choose the most reliable for your environment, but in an environment where older analog phones are used, which have no transfer capability, using the Asterisk method of transfer is the only option available to them. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_7/7.9_Call_transfer_operations.htm[24/11/2011 10:24:28 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

8
Hardware configuration
We cannot always oblige; but we can always speak obligingly. -- Voltaire Even though Elastix can work without any need for telephony hardware to be installed, telephony hardware is necessary if a direct connection to certain telephony networks, such as the PSTN, is required. Its installation and configuration is simplified with Elastix because it has a specialized Web interface that makes this task much easier. In this chapter we will be basically talking about PCI cards (or PCI express.) However, other devices can be used to connect to the PSTN like gateways, which work through IP, or channel banks that can even operate through USB.

8.1 Types of cards and manufacturers


In this section well basically be talking about telephony cards, also known as interface cards. This hardware is available both for analog and digital telephonic networks and inside each of these categories there are also the following subcategories: Analog FXO FXS Digital E1/T1/J1 BRI There are many hardware options that are compatible with Elastix, so we should have no problem finding one that
http://www.elastixbook.com/en/chapters/chapter_8/8.1_Types_cards_and_manufacturers.htm[24/11/2011 10:24:28 p.m.]

Unified Communications with Elastix Vol. 1

adapts to our needs. To make the decision even easier, Elastix has a hardware certification program that takes charge of put each model through many diverse tests to determine its compatibility with Elastix in agreement with the certification program criteria. The list of certified hardware is publicly available at the following link: http://www.elastix.org/en/product-information/certified-hardware.html Here we wont only find interface cards but also IP telephones, gateways, intercoms, channel banks, security cameras and appliances. Its also worth noting that if a determined model isnt listed it doesnt necessarily mean that its not compatible with Elastix. Since the certification program stipulates that the testing process can only be done by explicit request from the manufacturer, it could be the case that the model were looking for hasnt been turned over to the certification process by the manufacturer. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_8/8.1_Types_cards_and_manufacturers.htm[24/11/2011 10:24:28 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

8.2 Hardware installation for telephony hardware in Elastix


Installing telephony hardware in Elastix is a relatively easy task. However, its necessary to have some concepts clear before beginning so that we dont get confused. To install telephony hardware in Elastix we must follow the following steps: 1) Physically install the hardware 2) Detect the hardware drivers 3) Configure the Asterisk hardware Each of these tasks will be explained below. Previous Go to Index Next

http://www.elastixbook.com/...chapters/chapter_8/8.2_Hardware_installation_for_telephony_hardware_in_Elastix.htm[24/11/2011 10:24:29 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

8.3 Physical installation of a card


This doesnt involve any complicated task, just the obvious precautions when installing electronic cards in your computer, like having turned off and completely disconnected the power, using an electrostatic discharge device, etc. Note: In the case of FXS hardware installation, its quite common to have to connect a power cable to the card since we should remember that FXS interfaces need to give electric power to the devices connected to them.

Analog modular telephonic card with 3 FXO and 2 FXS ports installed

In the above figure we can observe in the lower right hand corner the Molex type connector that serves to give the card additional power in case we use FXS modules. After installing the card we turn on the computer and we should see the card listed on the PCI bus level. As an exercise we could try using the lspci command (at the Linux prompt) before and after installing the card to see the difference.

Modular hardware
There are manufacturers that design their hardware in a modular way, so that it can be expansible. The modules are socketed and can be added and removed with careful applied pressure. For example, lets take a look at the analog card in the following image with a capacity for up to 8 ports. You can clearly see the modules and that the manufacturer has differentiated them: the FXO modules are red and the FXS are green.

http://www.elastixbook.com/en/chapters/chapter_8/8.3_Physical_installation_card.htm[24/11/2011 10:24:31 p.m.]

Unified Communications with Elastix Vol. 1

The same card from the previous image with an FXS module extracted

There are also other kinds of cards where even the echo canceller is a module that can be installed easily. In this way you can get a card with or without hardware echo cancelling. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_8/8.3_Physical_installation_card.htm[24/11/2011 10:24:31 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

8.4 Hardware detection


Once the card has been installed, its time for the drivers to detect it. The most important telephony driver in Elastix is named DAHDI (its really a group of drivers). We wont go into a lot of detail about DAHDI for now since the Web administration interface will allow us to remove ourselves from the drivers work. However, later on well explain a bit more thoroughly the operation of DAHDI and how it relates to Asterisk. Note: We should mention that DAHDI isnt the only telephony driver in Elastix. Even if most hardware manufacturers use DAHDI (or have integrated their drivers inside DAHDI,) there are also manufacturers that provide different drivers like is the case of Sangoma or Rhino Equipment. These drivers are also integrated with Elastix. In the first versions of Elastix the task of detecting hardware was done manually executing some commands from the computer terminal. Now it is done with a Web interface that automatically detects hardware and graphically shows us the detected hardware. This interface can be reached from the System Hardware Detector menu. To detect new hardware its enough to press the Detect New Hardware button.

Deteccin de Hardware Elastix 2.0

In that menu you have the following options: Replace file chan_dahdi.conf: This file creates a /etc/asterisk/chan_dahdi.conf file in addition to the ones required for the DAHDI system (/etc/dahdi/modules.conf and /etc/dahdi/system.conf) that will be processed by Asterisk, containing the configuration of any cards that are detected. Detect Sangoma hardware: This option activates the function of the wanrouter daemon provided by SANGOMA manufacturers for the recognizing of their hardware and its integration with DAHDI modules. Detect ISDN hardware: This is an option inherited from previous versions of Elastix, used exclusively for the detection of mISDN type hardware. Usually this option is used for the detection of BRI cards by Digium and their clones. For analog and digital telephony cards there is an option on the Web GUI for enabling echo cancelling (softwarebased) that will be used for each port on the card. To configure echo cancelling click on Configuration of Span.

http://www.elastixbook.com/en/chapters/chapter_8/8.4_Hardware_detection.htm[24/11/2011 10:24:33 p.m.]

Unified Communications with Elastix Vol. 1

Then the particular configuration for the card will be entered showing each of the ports for the same and a deployable menu for the election of the required algorithm require by each port. Supported algorithms are: OSLEC, MG2, KBL, SEC, and SEC2. Note: The most commonly used algorithm is OSLEC. You can find more explanation about the echo cancelling algorithms and OSLEC in chapter 13.

Echo cancelling algorithms by port

In the following section, all of the necessary synchronization parameters for digital cards will be explained in more detail. Once the hardware detection action is executed, Elastix creates configuration files with the entered information, adding additional information that will consider it as usually correct, named as by default. With this default configuration, the user could modify parameters specific to his environment, so that the telephony hardware is adjusted to his particular environment. These low-level configurations are explained in the next section. Note: At the time of writing, if you press the detect hardware button ALL cards will be redetected and their default setting rewritten. If you had already configured the card previously this configuration will be rewritten. Do not forget to make the necessary backups. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_8/8.4_Hardware_detection.htm[24/11/2011 10:24:33 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

8.5 Telephony hardware configuration on the Asterisk level


Up until this moment, the hardware we have configured isnt connected with Asterisk in any way (unless the Replace chan_dahdi.conf button was selected.) Asterisk by omission does not know if the new hardware has been detected by DAHDI unless it is specified through the /etc/asterisk/chan_dahdi.conf file. We should realize that Asterisk and DAHDI are two separate software packages that know nothing about each other unless we communicate it to them explicitly. Let us see below a simplified view of how Asterisk and DAHDI communicate.

Simplified diagram of how Asterisk and DAHDI are related

We can see in the previous diagram that Asterisk is related to DAHDI through a module (the Asterisk module) called chan_dahdi.so and that this module needs the /etc/asterisk/chan_dahdi.conf file to know how to correctly communicate with DAHDI. Note: Further ahead, we will go into more detail about the /etc/dahdi/system.conf file shown in the previous diagram. Before going into detail about the configuration of the chan_dahdi.conf file we need to mention that an easy and automatic way of configuring our hardware on the Asterisk level is by pressing the Replace chan_dahdi.conf button. As the reader will assume, this action replaces the chan_dahdi.conf file with a generic one. However, in most cases the configuration written in this file will only be useful as an example or as a starting point since Elastix doesnt have any way of knowing how we want to group our telephony channels or other settings that depend on our specific environment and that are configured in that file. Below well explain how to adequately configure the chan_dahdi.conf file.
http://www.elastixbook.com/en/chapters/chapter_8/8.5_Telephony_hardware_configuration_on_the_Asterisk.htm[24/11/2011 10:24:34 p.m.]

Unified Communications with Elastix Vol. 1

Configuration of the chan_dahdi.conf file


Asterisk comes with a module called chan_dahdi.so that allows it to communicate with the DAHDI drivers and in this way connect Asterisk to the telephonic hardware. This module is configured through the chan_dahdi.conf file. In the chan_dahdi.conf file basically the signalization of voice channels is configured and they relate to Asterisk channels with circuits or telephonic lines defined in the driver configuration. These channels can be grouped into what is known as trunks. Note: The configuration of DAHDI drivers mainly resides in the /etc/dahdi/system.conf file. This file was written automatically when we realized the hardware detection from the Web interface. That is, if I have 15 circuits or telephony lines that terminate on the telephony hardware on your server, you can control them through Asterisk and trunk them. For example, dividing these lines into 3 trunks due to your client having 3 departments e.g. sales, support and finance. Lets first see a simple chan_dahdi.conf file so we can see the most important parameters and then well continue by explaining some of these parameters.
[trunkgroups] [channels] context=from-pstn signalling=fxs_ls ; trunk #0 group=0 language=es callprogress=no context=from-pstn channel=1-5 ; trunk #1 group=1 language=es callprogress=no context=from-pstn channel=6-10 ; trunk #2 group=2 language=es callprogress=no context=from-pstn channel=11-15

As your can see above, weve configured three trunks. Each trunk starts with the word group and is assigned a numerical identifier. In general you would start with the number zero.

http://www.elastixbook.com/en/chapters/chapter_8/8.5_Telephony_hardware_configuration_on_the_Asterisk.htm[24/11/2011 10:24:34 p.m.]

Unified Communications with Elastix Vol. 1

Inside each trunk you can repeat the global values (that is, those that are in the header, outside the trunk definition) and these values overwrite the former. For example, the signalization for a specific trunk could be overwritten. Some important parameters:

signaling This parameter defines the signaling for each channel or group of channels. The most common one well see for analog circuits is fxs_ls and for digital circuits pri_cpe. The following represents the possible values for this parameter: em: E & M Immediate Start em_w: E & M Wink Start em_e1: E & M CAS signalling for E1 lines featd: Feature Group D (The fake, Adtran style, DTMF) featdmf_ta: Feature Group D (The real thing, MF (domestic, US)) through a Tandem Access point fgccama: Feature Group C-CAMA (DP DNIS, MF ANI) fgccamamf: Feature Group C-CAMA MF (MF DNIS, MF ANI) featdmf: Feature Group D (The real thing, MF (domestic, US)) featb: Feature Group B (MF (domestic, US)) fxs_ls: FXS (Loop Start) fxs_gs: FXS (Ground Start) fxs_ks: FXS (Kewl Start) fxo_ls: FXO (Loop Start) fxo_gs: FXO (Ground Start) fxo_ks: FXO (Kewl Start) pri_cpe: PRI signalling, CPE side pri_net: PRI signalling, Network side (for instance, side that provides the dialtone) sf: SF (Inband Tone) Signalling sf_w: SF Wink sf_featd: SF Feature Group D (The fake, Adtran style, DTMF) sf_featdmf: SF Feature Group D (The real thing, MF (domestic, US)) sf_featb: SF Feature Group B (MF (domestic, US)) e911: E911 (MF) style signalling. Originating switch goes off-hook, far-end winks, originating sends KP911-ST, far-end gives answer supervision, Originating-end sends KP-0-ANI-ST The following are used for Radio interfaces: fxs_rx: Receive audio/COR on an FXS kewlstart interface (FXO at the channel bank) fxs_tx: Transmit audio/PTT on an FXS loopstart interface (FXO at the channel bank) fxo_rx: Receive audio/COR on an FXO loopstart interface (FXS at the channel bank) fxo_tx: Transmit audio/PTT on an FXO groundstart interface (FXS at the channel bank) em_rx: Receive audio/COR on an E&M interface (1-way) em_tx: Transmit audio/PTT on an E&M interface (1-way) em_txrx: Receive audio/COR AND Transmit audio/PTT on an E&M interface (2-way) em_rxtx: same as em_txrx (for our dyslexic friends)

http://www.elastixbook.com/en/chapters/chapter_8/8.5_Telephony_hardware_configuration_on_the_Asterisk.htm[24/11/2011 10:24:34 p.m.]

Unified Communications with Elastix Vol. 1

sf_rx: Receive audio/COR on an SF interface (1-way) sf_tx: Transmit audio/PTT on an SF interface (1-way) sf_txrx: Receive audio/COR AND Transmit audio/PTT on an SF interface (2-way) sf_rxtx: same as sf_txrx (for our dyslexic friends)

switchtype This parameter is for digital circuits and specifies the kind of PRI switch used. The most common is national and euroisdn depending clearly on which country we are in. The telephone company should provide this data, so we should feel free to ask. The possible values are the following: national: national ISDN type 2 ni1: national ISDN type 1 dms100: Nortel DMS100 4ess: AT&T 4ESS 5ess: Lucent 5ESS euroisdn: EuroISDN qsig: Protocol used in ISDN Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_8/8.5_Telephony_hardware_configuration_on_the_Asterisk.htm[24/11/2011 10:24:34 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

8.6 Digital interface configuration using the DAHDI configuration files


The Web based hardware detection tool that is included in Elastix allows us to detect hardware easily. However, even though the tool can successfully configure digital hardware in many cases, we need to take into account that the tool configures using default parameters and may need to be customized according to the real environment your server is in. The changes need to be made directly in the configuration files, so that will require a deeper knowledge at this level. Note: In this section, were basically talking about T-Carrier and E-carrier circuits based on DAHDI drivers.

DAHDI driver configuration


The telephony driver that we install on the Elastix server should be recognized by the drivers (ex. DAHDI) and then be activated in the Asterisk configuration. DAHDI reads your configuration mainly from the /etc/dahdi/system.conf file. For digital interfaces, the /etc/dahdi/system.conf file must define spans. A span is a group of digital channels. Usually a span represents a digital port on the card. For example, if a card has 4 E1 ports then usually we should define 4 spans, one for each port. A span defines in one line, which has the following format:
span=(spannum),(timing),(LBO),(framing),(coding)

Spannum It is a unique numeric identifier to tag the span. You must start from the number 1 and go up sequentiallyin increments of one. Timing Its a digit that defines the way the span synchronization will be handled. The possible values are as follows: Value 0 Meaning . DAHDI will provide synchronization timing and send it to the other side. This is most common when you connect through this span to an old PBX to which you need to provide synchronization. Normally, if you are connected to a telephony company, we should have no span with

http://www.elastixbook.com/...rs/chapter_8/8.6_Digital_interface_configuration_using_DAHDI_configuration_files.htm[24/11/2011 10:24:35 p.m.]

Unified Communications with Elastix Vol. 1

1 2 3,4,5,,n

this timing value. Span uses (Telco/Carrier) as primary source of timing synchronization. Span uses (Telco/Carrier) as secondary source of timing synchronization. Span uses (Telco/Carrier) as tertiary, quaternary. etc. source of timing synchronization.

Note: Only the value 0 can be repeated. The rest of the values starting from one should NOT be repeated. LBO (Line Build Out) It is a digit that represents the length of the cable between the card and the device (modem) provided by the telephony company. It can usually be left at 0 with no problem. However, if we have a very long cable we should check the following table: Value 0 1 2 3 4 5 6 7 Length of the cable or attenuation level 0 dB / 0 - 133 feet 133 - 266 feet 266 399 feet 399 - 533 feet 533 - 655 feet -7.5 dB -15 dB -22.5 dB

Framing As well remember, the digital communications protocols T-Carrier and E-Carrier divide information into frames, where each frames transports a determined number of timeslots. These frames can be of different formats and thats what is defined here. The possible values for T1 are d4 or esf, while for E1 they are cas or ccs. Coding It is necessary to code sent information to make it less susceptible to errors because the data itself is used as a synchronization source (or clock). You can lose that synchronization if long rows of zeros are sent (long segments with no voltage variation). To avoid this, the data is codified to avoid transmitting these long rows of zeros. For example, b8zs means Bipolar with 8 Zeros Substitution. The possible values for T1 are ami or b8zs, while those for E1 are ami or hbd3. For E1 you may also need to add error-checking crc4 (Cyclic Redundancy Check 4-bits). After making the changes to the system.conf file, it will be necessary to reboot the DAHDI daemon. If everything has been correctly configured, DAHDI has the lsdahdi command, which can be executed from the Linux operating system console that will show the configured cards and their respective channel state. If even though everything is correctly configured you may still receive alarm signals or errors. Make sure that there are no problems with the physical cabling or the digital trunk provider, who may have a problem on their side. Be aware too, that depending on the carrier, or even the termination equipment that they provide, you may need to
http://www.elastixbook.com/...rs/chapter_8/8.6_Digital_interface_configuration_using_DAHDI_configuration_files.htm[24/11/2011 10:24:35 p.m.]

Unified Communications with Elastix Vol. 1

use a reverse (crossover) cable. These are not the same as an Ethernet Crossover cable. Previous Go to Index Next

http://www.elastixbook.com/...rs/chapter_8/8.6_Digital_interface_configuration_using_DAHDI_configuration_files.htm[24/11/2011 10:24:35 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

8.7 DAHDI details


In this section, we list the names of the most important files that come as a part of the DAHDI and a brief description of each one of them.

Configuration files DAHDI files /etc/dahdi/system.conf Description Configuration file where the signalization for each telephony port is detailed This file is really an Asterisk configuration file that is used to tell Asterisk to which DAHDI channels to connect and how. This is a file used by the DAHDI startup script (/etc/init.d/dahdi). This file contains the names of the DAHDI drivers which are present in our system (let us remember that DAHDI is composed of several drivers.) This file is read by the DAHDI startup script to know which drivers it needs to load and in this way to not load all the drivers, but only the ones that are necessary.

/etc/asterisk/chan_dahdi.conf

/etc/dahdi/init.conf /etc/dahdi/modules

DAHDI kernel modules DAHDI kernel module dahdi.ko dahdi_dummy.ko Description Kernel module (driver) that contains DAHDIs main operation Necessary driver to provide Asterisk with a timing source when we dont have installed cards, due to cards having a timing source via hardware.

DADHI Asterisk modules Asterisk DAHDI module chan_dahdi.so app_dahdibarge.so Description Asterisk module that communicates with the DAHDI drivers. Asterisk module that provides the DAHDIBarge application at the dial plan level. This application

http://www.elastixbook.com/en/chapters/chapter_8/8.7_DAHDI_details.htm[24/11/2011 10:24:36 p.m.]

Unified Communications with Elastix Vol. 1

app_dahdiscan.so

monitors (listens) to a DAHDI channel. Asterisk module that provide the DAHDIScan application at the dial plan level. This application navigates between channels and monitors them.

DAHDI commands DAHDI command dahdi_cfg dahdi_monitor dahdi_scan dahdi_speed dahdi_test dahdi_tool dahdi_genconf Description Configures the hardware from the /etc/dahdi/system.conf configuration file Monitors the input and output levels of a DAHDI channel Prints the DAHDI spans configuration Runs performance tests on DAHDI hardware Tests to see if the DAHDI temporizer is working properly Shows the DAHDI interface state. Very useful for debugging. Automatically generates DAHDI hardware configuration files. Go to Index Next

Previous

http://www.elastixbook.com/en/chapters/chapter_8/8.7_DAHDI_details.htm[24/11/2011 10:24:36 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

8.8 Before DAHDI: machines using Zaptel


From Elastix 1.5 the Zaptel package was replaced by the DAHDI package. Due to this being a relatively recent its probable that in practice we will find those machines that still use Zaptel or information you read on the Web that refer to Zaptel. To adequately configure these machines in this section we present a summary of the most important difference among both of these driver packages.

Some name changes to take into account


One of the more obvious changes in the migration from Zaptel to DAHDI is the name change in the channels from ZAP to DAHDI; some other name changes that are important to take into account are listed below:

Changes in the configuration files DAHDI file /etc/dahdi/system.conf /etc/asterisk/chan_dahdi.conf /etc/dahdi/init.conf and /etc/dahdi/modules Zaptel file /etc/zaptel.conf /etc/asterisk/zapata.conf /etc/sysconfig/zaptel

Name changes in the kernel modules DAHDI module dahdi.ko dahdi_dummy.ko Zaptel module zaptel.ko ztdummy.ko

Name changes in the Asterisk modules DAHDI module chan_dahdi.so app_dahdibarge.so app_dahdiscan.so Zaptel module chan_zap.so app_zapbarge.so app_zapscan.so

Name changes in some commands DAHDI command dahdi_cfg dahdi_monitor dahdi_scan dahdi_speed Zaptel command ztcfg ztmonitor ztscan ztspeed

http://www.elastixbook.com/en/chapters/chapter_8/8.8_Before_DAHDI_machines_using_Zaptel.htm[24/11/2011 10:24:37 p.m.]

Unified Communications with Elastix Vol. 1

dahdi_test dahdi_tool dahdi_genconf

zttest zttool zapconf or genzaptelconf

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_8/8.8_Before_DAHDI_machines_using_Zaptel.htm[24/11/2011 10:24:37 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

9
IP telephone configuration
It is hard to wake who pretends to be asleep -- Navajo proverb Configuring an IP telephone tends to be quite simple. As a minimum an IP telephone needs 3 values to work: the PBX servers IP (in this case the Elastix server IP,) the user name (usually the extension,) and that users registered password (or Secret). Here we will show in detail how to configure a physical IP telephone and another that is software -based (softphone), since softphones have become quite popular in recent times. In these phones, SIP technology will be used for their configuration since its the most popular technology today, but you can be sure that the configuration of telephones supporting IAX protocol doesnt differ much from what is shown here. In general, in this book we will use SIP protocol for most examples with the exception of those cases where the phones are not connected inside a local network, in which case its preferable to use IAX protocol since its not so susceptible to problems related to the translation of IP addresses (NAT.) At the end of the chapter, we will go into detail on how to configure a great quantity of IP phones in a swift simple way. This method allows us to preconfigure phones from a tool called endpoint configurator available in Elastix.

9.1 Softphone configuration


Today the use of software telephones or softphones has become very popular, in no small part to the savings that can be made not having to buy physical phones. The savings are bigger with more extensions, which make it a very common alternative in call centers. Of course, before starting to configure the softphone we have to create an extension in Elastix.
http://www.elastixbook.com/en/chapters/chapter_9/9.1_Softphone_configuration.htm[24/11/2011 10:24:39 p.m.]

Unified Communications with Elastix Vol. 1

As an example let us suppose that the extension 5678 has been created, which uses SIP protocol and its assigned secret is 8765. The softphone that we will configure will be Zoiper, available in both a free and a commercial version. The free version is enough so that we can talk comfortably from one point to the other, so we will base our example on this version. To download Zoiper we need to visit the site http://www.zoiper.com We suppose that the reader has enough skills to install the software without problems. Once installed we execute it and a window like the following will appear:

Initial screen for the ZoIPER software

Next, we press the button with tool figure and enter the options menu. The options screen will display with options to configure new SIP extensions and IAX, since Zoiper counts with support for both protocols. In our example, we will configure an SIP extension, so we will see a screen like the following:

Configuring an SIP account

We will fill this screen with the following information:

http://www.elastixbook.com/en/chapters/chapter_9/9.1_Softphone_configuration.htm[24/11/2011 10:24:39 p.m.]

Unified Communications with Elastix Vol. 1

Domain: The IP address or domain name for the Elastix server Username: 5678 Password: 8765 Caller ID Name: The name that will appear on the phones that receive our calls After pressing the OK button, we will go back to the initial Zoiper screen. To complete this process, we need select the created extension and press the register button. This actually authenticates the extension to the Elastix system. Other softphones use a similar concept, but some may perform the registration automatically.

Before registering the SIP account

If Zoiper is correctly registered well observe that beside our account name Test the word Registered will appear.

After the SIP account has been registered

You can repeat this process to configure another Zoiper softphone using a different extension created in Elastix and then checking to make sure it is possible to make VoIP calls between both extensions. In the example, the extension 5678 receives the call from extension 2222.

http://www.elastixbook.com/en/chapters/chapter_9/9.1_Softphone_configuration.htm[24/11/2011 10:24:39 p.m.]

Unified Communications with Elastix Vol. 1

Call incoming into our softphone

Note: Asterisk gives you the possibility of checking the working of the automatically created extensions through an extension called ECO. This extension will answer automatically and reproduce the same audio we send. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_9/9.1_Softphone_configuration.htm[24/11/2011 10:24:39 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

9.2 IP telephone configuration


To configure an IP phone we need to take into account two aspects: 1. Network configuration 2. Device registration with the Elastix server To better illustrate the points mentioned we will use as an example a Polycom SoundPoint IP 330 telephone.

The Polycom 330 telephone that we will be configuring

Network configuration
The network configuration can be realized considering that by default the telephone will get its IP through DHCP, but it is also possible to configure a fixed IP. We will explain both methods. After configuring the Phones IP address, we will access the Web administration interface to complete the process by entering the remaining parameters. DHCP Through this option, the telephone will obtain an IP address automatically. Take into account that the network must have an operating DHCP server, which is the one that will assign its IP address. This may be already on your network, and may be part of your Network router or a service running on a Windows/Linux/MAC Server on your network. If you do not have one, Elastix has an embedded DHCP server at your disposal, which you can easily be activated from the Web interface.

http://www.elastixbook.com/en/chapters/chapter_9/9.2_IP_telephone_configuration.htm[24/11/2011 10:24:43 p.m.]

Unified Communications with Elastix Vol. 1

Below we will detail how to verify on an IP telephone what IP address it was assigned. Press "Menu Status Network TCP/IP Parameters In the LCD screen, the IP address will be shown. Let us write it down so that later we can access the phone from the Web interface.

Static IP If you need to maintain an exact register of the IP addresses of your phones and/or you want to place your IP Phones in specific segments of the IP network, you must use static IP addresses for your phones. To configure an IP address on the phone, you must enter the IP parameters, network mask, gateway and DNSs in a different menu. Below are instructions on how to enter each one of them. IP address Since by default the telephone is, configure to receive its IP address via DHCP, below we show the way to change this behavior to the use of a fixed (Static) IP. In the telephone interface press "Menu Settings Advanced (enter password, Default is 456) Admin Settings Network Configuration DHCP Client Edit Disabled Phone IP Address" Here we proceed to enter the IP address. Network mask If you do not enter the correct network mask, your IP telephone will not be able to register with its Elastix Server. These problems occur more frequently when the IP telephones are in different segments of the network than the Elastix Server; it is here where you have to select the right network mask. Select "Subnet Mask (Enter the network mask) Gateway In the case, your phone needs to connect to a different segment of the IP network from your Elastix server, your phone must have the correct IP address for the corresponding gateway (generally a router) of that segment, or your telephone will not be able to register with the Elastix Server. Select "IP Gateway (enter the gateways IP address) After any changes, we need to select "Exit" and then Save Config. We must then wait for the telephone to finish restarting.

Configuration for registration on the Elastix server


This configuration can be made from the phone itself or from a Web browser. In this case, we will use the Firefox browser.
http://www.elastixbook.com/en/chapters/chapter_9/9.2_IP_telephone_configuration.htm[24/11/2011 10:24:43 p.m.]

Unified Communications with Elastix Vol. 1

Since we know the IP address for our phone already, we will enter from the Web browser. In the following example, our phones IP address is 192.168.1.235

Firefox address bar

Before entering the Web configuration interface a dialog box will ask us for the user name and password for the phone. The manufacturers default user name and password are Polycom and 456 respectively.

456

Authentication dialog via user and password

Elastix IP server To enter the registration parameters for the Elastix server, we will begin by entering those parameters shown on the SIP tab. In this screen, you can configure part of the SIP parameters, such as the SIP server, that is the Elastix Server IP address and the Outbound Proxy which are the same in our case. The correct configuration is shown in the following figure where we suppose that the Elastix servers IP address is 192.168.1.160

http://www.elastixbook.com/en/chapters/chapter_9/9.2_IP_telephone_configuration.htm[24/11/2011 10:24:43 p.m.]

Unified Communications with Elastix Vol. 1

Web interface for configuring the SIP parameters for our phone

We must take into account that the Elastix Server address can belong, or not belong, to our IP network segment. It is possible that the Elastix Server can be on the Internet; it is also possible to get to it through the configured gateway. In this same screen, it is also possible to change the port used for SIP signalization with the Elastix Server. If you change to a different value from the default (5060 UDP), you must make sure that this change was also done in the Elastix Server. Extension To enter the specific parameter for the extension assigned to the IP telephone, select the tab lines and configure here your extension as is shown in the following figure. The parameter Auth Password must be the same as the parameter secret that was entered when the extension was created in the Elastix Web Interface.

http://www.elastixbook.com/en/chapters/chapter_9/9.2_IP_telephone_configuration.htm[24/11/2011 10:24:43 p.m.]

Unified Communications with Elastix Vol. 1

Configuration of the SIP line

Optional configuration In this section we will learn how to configure the Polycom to show the date and time of Elastix. In the menu, we must click on the tab "General" and on the field SNTP Server" (under the time section) enter the IP address for the Elastix server. Additionally we must select the correct value for our time zone in "GMT Offset"

http://www.elastixbook.com/en/chapters/chapter_9/9.2_IP_telephone_configuration.htm[24/11/2011 10:24:43 p.m.]

Unified Communications with Elastix Vol. 1

Configuration for the time server

Note: If when you try to enter one of the available extensions in the Elastix Server (from the phone were configuring) you hear a busy signal even though all the digits for the destination extension havent been dialed, check the Digitmap option, inside the section Local settings inside the SIP menu, or if that doesnt work just delete it completely. This may be called Dialplan on other manufacturers phones.

Changing the digit maps

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_9/9.2_IP_telephone_configuration.htm[24/11/2011 10:24:43 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

9.3 Using the Endpoint Configurator


Ocassionally, the installation of IP telephones is complicated when they are many and even more when the configuration is not as trivial as the one on the softphone. As shown in the previous section, some telephone models can be configured from a Web interface embedded in the telephone itself. Then there are others that must be configured through a telnet session. The Elastix Server has an interface that will allow us to configure many telephones in an easier, swifter manner. This tool is named the Endpoint Configurator. The Endpoint Configurator module first makes a scan of the network or subnet that is provided. Something to note is that when you enter the module, the default network and subnet are those that are configured in the actual Elastix central; the scan is executed on that segment of the network and it gets the internal information of MAC and IP of the connected network devices.

Scanning the network in search of endpoints

Note: The MAC address works as unique phone identifier for the endpoint configurator. If the IP address were used, this could change over time but with the MAC address this does not happen, as every network connectable device throughout the world has a unique MAC address provided by the manufacturer at the time of manufacture After obtaining the information for all the endpoints in the network segment, the module tries in an intelligent way to identify the devices that could be IP phones and in the same way tries to gather information about the manufacturer and model so it can choose which ones to configure by looking them up on its internal database of telephone models. When it has the telephone group to be configured the information is presented on the Elastix Web interface. Something like the following illustration will be shown:

http://www.elastixbook.com/en/chapters/chapter_9/9.3_Using_Endpoint_Configurator.htm[24/11/2011 10:24:46 p.m.]

Unified Communications with Elastix Vol. 1

Initial listing of telephones found on the network. Not yet configured.

As you can observe in the previous figure, a list of all the phones found in that network segment and that Elastix can recognize or will be able to configure are shown. As you can see, the report shows the columns MAC address, IP address and Manufacturer, which will help us recognize what IP telephone it is so we can mentally relate it to its physical location.

Close up view of the MAC address, IP address and Manufacturer fields

Then there are two columns called Telephone Model and User Extension. These columns serve to associate an extension (previously created in Elastix) with a physical telephone. In the list called Telephone Model, you can choose which phone model you want to associate with the extension and only those that Elastix can configure and recognize are listed. Take into account that to configure the telephones extensions they should have been created previously from the PBX PBX Configuration menu. Note: A limit of this tool is that the extensions must be SIP, as other protocol extensions are not supported. The developers in charge of Elastix development are working to incorporate support for other protocols.

Configuration of an ATCOM telephone, model AT-530


Below we will explain step by step how to configure an ATCOM brand telephone, model AT-530. This is a low cost telephone model supports both SIP and IAX. To configure it first we elect the model and extension to configure from the list shown in Endpoint Configurator. When a telephone is configured for the first time with this module, this presents a Not configured status, which means that the Elastix Server has no configuration for it.

http://www.elastixbook.com/en/chapters/chapter_9/9.3_Using_Endpoint_Configurator.htm[24/11/2011 10:24:46 p.m.]

Unified Communications with Elastix Vol. 1

Line corresponding to the AT-530 telephone detected on the network

You must choose the box found on the left side of the screen and then press the Configure button. Immediately there will appear a confirmation window in which, if you are sure, you can accept so the configuration process begins. This can take some time depending on the number of telephones you chose; in this case, since it is an example, there is only one telephone to configure.

Close up view of the information for the AT-530 telephone

After the process, well see that the page was updated and the telephone status is Configured without incident. This indicates that the Elastix Server did several things: First it created the necessary configuration file(s) in the path /tftpboot/ (path in the Elastix central) and in the case of this example only created the file atc0009455765aa.cfg where 0009455765aa represents the MAC address for the telephone. Second, it created a register in the Elastix database to maintain a history of the configured telephone. Third, through a telnet connection (only for ATCOMs) it loaded the configuration file on the telephone, saved the file and rebooted. Because of this, you will note that the telephone will reboot.

Configured AT-530 telephone

There are certain considerations regarding the telnet connection in ATCOM phones. To be able to establish it you need the user and password. For simplicitys sake, Elastix uses the manufacturers defaults. In the case of model AT-530, they are user admin with admin password and in the AT-320, the password is 12345678. What this means is that for the Endpoint Configurator to work, if these passwords are not as per the defaults, the configuration will fail. This is the same for most other makes and models of phones supported by Endpoint configurator. A good practice is always set the IP phones to factory defaults if you have already tried to manually preconfigure the phones before using the Endpoint Configurator. Coming back to interpreting the telephone status we have:
http://www.elastixbook.com/en/chapters/chapter_9/9.3_Using_Endpoint_Configurator.htm[24/11/2011 10:24:46 p.m.]

Unified Communications with Elastix Vol. 1

Status Not configured Configured without Incident

Color Orange Green

UPDATE: Secrets not equal Red in FreePBX and Endpoint

Description Not configured yet by the Elastix central The central configured the telephone with no problems It is necessary to update. The reason is that the password has changed in the central (FreePBX) and in the endpoint.db the old one is still maintained.

If there are no issues our IP telephone is configured and registered to the Elastix Server and when you wish to change extensions, you go to the endpoint configurator, click a couple of times and its ready. Note: There is a Deconfigure button. The action it executes is only at the module level. The Elastix Server deletes the historic register relating to the IP telephone in its internal database and deletes the configuration files related to the path /tftpboot/. This indicates that the telephone will keep the configuration that was sent to it since the last update with this tool.

Configuring a Polycom Soundpoint IP 501 telephone


Below we will show an example of how to configure a Polycom SoundPoint IP501 telephone. First, we choose the model and extension to configure. As in the case of the ATCOM Telephone, we can assume that it is the first time that it is being configured from the Elastix Server so we will note the Status is Not configured.

Line corresponding to the Polycom telephone detected on the network

On the left side well select the box and then press the button Configure. Immediately the confirmation window appears in which, if youre sure, you will accept and the configuration process begins. This can take some time depending on the number of phones that you have chosen, in this case because it is an example there is only one telephone to configure.

http://www.elastixbook.com/en/chapters/chapter_9/9.3_Using_Endpoint_Configurator.htm[24/11/2011 10:24:46 p.m.]

Unified Communications with Elastix Vol. 1

Close up view with the information for our Polycom IP501 telephone.

After this process, well see that the page was updated and the telephone status is Configured without incident, this indicates that the Elastix Server realized several actions: First, it created the necessary configuration files on the path /tftpboot/ (path on the Elastix central. These files in the case of Polycom telephones are detailed in the table shown below:

Description The 0004f21aeb17 represents the MAC address and this file is a header that tells the telephone what it will do during the updating and configuration process. 0004f21aeb17reg.cfg Contains information on the extension(s) that the telephone will have Polycom A folder that has inside other folders called contacts, logs and overrides server.cfg Configuration related to the proxy server and SIP sip.cfg All the additional parameter that you wish to configure. For this its good to check the Polycom user manual. Second, in these telephones, there is no telnet connection and until now, its not known how to reboot and send the configuration files from the Elastix Server as a remote centralized action. Because of this it is necessary to execute the following changes on the Polycom telephone itself: Choose the kind of provisioning which is TFTP. Enter the Elastix Server IP address. Choose for it to read configuration through TFTP. Restart the Polycom telephone. These steps are the same in all the Polycom models supported by Elastix. Also, as in the case of the ATCOM brand telephones, a history is generated in the internal Elastix database, about the configuration of the Polycom telephone. If there are no incidents then now your IP telephone is configured and registered the Elastix Server and when you wish to change the extension all you need to do is go to the Endpoint Configurator module, click a few times and youll be ready.

File 0004f21aeb17.cfg

TFTP updating
TFTP is the protocol used in this case to provide provisioning. It means trivial FTP and is a protocol that requires no authentication. That is, we need neither a user nor a password to perform a process. Most IP telephones support this kind of provisioning to transfer their configuration files from the Elastix Server to their endpoints and vice versa, as in the case of Polycom telephones they also use it to download the contact list and to write logs. The Elastix central is embedded with a service charged with listening and accepting transfers using TFTP protocol. It is in the configuration file /etc/xinetd.d/tftp where the directory is customized for tftp use. In our case,
http://www.elastixbook.com/en/chapters/chapter_9/9.3_Using_Endpoint_Configurator.htm[24/11/2011 10:24:46 p.m.]

Unified Communications with Elastix Vol. 1

it is /tftpboot/.

Customizing configuration files


There are times when it is necessary to customize certain settings in the configuration files for the IP telephones. It is possible that in versions of Elastix beyond 2.0 there will be a tool based on the Web to handle these tasks, but for now, the reader can do it by editing the template configuration files that are on the Elastix central path /var/www/html/modules/endpoint_configuration/libs/vendors/. In this path, we will find the following: File Atcom.cfg.php Description In this file, you will find the configuration for some ATCOM models. To change the configuration it is recommended to check the user manuals for the ATCOM configuration files. In this file, youll find the configuration for some Polycom models. Since the content of these files is XML, this means that you can use the same XML for some models. In this file, youll find the configuration for some Linksys models. We should note that they also are in XML format. In this file, you will find the configuration for supported Cisco models. In this file, you will find the configuration for supported Aastra models.

Polycom.cfg.php

Linksys.cfg.php Cisco.cfg.php,

Aastra.cfg.php Grandstream.cfg.php In this file, you will find the configuration for supported Grandstream models. Snom.cfg.php In this file, you will find the configuration for supported Snom models.

When making changes to these template files, the next time you use the Endpoint Configuration model, your configuration customization will be reflected when configuring or updating your telephones. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_9/9.3_Using_Endpoint_Configurator.htm[24/11/2011 10:24:46 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

10
Advanced PBX Configuration
If I wait Ill lose the daring of youth -- Alexander the Great

10.1 Call routing


Incoming routes
This option allows configuring the destination for calls that enter through a specific trunk. When a call enters the server, Asterisk can note the DID (the number that caller rang to reach you), the Caller ID (the callers number that they are ringing from) or the port number through which the call is being received if it utilizes DAHDI-type trunks.

http://www.elastixbook.com/en/chapters/chapter_10/10.1_Call_routing.htm[24/11/2011 10:24:48 p.m.]

Unified Communications with Elastix Vol. 1

New incoming route creation form

Description: Tag that identifies the incoming route, e.g. MainNumber DID Number: For Digital lines, the DID information will normally be the phone number that the caller dialed to reach you. Some carriers pass the entire number including Area Code whilst some omit the area code. Some carriers even pass fewer digits than that. You need to determine from your carrier (or by viewing the Asterisk logs) what information is being passed to your Elastix system. For a peer of SIP or IAX types, the DID (Destination-Inward-Dial) is the destination number for the call. Like digital lines, it could be the number that the caller dialed or it can be a number assigned by the provider and is generally associated to the account number. For example, if your account is '85679432', by entering this number into the DID field, incoming calls destined for that account should match up with this information and be routed to the configured destination. If this field is left blank then it will refer to incoming calls with any destination number, commonly referred to as a Catch-All. Caller ID Number: CID Number is the Caller ID or phone number from which the call received by Elastix originated. This piece of information is not trustworthy since hackers can easily bypass it. If this field is left blank, then it will refer to incoming calls with any Caller ID.

http://www.elastixbook.com/en/chapters/chapter_10/10.1_Call_routing.htm[24/11/2011 10:24:48 p.m.]

Unified Communications with Elastix Vol. 1

Alert Info: This option can be used to activate the distinctive rings feature that is supported by some SIP devices. Requires particular knowledge of the brand and model of the SIP device Pause Before Answer: This option defines the number of seconds to wait before answering the incoming call. The first purpose of this option is to allow devices connected in parallel to this line, like fax machines or electronic security devices, to ring first before the PBX processes the incoming call. Privacy Manager: If this option is activated, any call without a valid Caller ID will not be able to be routed to its final destination if the Caller ID is not entered manually first. That is, the caller will be asked to enter his number using the telephones number pad. Language: With this field, you configure the language for the messages that will be played for taking care of the call. Write es for Spanish or en for English Detect Faxes: If this option is activated Asterisk will try to find a fax tone in the call, if it finds a fax tone, the call will be sent to the default fax extension thats configured in General configuration. Set destination: With set destination, we can specify where we want the call to end up, either: an IVR, a ring group, an extension, a miscellaneous destination, hanging up the call or a personalized context.

Outgoing routes
Through outgoing routes, we can indicate through which trunk or trunks calls that originate from an internal Elastix PBX extension should be routed.

http://www.elastixbook.com/en/chapters/chapter_10/10.1_Call_routing.htm[24/11/2011 10:24:48 p.m.]

Unified Communications with Elastix Vol. 1

Outgoing route creation form

Route Name: In this field, the descriptive name for the trunk is entered to simplify their administration. Route CID: In this field, it is possible to specify the number that will be used by the call as an origin number. This feature (changing the origin number at the will of the PBX administrator) needs to be supported by the provider of the trunk being used to make the call. Route Password: If we fill this field, each time a call tries to use this trunk, the caller will be asked to enter that same pattern as a password. If the password is entered correctly, the call is connected; if not then it is discarded. Only numbers are allowed to be entered. Emergency Dialing: With this option, we can specify that the route is for emergency calls. A different Caller ID can be specified. Dial Patterns: The dial patterns is the group or pattern of digits that Asterisk uses to check if the number marked by the internal extension goes with the pattern configured on the outgoing route and in this way to determine the channel through which the call must be sent. There are rules on how to specify dial pattern, which we indicate below: Pattern X Z N [1237-9] . | Description Represents any digit 0-9 Represents any digit 1-9 Represents any digit 2-9 Represents any digit between brackets Represents one or more characters Separates the number on the left from the dialed number. For example: 9|NXXXXXX should represent the dialed numbers as 92234567 but should only pass 2234567

Trunk Sequence: It lists and indicates the order in which trunks will be used. When a dialed number by a caller goes with the specified dial pattern, Asterisk will try to make the call through the trunks specified in this option in the order in which they are listed. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_10/10.1_Call_routing.htm[24/11/2011 10:24:48 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

10.2 Trunks
A trunk is one that allows a call to be finished at another external VoIP communications system. Some kinds of trunks are: DAHDI IAX2 SIP ENUM DUNDi Custom Let us see some of the parameters for configuring a DAHDI trunk:

Creation of a new DAHDI trunk

Trunk Description: In this field, a distinctive name is assigned to the trunk. Outbound Caller ID: In this option, it is possible to specify the origin number or Caller ID that the call will use when it uses this trunk. It is necessary for the provider of the telephone line connected to that DAHDI port to allow Caller ID change. The format used is:

http://www.elastixbook.com/en/chapters/chapter_10/10.2_Trunks.htm[24/11/2011 10:24:49 p.m.]

Unified Communications with Elastix Vol. 1

Callers name <###########> If you do not wish to use a Caller ID, leave this option blank. Maximum channels: This option limits the number of channels that can be used in a trunk. When we say channels, we mean the number of simultaneous calls that can be made, either incoming or outgoing. Dial Rules: The dial rules indicate how Asterisk should dial to make a call in a trunk. This option can be used to add or remove prefixes. If a marked number doesnt go with the patterns in these rules, its dialed as it was entered. The rules can be specified through the following syntax: Pattern X Z N [1237-9] . | Description Represents any digit 0-9 Represents any digit 1-9 Represents any digit 2-9 Represents any digit between brackets Represents one or more characters Separates the number on the left from the dialed number. For example: 9|NXXXXXX should represent the dialed numbers as 92234567 but should only pass 2234567 Adds a prefix to the dialed number. For example: 001+NXXNXXXXXX should add 001 to the number 3058293438 when this is dialed.

IAX and SIP type trunks


Apart from the configurations shown above, there must be specified incoming and outgoing configurations that are generally provided by the voice services provider. The configurations can include username, password, codec being used, the host with which to register, etc. Example of the detail configurations for Peer:
allow=ulaw&alaw&gsm&ilbc&g726&adpcm&lpc10 canreinvite=no disallow=all dtmfmode=info fromuser=myusername host=nyc.voicepulse.com qualify=5000 secret=mypassword sendrpid=yes type=peer username=myusername
http://www.elastixbook.com/en/chapters/chapter_10/10.2_Trunks.htm[24/11/2011 10:24:49 p.m.]

Unified Communications with Elastix Vol. 1

It is also possible that a register chain is needed with the following syntax: myusername:mypassword@host

DAHDI trunks
DAHDI trunks are those associated with the telephony hardware installed on the machine and use the chan_dahdi.so module. The files associated to these kinds of trunks are /etc/asterisk/chan_dahdi.conf and the files in the /etc/dahdi/ folder. DAHDI trunks are created through a number associated with the channel position in the hardware.

Custom trunks
These trunks are created when uncommon protocols are used in Asterisk, like H323, CAPI, etc. A dial string must be specified. For example:
CAPI/XXXXXXX

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_10/10.2_Trunks.htm[24/11/2011 10:24:49 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

10.3 Billing
The Rates utility under the Billing menu in the Reports tab in Elastix allows us to visualize and configure rates that will be used for call billing.

Listing of defined rates

Visualizing, Editing, and Deleting


The View link will take us to a screen where the rate data is shown. To delete a rate, click on the Delete button. You can also modify the values of a rate by clicking on the Edit button. The only values you can change are Name, Rate and Rate Offset.

Rate editing form

Creating a rate
To add a new rate click on the button Create New Rate. A form will be shown in which the following fields will be entered: Prefix: Name: Rate: Rate Offset: Trunk: Telephone prefix to which the rate will be applied Rate name Value of the rate Cost of the connection Trunk from which the call accounting will be taken.

http://www.elastixbook.com/en/chapters/chapter_10/10.3_Billing.htm[24/11/2011 10:24:52 p.m.]

Unified Communications with Elastix Vol. 1

Creation of a new rate

Billing report
The Billing Report in the Billing menu in Elastix allow us to visualize details on calls with their respective cost and applied rate. The report will change depending on the filtering values: Start Date: Starting date from which the calls will be selected. End Date: Ending date from which the calls will be selected. Field: Additional filtering fields: Source, Destination, Destination channel.

Billing report

Destination Distribution
The Destination Distribution option in the Billing menu in Elastix allows to visualize with a distribution graph the outgoing calls grouped by rate. The graph will change depending on the filtering values: Start Date: Starting date from which the calls will be selected.

http://www.elastixbook.com/en/chapters/chapter_10/10.3_Billing.htm[24/11/2011 10:24:52 p.m.]

Unified Communications with Elastix Vol. 1

End Date: Ending date from which the calls will be selected. Criteria: Distribution by Time, Distribution by Number of Calls, Distribution by Cost

Distribution by Time The distribution by time option shows a pie chart of the trafficked time for each trunk. It also shows a list of the trunks with the most trafficking time.

Pie chart showing the distribution of destinations based on use time

Distribution by Number of Calls Shows a pie chart of the number of calls for each trunk. It also shows a list of the trunks with the most handled calls.

Distribution of destination based on the number of calls

Distribution by cost Shows a pie chart divided by the summarized cost for each trunk. That is, the cost for all the handled calls is computed for each trunk. This calculation is based on the rated entered in the Rates menu.

Billing Setup
http://www.elastixbook.com/en/chapters/chapter_10/10.3_Billing.htm[24/11/2011 10:24:52 p.m.]

Unified Communications with Elastix Vol. 1

In this option, we have to sections that will be explained below:

Default Rate Configuration The Default Rate Configuration option in the Billing menu in Elastix allows us to determine the cost per minute and connection for the default route, in other words the rate that will be applied when no other rate to apply to that call is found.

Default rate

Trunk Bill Configuration The Trunk Bill Configuration option under the Billing Setup menu in Elastix allows us to determine which will be the trunks that are used to obtain calls for the billing process. The list shows all registered trunks, you must choose those to be used for billing and then click on the button Billing Capable.

Billing capable trunks selected with a checkmark

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_10/10.3_Billing.htm[24/11/2011 10:24:52 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

10.4 Reports
CDR Report
CDR is an abbreviation for Call Detail Record. The CDR Report option in the Reports tab in Elastix allows us to view a list with call details.

CDR report

The report changes according to filtering values: Start Date: Starting date from which the calls will be selected. End Date: Ending date from which the calls will be selected. Field: For filtering - Destination Number, Source Number, Src. Channel, Account Code, Dst. Channel, Company, User Status: ANSWERED, BUSY, FAILED, NO ANSWER Note: This report can be exported in CSV format. This file format can be opened as a spreadsheet to manage the data further e.g. calculate call time averages by extension.

Channel Usage
The Channel Usage option in the Reports menu in Elastix allows us to graphically view the number of simultaneous call for each channel.

http://www.elastixbook.com/en/chapters/chapter_10/10.4_Reports.htm[24/11/2011 10:24:54 p.m.]

Unified Communications with Elastix Vol. 1

Channel usage report

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_10/10.4_Reports.htm[24/11/2011 10:24:54 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

10.5 DISA Configuration


The DISA module (Direct Inward System Access) allows users to access by telephone from the outside the serviced provided by the Elastix PBX, the access is done by obtaining an internal dialing tone. With this internal tone, the external caller can have the same calling functionalities as if he was inside the facilities. For example, the external caller could make international calls via the Elastix PBX (if it is allowed). Normally DISA support is not available for all a companys employees and a password is necessary to obtain access to the internal tone. To enter the password, some companies provide a hidden option in the companys main IVR. In any case, precaution must be taken so that unwanted users who could use it to make calls at the companys expense cannot use DISA access. To configure DISA access we must go to the "PBX -> PBX Configuration -> DISA" menu and we will get a screen like the following:

Form for creating a new DISA access

DISA name: Distinctive name for the DISA access. PIN: The password so the user can access DISA support (internal tone) Response Timeout: Maximum time that the DISA application will wait for the user to complete the PIN or to dial a destination. Digit Timeout: Maximum allowed time between digits. Require Confirmation: Asks for confirmation before asking for the password.
http://www.elastixbook.com/en/chapters/chapter_10/10.5_DISA_Configuration.htm[24/11/2011 10:24:56 p.m.]

Unified Communications with Elastix Vol. 1

Caller ID: If you use this field, all the outgoing calls originated from this DISA will use this number as CallerID. Context: Context used by DISA calls. Allow Hangup: If this option is turned on, the user that is calling from that DISA has the possibility of hanging up the call pressing ** to get a new dial tone so he can make a new call. Then, to make the DISA available from the main IVR, we must modify the IVR adding the DISA access with a new IVR option. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_10/10.5_DISA_Configuration.htm[24/11/2011 10:24:56 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

10.6 Time conditions


The use of time conditions is a very useful feature for many businesses that want to modify the behavior of their PBX depending on the time of the day, day of the week, or even the day of the year. For example, company X wants to make it that calls made to sales at night should not go to the sales waiting line but to a message that is played with the office attendance schedule and offering an alternative number for urgent cases; or company Z wants to play a welcome IVR message that is different from the usual one during the weekends, since they have special offers for the weekend. Time conditions are a feature that is provided thanks to the integration of Elastix with the FreePBX software. To configure time conditions, it is necessary to know what will be put into place by entering two menus. The first menu, Time Groups is used to define the different schedules that will be needed to discriminate time conditions, and the Time Conditions menu will be used to determine the destination of a call according to the scheduling group previously defined. To enter the Time Groups utility, you must go to the PBX -> PBX Configuration -> Time Groups tab. Here we will have access to a form that will allow us to establish the time range that will later be used in the Time Conditions menu.

Adding a new time group

After defining the Time Groups, it is necessary to enter the Time Conditions utility to relate this scheduling group with an entity like an IVR, an extension, a waiting line, voicemail, etc.

http://www.elastixbook.com/en/chapters/chapter_10/10.6_Time_conditions.htm[24/11/2011 10:24:57 p.m.]

Unified Communications with Elastix Vol. 1

Adding a new time condition

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_10/10.6_Time_conditions.htm[24/11/2011 10:24:57 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

11
FreePBX internal operation
Liberty is not begged for, its conquered -- Eloy Alfaro

11.1 FreePBX basics


FreePBX is the Asterisk configuration software that has been integrated as a part of the Elastix distro. This software generates the configuration files required by Asterisk based on the configuration entered by the user from the Web interface. To do this task FreePBX divides it into two steps: 1. Gathers the desired configuration into a configuration database. In the case of Elastix, the MySQL database engine is used. 2. Converts the stored MySQL information into configuration files through the retrieve_conf tool. To illustrate this process, let us see the following figure:

http://www.elastixbook.com/en/chapters/chapter_11/11.1_FreePBX_basics.htm[24/11/2011 10:24:58 p.m.]

Unified Communications with Elastix Vol. 1

FreePBX operation and components

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_11/11.1_FreePBX_basics.htm[24/11/2011 10:24:58 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

11.2 File organization


FreePBX reads and writes information in several directories for its proper operation. Below is a list of the most important ones: Directory /var/www/html/admin/ /etc/asterisk/ /var/lib/asterisk/agi-bin/ Description Where the GUI for FreePBX resides Asterisk configuration files modified by FreePBX Where the Asterisk AGI scripts reside. FreePBX counts with some scripts in this folder, like dialparties.agi Some binaries or their corresponding symbolic links that are used by FreePBX The amportal script is here and can only be manipulated by root Sounds that are used in the FreePBX dial plan Sounds that have been created by the user. For example, when a welcome IVR is created. Where voicemails are stored. Where voice recordings are stored. Where CDRs are written in text format. Go to Index Next

/var/lib/asterisk/bin/ /usr/local/sbin/ /var/lib/asterisk/sounds/ /var/lib/asterisk/sounds/custom/

/var/spool/asterisk/voicemail/ /var/spool/asterisk/monitor/ /var/log/asterisk/cdr-csv/ Previous

http://www.elastixbook.com/en/chapters/chapter_11/11.2_File_organization.htm[24/11/2011 10:24:59 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

11.3 Configuration
amportal.conf
The file /etc/amportal.conf is a plain text file containing general configuration information read by FreePBX. That is, this is the main configuration file for FreePBX and it can be manually edited if that is needed. In this configuration file is the information for database access (user and password) as well as the authentication type the FreePBX will use for its Web users. This file is well documented so we will not go into detail about its options of configuration directives. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_11/11.3_Configuration.htm[24/11/2011 10:25:00 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

11.4 retrieve_conf: Dial plan generator


retrieve_conf is a program written in PHP that is charged with generating the dial plan from the information stored on the database (MySQL in our case.) This program is usually executed from the Web through a PHP script each time we click on the FreePBX red bar that says Apply Configuration Changes here. However, retrieve_conf can be launched even from the command line. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_11/11.4_retrieve_conf_ Dial_plan_generator.htm[24/11/2011 10:25:01 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

11.5 dialparties.agi
This is an AGI script written in PHP. You can open it from the dial plan when you want to make a call. Its main task is to check the state of the extension, which is being called, and also whatever options could be configured for that extension (call waiting, call forward, do not disturb). Finally, the script returns that information so that the proper action can be taken like for example returning a busy signal in the case of DND or routing the call to another extension in the case of call forward. If the extension is available and no options are activated, the call will go on without any inconvenience. To do its job, dialparties.agi checks the Asterisk database (in the file /var/lib/asterisk/astdb). Below are some diagnostics lines that appear in CLI when trying to make a call. These lines are returned by the dialparties.agi script.
dialparties.agi: Caller ID name is 'Pedro Paramo' number is '5454' dialparties.agi: Methodology of ring is 'none' -- dialparties.agi: Added extension 1616 to extension map -- dialparties.agi: Extension 1616 cf is disabled -- dialparties.agi: Extension 1616 do not disturb is disabled dialparties.agi: Extension 1616 has ExtensionState: 0 -- dialparties.agi: Checking CW and CFB status for extension 1616 -- dialparties.agi: dbset CALLTRACE/1616 to 5454 -- dialparties.agi: Filtered ARG3: 1616

Note: This script can be overwritten by FreePBX itself for a new one so if changes are made to its code this should be taken into account. dialparties.agi is found on the path /var/lib/asterisk/agi-bin/dialparties.agi. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_11/11.5_dialparties_agi.htm[24/11/2011 10:25:01 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

11.6 Structure of a FreePBX module


This sections purpose is so that we can understand better the operation of FreePBX to solve possible problems. FreePBX modules have the following minimum file structure: File name Description module.xml Contains the module information in XML format page.<module>.php Modules main file containing the necessary functionality. As can be imagined, the word <module> should be replaced with the modules respective name. functions.inc.php Library of PHP functions both for the modules use and for sharing with other FreePBX components. install.sql Contains SQL sentences that will be executed on the database when installing the module. Basically used to create the necessary table for the module. uninstall.sql Contains the SQL sentences necessary to uninstall a module. Basically used to remove created tables. install.php PHP script to be executed when installing the module uninstall.php PHP script to be executed when uninstalling the module Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_11/11.6_Structure_FreePBX_module.htm[24/11/2011 10:25:02 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

12
Connecting Elastix Servers
Any power not based in union, is weak -- Jean de la Fontaine

12.1 Interconnection between two Elastix servers


One of the advantages of using Elastix is that we can easily interconnect two Elastix servers in remote locations so that they can communicate with a single dial plan. Below we will see how to interconnect two Elastix servers using a SIP-type trunk. Let us suppose that we want to interconnect an Elastix server in point A with another Elastix server in point B. The result must be that a telephone connected to the server at point A can communicate by simply dialing the extension of a phone connected to the Elastix server at point B and vice versa.

http://www.elastixbook.com/en/chapters/chapter_12/12.1_Interconnection_between_two_Elastix_servers.htm[24/11/2011 10:25:03 p.m.]

Unified Communications with Elastix Vol. 1

Interconnecting two Elastix

To implement this, defining two things are required: 1. The SIP trunk between both Elastix servers 2. The outgoing routes in each Elastix server The entire configuration can be done from the Elastix web interface from the PBX -> PBX Configuration menu.

Defining the SIP trunk


We define the name of the trunk, which in our case will serve as username for the registration process. We will create the trunk from the Elastix at point A as pointA and the one at point B as pointB. See chapter 10 for details on creating SIP trunks. Then we define the peer details, which in this case will be the following:
host=dynamic secret=welcome trunk=yes type=friend

This configuration of the peer section must be repeated on both Elastix servers. In this example, we have defined welcome as our secret. Now we need to define the register string using pointA or pointB as username, whatever the case may be. For the Elastix server at point A we need to have:
pointB:welcome@192.168.1.240

For the Elastix server at point B it should be:


pointA:welcome@192.168.1.239
http://www.elastixbook.com/en/chapters/chapter_12/12.1_Interconnection_between_two_Elastix_servers.htm[24/11/2011 10:25:03 p.m.]

Unified Communications with Elastix Vol. 1

Once this configuration is set in both Elastix we can verify from the Asterisk CLI if the SIP trunks are registered. When executing the command sip show registry in the point A Elastix server, we should see something like the following:
elastix*CLI> sip show registry Host Username Refresh State Reg.Time 192.168.1.240:5060 pointB 105 Registered Fri,11 Apr 2008 10:29:43

The next step is defining the user details in the same SIP trunk creation screen from before. The user section establishes where we want the call to end. In this case, we want it to be accessible to local extensions, so it is enough with adding the primary context from-internal. This indicates that when the call enters through the trunk the specified context will start. The configuration is as follows:
context=from-internal host=192.168.1.240 insecure=very type=friend

Defining outgoing routes


See chapter 10 for details on the creation of outgoing routes. First, we determine the name of the outgoing route. In this case well specify the outgoing route on the server at point A as: ElastixB Then we define the dial pattern. In this case, we will use the following dial pattern: 2|XXX. We are assuming that to dial to the extensions connected to the Elastix server at point B we need to dial with the number 2 first. Finally, we choose the trunk through which the call must go. In this case well choose the trunk SIP/pointA Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_12/12.1_Interconnection_between_two_Elastix_servers.htm[24/11/2011 10:25:03 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

12.2 Connection with call providers via IP


The popularity of voice service providers (VSP) has grown incredibly in the last years. These companies provide SIP or IAX connections for local or international calls through the internet at a low cost. In this section, we will establish a SIP connection with a provider that will allow us to make calls inside the United States. Our goal is to register our SIP trunk with a VSP that allows us to make calls to the USA from any IP telephone connected to our Elastix server. To implement this, we have to define two things. 1. The Elastix server SIP trunk 2. The outgoing route in the Elastix server

Defining the SIP trunk


As we saw before, the first thing we must do is define the name of the trunk. In this case, we will call it VP-SIPNYC. See chapter 10 for details on the creation of SIP trunks. Now we must define the peer features. This information must be provided by the VSP. In general, VSPs give the same information for all their users with the only difference being the username and password. As an example, our VSP asked us to configure the SIP trunk in the following way:
allow=ulaw&alaw&gsm&ilbc&g726&adpcm&lpc10 canreinvite=no disallow=all dtmfmode=info fromuser=myusername host=nyc.voicepulse.com qualify=5000 secret=mypassword sendrpid=yes type=peer username=myusername

Then we add the registration chain, which in our case is the following:
myusername:mypassword@nyc.voicepulse.com

http://www.elastixbook.com/en/chapters/chapter_12/12.2_Connection_call_providers_via_IP.htm[24/11/2011 10:25:04 p.m.]

Unified Communications with Elastix Vol. 1

Defining the outgoing route


See chapter 10 for details on the creation of outgoing routes First, we determine the name of the outgoing route. In this case well name it INTERNATIONAL Then we define the dial pattern. In this case, we will use the following dial pattern: 00. We are assuming that to dial to an exterior number dialing two zeros first is required. Finally, we choose the trunk through which the call will go. In this case we choose the trunk SIP/VP-SIPNYC Once this configuration is established we can verify from the Asterisk CLI whether the SIP trunk is registered. When we execute the sip show registry command ion the Elastix server, we should see something like the following:
elastix*CLI> sip show registry Host Username nyc.voicepulse.com:5060 myusername

Refresh State 105 Registered

Reg.Time Fri,11 Apr 2008 10:29:43

When dialing an international number like 0018773527849 the call must be established through this VSP. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_12/12.2_Connection_call_providers_via_IP.htm[24/11/2011 10:25:04 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

12.3 Predefined connection with call providers via IP


There is another way of creating SIP trunks to interconnect the Elastix server to a VSP. The VoIP Provider interface allows us to enter the peer and register chain parameters directly into a form. In addition, we can select from the most common providers that are already setup with predetermined configuration settings. The following image shows the configuration of a SIP trunk with a predefined VSP.

Web interface for configuring VSPs

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_12/12.3_Predefined_connection_call_providers_via_IP.htm[24/11/2011 10:25:05 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

13
Voice quality
Quality means doing it right when no one is looking. -- Henry Ford

13.1 Voice problem symptoms


Quantifying the problems that affect voice quality is difficult because each persons perception greatly affects it. The causes of voice quality deterioration are varied and hard to categorize. In this section, we will go over the most common problems explaining their causes and possible solutions.

Echo
Echo is one of the most common symptoms and is very easy to recognize. It is produced when a part of the outgoing signal is reflected in the returning signal. Echo consists of the repeating once, or more times of the conversation, with a certain time displacement. There are many causes for echo but one of the most common is produced in analog lines when the signals are converted in the hybrid converter or 2 to 4 string converter (See chapter 1 for more details.) This happens because it is very difficult to separate outgoing and incoming signals in an effective way. The problem gets worse when the impedance on the telephone line varies much. Many of the telephony cards available for Asterisk do not have a good mechanism for adjusting the line impedance with the card impedance. For this reason, a part of the wave is reflected, causing echo. Note: we should remember that for a receptor to efficiently absorb the power of a received signal, its
http://www.elastixbook.com/en/chapters/chapter_13/13.1_Voice_problem_symptoms.htm[24/11/2011 10:25:06 p.m.]

Unified Communications with Elastix Vol. 1

impedance must coincide with that of the line. However, there is a better way to couple these impedances in the best way possible. This can be done with a program called fxotune available in Elastix from the command line. Unfortunately, this utility must be executed manually and with the Asterisk service off. For lines with echo problems, it is recommended to execute it in nonworking hours once a week because it can take a considerable amount of time. The command is the following:
fxotune -i 5

The fxotune command tries sending a pure signal down the line and listening for the return. It does this many times for each line until it finds the best gain value. Finally, this software writes the gain value in the file /etc/fxotune.conf When the execution is done, DAHDI must be told to load the new gain values. We can do that with the following command:
fxotune -s

We must execute this always before loading Asterisk so it is recommended to include it at the end of the DAHDI start-up script found on the path /etc/init.d/dahdi so it is not needed to be manually done each time. Note: It is very important to note that if you use fxotune to try to couple the lines that the variables txgain or rxgain should not be configured in chan_dahdi.conf since they will be overwritten by fxotune. The only thing left is to turn Asterisk on as normal. Finally, another cause for echo is of an acoustic nature cause when the sound signal feeds back from the microphone to the earphone. This is more noticeable when we speak through an amplifier. Of course, the design of the phone makes a difference and there are models that induce less acoustic echo than others do.

Low volume level


Many low-quality telephone lines damp the signal in a significant way causing us to hear a very low volume. This obviously affects the quality of the voice making the conversation be many times unintelligible or that the DTMF tones cannot be detected. Both the reception and the transmission volumes can be amplified through settings in the file chan_dahdi.conf. However, care should be taken because on occasion a low volume means a badly coupled line and a better solution in that case would be to use the fxotune utility to correct the problem. If we arbitrarily modify the gain parameters, we could make the echo on the line worse. The setting that modifies the gain on the transmission signal is called txgain and for reception, it is rxgain. Both can be edited in the file chan_dahdi.conf.

Voice delay

http://www.elastixbook.com/en/chapters/chapter_13/13.1_Voice_problem_symptoms.htm[24/11/2011 10:25:06 p.m.]

Unified Communications with Elastix Vol. 1

Voice delay is the time the voice takes in getting to its destination. Usually the delay is less than a second and if it is less than 200 ms, it is not noticeable. When the delay is over 500 ms the talkers tend to interrupt each other and the conversation overlaps. This can be irritating for communications. It is almost impossible to eliminate delay on the server level since in the great majority of cases it is a symptom of problems in the communications network. That is, if you want to eliminate it possible changes to the communications network will have to be considered.

Voice distortion
There are different problems for this category. The most commons of these is robotized voice. When a codec for bandwidth optimization (ex. gsm) is used, and connectivity is having problems, then the loss of information causes distortion. In these cases, it is advisable to change codec to one that offers less voice compression.

Jerkiness in the communication


This bothersome problem is usually related to packet loss in the network. The main causes of packet loss are an elevated latency of a limited bandwidth, among others. Jerkiness can also be caused by an elevated jitter. We will learn more about jitter in the next section. In any case the usual thing is to look for the cause of this problem on the network first and the not the server. Jerkiness can be caused by server problems when the memory resource and CPU consumption are very elevated. Generally, if the maximum latency (absolute, not average) for the network is 150 ms and the communications channel is not saturated then we can be sure that jerkiness in communications is not related to the network. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_13/13.1_Voice_problem_symptoms.htm[24/11/2011 10:25:06 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

13.2 Parameters related to voice quality in packet networks


Network delay
We should point out that we are not talking about voice delay but about the delay of the packets in the network. An easy way to calculate (approximately) the network delay is using the command ping. This command sends test packets to a destination and presents us with a small statistical summary of the sent packets. The summary looks like the following:
--- ping statistics --6 packets transmitted, 6 received, 0% packet loss, time 5004ms rtt min/avg/max/mdev = 73.055/74.181/74.852/0.710 ms

Here we can see some parameters like minimum, average and maximum delay and its deviation.

Packet loss
Sometimes some of the packets that compose a message do not make it to the destination. There can be many reasons for this, like defective or saturated equipment, losses in the transmission media (badly finished cables, elevated electric noise,) and other reasons. In the ping command summary in the network delay section, we see that it also reports a percentage of packet loss. The ideal is for there to be no packet loss at all (0%.) If there is, it should be investigated why. Even losses of less than 1% can affect IP voice conversation. This problem is even greater when we use codecs with a lot of compression.

Jitter
Jitter is an important parameter when talking about voice quality in packet networks. Jitter is defined as the variability of the network delay and normally is in the milliseconds. This parameter is necessary to analyze the quality of the voice since having a low average network delay is not enough to guarantee a good quality. When there is an acceptable network delay average but with high variability, there is a higher chance that packets will arrive out of order or with excessive delays. Due to voice communication being in real time, it cannot wait for all the packets to arrive and it will discard those that take longer than necessary. So, if we have a high jitter, it is more probably that packets will be discarded and that we hear jerkiness in the conversation. Note: Many people blindly trust in the ping command to get the network delay or even to calculate jitter doing manual calculation. Even though ping can be used in tight situations, the ping command does not

http://www.elastixbook.com/en/chapters/chapter_13/13.2_Parameters_related_to_voice_quality.htm[24/11/2011 10:25:07 p.m.]

Unified Communications with Elastix Vol. 1

send voice packets but ICMP traffic, which does not behave in the same way on the network. Even in certain networks, this protocol can have a bandwidth limitation that is totally different from voice packets. The most exact way to calculate jitter is with real RTP packets, which can be analyzed with a sniffer.

Jitter buffers To minimize jitters negative effects some VoIP solutions manufacturers have thought of waiting for lost voice packets before reassembling the voice signal at the destination. As these packets arrive, they would be reordered to reconstruct the original message. This solution is not free of problems since with this action we are also raising network delay to make the message get to its destination after reordering. However, the idea is good and practical. Maybe if we wait just the right amount of time it is probable that a good part of lost packets arrive without significantly affecting delay. A jitter buffer then is a small register where voice packets are temporarily stored for a short while to wait for possible lost packets. The waiting time is known as buffer size. Asterisk supports the jitter buffer concept and this parameter is configurable at the IAX and SIP protocol level. This parameter can be configured in the corresponding technology files (iax.conf and sip.conf). If you want to make sure that the jitter buffer is activated you can add the following options to the following files. In sip.conf:
jbenable=yes jbmaxsize=200 ; Optional (defines buffer size)

In iax.conf:
jitterbuffer=yes maxjitterbuffer=200 ; Optional (defines buffer size)

Image of the working of a jitterbuffer

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_13/13.2_Parameters_related_to_voice_quality.htm[24/11/2011 10:25:07 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

13.3 How to measure voice quality


Measuring voice quality has always been a problem for engineers. The complexity lies in that voice quality is a subjective parameter for the person listening to it. Even the concepts like the understandability of a telephony conversation vary depending on the language we use. Additionally, our mind plays a series of tricks on us to make life easier that make certain measurements of voice quality hard to get. If the voice gets distorted right before ending the conversation, it is probable that people will rate the call quality differently than if the errors occurred at the beginning of the call. This happens because our mind gives more importance to more recent events as opposed to those further in the past. There are also people that will unconsciously justify a certain lack of voice quality in favor of perceived personal advantages or convenience. An example of this is that people will not complain much about voice quality on cell phones thanks to the advantage of mobility. However, if that same quality was heard on a fixed line it is probable that they would call the telephone company to complain because their line has bad quality. Said in another way, as human beings, we are unconsciously justifying this diminishment in voice quality in cell phones. This is just the tip of the iceberg since there are a series of subjective parameters to identify the quality of the voice that are somewhat hard to quantify. The important part of this example is to demonstrate what a difficult task it is to measure voice quality. Even so, there are some attempts at standardizing the measurement of voice quality. One of the best known is the MOS scale that is based on subjective measurements. We can also relate the E model since it brings in some objective parameters like network delay and packet loss. Something interesting about this last model is that it contemplates the conversion of MOS scale results, which allows us to obtain a standard scale to quantify voice quality.

MOS scale
The MOS scale is really a recommendation of the ITU. Specifically the ITU-T P.800 recommendation. This scale writes down a voice quality scale based on the subjective samples that are realized through a series of techniques known as Absolute Category Rating (ACR). For this, a group of people is brought together and they are asked to rate voice quality in a subjective way. Before starting the evaluation, they must listen to some previously defined examples from the recommendation so that the users have a reference frame. Once this is done a series of phrases is transmitted (they are also pre-defined by the recommendation) through the telephone line and the users proceed to rate the voice quality. The following is a summary of the MOS scale. MOS rating 5 4 Quality Excellent Good Effort No effort needed It is necessary to pay attention but no significant effort is needed.

http://www.elastixbook.com/en/chapters/chapter_13/13.3_How_to_measure_voice_quality.htm[24/11/2011 10:25:08 p.m.]

Unified Communications with Elastix Vol. 1

3 2 1

Acceptable Poor Bad

Moderated effort Great effort Cant be understood

A disadvantage of using the MOS scale is without a doubt the quantity of time necessary to determine voice quality in a simple line. Imagine trying to coordinate a series of tests with a great amount of people whom we would have to previously train just to evaluate voice quality of a single line.

Model E
Model E is a model that is more mathematical and objective for the measurement of voice quality based on some network parameters like network delay, packet loss and jitter. Note: By saying that this is an objective method, the reader should not think that it is necessarily a better method of voice quality measurement. Voice quality contains an important subjective component, as has been mentioned before. However, many times it is more practical to measure the network parameters to make a mathematical calculation to approximate the voice quality measurement to the MOS scale. Model E was also recommended by the ITU and it is recommendation ITU-T G.107. This recommendation says that voice quality is represented by an R parameter, which is calculated in the following way:

R = R0 IS Id Ie + A
Where,

R 0 represents the signal-to-noise ratio I S represents the degradation the signal suffers when being converted into packets I d represents the network delay I e represents the degradation introduces by network devices and depends on the codec and packet A represents a safety margin
Simplified formula The ITU recommendation provides us with a more simplified formula to calculate parameter R. It is a less precise approximation than the above expression since it supposes some default values. The formula is as follows:

R = 94,2 I d I e
Note: If we are observant we will note that the maximum value that R could have is 94,2. We have defined parameters Id and Ie as network delay and packet loss respectively. However, before we enter these values into the formula we need to normalize them according to the ITU recommendation.

http://www.elastixbook.com/en/chapters/chapter_13/13.3_How_to_measure_voice_quality.htm[24/11/2011 10:25:08 p.m.]

Unified Communications with Elastix Vol. 1

The parameter Id represents network delay and is normalized by the following formula:

I d = 0.024 d + 0.11 (d 177.3) H(d 177.3)


Where d is the network delay in milliseconds and H( ) is the Heavyside function: H(x) = 0 for x < 0 y 1 for x 0. When analyzing the I d formula we will notice that there is an inflection value at 177.3 ms. This means that at higher values voice quality is affected at more severe rhythm. This is an interesting piece of data since it allows us to sketch an empirical rule to always keep network delay below 170 ms (approximately.) Finally, we need to calculate Ie so we can replace this value in the formula and calculate R Ie depends mainly on packet loss and the codec used. To maintain things relatively simple we will use a graph with which we can determine the approximate value of Ie depending on the two mentioned factors. The table is as follows:

Ie (y) vs. packet loss (x)

This graph was generated from the following approximate value table. The vertical axis represents the Ie parameter and the horizontal axis represents packet loss. Packet loss % 0 1 2 4 8 16 Ie [G.711] 0 3 5 7 9 20 Ie [G.723.1] 11 15 18 20 22 24 Ie [G.729A] 15 18 20 25 28 30

We can observe that the more compression is involved with the use of a particular codec, the more it contributes to the Ie parameter and the less voice quality. Even with zero packet loss, we can observe that some codecs will diminish voice quality.

http://www.elastixbook.com/en/chapters/chapter_13/13.3_How_to_measure_voice_quality.htm[24/11/2011 10:25:08 p.m.]

Unified Communications with Elastix Vol. 1

Translating R to the MOS scale Having calculated the value of R we will proceed to explain how to translate it to the better known MOS scale.

The formula is as follows:

MOS = 1 MOS = 1 + 0.035 R + 7 R (R 60) (100 R) 10 -6 MOS = 4.5

;R<0 ; 0 < R < 100 ; R > 100

Now we have a practical and objective way to measure voice quality in VoIP installation. In this way, we can make the necessary adjustments to improve the satisfaction of the telephone users. Example Let us suppose that we have done measurements in a point of the network and we want to determine voice quality at that point knowing that we use the G.711 codec. The network delay is 143 ms and packet loss reaches 7%. What is the voice quality measurement according to the MOS scale? After manipulating the values according to the expressions exposed before, we will arrive at a value similar to what follows:

R = 94.2 0.024 143 7.2 R = 83.57


Translating R to the MOS scale, well obtain:

MOS = 4.15
This is an acceptable result (4.15/5.00) since we will have satisfied users. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_13/13.3_How_to_measure_voice_quality.htm[24/11/2011 10:25:08 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

13.4 Echo cancellers


Operation of echo cancellers
It is very important to know how echo cancellers work to understand how to get the maximum benefit from them and maybe design our own or modify an existing one in case of it being open source. There are echo cancellers both in hardware and in software. Generally, it is preferred for echo cancelling to be implemented in hardware so that it will not overload the servers processor. The principles of echo cancelling are the same for both implementations. An echo canceller comes from a very simple logical principle. If echo means that a part of the outgoing signal is reflected in the incoming signal then to eliminate echo it should be enough with subtracting the outgoing signal (in a certain proportion) from the returning signal. Due to echo being a reflected signal that is dampened, the key is in estimating adequately this damping requirement. For example, let us suppose that the echo signal is 20% of the original signal. Then we can predict that by subtracting from the return signal 20% of the outgoing signal we will have eliminated the echo completely. At least in theory, of course. This prediction of the damping factor is a key part of any echo cancelling algorithm and receives the name of adaptive algorithm or adaptive filter. It is called this because it must adapt the value constantly to obtain better results. In the following figure, we will suppose the damping in the reflected signal is represented with . The received signal is Rx, the transmitted signal is Tx and the signal transmitted with the echo component is Txe.

Basic operation of an echo canceller

However, it is not as easy as is explained here. The echo is not just a dampened return signal but can also be displaced in time with a certain delay. Therefore, we also must be able to predict this delay to be able to subtract the echo signal. Predicting the delay is no easy task and generally, echo cancellers have limits. Checking the signal in search of delay for long lapses of time involves too much work and echo cancellers can stop working. Note: We should stop for a moment to remember that echo cancellers must work in real time and because of

http://www.elastixbook.com/en/chapters/chapter_13/13.4_Echo_cancellers.htm[24/11/2011 10:25:10 p.m.]

Unified Communications with Elastix Vol. 1

this cant spend time on complex calculations or they would stop being fast enough and would delay the sending of the voice. The typical delay values that an echo canceller can manage are 64 ms or 128 ms. Obviously, the smaller the delay, the smaller the work for the echo canceller (in terms of CPU use) but the bigger the possible imprecision. This maximum delay time that an echo canceller can tolerate is usually referred to as a tail.

G.168 standard
Some years ago ITU launched specifications that define the parameters on what an echo canceller should be. It could be said that the document is a recommendation. So, if an echo canceller is in concordance with that recommendation its said that it is G.168 compliant. However, G.168 is a complex technical specification and it is not easy to determine if an echo canceller is compatible or not. There are even companies that are dedicated to the tedious work of checking to see if an echo canceller is G.168 compatible or not. We will not go into detail here about G.168 since it is beyond the scope of this book. For more information about the technical details of G.168 we recommend you visit the ITU site (http://www.itu.int).

OSLEC
Elastix incorporates an interesting open source software echo canceller known as OSLEC (http://www.rowetel.com/ucasterisk/oslec.html). This echo canceller is part of DAHDI and can be configured independently for each channel easily from the Elastix Web Interface. This is an image of the hardware detection interface from where we can activate the echo cancelling support.

Echo cancelling configuration from the Elastix interface

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_13/13.4_Echo_cancellers.htm[24/11/2011 10:25:10 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

14
Uncovering VoIP Protocols
When wireless is fully applied the earth will be converted into a huge brain, capable of response in every one of its parts. -- Nikola Tesla, 1905

14.1 SIP Protocol


Session Initiation Protocol (SIP) is a signalization protocol (application-layer control) created to administer multimedia sessions between two or more parts. Contrary to what one may think, this protocol is not the one that transports the voice itself but is in charge of the necessary communication to establish, modify and end a call. SIP protocol was designed with a premise of simplicity in mind. It is a text protocol with simple communication messages. SIP even shares some status codes with HTTP, like the familiar 404: Not found. SIP is a peer-to-peer protocol. That means that practically all of the logic is stored at the endpoints.

Protocol details
Uses in itself two important protocols: RTP transmits voice and video SDP negotiates the endpoints capacity The latest version of the standard is RFC3261. Allows to easily understand transmitted messages by sending them as text, which makes debugging easier.

http://www.elastixbook.com/en/chapters/chapter_14/14.1_SIP_Protocol.htm[24/11/2011 10:25:11 p.m.]

Unified Communications with Elastix Vol. 1

SIP signalization
The SIP protocol uses methods and responses to achieve its operation. A method is a mechanism used to convey an action. A response, as its name indicates, contains the response to a method.

Methods Method INVITE ACK BYE CANCEL OPTIONS REGISTER INFO Description Invites a user to a call Abbreviation of acknowledgment sent to indicate that a message has been received. Ends a connection between users or rejects a call Stops the requirement or search for a user Asks for information about the capacity of the SIP server Registers the location of a user Interchanges signalization information for a user in the course of a session

Responses 1xx Informational (e.g. 100 Trying, 180 Ringing) 2xx Successful (e.g. 200 OK, 202 Accepted) 3xx Redirection (e.g. 302 Moved Temporarily) 4xx Request Failure (e.g. 401 Unauthorized, 404 Not Found, 482 Loop Detected) 5xx Server Failure (e.g. 501 Not Implemented) 6xx Global Failure (e.g. 603 Decline)

Registration
The following diagram illustrates the registration of a SIP endpoint against a SIP server. It must be taken into account that this is a simplified view since the registration process must also negotiate the codec being used as well as other parameters.

http://www.elastixbook.com/en/chapters/chapter_14/14.1_SIP_Protocol.htm[24/11/2011 10:25:11 p.m.]

Unified Communications with Elastix Vol. 1

SIP registration

This registration must be done periodically in a way that during the session its not necessary to send authentication information.

Session
After registration, the SIP endpoint can initiate a session (in our case a telephone call). In the following image, we illustrate the specific case of a conversation between two SIP endpoints. Messages such as ACKs have been intentionally omitted to make legibility better.

SIP session between two IP telephones

We should note that SIP is in charge of signalization only. The voice itself is transmitted through RTP protocol, which we will explain in more detail at the end of this chapter. As we can observe, all communications pass by the Elastix server. That is, Elastix works as a mediator (SIP Proxy.)

Asterisk and SIP


http://www.elastixbook.com/en/chapters/chapter_14/14.1_SIP_Protocol.htm[24/11/2011 10:25:11 p.m.]

Unified Communications with Elastix Vol. 1

Some details that we must take into accounts when we use SIP protocol with Asterisk are the following: Previous versions of Asterisk (up to 1.4 even) limited the function of SIP protocol to UDP. In todays versions of Asterisk, we can even make use of SIP over TCP. By default port 5060 is used for the SIP service although this parameter can be modified in the file sip.conf SIP has Network Address Translation (NAT) issues although this problem can be fought with parameters such as externip, localnet and nat in the file sip_nat.conf In Asterisk, it is possible to run a diagnostic of the SIP protocol. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_14/14.1_SIP_Protocol.htm[24/11/2011 10:25:11 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

14.2 IAX Protocol


Inter-Asterisk exchange (IAX) is a signalization protocol created by Mark Spencer, the same creator of Asterisk. Its objective is to solve existing problems with other protocols. This protocol is not an industry standard yet, but it wants to become so, through a standardization process at the IETF. In essence, IAX presents two very interesting advantages over other protocol alternatives, like SIP. Consumes less bandwidth Solves NAT and firewall problems better via the use of a single port Let us check each one of these advantage: Consumes less bandwidth While SIP is a text-based protocol, IAX is a binary protocol that has an advantage from the point of view of bandwidth consumption, since in binary, less bytes will be spent. Also, IAX protocol allows trunking of various audio channels in the same data flow. That is, that in the same datagram, you can send several sessions at once. This means a reusing of datagrams, which results in an additional saving of bandwidth. Solves NAT and firewall problems better SIP allows signalization from port 5060 and uses port pairs between 10000 and 20000 for the voice itself. This port separation tends to cause problems when sending voice communication through a firewall. IAX transmits in UDP and uses only port 4569 to transmit both signalization and voice. This allows communications to be conducted through firewalls much easier. The administrator must make sure to open just a single port in the firewall. Also, the IAX endpoint doesnt need to know anything about the network in which it is operating. This combination of attributes makes the case where the call is completed but the audio is not received to be eliminated. If we reflect on these advantages, well realize that IAX is perfect for trunking between two Elastix servers. In other words, when connecting two or more Elastix servers the use of IAX is highly recommended. The actual version of IAX protocol is 2. The former is obsolete, so its common to see the name IAX2 as a synonym for IAX.

Phases of an IAX call


An IAX call has three phases, which are explained below.

Establishing a call To initiate a call the machine that initiates it (machine A) sends a NEW message to the receiving machine (machine B). This last one responds with the message ACCEPT. After this, machine B will ring its bell waiting for

http://www.elastixbook.com/en/chapters/chapter_14/14.2_IAX_Protocol.htm[24/11/2011 10:25:13 p.m.]

Unified Communications with Elastix Vol. 1

the user to life the earpiece. If this happens, machine B will send an ANSWER message to machine A to notify it that the user answered. Note: Some ACK messages have been intentionally omitted in this explanation to make it clearer.

Establishment of an IAX call

Ongoing call Once the call is answered by machine B the interchanged of audio is initiated with packets called frames. These frames are sent within the same communications flow as the initial signalization.

Hang-up Any of the involved parties in a conversation can send a HANGUP message to end the call at any time.

Hanging up of an IAX call

Frames

http://www.elastixbook.com/en/chapters/chapter_14/14.2_IAX_Protocol.htm[24/11/2011 10:25:13 p.m.]

Unified Communications with Elastix Vol. 1

To interchange audio between two participants in a call there can be two kinds of frames used both specific for IAX called full and mini. They are also known as F and M because of their initials. A conversation is composed mostly of mini-type frames, whose advantage is (as the name suggests) of being small and light. That means that they have a small 4-byte header, which helps save bandwidth. Occasionally there is an interchange of full-type frames, which additionally have synchronization information to keep both points synchronized.
1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |F| Origin number |R| Destination number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | time-stamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | OSeqno | ISeqno | Frame type |C| Subclass | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | : Data : | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Full-type frame

1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |F| Origin number | time-stamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | : Data : | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Mini-type frame

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_14/14.2_IAX_Protocol.htm[24/11/2011 10:25:13 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

14.3 RTP protocol


RTP is the protocol that is charged with transporting voice itself. Many people get confused and think this is what SIP does, but that is not right. As we have seen before in this chapter, once SIP establishes that a call is made, RTP takes charge of transporting voice to its destination. RTP works on UDP so there is not much transmission control. This implies the sending equipment sends the voice to the other end with only the hope that it will arrive. Therefore, it does not expect to receive confirmation of the received message since voice needs to be transmitted in real time and any delay can compromise voice quality. If a voice packet is lost in the way that space is simply filled with silence. Technically this is called comfort noise. It is because of this necessity to transmit data in real time that it is obvious that RTP is an acronym for Real Time Protocol. RTP works with the help of another protocol called RTCP. This protocol is not complete indispensable but it gives valuable help at the moment of transporting voice optimally since it gives statistics and control information. This information itself allows the involved voice devices in the conversation to make decisions to better the transmission in case it is possible. For this effect, RTCP packets are transmitted periodically.

Structure of an RTP packet


An RTP packet is composed of a header and the payload. The following diagram illustrates the structure of the header in RTP packets. Byte 1 P X Byte 2 CC M Byte 3 Byte 4 Sequence number

V=2

PT Timestamp Synchronization Source (SSRC) Contributing Source (CSRC) Extension (optional depending on Bit X) Data

These fields are defined as follows: V is the version number. This field is 2 bits long and its value is always the number 2. P is a bit that indicates if there is padding at the end of the date. Padding is nothing more than additional bits at the end of a payload used to accommodate certain encrypting algorithms that expect a fixed size payload. X or extension is a bit that indicates if theres an extension of the header CC is a 4 bit identifier that indicates the CSRC count M marker of one bit PT or payload type is a 7-bit identifier that indicates the kind of payload that this RTP packet contains.
http://www.elastixbook.com/en/chapters/chapter_14/14.3_RTP_protocol.htm[24/11/2011 10:25:14 p.m.]

Unified Communications with Elastix Vol. 1

Examples of types are G729, GSM, PCMU (G711 u-law), and others. Sequence number: Is a whole number that identifies each packet in the present data flow. This sequential identifier goes up by one for each transmitted packet. It occupies 16 bits. Timestamp represents the point in time in which the data sampling was started to transmit in the payload. It occupies 32 bits. SSRC identifies the synchronization source since the same device may be communicating with different RTP packet sources. It is a random 32 bit number for which there is the possibility (although low) that this number will repeat in two sources. There are mechanisms to solve this problem CSRC is a 32-bit number that identifies the sources contributing to the payload. Extension is a field of variable length that allows extending the header functionality. This information is only attached to the RTP header if the bit X indicates so. After the header, the data must be transmitted; this is nothing more than the audio properly converted to digital and codified. We should remember that RTP uses two ports for communication, one for going and one for returning. This pair of ports is negotiated when the call between the points is established but in the case of Asterisk, it is between the ranges of 10000 and 200000. However, this can be configured in the file /etc/asterisk/rtp.conf. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_14/14.3_RTP_protocol.htm[24/11/2011 10:25:14 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

14.4 SRTP Protocol


SRTP or Secure RTP is, as its name indicates, an alternative to RTP when we need to encrypt the transmitted information. In our case, it becomes useful when it is necessary to guarantee that a call will not be listened to by an interceptor, maintaining the information confidential. From the point of view of a real time protocol, it becomes difficult to conceive of a data encryption that does not add delay to the communication. If each packet must be encrypted in the origin and decrypted in the destination, without a doubt this will add an additional delay, depending on the power of our CPU, which is the one that will realize the necessary math for the data encryption. Also we can think that the use of encrypting algorithms will add additional bandwidth which is always undesirable. All of the above fears are valid and were in the mind of the people that designed the protocol. That is why if we read the official document where the protocol is defined (RFC 3711) we will see that apart from the obvious SRTP objectives (confidentiality of the information and data integrity) these others are defined: Low impact on bandwidth Low computational cost In general, we can say that they did a good job and the protocol does not add a significant bandwidth or computing cost so in most cases we can implement SRTP without fears. SRTP is available natively in Asterisk from version 1.8 and activating it is pretty easy. For example, if the communication is SIP its enough adding to the configuration at each endpoint the parameter encryption=yes Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_14/14.4_SRTP_Protocol.htm[24/11/2011 10:25:15 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

15
Basic problem diagnostics
If Id asked people what they wanted, they would have asked for a faster horse -- Henry Ford, founder of the Ford Motor Company

15.1 Interpreting the log


It is very important to understand how to read Asterisks log files since from there we can extract very valuable information in our diagnostic process. The level of detail and the kind of information in the log files are controlled from the file /etc/asterisk/logger.conf. This is a plain text file where the names of the log files and the level of detail written into them are defined. This is done in single line, with the following syntax:
File name => Debugging levels

Where the debugging levels are separated by a comma and can be the following: debug notice warning error verbose

http://www.elastixbook.com/en/chapters/chapter_15/15.1_Interpreting_log.htm[24/11/2011 10:25:16 p.m.]

Unified Communications with Elastix Vol. 1

Note: There is a special kind of reserved file name called console. This name represents the asterisk console, that is, what is shown in the Asterisk CLI. The following is a fragment of the contents of the logger.conf file that is distributed with Elastix.
; Directory for log files is configures in asterisk.conf ; option astlogdir ; [logfiles] ; ; Format is "filename" and then "levels" of debugging to be included: ; debug ; notice ; warning ; error ; verbose ; ; Special filename "console" represents the system console ; ;debug => debug ; The DTMF log is very handy if you have issues with IVRs ;dtmf => dtmf ;console => notice,warning,error ;console => notice,warning,error,debug ;messages => notice,warning,error full => notice,warning,error,debug,verbose

In the previous example, we see come commented lines and a single activated log file names full. This one, as well as other files defined in this way, is in the path /var/log/asterisk/.

The /var/log/asterisk/full file


According to the logger.conf file, Elastix activates by default the log file full where Asterisk writes information about its operation. Each line of this file has the following format: [TIME DATE]LEVEL[PID]FILE_NAME: MESSAGE Below we will see an example of the Asterisk log file.

http://www.elastixbook.com/en/chapters/chapter_15/15.1_Interpreting_log.htm[24/11/2011 10:25:16 p.m.]

Unified Communications with Elastix Vol. 1

Log file /var/log/asterisk/full

Log monitoring It is very important to follow the Elastix servers activity in real time. Many times well find ourselves doing this while we make or take a call to find out what went wrong. The following is a useful method to interactively check the log file full as it is being written with Asterisks messages.
tail -f /var/log/asterisk/full

If we want to interactively see only the errors, we can add the following filter:
tail -f /var/log/asterisk/full | grep ERROR

If we also want to see warnings, we can slightly alter the filter in the following way:
tail -f /var/log/asterisk/full | grep -E "(ERROR|WARNING)"

Note: If we want to check the whole log instead of doing it interactively we need to replace the command tail f with the command cat

What information can the MESSAGE field give us?


MESSAGE refers to the information that is at the right side of each log line, after the file name. If it is an ERROR or WARNING line here, we will find a brief explanation of the error that occurred or of the warning. However, there are other lines with messages that are less obvious and that simply describe the processing of a call through the dial plan. These lines are usually marked with a VERBOSE level since they are simply informative.

http://www.elastixbook.com/en/chapters/chapter_15/15.1_Interpreting_log.htm[24/11/2011 10:25:16 p.m.]

Unified Communications with Elastix Vol. 1

These VERBOSE level lines (and other informative lines) give use very useful information for problem diagnostics. Especially useful are those that start with the word Executing since they then mention the context and priority in which Asterisk is processing the dial plan. The syntax for these lines is the following: [TIME DATE] VERBOSE[PID] logger.c: MORE_TEXT -- Executing [extension@context:priority]

MORE_TEXT can contain information about the application that was executed and the parameters that it received. Let us see an example of this:
[Oct 28 17:52:34] VERBOSE[22034] logger.c: -- Executing [s@macro-dial:7] Dial("Local/502@from-internal-e27c,2", "SIP/502|21|trTWuwM(auto-blkvm)") in new stack

In this example, we see that when this log line was written we were in the macro-dial context (a macro, since it starts with the word macro.) Also, the extension was s and the priority was 7. We can also observe that it is trying to dial with the application Dial() using certain parameters. In any case, we can observe that there is a lot of useful information that we can obtain from each written line in the log.

Process number (PID)


Asterisk is multiprocessing software. This means that it can create several instances of itself that will work in a coordinated way between themselves to execute different tasks at the same time. When Asterisk writes a line in the log, it also writes the process number (PID) that wrote it. This gives us valuable information since we can have a more exact view of the call process. To do this we can filter the PID if we know it.
cat /var/log/asterisk/full | grep 38484

With the above command, we were filtering the output to show process 38484. Of course, we could also capture another chain of characters that matches with the pattern 38484. However, these lines are irrelevant and can be discarded manually. Thanks to this, we can filter the process of a call and isolate it to find errors. This is particularly useful in an environment with a high number of simultaneous calls due to the high quantities of information that Asterisk writes into the log. Note: Something important to take into account is that a call can have more than one process (and PID) involved. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_15/15.1_Interpreting_log.htm[24/11/2011 10:25:16 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

15.2 Diagnostics through the CLI


From the Asterisk CLI we can see Asterisks operation in real time. Its something similar to "tail -f /var/log/asterisk/full" but with the advantage of seeing the output text bolded (for better reading.) Also, the CLI allows us to interact simultaneously with Asterisk by executing some commands from the console. Elastix gives us a direct interface to the Asterisk CLI found in PBX->Tools and based on the Web. Using the CLI from the Web Interface can be very comfortable since you do not have to start a SSH session, which many times is restricted for remote connections. It should be noted that from the Web interface it is not possible to have an interactive CL. This is the main difference between executing the CLI from the command lines as opposed to executing it from the Web.

To access the CLI from the command line it is necessary to execute the following.
asterisk -r

Following is an example of the execution of the help command from the Elastix Web Interface.

Executing the CLI from the Elastix Web Interface.

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_15/15.2_Diagnostics_through_CLI.htm[24/11/2011 10:25:18 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

15.3 Sniffing
The term sniffing describes how packets are captured from the network in their original format for later analysis. There are specialized tools for this end and some can cost a real fortune. Luckily, there are open source solutions that do a great job, as is the case of Wireshark. Wireshark was previously known as Ethereal. This powerful sniffer contains advanced analysis tools that allow us to analyze RTP and SIP packets, among others. To capture the details of a call and analyze it we must first define the servers network card in which we will listen, if there is more than one. Packet capture itself is very easy and we only need to execute Wireshark by following the instructions. After the capture is ended, it is probable that along with the voice packets we captured other packets that were circulating the network. Many of these packets, like ICMP, DNS and SMTP are not interesting for our purpose but with practice, filtering these irrelevant packets is something that we should learn. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_15/15.3_Sniffing.htm[24/11/2011 10:25:19 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

16
Asterisk external control
Respect is something that is earned, not something that is demanded of others. -- Anonymous Many times editing the dial plan is not enough and a more flexible mechanism is necessary to handle what the company needs. On other occasions, we would even like to control Asterisk in real time through a remote application. To expand the behavior of Asterisk beyond the dial plan there are two very useful interfaces called AGI and AMI. These interfaces allow us to interact with Asterisk at a level that is much more powerful than the one achieved until now.

16.1 Asterisk AGI


Asterisk Gateway Interface (AGI) established a way to interact with Asterisk from a command line program. This program can be written in practically any programming language and is invoked by Asterisk from the dial plan. At the moment of invoking an AGI program, certain parameters are sent to it and it responds with AGI commands that are understood by Asterisk. The AGI usefulness is huge and allows us to develop extra functionality for our PBX. A common example of this is the development of applications for the telephonic query of databases. AGI programs or scripts are very popular. Elastix comes with some of these scripts preinstalled by default in the folder /var/lib/asterisk/agi-bin/

http://www.elastixbook.com/en/chapters/chapter_16/16.1_Asterisk_AGI.htm[24/11/2011 10:25:20 p.m.]

Unified Communications with Elastix Vol. 1

Execution of AGI scripts


AGI scripts communicate with Asterisk through the file descriptors STDIN, STDOUT and STDERR. This means that they should be executable from the same command line. Something very important that should be mentioned is that AGI scripts need to have execution permission for the asterisk user and group so that they can run. We can assign permissions in the following way:
# chown asterisk.asterisk script_prueba.agi # chmod 755 script_prueba.agi

After this, we can execute the AGI script from the dial plan so it can do something useful. It does this thanks to the AGI() function. Below is an example.
exten => 6789,1,Answer exten => 6789,2,AGI(script_prueba.agi)

As we see in the above example, we have told Asterisk to execute the script called script_prueba.agi. This script will execute when the user dials the extension 6789. By default Asterisk will assume that the script is in the path var/lib/asterisk/agi-bin/ although another path can be specified with the AGI() function.

Parameters sent to the AGI() script


As we had said before, Asterisk sends certain information to the AGI script when it is invoked. Below is an example of the information sent to the script dialparties.agi, which is a component of FreePBX when we execute it.
agi_request: dialparties.agi agi_channel: SIP/4444-08d6ab60 agi_language: en agi_type: SIP agi_uniqueid: 1222117320.271 agi_callerid: 4444 agi_calleridname: Edgar Landivar agi_callingpres: 0 agi_callingani2: 0 agi_callington: 0 agi_callingtns: 0 agi_dnid: 216 6 agi_rdnis: unknown agi_context: macro-dial agi_extension: s agi_priority: 3 agi_enhanced: 0.0 agi_accountcode:

In addition to the information Asterisk sends the AGI script by default, we can send it additional information invoking the AGI() function with certain parameters, in the following way:
http://www.elastixbook.com/en/chapters/chapter_16/16.1_Asterisk_AGI.htm[24/11/2011 10:25:20 p.m.]

Unified Communications with Elastix Vol. 1

exten => 6789,1,Answer exten => 6789,2,AGI(script_prueba.agi|param1|param2|param3)

In the above example, the additional parameters param1, param2 and param3 were sent to the script. The script can receive as many parameters as is necessary.

AGI commands
As a reference for the reader, below we will show a list of the available AGI commands in the latest version of Elastix. This list has been generated with the command agi show commands from the CLI. Command answer asyncagi break channel status database del database deltree database get database put exec get data get full variable get option get variable hangup noop receive char receive text record file say alpha say digits say number say phonetic say date say time say datetime send image send text set autohangup Description Answers the channel Interrupts the Async AGI Returns the status of the connected channel Eliminates a code/value from the database Eliminates a tree code/value from the database Obtains a value from the database Adds/updates a value on the database Executes an application Listens for DTMF tones on a channel Evaluates a channel expression File stream, listens for DTMF, with timeout Obtains a channel variable Hangs up the current channel Does nothing Receives a character from the channels that support it Receives text from the channels that supports it Records a file Vocalizes a chain of characters Vocalizes a chain of digits Vocalizes numbers Vocalizes a chain of characters phonetically Vocalizes a date Vocalizes a time Vocalizes a time in a specific format Sends images to the channels that support it Sends text to channels that support it Auto hangs up a channel after a certain time

http://www.elastixbook.com/en/chapters/chapter_16/16.1_Asterisk_AGI.htm[24/11/2011 10:25:20 p.m.]

Unified Communications with Elastix Vol. 1

set set set set set

callerid context extension music priority

set variable stream file control stream file tdd mode verbose wait for digit speech create speech set speech speech speech speech speech speech gosub destroy load grammar unload grammar activate grammar deactivate grammar recognize

Specifies callerid for the current channel Specifies a context for the current channel Changes the channels extension Starts/stops the waiting music generator Specifies the priority in the dial plan for the channel Specifies a channel variable Sends an audio file in the channel Sends an audio file in the channel and allows the receiver to control the stream Changes TDD more (for deaf people) Writes a messages in the verbose log file for Asterisk Waits for the entering of a digit Creates an object for speech recognition Specifies an option for the voice recognition engine Destroys an object for speech recognition Loads a vocabulary Unloads a vocabulary Activates a vocabulary Deactivates a vocabulary Speech recognition Executes the dial plan subroutine

AGI libraries
Even though an AGI script can be written in practically any language, some languages already count with libraries to facilitate development tasks. Some of those languages are the following: Perl PHP Python Ruby C .NET For more information on libraries or frameworks that are available for these languages, we recommend you check this link: http://www.voip-info.org/wiki-Asterisk+AGI In our case, we will use a PHP library called phpAGI with which we will code a simple sample AGI script in the next section:

Example of a simple AGI script


http://www.elastixbook.com/en/chapters/chapter_16/16.1_Asterisk_AGI.htm[24/11/2011 10:25:20 p.m.]

Unified Communications with Elastix Vol. 1

To better illustrate how an AGI script works, we will code something very basic. This script vocalizes a number when we dial a specific extension. Following the PHP code:
#!/usr/bin/php -q <?php echo "SAY NUMBER 1234 \n"; sleep(4); ?>

We can save this code as simple.agi in the standard path /var/lib/asterisk/agi-bin/ Once saved, we must make sure that the script can be executed by the asterisk user in the asterisk group. As we have explained before, this is done in the following way:
chown asterisk.asterisk /var/lib/asterisk/agi-bin/simple.agi chmod 755 /var/lib/asterisk/agi-bin/simple.agi

Finally, we must modify the dial plan to invoke our AGI script when a specific extension is marked. We will use extension 6789 for this example:
exten => 6789,1,Answer exten => 6789,2,AGI(simple.agi) exten => 6789,3,Hangup

These instructions can be found at the end of the file /etc/asterisk/extensions_custom.conf, since that file isnt overwritten by FreePBX. Ready! Dial extension 6789 and you will hear the code say: one two three four. Previous Go to Index Next

http://www.elastixbook.com/en/chapters/chapter_16/16.1_Asterisk_AGI.htm[24/11/2011 10:25:20 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

16.2 Asterisk AMI


The Asterisk Manager Interface (AMI) establishes a way to communicate with Asterisk through IP protocol. Let us say that it is a similar concept to AGI but oriented towards execution from remote devices. It is this last thing that turns it into a powerful tool. With the functionality, that AMI provides powerful client applications can be developed that can be executed in other computers thus freeing the Asterisk servers load. One example of what can be done with AMI is the call center module that is a part of the Elastix project. This Elastix module is coded using mostly AMI. Due to AMI allowing remote devices to control the Asterisk operation, it is required for these devices to authenticate themselves. The users, passwords and permissions are defined in a file called /etc/asterisk/manager.conf The following represents a part of the file manager.conf that is distributed with Elastix by default.
; ; AMI - Asterisk Manager interface ; [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 [admin] secret = elastix456 deny=0.0.0.0/0.0.0.0 permit=127.0.0.1/255.255.255.0 read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate #include manager_additional.conf #include manager_custom.conf

In this file, a user is defined, named admin with the elastix456 password that can connect from the IP 127.0.0.1 with a 255.255.255.0 mask. After this, certain permissions are defined for this user.

Testing from telnet


To test the AMI interaction, it is not necessary to have a sophisticated program. A simple way to do it is through the telnet program, available on any computer. Let us see an example executing this command from the Elastix server itself and assuming the above configuration file. First, we connect to the Elastix server through a telnet session. For this, we execute the following from the command line:
[root@elastix ~]# telnet 127.0.0.1 5038 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. Asterisk Call Manager/1.1

As we can see, the server has answered us with a message indicating that AMI is listening and is telling us that it is using version

http://www.elastixbook.com/en/chapters/chapter_16/16.2_Asterisk_AMI.htm[24/11/2011 10:25:22 p.m.]

Unified Communications with Elastix Vol. 1

1.1 of the protocol. Below we authenticate with the user name and password specified in the file manager.conf. We need to write the following in the terminal.
Action: Login ActionID: 1 Username: admin Secret: elastix456

It is important to know that after writing the above command and sending it we must return twice. That is, we must press Enter two times to send the previous authentication petition. AMI will answer with a success or an error message after this. The following is the message we get when it is successful.
Response: Success ActionID: 1 Message: Authentication accepted

From now on, register messages that AMI will send to our session each time an event occurs will start to appear. For example, we will receive messages when a call is ended or if an extension is ringing. Once the session is authenticated, we can perform commands, also known as actions, directly through AMI.

AMI packet types


In AMI communication, there are three different types of information packets. Action: A command sent by the AMI service client to be processed. Response: Asterisks response to the action required by the client. Event: The information of an asynchronous event that occurred in Asterisk. For example, the arrival of a telephone call. To relate the responses with the actions an ActionID can be included with each action. Asterisk will return this parameter in the response.

AMI actions or commands


The following AMI command listing is obtained when the command manager show commands is executed from the Elastix CLI. Command Privileges Description Specifies absolute timeout Specifies that a user has stopped being authenticated Lists agents and their states Adds an AGI command for execution

AbsoluteTimeout

system,call,all

AgentLogoff

agent,all

Agents

agent,all

http://www.elastixbook.com/en/chapters/chapter_16/16.2_Asterisk_AMI.htm[24/11/2011 10:25:22 p.m.]

Unified Communications with Elastix Vol. 1

AGI Atxfer

agi,all call,all

with AGI

Async

Bridge

call,all

Challenge

<none>

ChangeMonitor

call,all

Attended transfer Connects two channels present in the PBX Generates a challenge for MD5 authentication Changes the monitoring file for a channel Executes a CLI command Shows the PBX core settings (version, etc.) Lists current active channels Shows status variables for the PBX core Creates an empty file in the configuration directory Dial on a DAHDI channel while its offhook Changes the do not disturb (DND) state of the DAHDI channel to OFF Changes the do not disturb (DND) state of the DAHDI channel to ON Hangs up the DAHDI channel Completely restarts the DAHDI channels (ends all calls)

Command

command,all

CoreSettings

system,reporting,all

CoreShowChannels

system,reporting,all

CoreStatus

system,reporting,all

CreateConfig

config,all

DAHDIDialOffhook

<none>

DAHDIDNDoff

<none>

DAHDIDNDon

<none>

DAHDIHangup

<none>

DAHDIRestart

<none>

http://www.elastixbook.com/en/chapters/chapter_16/16.2_Asterisk_AMI.htm[24/11/2011 10:25:22 p.m.]

Unified Communications with Elastix Vol. 1

DAHDIShowChannels

<none>

Shows the DAHDI channel state Transfers DAHDI channel a

DAHDITransfer

<none>

DBDel

system,all

Deletes a register in the database Deletes a tree in the database Obtains a register from the database Adds a register to the database Controls the flow of an event Verifies the state of an extension Obtains the configuration Obtains the configuration in JSON format Obtains channel variable a

DBDelTree

system,all

DBGet

system,reporting,all

DBPut

system,all

Events

<none>

ExtensionState GetConfig

call,reporting,all system,config,all

GetConfigJSON

system,config,all

Getvar Hangup

call,reporting,all system,call,all

Hangs up a channel Shows IAX network statistics Lists peers Lists peers IAX IAX

IAXnetstats IAXpeerlist IAXpeers IAXregistry

system,reporting,all system,reporting,all system,reporting,all system,reporting,all

ListCategories

config,all

ListCommands

<none>

Shows IAX registry Lists the categories in the configuration file Lists the available manager commands (AMI) Starts Manager session Ends Manager a

Login

<none>

http://www.elastixbook.com/en/chapters/chapter_16/16.2_Asterisk_AMI.htm[24/11/2011 10:25:22 p.m.]

Unified Communications with Elastix Vol. 1

Logoff

<none>

session Checks the number of messages in the inbox Checks the inbox Lists the participants in a conference Mutes a meetme user Unmutes a meetme user Verifies if a module is loaded Loads module Monitors channel Originates call Parks channel a a a a

MailboxCount MailboxStatus

call,reporting,all call,reporting,all

MeetmeList MeetmeMute MeetmeUnmute

reporting,all call,all call,all

ModuleCheck ModuleLoad Monitor Originate Park ParkedCalls

system,all system,all call,all originate,all call,all <none>

Lists parked calls Pauses channel monitoring Command to maintain the connection active Plays DTMF signal in a specific channel Adds an interface to the queue Adds a personalized record to the queue log Establishes a member of a queue as temporarily unavailable Establishes the penalty for a member of a queue Reloads a queue, queues or any subsection of

PauseMonitor

call,all

Ping

<none>

PlayDTMF

call,all

QueueAdd

agent,all

QueueLog

agent,all

QueuePause

agent,all

QueuePenalty

agent,all

http://www.elastixbook.com/en/chapters/chapter_16/16.2_Asterisk_AMI.htm[24/11/2011 10:25:22 p.m.]

Unified Communications with Elastix Vol. 1

QueueReload

<none>

a queue or queues Deletes an interface from a queue Dumps the statistics for a queue Queue rules Queues Queue status Queue summary Transfers call a

QueueRemove

agent,all

QueueReset QueueRule Queues QueueStatus QueueSummary Redirect Reload

<none> <none> <none> <none> <none> call,all system,config,all

Sends a reload event Sends a text message to the channel Establishes a channel variable Shows the dial plan Sends a SIP notification Lists SIP peers (text format) Shows SIP peers (text format) Shows SIP peers (text format) Shows SIP registry (text format)

SendText

call,all

Setvar ShowDialPlan SIPnotify

call,all config,reporting,all system,all

SIPpeers

system,reporting,all

SIPqualifypeer

system,reporting,all

SIPshowpeer

system,reporting,all

SIPshowregistry Status StopMonitor

system,reporting,all

Lists the system,call,reporting,all channel status call,all Stops channel monitoring Unpauses channel monitor a

UnpauseMonitor UpdateConfig

call,all config,all

Updates basic configuration Sends arbitrary event an

UserEvent

user,all

VoicemailUsersList call,reporting,all

WaitEvent

<none>

Lists all the information for voicemail users Waits for an event to occur

http://www.elastixbook.com/en/chapters/chapter_16/16.2_Asterisk_AMI.htm[24/11/2011 10:25:22 p.m.]

Unified Communications with Elastix Vol. 1

Previous

Go to Index

Next

http://www.elastixbook.com/en/chapters/chapter_16/16.2_Asterisk_AMI.htm[24/11/2011 10:25:22 p.m.]

Unified Communications with Elastix Vol. 1

A
Previous File a2billing.conf additional_a2billing_iax.conf additional_a2billing_sip.conf adsi.conf adtranvofr.conf agents.conf alarmreceiver.conf alsa.conf amd.conf applications.conf asterisk.conf

Go to Index

Asterisk configuration files distributed with Elastix


Description General configuration file for a2billing IAX configuration for a2billing SIP configuration for a2billing ADSI configuration file (Analog Display services Interface.) With ADSI Asterisk can interact with the analog telephones display. Configuration file that allows voice support on Frame Relay Configuration file that allows managing of agents in queues. Serves to configure the application AlarmReciever(). Configures the sound driver for the ALSA drivers Used for automatic detection of answering machines Basically includes the dial plan. The contexts included here can be called applications and their name starts with the chain app-. Main configuration file for Asterisk. Here are configured the work directories for Asterisk as well las some general options. Configuration file for the Asterisk module

cbmysql.conf

http://www.elastixbook.com/en/chapters/Appendix.htm[24/11/2011 10:25:23 p.m.]

Unified Communications with Elastix Vol. 1

cdr.conf cdr_custom.conf cdr_manager.conf cdr_mysql.conf

cdr_odbc.conf

cdr_pgsql.conf

cdr_tds.conf

chan_dahdi.conf

chan_dahdi_additional.conf cli.conf codecs.conf dahdi-channels.conf

dnsmgr.conf

dundi.conf enum.conf extconfig.conf

extensions.ael extensions.conf

CBMySQL (Conference Bridge MySQL) used to manage conferences in Elastix. Main configuration file for CDR reporting This file defines what is written in Asterisk CDRs. This file controls whether CDRs are sent through AMI (Asterisk Manager Interface). Configuration file for the module cdr_mysql that allows registering CDRs in the MySQL database. Here the module that allows registering CDRs through the ODBC driver of the database is configured Here the module that allows registering CDRs in the PostgreSQL database is configured. With this file we can configure the module that allows registration of CDRs through freeTDS drivers. For example, with this module we can register CDRs in the MSSQL database. This file contains the DADHI-type channel configuration. This file also includes the files chan_dahdi_additional.conf and dahdi-channels.conf. This file is overwritten by FreePBX mainly when DAHDI-type extensions are created. Configuration file for the Asterisk console. In this file some options are configured that control the operation of some codecs. This file is included in chan_dahdi.conf and is an automatically generated file by the Elastix Hardware Detector through the tool dahdi_genconf. This file defines whether Asterisk should realize regular DNS petitions and how often. DUNDI configuration file (Distributed Universal Number Discovery). ENUM configuration file Allows configuration of what is known as external configuration. Basically a functionality that allows mapping any configuration file with an external entity, like a database. Dial plan in AEL format (Asterisk Extension Language). Not used in Elastix Configuration file that includes extensions_additional.conf and extensions_custom.conf.

http://www.elastixbook.com/en/chapters/Appendix.htm[24/11/2011 10:25:23 p.m.]

Unified Communications with Elastix Vol. 1

extensions_a2billing.conf extensions_additional.conf

extensions_custom.conf

features.conf

features_applicationmap_additional.conf

features_applicationmap_custom.conf

features_featuremap_additional.conf

features_featuremap_custom.conf

features_general_additional.conf features_general_custom.conf

festival.conf followme.conf func_odbc.conf

globals_custom.conf

gtalk.conf h323.conf

http.conf

Additional dial plan for the application A2Billing Asterisk configuration file modified for FreePBX that should not be edited by hand because all changes are lost File where personalized contexts for Asterisk can be created without FreePBX overwriting them. Here some Asterisk features can be configured, like transfer parameters and call capture. File included in features.conf that contains the configuration of the applicationmap section and that is overwritten by FreePBX File included in features.conf that contains the configuration of the applicationmap section and that can be modified by the user since its not overwritten by FreePBX File included in features.conf that contains elements of configuration of the featuremap section and that is overwritten by FreePBX File included in features.conf that contains the configuration of the featuremap section and that can be modified by the user since it isnt overwritten by FreePBX. General features configuration file that is overwritten by FreePBX General features configuration file that can be modified by the user because FreePBX doesnt overwrite it. Festival configuration file. Configuration for the followme functionality Allows configuring connection parameters in a database through the ODBC driver to make fast queries through the same dial plan. Allos the user to define global variables that wont be overwritten by FreePBX. This file is included in extensions_additional.conf. Configuration file so that Asterisk work as a client for the service Google Talk. Configuration file for the H.323 protocol according to the implementiation baes on Project open H.323. There are other implementations. Configuration for the mini web server

http://www.elastixbook.com/en/chapters/Appendix.htm[24/11/2011 10:25:23 p.m.]

Unified Communications with Elastix Vol. 1

iax.conf iax_additional.conf iax_custom.conf iax_general_additional.conf

iax_general_custom.conf

iax_registrations_custom.conf

iax_registrations.conf

iaxprov.conf indications.conf

jabber.conf

jingle.con

localprefixes.conf logger.conf

manager.conf manager_additional.conf manager_custom.conf

meetme.conf

embedded in Asterisk. By default this service is turned off so one should be careful not to lift it in the same port as the Apache server that is integrated in Elastix. Main IAX file that includes the others. IAX configuration generated by FreePBX that shouldnt be edited IAX configuration that can be edited since its not overwritten by FreePBX File complementary to iax.conf where FreePBX writes general configuration. This is because now the file iax.conf is simply an inclusion file, in other words that it includes other file Similar to iax_general_additional.conf but here the user can write FreePBX doesnt overwrite information since this file. Similar to iax_registrations.conf but this file isnt overwritten by FreePBX, allowing it to store user configuration without it being written over. File used by FreePBX to store registry chain information with other PBXs or VoIP providers that use IAX protocol. File used to update the IAX devices firmware File to configure tone definition. These tones can vary from one country to the next or from one telephone company to the next. File that allows configuration of XMPP support in Asterisk. This is because Asterisk can connect as a client to a XMPP server. (The name Jabber is the previous name for XMPP protocol.) Jingle configuration file. Jingle is an extension of XMPP protocol that allows supporting multimedia through this protocol. File that allows to configure dialing rules based on prefixes. In this file Asterisk logging can be configured. See the diagnostics section for more information. Configuration file for the Asterisk Manager Interface service. AMI configuration information that can be overwritten by FreePBX. Configuration information for AMI for user access, since this file isnt overwritten by FreePBX. Configuration of permanent conference

http://www.elastixbook.com/en/chapters/Appendix.htm[24/11/2011 10:25:23 p.m.]

Unified Communications with Elastix Vol. 1

meetme_additional.conf mgcp.conf misdn.conf modem.conf

modules.conf musiconhold.conf

musiconhold_additional.conf musiconhold_custom.conf

muted.conf

osp.conf

oss.conf

rooms. Configuration for written conference rooms for FreePBX. Configuration of MGCP protocol Configuration file for the chan_misdn channel in Asterisk Configuration file for modem and ISDN support using ISDN4Linux or CAPI4Linux drivers. This file tells Asterisk which modules to load and which not to load. Here the waiting music is configured. Asterisk is very flexible and even supports audio streaming. Configuration file for waiting music, overwritten by FreePBX. Waiting music definition defined by the user. This file isnt overwritten by FreePBX. Allows sensing audio to certain channels and reducing the volume for those channels while they are active. Allows configuration for OSP protocol (Open Settlement Protocol). This protocol allows us to interchange information (like accounting and use) with providers that support that protocol. Allows configuration for OSS (Open Sound System) channels. OSS is an audio driver (or a group of audio drivers) and allows us to configure channels in the sound card itself. Something similar to the ALSA report. File the stores certain parking lot information. This file is automatically written by the module Parkinglot. Allows configuring phone-type channels that are based on a project Linux channel implementation, or Linux Telephony that supports these kinds of Linux devices. Configures some basic parameters for the support of PHPAGI library Basically this file defines the number of tries that a user has to try to enter a valid telephone number into the application PrivacyManager(). General configuration file for queues. If one wishes to edit queues in a text file its recommended to modify queues_custom.conf.

parking_additional.inc

phone.conf

phpagi.conf privacy.conf

queues.conf

http://www.elastixbook.com/en/chapters/Appendix.htm[24/11/2011 10:25:23 p.m.]

Unified Communications with Elastix Vol. 1

queues_additional.conf

queues_custom_general.conf

queues_custom.conf

queues_general_additional.conf queues_post_custom.conf res_mysql.conf

res_odbc.conf res_pgsql.conf res_snmp.conf rpt.conf

rtp.conf

say.conf sip.conf sip_additional.conf sip_custom.conf sip_general_additional.conf

sip_general_custom.conf

sip_nat.conf sip_notify.conf sip_registrations_custom.conf

File that creates queues generated from FreePBX. Should not be manually modified because changes may be lost. General queue configuration file written by the user, that is, its not written over by FreePBX. Queue configuration file that can be modified by users without being deleted by FreePBX. General queue configuration file written by FreePBX. FreePBX does not use this file now. Allows Asterisk to obtain the configuration of the MySQL database. This concept is named Asterisk Realtime. Allows Asterisk to obtain the configuration for databases through the ODBC driver. Allows Asterisk to obtain the configuration of the PostgreSQL database. Allows SNMP support configuration in Asterisk Radio repeater configuration file. This allows Asterisk to communicate through VoIP using radio repetition technology. RTP protocol configuration. Here the range of RTP ports used by Asterisk can be configured. Defines certain internationalization parameters. SIP configuration file that includes the others. SIP configuration generated by FreePBX and that should not be edited manually. SIP configuration that can be modified and is not overwritten by FreePBX. Complementary file to sip.conf where FreePBX writes general configuration. This is because now the file sip.conf is left as a simple inclusion file, that is it includes other files. Similar to sip_general_additional.conf but here the user can write information into the file, since this file isnt overwritten by FreePBX Configuration for working with SIP through a NAT (Network Address Translation). Used to configure the support that allows to remotely restart some SIP phones. Similar to sip_registrations.conf but this file isnt overwritten by FreePBX

http://www.elastixbook.com/en/chapters/Appendix.htm[24/11/2011 10:25:23 p.m.]

Unified Communications with Elastix Vol. 1

sip_registrations.conf

skinny.conf

sla.conf smdi.conf

udptl.conf

unicall.conf users.conf

vm_email.inc vm_general.inc voicemail.conf vpb.conf

allowing it to store user configuration without worrying about it being deleted File used by FreePBX for storing registry chain information with other PBXs or VoIP providers. Allows configuration of the SCCP protocol (Skinny Client Control Protocol) in Asterisk. Configuration of SLAs (Shared Line Appearances). Allows SMDI support configuration (Station Message Desk Interface) that allows Asterisk to function as a voicemail system for PBXs that support this protocol. Allows Asterisk to support UDPTL packets. These packets are used for protocol T.38 for fax. Here the module chan_unicall is configured. This file is used to define the concept of user that can have optionally associated a telephone (or extension.) This models better the fact that one same user can change telephone device and that from any device he is able to authenticate. Email template that is sent to notify the user of the arrival of a voicemail. Some general parameters related to voicemail. Configuration file for voice mail. Configuration file for VoiceTronix cards.

The following group of files can be found in versions of Elastix below 2.9, when Zaptel drivers were still used. They are listed here as reference. File zapata_additional.conf Description File that FreePBX overwrites and that is included in zapata.conf. Used mainly when creating ZAP-type extensions. File written by the script genzaptelconf and by the Elastix hardware detector to add configuration to zapata.conf. Configuration for telephony cards that use Zaptel drivers. Go to Index

zapata-channels.conf

zapata.conf

Previous

http://www.elastixbook.com/en/chapters/Appendix.htm[24/11/2011 10:25:23 p.m.]

Vous aimerez peut-être aussi