8. Presupuesto
9.1.6. Mejoras en la centralita
Es posible configurar un trunk SIP que permita a las Raspberry realizar llamadas a la red telef´onica y explotar el mismo mecanismo que se utiliza en este momento para realizar llamadas a extensiones para prescindir del Softphone realizando la llamada directamente a trav´es del trunk SIP.
Bibliograf´ıa
[1] Andrei Fokau, “A simple unix/linux daemon in Python.” https://gist.github. com/andreif/cbb71b0498589dac93cb, 2014. Online; 29 Agosto 2018.
[2] A. Glow, “Raspberry pi shutdown / restart button.” https://www.hackster.io/ glowascii/raspberry-pi-shutdown-restart-button-d5fd07, Nov 2017.
[3] “Amazon dash button: Un hack para enviar un sms las noches de fiesta.”http://www. elladodelmal.com/2018/03/amazon-dash-button-un-hack-para-enviar.html. [4] https://www.raspberrypi.org/forums/viewtopic.php?f=108&t=120793.
[5] “Raspberry pi 3 model b.” https://www.raspberrypi.org/products/ raspberry-pi-3-model-b/.
[6] “Dash buttons: Dispositivos amazon.” https://www.amazon.es/b?ie=UTF8&node= 10909716031.
[7] A. T. Project, “Apache tomcat.” http://tomcat.apache.org/.
[8] R. C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship. Prentice Hall, 2008.
[9] “Linphone.” http://www.linphone.org/technical-corner/linphone/overview. [10] “Documentation.” https://www.freedesktop.org/wiki/Software/PulseAudio/
Documentation/.
[11] E. Freeman, Head First Design Patterns: A Brain-Friendly Guide. O’Reilly Media, oct 2004.
[12] N. Shmyrev, “Cmusphinx open source speech recognition.” https://cmusphinx. github.io/.
[13] “Freetts 1.2.3 - a speech synthesizer written entirely in the java(tm) programming language.” https://freetts.sourceforge.io/.
[14] “Gpio.” https://www.raspberrypi.org/documentation/usage/gpio/.
[15] “Amazon dash hack with raspberry pi and python - the magpi magazine.” https: //www.raspberrypi.org/magpi/hack-amazon-dash-button-raspberry-pi/, May 2017.
[16] P. Vouzis, “Impact of packet loss, jitter, and latency on voip.” https://netbeez. net/blog/impact-of-packet-loss-jitter-and-latency-on-voip/, May 2018.
[17] “Making embedded linux easy.”https://buildroot.org/docs.html.
[18] “Raspberry pi auto login without etc/inittab.” http://stackoverflow.com/ questions/33753985/raspberry-pi-auto-login-without-etc-inittab.
[19] “News.” http://www.linphone.org/.
[20] “Linphone.” http://www.linphone.org/technical-corner/linphone/ documentation.
[21] “An introduction to linphone.” https://codeghar.wordpress.com/2010/04/29/ an-introduction-to-linphone/, Apr 2010.
[22] “Bluetooth audio streaming - raspberry pi forums.”https://www.Raspberrypi.org/ forums/viewtopic.php?t=68779.
[23] “/etc/bluetooth/audio.conf missing - raspberry pi forums.” https://www. raspberrypi.org/forums/viewtopic.php?f=28&t=124876.
[24] https://linux.die.net/man/5/pulse-daemon.conf.
[25] “Bluetooth issues blue-utils bluez-simeple-agent.” https://www.raspberrypi.org/ forums/viewtopic.php?f=28&t=133961.
[26] “Bluetooth.” https://wiki.archlinux.org/index.php/bluetooth#hcitool_ scan:_Device_not_found.
[27] A. feiticeir0, “Raspberry pi bluetooth wireless speaker.” http://blog.whatgeek. com.pt/2014/04/raspberry-pi-bluetooth-wireless-speaker/, Apr 2015. [28] smaffulli, “Streaming audio from raspberry pi – part 2.” http://maffulli.net/
2013/03/23/streaming-audio-from-raspberry-pi-part-2/, Mar 2013. [29] “arecord(1) - linux man page.”https://linux.die.net/man/1/arecord.
[30] “Best way to setup usb mic as system default on raspbian jes- sie.” https://raspberrypi.stackexchange.com/questions/37177/ best-way-to-setup-usb-mic-as-system-default-on-raspbian-jessie.
[31] n. a. notes.for.sabi.co.UK. http://www.sabi.co.uk/Notes/linuxSoundALSA.html. [32] “https://wiki.freepbx.org/display/fop/installing freepbx 13 on debian 8.1.” https:
//wiki.freepbx.org/display/FOP/Installing+FreePBX+13+on+Debian+8.1. [33] P. Lehtinen, “Jansson.”http://www.digip.org/jansson/.
[34] “National numbering plans.” http://www.itu.int/oth/T0202.aspx?parent= T0202.
[35] https://wiki.freepbx.org/display/F2/WebserverOverrides.
[36] “.htaccess: Invalid command ’rewriteengine’, perhaps misspe- lled or defined by a module not included in the server con- figuration.” https://stackoverflow.com/questions/10144634/
[37] Neuronetv, “Reload failed because retrieve conf.” https://community.freepbx. org/t/solved-reload-failed-because-retrieve-conf-encountered-an-error-1/ 36981/2, journal=FreePBX Community Forums, Sep 2016.
[38] Amztransit and Jfinstrom, “Clearing 2 ou have 2 tampered files”message.” https: //community.freepbx.org/t/clearing-you-have-2-tampered-files-message/ 35470, Jun 2016.
[39] Digium, “Sip security.” http://www.digium.com/blog/2009/03/28/ sip-security/.
[40] “Fail2ban (with iptables) and asterisk.” https://www.voip-info.org/ fail2ban-(with-iptables)-and-asterisk, Oct 2008.
[41] “Configure dummy sound device on server with snd- dummy.” https://askubuntu.com/questions/490711/ configure-dummy-sound-device-on-server-with-snd-dummy.
[42] “How can i change the default audio device from com- mand line?.” https://askubuntu.com/questions/14077/ how-can-i-change-the-default-audio-device-from-command-line.
[43] “Tutorial raspberry pi – 7. escritorio remoto vnc no-ip.”https://geekytheory.com/ tutorial-raspberry-pi-7-escritorio-remoto-vnc-no-ip.
Anexo I Manual de instalaci´on y
uso
En las siguientes secciones de describe de manera sistem´atica los pasos a seguir para configurar la Raspberry Pi.
10.1.
Instalaci´on de raspbian
Descarga de Raspbian desde https://www.raspberrypi.org/downloads/raspbian/ Des- carga de la distribuci´on
1 cd /home/ c a r l o s / Documents / p r o y e c t o / d e s c a r g a s
2 wget h t t p s : / / downloads . r a s p b e r r y p i . o r g / r a s p b i a n l a t e s t Listing 10.1: Descarga de raspbian Carga en la tarjeta SD
Para averiguar el nombre de la tarjeta
1 d f −h
Listing 10.2: Listado de unidades de almacenamiento Antes de insertar la tarjeta
Figura 10.1: Antes de insertar la tarjeta 89
Tras insertar la tarjeta
Figura 10.2: Despu´es de insertar la tarjeta La tarjeta se monta en /dev/sdf1.
Es una tarjeta SD de clase U3 de 16GB.
Una vez localizado el nombre que le asigna el sistema a la tarjeta hay que desmontarla para que no se interrumpa el proceso de copia del sistema de archivos a la misma, utilizamos unmount, en este caso:
1 umount / dev / s d f 1
Listing 10.3: Desmontar la tarjeta Se verifica que la tarjeta est´a desmontada.
Figura 10.3: Tarjeta desmontada
El siguiente paso es cargar la imagen en la tarjeta SD, el archivo descargado no tiene extensi´on pero sabemos que es un archivo .zip comprimido, a˜nadimos la extensi´on y lo descomprimimos utilizando unzip.
1 mv r a s p b i a n l a t e s t r a s p b i a n l a t e s t . z i p 2 u n z i p r a s p b i a n l a t e s t . z i p
Listing 10.4: Descompresi´on del sistema
Ahora tenemos la imagen descomprimida 2016-05-27-raspbian-jessie.img.
Hay que utilizar el comando dd para escribir la imagen en la tarjeta, sdf1 es una partici´on, para escribir sobre toda la tarjeta hay que hacerlo en sdf en lugar de sdf1.
1 dd bs=4M i f=2016−05−27−r a s p b i a n−j e s s i e . img o f =/dev / s d f Listing 10.5: Escritura del sistema en la tarjeta
Para verificar que se ha escrito bien la imagen: Para copiar el contenido de la tarjeta a un archivo (Se puede utilizar para hacer backups)
1 dd bs=4M i f=/dev / s d f o f=from−sd−c a r d . img
Listing 10.6: Creaci´on de un backup del sistema
Lo que ha copiado el anterior comando es el contenido completo de la tarjeta, inclu- yendo el espacio libre, el archivo resultante tiene 16 GB. Como el objetivo es verificar que la imagen se ha copiado correctamente hay que eliminar el espacio en blanco, utilizando truncate.
1 t r u n c a t e −−r e f e r e n c e 2016−05−27−r a s p b i a n−j e s s i e . img from−sd−c a r d . img Listing 10.7: Eliminar el espacio en blanco de la imagen
Ahora que hemos eliminado la parte innecesaria del archivo podemos verificar que se ha copiado correctamente mediante diff.
1 d i f f −s from−sd−c a r d . img 2016−05−27−r a s p b i a n−j e s s i e . img
Listing 10.8: Comparaci´on de la imagen cargada en la Raspberry con la original El resultado es que ambos archivos son id´enticos, eliminamos el archivo copiado. 1 rm from−sd−c a r d . img
Listing 10.9: Eliminar el backup
Para extraer la tarjeta con seguridad ejecutamos el comando sync. 1 s y n c
Listing 10.10: Extracci´on de la SD