====== Integration des GSM/Cellulaires dans Asterisk ======
Pour le moment, ca n'est pas mis en oeuvre: donc juste de la doc libre
**Probleme**:
* Ma femme a un GSM Perso
* moi un pro et un perso
* et nous avons des combinés dect...
* On se fait confiance (elle peut decrocher mes tels pro et perso, et reciproquement)
* Mes serveurs, fon sont virtualisés dans la cave
* Pas envie de depenser trop de sous dans des passerelles qui ne font que la motié des choses
* En gros ca fait qu'a nous 2 nous avons 4 tel sur nous...
**Solutions**
* Installer sur un NsLu2
* une debian avec un asterisk 1.6 + chan_mobile
* Mettre plusieurs dongles BT (un par equipement, FIXME valider le fnc de plusieurs lignes avec un dongle)
* Integrer tout les GSM sur le BR du NsLU2
* Integrer les nouvelles extentions a l'asterisk en VM...
**Interets de cette solutions**
* FIXME backup des GSM et contact over BT
* poser les GSM en entrant et les mettres en charge
* possibilite d'utiliser un kit BT comme un combiné telephonique
* possibilité de detecter une presence via l'appariage BT (cf domotique)
* possibilité de transferer des appels entrants sur les GSM si non apparaige
* Ca px etre drole si le GSM n'a plus de pile donc plus de BT et il recoit les appels...
===== Installation de la configuration =====
==== Configuration OS ====
* Debian Squeeze
* asterisk (1.6.2)
apt-get install asterisk-mobile
* bluetooth
apt-get install bluetooth bluez bluez-alsa
* FIXME suite au grillage du DockStar, nous revoila dans une nouvelle aventure: raspberry root@raspberrypi:~# apt-get install asterisk asterisk-core-sounds-fr asterisk-mobile asterisk-mp3 asterisk-voicemail-imapstorage bluetooth bluez bluez-alsa
* FIXME et evidement ca m'a installé que des trucs utils : cups... pour ca... avahi... donc apt-get remove avahi-daemon
==== Configuration du BlueTooth ====
* Il n'y a pas besoin de configurer la partie rfcomm en fait...
* Modification du fichiers de confs /etc/bluetooth/main.conf
* La Clef DisablePlugins doit ressembler a cela (surtout pnat):
DisablePlugins = network,input,pnat,hal
Cela permet de "corriger un bug" que l'on retrouve dans ces points là
* [[http://forums.digium.com/viewtopic.php?f=1&t=78042&sid=78853ac319bbc692501096cd1defbbb5#p158358|Là le mec qui propose de patcher Asterisk]]
* [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614786|En pied de lien, le type qui a proposé une configuration qui "corrige"]]
==== Appairage + Récuperation du minima pour configurer Asterisk ====
Pour information : il faut autant de dongle BT/USB qu'il y a de telephonne a enregistrer sur l'Asterisk....
- Mettre le telephone en "visible"
- Lancer un scan a partir d'un dongle BT
root@harald:/etc/bluetooth# hcitool scan
Scanning ...
00:25:00:00:00:00 adlp@taffe
root@harald:/etc/bluetooth#
- Faire l'apparaige (le terminal toujours visible...)
root@harald:/etc/asterisk# /usr/share/doc/bluez/examples/simple-agent hci1 00:25:00:00:00:00
RequestPinCode (/org/bluez/577/hci1/dev_00_25_00_00_00_00)
Enter PIN Code: 0000
Release
New device (/org/bluez/577/hci1/dev_00_25_00_00_00_00)
- Trouver le Channel BT aproprié (Tres honnetement j'explore le resultat et y selectionne dans la categorie Handset, et je fais des essais)
root@harald:~/BT# sdptool browse 00:25:00:00:00:00
Browsing 00:25:00:00:00:00 ...
Service Name: Network Access Point Service
Service Description: Personal Ad-hoc Network Service which provides access to a network
Service RecHandle: 0x10000
Service Class ID List:
"Network Access Point" (0x1116)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 15
"BNEP" (0x000f)
Version: 0x0100
SEQ8: dd 6
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Network Access Point" (0x1116)
Version: 0x0100
- Récuperation de la Mac addresse du dongle
root@harald:~/BT# hcitool dev
Devices:
hci0 00:11:00:00:00:00
==== Configuration d'Asterisk ====
* Configuration du fichier
root@harald:/etc/asterisk# cat mobile.conf
[general]
interval=10 ; Number of seconds between trying to connect to devices.
;; The following is a list of adapters we use.
;; id must be unique and address is the bdaddr of the adapter from hciconfig.
;; Each adapter may only have one device (headset or phone) connected at a time.
;; Add an [adapter] entry for each adapter you have.
[adapter]
id=apm0
address=00:11:00:00:00:00
;;forcemaster=yes ; attempt to force adapter into master mode. default is no.
;;alignmentdetection=yes ; enable this if you sometimes get 'white noise' on asterisk side of the call
; ; its a bug in the bluetooth adapter firmware, enabling this will compensate for it.
; ; default is no.
[adlp-gs]
address=FC:00:00:00:00:01
port=10
context=in-gsm
adapter=apm0
[adlp-taffe]
address=00:25:00:00:00:00
port=12
context=in-gsm
adapter=apm0
;[NOKIA6630]
;address=00:11:9F:BE:79:60 ; the address of the phone
;port=28 ; the rfcomm port number (from mobile search)
;context=incoming-mobile ; dialplan context for incoming calls
;adapter=blue ; adapter to use
;group=1 ; this phone is in channel group 1
;;sms=no ; support SMS, defaults to yes
;;nocallsetup=yes ; set this only if your phone reports that it supports call progress notification, but does not do it. Motorola L6 for example.
* Et maintenant dans la vie courante
* Je vous laisse imaginer la configuration du DialPlan
* Un zoli petit exemple:
root@harald:~# asterisk -rfccccccvvvvvvvvggggg
Asterisk 1.6.2.9-2+squeeze4, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
== Parsing '/etc/asterisk/asterisk.conf': == Found
== Parsing '/etc/asterisk/extconfig.conf': == Found
Connected to Asterisk 1.6.2.9-2+squeeze4 currently running on harald (pid = 569)
Verbosity was 0 and is now 8
harald*CLI> mo
mobile module
harald*CLI> mobile show devices
ID Address Group Adapter Connected State SMS
adlp-gs FC:00:00:00:00:00 0 apm0 Yes Free No
===== Liens circonstanciés =====
* [[http://www.mas.nom.fr/debian/chan_bluetooth/]]
* [[http://www.voipphreak.ca/2008/10/30/installing-and-configuring-chan_mobile-for-bluetooth-presence-support-in-asterisk-16/]]
* [[http://www.tux89.com/telephonie/raccorder-un-telephone-portable-bluetooth-a-asterisk/]] Trop cher et moins fun
* [[http://www.thetechguide.com/howto/asterisk/chanbluetooth.html]]
* [[http://www.pbxinaflash.com/community/index.php?threads/asterisk-channel-driver-to-allow-bluetooth-mobile-phones-to-be-used-as-fxo-device.48/]]
* [[https://wiki.asterisk.org/wiki/display/AST/Using+chan_mobile]] c'est ca qui m'interesse en fait, integré a la debian
* [[http://www.geekzone.co.nz/tonyhughes/2043]] transfer sur absence de BT...
* [[http://www.voip-info.org/wiki/view/Asterisk+Connecting+to+the+Cellular+Network]]
* [[http://www.voip-info.org/wiki/view/Asterisk+Bluetooth+channels]]
* [[http://www.voip-info.org/wiki/view/chan_mobile]]
* [[http://snapvoip.blogspot.fr/2007/10/configuring-using-and-debugging.html]]
* [[http://nerdvittles.com/index.php?p=188]]
* [[http://nerdvittles.com/index.php?p=185]]