chan_mobile [WORKING well with iPhone 4s]

I don’t know if it is relevant, but I too have a /var/lib/bluetooth/{BT address} directory on my system and get new directories created every time a new blue tooth adaptor is found. But I also have a hcid.conf file.

I need to spend time with family over the weekend but will be back onto this early next week.

simcity Thanks again for your patience and input.

I was just googling and came across this blog slating the general development and support for the bluez package (since release 4.x anyway) and the grief it has caused folks.

Seems like the general configuration settings for the “new” bluetooth daemon, called bluetoothd (instead of hcid), resides in /etc/bluetooth/main.conf rather than the old /etc/bluetooth/hcid.conf

Just so that you are aware, my installed bluetooth related packages (for CentOS 6.2 x86-64) are as follows. This may be different to what you have installed:

bluez x86_64 version 4.66
bluez-libs x86_64 version 4.66
bluez-libs-devel x86_64 version 4.66
gnome-bluetooth x86_64 version 2.28.6
gnome-bluetooth-libs x86_64 version 2.28.6
pulseaudio-module-bluetooth x86_64 version 0.9.21

My /etc/bluetooth/main.conf file looks like this:

[General]

# List of plugins that should not be loaded on bluetoothd startup
#DisablePlugins = network,input

# Default adaper name
# %h - substituted for hostname
# %d - substituted for adapter id
Name = %h-%d

# Default device class. Only the major and minor device class bits are
# considered.
Class = 0x000100

# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever
DiscoverableTimeout = 0

# How long to stay in pairable mode before going back to non-discoverable
# The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever
PairableTimeout = 0

# Use some other page timeout than the controller default one
# which is 16384 (10 seconds).
PageTimeout = 8192

# Discover scheduler interval used in Adapter.DiscoverDevices
# The value is in seconds. Defaults is 0 to use controller scheduler.
DiscoverSchedulerInterval = 0

# What value should be assumed for the adapter Powered property when
# SetProperty(Powered, ...) hasn't been called yet. Defaults to true
InitiallyPowered = true

# Remember the previously stored Powered state when initializing adapters
RememberPowered = true

# Use vendor, product and version information for DID profile support.
# The values are separated by ":" and VID, PID and version.
#DeviceID = 1234:5678:abcd

# Do reverse service discovery for previously unknown devices that connect to
# us. This option is really only needed for qualification since the BITE tester
# doesn't like us doing reverse SDP for some test cases (though there could in
# theory be other useful purposes for this too). Defaults to true.
ReverseServiceDiscovery = true

# Enable name resolving after inquiry. Set it to 'false' if you don't need
# remote devices name and want shorter discovery cycle. Defaults to 'true'.
NameResolving = true

# Enable runtime persistency of debug link keys. Default is false which
# makes debug link keys valid only for the duration of the connection
# that they were created for.
DebugKeys = false

OK. Here are the contents of various files within /var/lib/bluetooth/{BT adapter address} .This is for my working adapter.

For security I’ve obfuscated my iPhones BT adapter address as {my iPhone BT address} below and various other entries like for the linkkeys. I’ve also obfuscated the entries in these files for the other phones I tried (which didn’t work anyway) {old phone BT address} and other gear like my laptop and other BT adapters which I tried.

classes :

