Esta charla cubrirá conceptos básicos de llamadas a través de channel dongle, enviando y recibiendo SMS. Esta sesión está dirigida a quienes aun no conocen el driver chan_dongle o quieren incluir un canal móbil a su sistema SOHO con un bajo presupuesto. Podría ser interesante mirar a los rostros de los asistentes cuando empiecen a recibir mensajes SMS en tiempo real.
8. Resumen
fprior@iridio.com.ar
Esta demo va a funcionar !
Envie un mensaje AHORA a este movil, para participar de la Demo final:
55 8573 ****
Telefono ya no disponible
8
10. Requisitos
fprior@iridio.com.ar
1. Buscar un Dongle
2. Marca HUAWEI
3. Solo son suportados algunos modelos
http://wiki.e1550.mobi/doku.php?id=requirements
Posibles problemas de energía y Hub USB
Gasto Energetico 5V/500mA ? 2.5 W
OK
10
12. Instalación y Configuración
fprior@iridio.com.ar
Conectar el dispositivo
root@debian002:~# dmesg
[233065.096432]
[233065.096458]
[233065.096475]
[233065.909669]
[233067.328939]
[233067.394668]
[233067.419393]
[233067.419582]
[233067.419619]
[233067.439255]
[233067.447136]
[233067.466022]
[233067.466112]
[233067.476046]
[233067.476070]
[233067.479013]
[233067.479087]
[233067.479124]
usb 2-2.1: Product: HUAWEI Mobile
usb 2-2.1: Manufacturer: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
usb 2-2.1: SerialNumber: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
usb 2-2.1: configuration #1 chosen from 1 choice
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for GSM modem (1-port)
option 2-2.1:1.0: GSM modem converter detected
usb 2-2.1: GSM modem converter now attached to ttyUSB0
option 2-2.1:1.1: GSM modem converter detected
usb 2-2.1: GSM modem converter now attached to ttyUSB1
option 2-2.1:1.2: GSM modem converter detected
usb 2-2.1: GSM modem converter now attached to ttyUSB2
usbcore: registered new interface driver option
option: v0.7.2:USB Driver for GSM modems
12
13. Instalación y Configuración
fprior@iridio.com.ar
root@debian002:~# apt-get install minicom
root@debian002:~# minicom -c on -D /dev/ttyUSB0
-c es para dar color -D es para abrir un puerto especifico
Welcome to minicom 2.4
OPTIONS: I18n
Compiled on Sep 5 2010, 09:23:03.
Port /dev/ttyUSB14
Press CTRL-A Z for help on special keys
AT
OK --> Check the connection
ATI --> get device information
Manufacturer: huawei
Model: E1552
Revision: 11.608.13.02.00
IMEI: 353143037121812
359638019133911
AT+CGSN
353143037121812
359638019133911 --> International Mobile Equipment Identity [IMEI]
AT+CIMI
722310501570940 --> International Mobile Subscriber Identity [IMSI]
AT^CVOICE=?
^CVOICE:(0) --> Voice is enabled !
AT^U2DIAG=0
OK --> switch the device in modem mode only
13
14. Instalación y Configuración
fprior@iridio.com.ar
Instalación del modulo chan_dongle:
wget http://asterisk-chan-dongle.googlecode.com/files/chan_dongle-1.1.r14.tgz
tar -xzvf chan_dongle-1.1.r14.tgz
cd chan_dongle-1.1.r14
./configure
make
make install
cp etc/dongle.conf /etc/asterisk/dongle.conf
modificar dongle.conf
[dongle1]
;audio=/dev/ttyUSB1
;data=/dev/ttyUSB2
; tty port for audio connection;
; tty port for AT commands;
imei=123456789012345
imsi=123456789012345
context=dongle-incoming
recargar el dongle.conf
*CLI> dongle reload now
14
15. Instalación y Configuración
fprior@iridio.com.ar
*CLI> help dongle
dongle callwaiting
dongle cmd*
dongle discovery
dongle pdu*
dongle reload
dongle remove
dongle reset
dongle restart
dongle show device settings*
dongle show device state*
dongle show device statistics
dongle show devices*
dongle show version*
dongle sms*
dongle start
dongle stop
dongle ussd
Enable/Disable Call-Waiting on the dongle
Send commands to port for debugging
Discovery devices and create config
Send PDU of SMS from the dongle
Reload dongle
Remove dongle
Reset dongle now
Restart dongle
Show Dongle device settings
Show Dongle device state
Show Dongle device statistics
Show Dongle devices state
Show module version
Send SMS from the dongle
Start dongle
Stop dongle
Send USSD commands to the dongle
15
16. Instalación y Configuración
fprior@iridio.com.ar
*CLI> dongle show version
chan_dongle: Huawei 3G Dongle Channel Driver, Version 1.1, Revision 14
Project Home: http://code.google.com/p/asterisk-chan-dongle
Bug Reporting: http://code.google.com/p/asterisk-chan-dongle/issues/list
*CLI> dongle show devices
ID
Group State
RSSI Mode Submode Provider Name Model Firmware IMEI
IMSI
dongle1 0
Free
31
3
3
TelCel
E169 11.314.13 359658016133911
724310501530940
debian003*CLI> dongle show device
*CLI> help dongle restart
Usage: dongle restart < now | gracefully | when convenient > <device>
Restart dongle <device>
*CLI> help dongle reload
Usage: dongle reload < now | gracefully | when convenient >
Reloads the chan_dongle configuration
16
17. Troubleshooting
fprior@iridio.com.ar
Problema
El modem no puede conectarse a la
red GSM
“Error checking subscriber phone number”
“Dongle needs to be reinitialized. The SIM
card is not ready yet”
“Error initializing Dongle”
AT+CNUM ERROR
Solución
Habilitar todas las frecuencias:
AT^SYSCFG=2,2,3fffffff,0,2
El modem se encuentra bloqueado:
Desbloquear el modem calculadoras
online y ejecutar
AT^CARDLOCK=”< code >”
Modem con función de Voz
deshabilitada
DC-Unlocker puede solucionar el
problema por un pocos U$ habilitando
la función Voz
Linux reconoce el dispositivo como
memoria de almacenamiento.
AT^U2DIAG=0
Establece el dispositivo como
modem solamente.
17
19. Llamadas
fprior@iridio.com.ar
edit extensions.conf
[internal]
[internal]
exten => 74,1,Dial(DONGLE/dongle1/6785574445)
exten => 74,1,Dial(DONGLE/dongle1/5585731259)
[dongle_incoming] ;same as defined in dongle.conf
exten => s,1,NoOp(Incoming CALL from ${CALLERID(all)} to ${EXTEN})
same => n,Dial(SIP/26)
same => n,Hangup()
19
20. Enviar SMS desde CLI
fprior@iridio.com.ar
3 modos de enviar mensajes
1. Asterisk Console
2. DialPlan
3. Asterisk Manager Interface
Utilizando CLI y texto plano:
*CLI> dongle sms dongle1 5585739395 This is an OUTGOING message from CLI
[dongle1] SMS queued for send with id 0x993efd0
-- [dongle1] Successfully sent SMS message 0x993efd0
[Aug 15 18:03:14] NOTICE[16262] at_response.c:257 at_response_ok: [dongle1]
Successfully sent SMS message 0x993efd0
debian003*CLI>
20
21. Enviar SMS desde DialPlan
fprior@iridio.com.ar
Modificar extensions.conf
[internal]
exten => 74,1,Dial(DONGLE/dongle1/5585739395)
exten => 78,1,DongleSendSMS(dongle1, 5585739395, ’Esto es un mensaje SALIENTE
enviado desde DialPlan.')
[dongle_incoming] ;same as defined in dongle.conf
exten => s,1,NoOp(Incoming CALL from ${CALLERID(all)} to ${EXTEN})
same => n,Hangup()
exten => sms,1,NoOp(Incoming SMS into ${DONGLENAME})
same => n,NoOp( From ${CALLERID(num)})
same => n,NoOp( Message: ${BASE64_DECODE(${SMS_BASE64})})
same => n,Hangup()
Ejecución Dialplan
-- Executing [78@internal:1] DongleSendSMS("SIP/2600000011", "dongle1,5585739395,‘Esto es un mensaje SALIENTE enviado desde
DialPlan.'") in new stack
-- Auto fallthrough, channel 'SIP/26-00000011' status is 'UNKNOWN'
-- [dongle1] Successfully sent SMS message 0x993efd0
[Aug 15 18:19:25] NOTICE[16262] at_response.c: at_response_ok: [dongle1]
21
22. Recibir SMS
fprior@iridio.com.ar
Modificar extensions.conf
[internal]
exten => 74,1,Dial(DONGLE/dongle1/5585739395)
exten => 78,1,DongleSendSMS(dongle1, 5585739395, ’This is an OUTGOING sms sended thru
DialPlan.')
[dongle_incoming] ;same as defined in dongle.conf
exten => s,1,NoOp(Incoming CALL from ${CALLERID(all)} to ${EXTEN})
same => n,Hangup()
exten => sms,1,NoOp(Incoming SMS into ${DONGLENAME})
same => n,NoOp( From ${CALLERID(num)})
same => n,NoOp( Message: ${BASE64_DECODE(${SMS_BASE64})})
same => n,Hangup()
SMS entrantes:
[dongle1] Got SMS from 5585739395: ‘Esto es un mensaje ENTRANTE message por dongle1.'
-- Executing [sms@dongle_incoming:1] NoOp("Local/sms@dongle_incoming-1f32;1", "SMS entrante
dongle1") in new stack
-- Executing [sms@dongle_incoming:2] NoOp("Local/sms@dongle_incoming-1f32;1", " From
5585739395") in new stack
-- Executing [sms@dongle_incoming:3] NoOp("Local/sms@dongle_incoming-1f32;1", " This is an
OUTGOING sms sended thru DialPlan. ") in new stack
-- Executing [sms@dongle_incoming:4] Hangup("Local/sms@dongle_incoming-1f32;1", "") in new
stack
== Spawn extension (dongle_incoming,sms,4) exited non-zero on 'Local/sms@dongle_incoming1f32;1'
22
30. Conclusiones
fprior@iridio.com.ar
• Simple, económica y escalable
• Meno gastos con el justo redireccionamiento.
• Integración SMS, apta para un sinnúmero de aplicaciones:
envío de alertas sobre averías
notificar clientes acerca de vencimientos, promociones
recordatorios de citas médicas, etc.
• Personalización SMS con información dinámica: ej.
“Estimado $CLIENTE, su credito vence el $FECHA”
• Rapido: 4-5 SMS/min = 240 mensajes / hora
aprox. 2000 sms/día
30