Académique Documents
Professionnel Documents
Culture Documents
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.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.]
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
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
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.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
Ir a ndice
Edgar Landvar
Copyright (c) 2008-2011 Edgar Landvar La presente obra se encuentra licenciada bajo los trminos de la licencia Creative Commons
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
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.
Feedback
Como siempre, cualquier sugerencia ser bien recibida. Que el lector no dude en escribir un email a elastixbook@palosanto.com Ir a ndice
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.
Ir a ndice
Ir a ndice
Siguiente
1
Introduccin a la telefona
No importa si yo muero, otros terminarn mi trabajo -- Mark Twain
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.
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.
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
Anterior
Ir a ndice
Siguiente
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.
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.
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
Anterior
Ir a ndice
Siguiente
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
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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.
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.
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
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.]
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
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.
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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.
Anterior
Ir a ndice
Siguiente
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
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.
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.]
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.
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
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
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.]
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.
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
Anterior
Ir a ndice
Siguiente
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.
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
Anterior
Ir a ndice
Siguiente
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.]
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
Anterior
Ir a ndice
Siguiente
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.]
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
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
Anterior
Ir a ndice
Siguiente
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.
Ejecutando PuTTY
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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
opt
proc
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
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.
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
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.]
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
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.
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
Anterior
Ir a ndice
Siguiente
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.]
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
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
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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.]
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.]
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.
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
Anterior
Ir a ndice
Siguiente
/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.]
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
Anterior
Ir a ndice
Siguiente
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
Anterior
Ir a ndice
Siguiente
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
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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
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.
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.
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.
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
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
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
Anterior
Ir a ndice
Siguiente
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
core set debug channel core set debug core set verbose core show channels dialplan reload dialplan show help iax2 set debug
module reload
sip set debug ip sip set debug peer sip show peers
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.
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.
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
Anterior
Ir a ndice
Siguiente
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
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.
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.
A continuacin, proceda a escoger el tipo de teclado de acuerdo al idioma. Si su teclado es de idioma espaol seleccione la opcin es.
Ahora el programa instalador nos consulta si queremos revisar las particiones creadas. Escoja la opcin No y digite la tecla de Enter para proseguir.
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.
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.
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.
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.
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.
Adicionalmente, se copiarn todos los archivos necesarios para correr Elastix hacia el disco duro.
Una vez que termina la copia de paquetes al disco duro, el servidor se reiniciar automticamente.
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
Usted deber confirmar la clave anteriormente ingresada para administracin de MySQL nuevamente en la siguiente pantalla.
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.
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.
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.
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
Anterior
Ir a ndice
Siguiente
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.
Dentro de poco el programa instalador mostrar una pantalla preguntando el tipo de particionamiento que se va a realizar.
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.
El primer paso ser crear todas las particiones de tipo RAID para lo cual se elige la opcin Nuevo.
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.
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.
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.
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.
Seleccione la opcin Aceptar para continuar con la instalacin. Anterior Ir a ndice Siguiente
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.]
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.
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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
Anterior
Ir a ndice
Siguiente
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.
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
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
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
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
Anterior
Ir a ndice
Siguiente
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
Anterior
Ir a ndice
Siguiente
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.]
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.
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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.
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.
Como podemos observar aqu podemos cambiar la asignacin de IP de DHCP a Esttica que es lo que queramos. Anterior Ir a ndice Siguiente
Anterior
Ir a ndice
Siguiente
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.
En ocasiones un mdulo puede estar contenido dentro de solo un men como en la siguiente figura.
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.
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
DHCP Server DHCP Client List Assign IP Address to Host User Management Groups Users
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
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
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
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.
Monitoring
Endpoint Configurator Conference Batch of Extensions Tools Asterisk-Cli Asterisk File Editor Text to Wav Flash Operator Panel
VoIP Provider
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
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
Addons Available Installed Anterior Listado de mdulos disponibles extender la funcionalidad de Elastix Listado de mdulos instalados Ir a ndice para
Siguiente
Anterior
Ir a ndice
Siguiente
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,
nicamente seleccionando los mdulos adecuados. Esta matriz de permisos se configura desde Sistema Administrar Usuarios 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.
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.]
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
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.
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.
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
Anterior
Ir a ndice
Siguiente
A continuacin se explicarn las opciones de dicha pantalla. Opciones del comando dial: Explicaremos esto ms al detalle en breve.
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.
Anterior
Ir a ndice
Siguiente
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.
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.
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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.
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.
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
Anterior
Ir a ndice
Siguiente
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.
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).
Para regresar a la interfaz de administracin de todas las conferencias de clic en Cancelar. Anterior Ir a ndice Siguiente
Anterior
Ir a ndice
Siguiente
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.
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
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
Adicionalmente, en Elastix 2.0 an se encuentra disponible el Flash Operator Panel en el men de PBX en el submen Flash Operator Panel.
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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
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.
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
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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.
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
Anterior
Ir a ndice
Siguiente
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.
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.
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.
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.]
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
Anterior
Ir a ndice
Siguiente
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
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
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.]
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
Anterior
Ir a ndice
Siguiente
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.
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.]
Anterior
Ir a ndice
Siguiente
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
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
Anterior
Ir a ndice
Siguiente
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
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.
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.
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.
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.
Si Zoiper se registra correctamente observaremos que junto al nombre de nuestra cuenta Test aparecer la palabra Registered.
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.
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
Anterior
Ir a ndice
Siguiente
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.]
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.
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
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.
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
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.
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"
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.
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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
Anterior
Ir a ndice
Siguiente
10
Configuracin avanzada de PBX
Si espero perder la audacia de la juventud -- Alejandro Magno
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.]
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.
Route Name:
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
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.
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 <###########>
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
Adems es posible que se requiera una cadena de registro que tiene la siguiente sintaxis: myusername:mypassword@host
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
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.
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.
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:
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.
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 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.]
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.
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.
Anterior
Ir a ndice
Siguiente
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.
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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.
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
Anterior
Ir a ndice
Siguiente
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.
Una vez configurada, no olvide seleccionarla dentro de sus rutas entrantes. Anterior Ir a ndice Siguiente
Anterior
Ir a ndice
Siguiente
11
Funcionamiento interno de FreePBX
La libertad no se implora, se conquista -- Eloy Alfaro
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
/var/lib/asterisk/bin/
Anterior
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
Anterior
Ir a ndice
Siguiente
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
Anterior
Ir a ndice
Siguiente
functions.inc.php
install.sql
uninstall.sql
install.php uninstall.php
Anterior
Anterior
Ir a ndice
Siguiente
12
Conectando Servidores Elastix
Cualquier poder, si no se basa en la unin, es dbil -- Jean de la Fontaine
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
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
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
Anterior
Ir a ndice
Siguiente
Al marcar un nmero internacional como 0018773527849 la llamada debe establecerse por medio de este VSP. Anterior Ir a ndice Siguiente
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
13
Calidad de voz
Calidad es hacer las cosas bien cuando nadie est controlando -- Henry Ford
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.]
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.
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
Anterior
Ir a ndice
Siguiente
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.]
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)
Anterior
Ir a ndice
Siguiente
Anterior
Ir a ndice
Siguiente
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
3 2 1
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.]
recomendacin ITU. El parmetro Id representa el retardo de red y se normaliza con la siguiente frmula.
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
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:
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.
MOS = 4.15
Lo cual es un resultado aceptable (4.15/5.00) pues todava encontraremos usuarios satisfechos. Anterior Ir a ndice Siguiente
Anterior
Ir a ndice
Siguiente
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.]
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.
Anterior
Ir a ndice
Siguiente
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
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
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.
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.
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.]
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
Anterior
Ir a ndice
Siguiente
Establecimiento de la llamada
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.
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.
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
Anterior
Ir a ndice
Siguiente
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
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
Anterior
Ir a ndice
Siguiente
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
Donde los niveles de debugging son separados por coma y pueden ser los siguientes: debug notice warning error verbose
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.
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
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.
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
Anterior
Ir a ndice
Siguiente
A continuacin un ejemplo de ejecucin del comando help desde la interfaz Web de Elastix.
Anterior
Ir a ndice
Siguiente
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
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.
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().
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
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
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
Anterior
Ir a ndice
Siguiente
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.
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.
AbsoluteTimeout
system,call,all
AgentLogoff
agent,all
Agents
agent,all
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>
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
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>
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
ParkedCalls
<none>
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
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
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
StopMonitor
call,all
UnpauseMonitor
call,all
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>
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
cbmysql.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.
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
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
globals_custom.conf
gtalk.conf
h323.conf
http.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
jingle.con
localprefixes.conf logger.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.
parking_additional.inc
phone.conf
phpagi.conf privacy.conf
queues.conf
queues_additional.conf
queues_custom_general.conf
queues_custom.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.
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.
vm_email.inc
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
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.]
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.]
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
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
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
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
Go to Index
Edgar Landvar
Copyright (c) 2008-2011 Edgar Landvar The following work is licensed under the terms of the Creative Commons Attribution-Share
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
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.
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
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.
Go to Index
Next
1
Introduction to telephony
I dont care if I die, others will finish my work... -- Mark Twain
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.
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.
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
Previous
Go to Index
Next
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.
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.
Previous
Go to Index
Next
Previous
Go to Index
Next
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
Previous
Go to Index
Next
Previous
Go to Index
Next
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
Previous
Go to Index
Next
Previous
Go to Index
Next
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
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
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
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.
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
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
Previous
Go to Index
Next
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.
Previous
Go to Index
Next
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
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.
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.
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
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
IP packet
http://www.elastixbook.com/en/chapters/chapter_2/2.2_IP_Protocol.htm[24/11/2011 10:23:37 p.m.]
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.]
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.
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
Previous
Go to Index
Next
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.
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
Previous
Go to Index
Next
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.)
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
Previous
Go to Index
Next
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.
Real Ethernet Bandwidth 95.2 Kbps 46.4 Kbps 39.2 Kbps Go to Index
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
Previous
Go to Index
Next
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.
Running PuTTY
Previous
Go to Index
Next
Previous
Go to Index
Next
Previous
Go to Index
Next
Previous
Go to Index
Next
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
opt proc
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
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.]
-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
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
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
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
-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
Previous
Go to Index
Next
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
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
Previous
Go to Index
Next
Previous
Go to Index
Next
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.
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
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.
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
Previous
Go to Index
Next
/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.]
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
Previous
Go to Index
Next
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
Previous
Go to Index
Next
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
Previous
Go to Index
Next
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].
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:
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
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)
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.]
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
Previous
Go to Index
Next
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
core set verbose core show channels dialplan reload dialplan show help iax2 set debug
module reload
sip set debug ip sip set debug peer sip show peers sip show registry core stop gracefully
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
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
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
Previous
Go to Index
Next
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
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:
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.
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.
Keyboard-type selection
Partitioning Confirmation
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.
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.
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.
The next screen will ask us to enter additional network parameters such as the gateway, primary DNS and secondary DNS.
Now we need to name our server with a hostname. It must be taken into account that a correct host name has the
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
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.
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.
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.
You will have to confirm the password previously entered for MySQL administration in the next screen.
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.
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.
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
Previous
Go to Index
Next
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.
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 first step will be to create all the RAID-type partitions for which you choose the option New.
In the next screen, you will fill out the following parameters:
- 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.
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.
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.]
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:
Select the OK option to continue with the normal installation process. Previous Go to Index Next
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.
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:
Previous
Go to Index
Next
Previous
Go to Index
Next
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
Previous
Go to Index
Next
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.
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
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
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
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
Previous
Go to Index
Next
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
Previous
Go to Index
Next
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.
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
Previous
Go to Index
Next
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:
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.
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
Previous
Go to Index
Next
On occasion the module can be contained inside a single menu, as is shown in the following figure:
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.
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.
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
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
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
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
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
Previous
Go to Index
Next
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.]
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.
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.
Previous
Go to Index
Next
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.
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.
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
Previous
Go to Index
Next
Below the options of this screen will be explained: Dial Options: Well explain this in detail briefly.
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
Previous
Go to Index
Next
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.
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.]
Fail Over Destination: This is the destination if an agent couldnt attend a call in the Queue. Previous Go to Index Next
Previous
Go to Index
Next
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
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.
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
Previous
Go to Index
Next
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.
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
Previous
Go to Index
Next
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:
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
Previous
Go to Index
Next
Previous
Go to Index
Next
Previous
Go to Index
Next
Additionally, in Elastix 2.0 the original Flash Operator Panel is still available in the PBX menu in the Flash Operator Panel sub-menu.
Previous
Go to Index
Next
Previous
Go to Index
Next
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
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
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.
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
Previous
Go to Index
Next
Previous
Go to Index
Next
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.
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
Previous
Go to Index
Next
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.
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.
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
Previous
Go to Index
Next
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.]
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.
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)
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
Previous
Go to Index
Next
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
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.]
use a reverse (crossover) cable. These are not the same as an Ethernet Crossover cable. Previous Go to Index Next
Previous
Go to Index
Next
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
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
Previous
Go to Index
Next
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
Previous
Go to Index
Next
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.
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:
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:
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.
If Zoiper is correctly registered well observe that beside our account name Test the word Registered will appear.
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.
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
Previous
Go to Index
Next
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.
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.
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
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
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
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.
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"
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.
Previous
Go to Index
Next
Previous
Go to Index
Next
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:
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.
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.
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.
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.
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.]
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.
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.
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.]
it is /tftpboot/.
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
Previous
Go to Index
Next
10
Advanced PBX Configuration
If I wait Ill lose the daring of youth -- Alexander the Great
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.
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.
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
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:
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:
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.
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
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.
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.
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.
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.
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 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.]
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.
Previous
Go to Index
Next
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.
Previous
Go to Index
Next
Previous
Go to Index
Next
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.]
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
Previous
Go to Index
Next
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.
Previous
Go to Index
Next
Previous
Go to Index
Next
11
FreePBX internal operation
Liberty is not begged for, its conquered -- Eloy Alfaro
Previous
Go to Index
Next
Previous
Go to Index
Next
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
Previous
Go to Index
Next
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
Previous
Go to Index
Next
Previous
Go to Index
Next
12
Connecting Elastix Servers
Any power not based in union, is weak -- Jean de la Fontaine
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.
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
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
Previous
Go to Index
Next
Then we add the registration chain, which in our case is the following:
myusername:mypassword@nyc.voicepulse.com
When dialing an international number like 0018773527849 the call must be established through this VSP. Previous Go to Index Next
Previous
Go to Index
Next
Previous
Go to Index
Next
Previous
Go to Index
Next
13
Voice quality
Quality means doing it right when no one is looking. -- Henry Ford
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.]
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.
Voice delay
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.
Previous
Go to Index
Next
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
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)
Previous
Go to Index
Next
Previous
Go to Index
Next
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.
3 2 1
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.
The parameter Id represents network delay and is normalized by the following formula:
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.
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.
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:
MOS = 4.15
This is an acceptable result (4.15/5.00) since we will have satisfied users. Previous Go to Index Next
Previous
Go to Index
Next
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
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.
Previous
Go to Index
Next
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
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.
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.
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.
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.)
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
Previous
Go to Index
Next
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
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.
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.
Frames
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
Previous
Go to Index
Next
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.]
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
Previous
Go to Index
Next
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
Where the debugging levels are separated by a comma and can be the following: debug notice warning error verbose
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/.
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
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.
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
Previous
Go to Index
Next
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.
Previous
Go to Index
Next
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
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.
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.
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.]
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
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:
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
Previous
Go to Index
Next
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.
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
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.
AbsoluteTimeout
system,call,all
AgentLogoff
agent,all
Agents
agent,all
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>
DAHDIShowChannels
<none>
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
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>
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
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
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
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
SIPpeers
system,reporting,all
SIPqualifypeer
system,reporting,all
SIPshowpeer
system,reporting,all
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
UserEvent
user,all
VoicemailUsersList call,reporting,all
WaitEvent
<none>
Lists all the information for voicemail users Waits for an event to occur
Previous
Go to Index
Next
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
cbmysql.conf
cdr_odbc.conf
cdr_pgsql.conf
cdr_tds.conf
chan_dahdi.conf
dnsmgr.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.
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
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
iax_general_custom.conf
iax_registrations_custom.conf
iax_registrations.conf
iaxprov.conf indications.conf
jabber.conf
jingle.con
localprefixes.conf logger.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
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
queues_additional.conf
queues_custom_general.conf
queues_custom.conf
rtp.conf
sip_general_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
sip_registrations.conf
skinny.conf
sla.conf smdi.conf
udptl.conf
unicall.conf users.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