{my laptop BT address} 0x3a010c
{my iPhone BT address} 0x7a020c
{my 2d dgl BT address} 0x4a0104
{my T630   BT address} 0x520204
{my B'Berry BT address} 0x7a020c

config :

name Asterisk PBX
class 0x4a0104
onmode discoverable
mode discoverable

did :

{my iPhone BT address} 0002 05AC 12A0 0510

features :

{my laptop BT address} FFFF8FFE9BFF7983
{my iPhone BT address} BFFECFFEDBFF7B87
{my 2d dgl BT address} FFFF8FFE9BF90080
{my T630   BT address} 04CA310000000000
{my B'Berry BT address} BFFE2DFE98397983

lastseen :

{my laptop BT address} 2012-06-16 20:08:09 GMT
{my iPhone BT address} 2012-03-15 01:48:31 GMT
{my 2d dgl BT address} 2012-03-15 01:58:41 GMT
{my T630   BT address}  2012-06-16 20:08:39 GMT

lastused :

{my laptop BT address} 2012-06-16 20:08:17 GMT
{my iPhone BT address} 2012-06-29 20:49:48 GMT
{my 2d dgl BT address} 2012-03-15 02:00:01 GMT
{my T630   BT address} 2012-06-16 20:08:52 GMT
{my B'Berry BT address} 2012-03-17 18:25:03 GMT

linkkeys :

{my iPhone BT address} {thirty two characters followed by a space then a single char space and a single char}

manufacturers :

{my laptop BT address} 15 4 16916
{my iPhone BT address} 15 6 16643
{my 2d dgl BT address} 10 3 3164
{my T630   BT address}  0 1 1283
{my B'Berry BT address} 13 4 7455

names :

{my laptop BT address} Sean Simpson’s MacBook Pro
{my iPhone BT address} Sean Simpson’s iPhone 4S
{my 2d dgl BT address}  Asterisk PBX 2
{my T630   BT address} T630
{my B'Berry BT address} BlackBerry 9360

profiles :

{my iPhone BT address} 00000000-deca-fade-deca-deafdecacafe 00001000-0000-1000-8000-00805f9b34fb 0000110a-0000-1000-8000-00805f9b34fb 0000110c-0000-1000-8000-00805f9b34fb 0000110e-0000-1000-8000-00805f9b34fb 00001116-0000-1000-8000-00805f9b34fb 0000111f-0000-1000-8000-00805f9b34fb 0000112f-0000-1000-8000-00805f9b34fb 00001200-0000-1000-8000-00805f9b34fb

sdp :

{my iPhone BT address}#4F491116 35CA0900000A4F49111609000135031911160900020A00000001090004351E350619010009000F351419000F090100350C0908000908060981000986DD0900053503191002090006352409656E09006A09010009667209006A09011009646509006A090120096A6109006A090130090008080009000935083506191116090100090100251A50414E204E6574776F726B204163636573732050726F66696C6509010125144E6574776F726B2041636365737320506F696E7409030A09000109030B09000D09030C0A0003E800
{my iPhone BT address}#4F49B3D0 358B0900000A4F49B3D009000135111C00000000DECAFADEDECADEAFDECACAFE0900020A00000000090004350C3503190100350519000308010900053503191002090006352409656E09006A09010009667209006A09011009646509006A090120096A6109006A09013009000808FF09000935083506191101090100090100250C576972656C65737320694150
{my iPhone BT address}#4F49110E 35A40900000A4F49110E090001350619110E19110F0900020A000000000900043510350619010009001735061900170901030900053503191002090006352409656E09006A09010009667209006A09011009646509006A090120096A6109006A09013009000808FF0900093508350619110E090104090100250C415652435020446576696365090101251552656D6F746520436F6E74726F6C20446576696365090311090002
{my iPhone BT address}#4F49110C 35B80900000A4F49110C090001350319110C0900020A000000000900043510350619010009001735061900170901030900053503191002090006352409656E09006A09010009667209006A09011009646509006A090120096A6109006A09013009000808FF0900093508350619110E09010409000D35123510350619010009001B3506190017090103090100250C415652435020446576696365090101251552656D6F746520436F6E74726F6C20446576696365090311090091
{my iPhone BT address}#4F49110A 35870900000A4F49110A090001350319110A0900020A000000000900043510350619010009001935061900190901020900053503191002090006352409656E09006A09010009667209006A09011009646509006A090120096A6109006A09013009000808FF0900093508350619110D090102090100250C417564696F20536F75726365090311090001
{my iPhone BT address}#4F49112F 35840900000A4F49112F090001350319112F0900020A00000000090004351135031901003505190003080D35031900080900053503191002090006352409656E09006A09010009667209006A09011009646509006A090120096A6109006A09013009000808FF09000935083506191130090100090100250950686F6E65626F6F6B0903140801
{my iPhone BT address}#4F49111F 35900900000A4F49111F090001350619111F1912030900020A00000000090004350C3503190100350519000308080900053503191002090006352409656E09006A09010009667209006A09011009646509006A090120096A6109006A09013009000808FF0900093508350619111E090106090100251148616E6473667265652047617465776179090301080109031109002F
{my iPhone BT address}#00000000 35B40900000A0000000009000135031910000900020A00000000090004350A35031901003503190001090006352409656E09006A09010009667209006A09011009646509006A090120096A6109006A09013009000808FF09020035030901000902010A0000000909030035382503342E302531436F70797269676874202863292032303037204170706C6520496E632E20416C6C20726967687473207265736572766564090308450D7777772E6170706C652E636F6D
{my iPhone BT address}#4F491200 35850900000A4F49120009000135031912000900020A000000000900053503191002090006352409656E09006A09010009667209006A09011009646509006A090120096A6109006A09013009000808FF090101250F506E5020496E666F726D6174696F6E0902000901020902010905AC0902020912A00902030905100902042801090205090002

trusts :

{my iPhone BT address} [all]

I have same version of bluez/bluetooth related package installed on CentOS 6.4 x86_64 server

problem is I able to pair, but not connected, I tried on different phone, different bluetooth dongle. all same. below are list of what I have tested. Asterisk testing just as reference, as I don’t even able to get phone connect to server just with bluez or related command.

Hardware:
server : DELL Optiplex 790 (Intel i5 CPU, 4G memory)
bluetooth dongle:
hciconfig -a
hci0: Type: BR/EDR Bus: USB
BD Address: 00:15:AA:AA:AA:AA ACL MTU: 339:8 SCO MTU: 128:2
UP RUNNING PSCAN
RX bytes:26858 acl:246 sco:0 events:639 errors:0
TX bytes:12305 acl:256 sco:0 commands:203 errors:0
Features: 0xff 0x3e 0x85 0x30 0x18 0x18 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: ''
Class: 0x000104
Service Classes: Unspecified
Device Class: Computer, Desktop workstation
HCI Version: 2.0 (0x3) Revision: 0xc5c
LMP Version: 2.0 (0x3) Subversion: 0xc5c
Manufacturer: Cambridge Silicon Radio (10)

hci1: Type: BR/EDR Bus: USB
BD Address: 00:0A:3A:82:07:9B ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN
RX bytes:111096 acl:153 sco:0 events:10041 errors:0
TX bytes:84344 acl:146 sco:0 commands:4974 errors:0
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x79 0x83
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'My PBX’
Class: 0x4a0100
Service Classes: Networking, Capturing, Telephony
Device Class: Computer, Uncategorized
HCI Version: 2.1 (0x4) Revision: 0x5183
LMP Version: 2.1 (0x4) Subversion: 0x420e
Manufacturer: Broadcom Corporation (15)

Phone:
iPhone 3GS: iOS 5.1.1
Virgin Android: adr2045, android 2.3.5, kernel 2.6.35.7-perf; hardware ver: VM9F_4A

Software
# rpm -qa | grep blue
bluez-libs-devel-4.66-1.el6.x86_64
bluez-compat-4.66-1.el6.x86_64
bluez-4.66-1.el6.x86_64
gnome-bluetooth-libs-2.28.6-8.el6.x86_64
gnome-bluetooth-2.28.6-8.el6.x86_64
pulseaudio-module-bluetooth-0.9.21-14.el6_3.x86_64
bluez-libs-4.66-1.el6.x86_64

cat /etc/redhat-release

CentOS release 6.4 (Final)

uname -a

Linux localhost.localdomain 2.6.32-358.6.1.el6.x86_64 #1 SMP Tue Apr 23 19:29:00 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

localhost*CLI> core show version
Asterisk 11.3.0 built by root @ localhost.localdomain on a x86_64 running Linux on 2013-05-14 14:56:11 UTC

below are testing

#hcitool dev
Devices:
hci0 00:15:83:15:A3:10
hci1 00:0A:3A:82:07:9B

hcitool scan
Scanning …
<iphone_bluetooth_address> 3GS
<android_bluetooth_address> JukeB

#./simple-agent.py hci0 <iphone_bluetooth_address>
RequestPinCode (/org/bluez/1423/hci1/dev_xx_xx_xx_xx_xx_xx)
Enter PIN Code: 0000
Release
New device (/org/bluez/1423/hci1/dev_xx_xx_xx_xx_xx_xx)

once I enter PIN code “0000” on server, and press enter, phone will have pop up screen ask pin, I type “0000” then press pair button, phone will say “Not connected”,during the prior, got below messages

tail -f /var/log/messages
May 23 07:35:18 localhost bluetoothd[1416]: link_key_request (sba=00:15:83:15:A3:10, dba=28:CF:DA:8B:D1:03)
May 23 07:35:18 localhost bluetoothd[1416]: pin_code_request (sba=00:15:83:15:A3:10, dba=28:CF:DA:8B:D1:03)
May 23 07:35:35 localhost bluetoothd[1416]: link_key_notify (sba=00:15:83:15:A3:10, dba=28:CF:DA:8B:D1:03, type=0)
May 23 07:35:35 localhost dbus-daemon: [system] Rejected send message, 1 matched rules; type=“method_return”, sender=":1.64" (uid=0 pid=3284 comm="/usr/bin/python) interface="(unset)" member="(unset)" error name="(unset)" requested_reply=0 destination=":1.1" (uid=0 pid=1410 comm="/usr/sbin/bluetoothd))

then if I force phone connected the server. will get below message on phone
connection unsuccessful, “computer” is not supported.'
and on server got below messages

localhost kernel: l2cap_recv_acldata: Unexpected continuation frame (len 0)

then goto Asterisk.

localhost*CLI> module load chan_mobile
Loaded chan_mobile

localhost*CLI> mobile search
Address Name Usable Type Port
<iphone_bt_address> 3GS Yes Phone 8

edit /etc/asterisk/chan_mobile.conf

[adapter] ;bt adp hci0 id=blue address=00:15:83:15:A3:10

[adapter]
;bt adp hci1
id=yellow
address=00:0A:3A:82:07:9B

[iPhone]
address=<iphone_bt_address>
port=8
context=incoming-mobile
adapter=yellow

then back to asterisk console, run below test.

localhost*CLI> mobile show devices
ID Address Group Adapter Connected State SMS
iPhone <iphone_bt_address> 0 blue No None Yes

did all test on other android phone, and other iPhone 4GS, all same issue.