You are visiting:Home arrow Articles for Geeks arrow Asterisk arrow HOWTO build and configure chan_mobile on Trixbox Thursday, 28 August 2008
Google
Support Geek-Pages.com in making a small donation:
Main Menu
Home
Articles for Geeks
FAQs for Non-Geeks
Links
Kevan's Blog
Contact Us
Forum
Search
Login Form





Lost Password?
No account yet? Register
Submit article to:
HOWTO build and configure chan_mobile on Trixbox PDF Print E-mail
Written by Kevan   

16. Let’s make sure we can see your phone or headset. Use the command:

[trixbox1.local ~]# hcitool scan

You should see something like this:

[trixbox1.local ~]# hcitool scan
Scanning ...
00:1B:63:E4:2F:05 Dan's iPhone
[trixbox1.local ~]#

17. If you see your phone above all is well and we can now search for your bluetooth devices using
the CLI command 'mobile search'. Be patient with this command as it will take 8 - 10 seconds to do
the discovery.

[trixbox1.local ~]# asterisk –r
trixbox1*CLI> mobile search

18. This will return something like the following:

Address Name Usable Type Port
00:1B:63:E4:2F:05 Dan’s iPhone Yes Phone 8
00:1C:CC:1C:E1:0C BlackBerry 8320 Yes Phone 3
00:0B:9E:11:74:A5 Hello II Plus Yes Headset 1

19. This is a list of all bluetooth devices seen and whether or not they are usable with chan_mobile.
a. The Address field contains the 'bd address' of the device. This is like an ethernet mac address.
b. The Name field is whatever is configured into the device as its name.
c. The Usable field tells you whether or not the device supports the Bluetooth Handsfree Profile or
Headset profile.
d. The Type field tells you whether the device is usable as a Phone line (FXO) or a headset (FXS).
e. The Port field is the number to put in the configuration file.
20. Choose which device(s) you want to use and edit /etc/asterisk/mobile.conf

[trixbox1.local ~]# nano /etc/asterisk/mobile.conf

For a phone create a stanza like the one below and paste in the MAC address on
the address line and also make sure you use the port that was displayed during
the mobile search. The 'id' of the device [bitinbrackets] can be anything you
like, just make the unique.

[my_phone]
address=xx:xx:xx:xx:xx:xx ; the address of the phone
port=x ; the port number (from mobile search)
context=from-mobile ; dialplan context for incoming calls
adapter=blue ; adapter to use

Now let’s configure your headset. If your are configuring a headset be sure to include the
type=headset line:

[my_headset]
address=xx:xx:xx:xx:xx:xx ; the address of the headset
port=x ; the port number (from mobile search)
type=headset ; tells asterisk it is a headset
adapter=blue ; adapter to use

21. Having done this, unload chan_mobile.so and load it again
(asterisk -r (and then...) module unload chan_mobile.so (and then...) module load chan_mobile.so
If asterisk bombs out after load/unload you need to go back in with asterisk -r to execute the above
You should see something like this...

trixbox1*CLI> module load chan_mobile.so
== Parsing '/etc/asterisk/mobile.conf': Found
== Registered application 'MobileStatus'
== Registered application 'MobileSendSMS'
== Registered channel type 'Mobile' (Bluetooth Mobile Device Channel Driver)