Asterisk Realtime
Asterisk Realtime
Instalación de Asterisk
Desactivamos SELinux
setenforce 0
yum -y update
Instalar dependencias
yum install gcc gcc-c++ lynx bison mysql-devel mysql-server php php-mysql php-pear php-
mbstring tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-
nameserver sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion
kernel-devel git subversion kernel-devel php-process crontabs cronie cronie-anacron wget vim
php-xml uuid-devel libtool sqlite-devel ntp
*Nota: Opcional
Reiniciar el sistema
reboot
cd /usr/src/
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-
complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8-current.tar.gz
cd dahdi-linux-complete-*
cd libpri-*
cd /usr/src
cd asterisk-*
./configure --libdir=/usr/lib64 && make menuselect && make && make install
Guardar y salir
Iniciar servicios
asterisk –rvvvvvvvvvv
mysql -u root -p
CREATE DATABASE asterisk;
quit;
cd /usr/src/asterisk-1.8.*/contrib/realtime/mysql
mysql -u root -p
use asterisk;
*NOTA: IMPORTAR TODA LA BASE DE DATOS ASTERISK AL SERVIDOR DBHA1 CON HEIDISQL
vim /etc/asterisk/res_config_mysql.conf
[general]
dbhost = 209.45.69.60
dbname = asterisk
;dbname = asterisk-dev
dbuser = phpmyadmin
dbpass = y@chay2014
dbport = 3306
dbsock = /var/lib/mysql/mysql.sock
dbcharset = latin1
vim /etc/asterisk/extconfig.conf
[settings]
Comprobar estado:
pbxdes-lab1*CLI>
vim /etc/asterisk/sip.conf
[general]
port=5060
bindaddr=0.0.0.0
rtcachefriends=yes
rtupdate=no
disallow=all
allow=g729
allow=alaw
allow=ulaw
allow=gsm
ignoreregexpire=yes
maxexpiry=3600
defaultexpiry=2400
alwaysauthreject=yes
allowguest=no
directrtpsetup=yes
canreinvite=no
qualify=yes
dtmfmode=rfc2833
language=es
[img1010]
context=intximg
type=friend
host=161.132.14.7
dtmfmode=rfc2833
nat=no
disallow=all
;;allow=g729
allow=alaw
allow=ulaw
;;allow=gsm
accountcode=IMGOUT
qualify=yes
vim /etc/asterisk/extensions.conf
[general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
[intximg]
[voicemail]
[fijo]
[0800]
include => voicemail
[movil]
[ldn]
exten =>_0[4-8][1-7][2-7]XXXXX,1,Dial(SIP/img1010/${EXTEN})
exten =>_0[4-8][1-7][2-7]XXXXX,2,Hangup
[rural]
exten =>_0[4-8][1-7]8XXXXX,1,Dial(SIP/img1010/${EXTEN})
[ldi]
;;;Paises Bloqueados
;agregados 21-07-15:
;;;PAISES PERMITIDOS:
[fijo-movil]
[fijo-ldn]
[fijo-ldi]
[fijo-rural]
[movil-ldn]
[movil-ldi]
[movil-0800]
[movil-rural]
[ldn-ldi]
[ldn-0800]
[ldi-0800]
[ldi-rural]
[0800-rural]
[movil-0800-rural]
[movil-ldn-ldi]
[movil-ldn-0800]
[fijo-0800-rural]
[fijo-movil-ldn]
[fijo-movil-ldi]
[fijo-movil-0800]
[fijo-movil-rural]
[fijo-ldn-ldi]
include => fijo
[fijo-ldn-0800]
[fijo-ldn-rural]
[ldn-0800-rural]
[ldn-ldi-0800]
[ldn-ldi-rural]
[movil-ldi-0800]
[movil-ldi-rural]
[fijo-ldi-0800]
[fijo-ldi-rural]
[ldi-0800-rural]
[fijo-movil-ldi-0800]
[fijo-movil-ldi-rural]
[fijo-movil-0800-rural]
[fijo-movil-ldn-ldi]
[fijo-movil-ldn-0800]
[fijo-movil-ldn-rural]
[fijo-ldn-0800-rural]
[fijo-ldn-ldi-0800]
[fijo-ldn-ldi-rural]
[movil-ldn-0800-rural]
[movil-ldn-ldi-0800]
[movil-ldn-ldi-rural]
[movil-ldi-0800-rural]
[ldn-ldi-0800-rural]
[fijo-movil-ldn-0800-rural]
[fijo-movil-ldn-ldi-0800]
[fijo-movil-ldn-ldi-rural]
[movil-ldn-ldi-0800-rural]
[fijo-movil-ldi-0800-rural]
[fijo-ldn-ldi-0800-rural]
[fijo-movil-ldn-ldi-0800-rural]
include => fijo
[pbx-1]
[pbx-2]
[pbx-3]
searchcontexts=yes
Voicemail en Español:
; just the CIDNAME, if it is not null, otherwise just the CIDNUM, or "an unknown
;emailbody=Dear ${VM_NAME}:\n\n\tjust wanted to let you know you were just left a $
{VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox ${VM_MAILBOX} from $
{VM_CALLERID}, on ${VM_DATE}, so you might\nwant to check it when you get a chance.
Thanks!\n\n\t\t\t\t--Asterisk\n
Para corregir errores editar la tabla voicemail_data tal y como está en la imagen:
http://www.nuance.es/empresas/solucion/soluciones-de-atencion-al-cliente/servicios-y-
soluciones/soluciones-de-recepcion-de-llamadas/loquendo-small-business-bundle/interactive-
tts-demo/index.htm
mv ivrpbx0001.wav /var/lib/asterisk/sounds/ivr
Asterisk CDR en MySQL
En el servidor pbxdes-lab1:
[global]
hostname=209.45.69.60
dbname=asteriskcdr
table=cdr
password=yachay2015
user=asterisk
port=3306
# y agrega al final
[global]
En el servidor pbxdes-dbha1:
mysql -u root -p
Creamos la database:
Creamos la tabla:
Database changed
Una vez hecho esto ponemos como índices para optimizar la búsqueda por estos campos:
Connected to [email protected], port 3306 using table cdr for 1 hours, 45 minutes, 47
seconds.
Wrote 31 records since last restart and 1 records since last reconnect.
pbxdes-lab1*CLI>
cd /var/lib/asterisk/sounds/es
wget http://www.voipnovatos.es/voces/voipnovatos-core-sounds-es-alaw-1.4.tar.gz
wget http://www.voipnovatos.es/voces/voipnovatos-extra-sounds-es-alaw-1.4.tar.gz
mv /var/lib/asterisk/sounds/es/dictate/es/* /var/lib/asterisk/sounds/es/dictate
mv /var/lib/asterisk/sounds/es/letters/es/* /var/lib/asterisk/sounds/es/letters
mv /var/lib/asterisk/sounds/es/silence/es/* /var/lib/asterisk/sounds/es/silence
mv /var/lib/asterisk/sounds/es/followme/es/* /var/lib/asterisk/sounds/es/followme
mv /var/lib/asterisk/sounds/es/phonetic/es/* /var/lib/asterisk/sounds/es/phonetic
mv /var/lib/asterisk/sounds/es/digits/es/* /var/lib/asterisk/sounds/es/digits
cp es/* ./