[Home]

Summary:ASTERISK-11146: chan_mobile cell phone will not connect via bt.
Reporter:Thomas Kilbride (obnauticus)Labels:
Date Opened:2008-01-03 16:44:21.000-0600Date Closed:2011-06-07 14:00:21
Priority:BlockerRegression?No
Status:Closed/CompleteComponents:Addons/chan_mobile
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_cellphone-22.patch
( 1) chan_mobile_1.4.x.patch
( 2) chan_mobile_1.4.x.patch
( 3) chan_mobile.c
( 4) chan_mobile-1.4.x.patch
( 5) dump.log
( 6) hcid.conf
( 7) mobile.conf
Description:My cell phone will not connect over bluetooth to the chan_mobile driver:

   -- Bluetooth Device SPHA640 has connected.
   -- Bluetooth Device SPHA640 has disconnected, reason (104).
   -- Bluetooth Device SPHA640 has connected.
   -- Bluetooth Device SPHA640 has disconnected, reason (104).
   -- Bluetooth Device SPHA640 has connected.
   -- Bluetooth Device SPHA640 has disconnected, reason (104).

The cell phone disconnects a few miliseconds after the Asterisk says the device has connected via CLI.

A hcidump log is provided attached in dump.log (not every time the device disconnects it obviouly generates a Disconnect Complete HCI event in the log (HCI Event: Disconn Complete (0x05) plen 4).

The source I am using to compile chan_mobile is included, along with a patch I found to even compile and get working.

****** ADDITIONAL INFORMATION ******

I am running Debian etch on
Linux 2.6.18-4-486 #1 Mon Mar 26 16:39:10 UTC 2007 i686 GNU/Linux
Comments:By: Dave Bowerman (dbowerman) 2008-01-08 06:47:01.000-0600

i note your trying to use it with 1.4.x, strictly speaking chan_mobile is for trunk, but it should work ok if you make the necessary patches so it will compile.

can you tell me what sort of adapter you are using? also what version of bluez-libs?

By: Josef Liska (phokz) 2008-01-08 07:29:53.000-0600

Hello, I also tried it with asterisk 1.4 and it works for me with Nokia 6230i and Ubuntu 7.10. On Ubuntu 7.4 (just 6months older!) it did not work reliably. I can provide my diff for 1.4 if you are interested.

I think your distro's kernel bluetooth stack and bluez-libs are too old for this kind of app.

My working adapter is ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

With my second adapter ID 0db0:6970 Micro Star International
I had problems (problably with sco data alignment).

By: Dave Bowerman (dbowerman) 2008-01-08 22:57:56.000-0600

i second phokz's comments.

kernel version (i.e. 2.6.20 ->) and bluez-libs (3.2x ->) are critical to stable performance with chan_mobile.

also CSR chipset adapter is the one to use.

By: Thomas Kilbride (obnauticus) 2008-01-09 16:21:42.000-0600

Version of bluez-lib:
3.7-1 from Debian Aptitude. I tried compiling from source to do this also, no luck, same errors.

Bluez-Utils:

3.7-1

Bluetooth dongle info:
1131:1001 Integrated System Solution Corp. KY-BT100 Bluetooth Adapter


phokz:
Your diff from latest svn trunk (chan_mobile.c) would be greatly appreciated on my end :)



By: Josef Liska (phokz) 2008-01-17 05:07:08.000-0600

obnauticus: you _must_ upgrade bluez stack, either you can compile latest from bluez.org (at time of writing 3.24) or install recent distro. In my case, Kubuntu 7.10 with bluez 3.19 worked.

I uploaded (twice, sorry admins) patch of r499, which is what I tested.



By: Thomas Kilbride (obnauticus) 2008-01-18 00:32:50.000-0600

I will try your patch and recompile bluez libs and utils.

By: rtd (rolfbeethoven) 2008-01-19 09:01:19.000-0600

I experienced exactly the same problem as you describe.  The phone kept connect and disconnecting with the error message "[my phone info].. has disconnected, reason (104)."  My phone was connecting fine with no problems at first, but any incoming calls were picked up and disconnected immediately, so I started playing around with mobile.conf.  One of the versions I tried included type=headset in my phone stanza.  When I unloaded and loaded chan_mobile.so, I got the connect-disconnect problem ad nauseum.  When I changed the mobile.conf settings to their original settings (see below) and unloaded and loaded chan_mobile.so I get my old reliable connection back.  My phone never disconnects, but Asterisk always hangs up.  Anyway, I thought you may want to experiment with your mobile.conf settings.  Our problem sounded identical.

my mobile.conf settings:

; mobile.conf
; configuration file for chan_mobile

[general]
interval=10             ; Number of seconds between trying to connect to devices.

[adapter]
id=blue
address=00:02:72:80:36:03

[Katja Cell]
address=00:19:A1:BE:3F:6A       ; the address of the phone
port=4                          ; the rfcomm port number (from mobile search)
context=incoming-mobile         ; dialplan context for incoming calls
adapter=blue                    ; adapter to use

By: Thomas Kilbride (obnauticus) 2008-01-19 16:00:36.000-0600

My configuration is almost identical to yours.

By: jmls (jmls) 2008-02-17 12:48:00.000-0600

does this work with trunk ?

By: Thomas Kilbride (obnauticus) 2008-02-17 15:05:33.000-0600

I am not sure if it works with trunk.

By: jmls (jmls) 2008-02-17 15:07:37.000-0600

chan_mobile is only supported on trunk

By: Thomas Kilbride (obnauticus) 2008-03-04 23:35:31.000-0600

This helps a lot check this out:

asterisk*CLI> mobile search
No Bluetooth Cell / Mobile devices found.
   -- Bluetooth Device SPHA640 has connected.
]2008-03-04 21:37:08] DEBUG[28674]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+BRSF=4
[2008-03-04 21:37:08] DEBUG[28675]: chan_mobile.c:1812 do_sco_listen: About to accept() socket.
[2008-03-04 21:37:08] DEBUG[28674]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [+BRSF:37]
[2008-03-04 21:37:08] DEBUG[28674]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [OK]
]2008-03-04 21:37:08] DEBUG[28674]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+CIND=?
[2008-03-04 21:37:08] DEBUG[28674]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [+CIND: ("service",(0,1)),("call",(0,1)),("callsetup",(0,3))]
[2008-03-04 21:37:08] DEBUG[28674]: chan_mobile.c:1345 do_monitor_phone: CIEV_CALL=2 CIEV_CALLSETUP=3
   -- Bluetooth Device SPHA640 has disconnected, reason (104).
   -- Bluetooth Device SPHA640 has connected.
]2008-03-04 21:37:34] DEBUG[28679]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+BRSF=4
[2008-03-04 21:37:34] DEBUG[28680]: chan_mobile.c:1812 do_sco_listen: About to accept() socket.
[2008-03-04 21:37:34] DEBUG[28679]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [+BRSF:37]
[2008-03-04 21:37:34] DEBUG[28679]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [OK]
]2008-03-04 21:37:34] DEBUG[28679]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+CIND=?
[2008-03-04 21:37:34] DEBUG[28679]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [+CIND: ("service",(0,1)),("call",(0,1)),("callsetup",(0,3))]
[2008-03-04 21:37:34] DEBUG[28679]: chan_mobile.c:1345 do_monitor_phone: CIEV_CALL=2 CIEV_CALLSETUP=3
[2008-03-04 21:37:34] DEBUG[28679]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [OK]
]2008-03-04 21:37:34] DEBUG[28679]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+CIND?
   -- Bluetooth Device SPHA640 has disconnected, reason (104).
   -- Bluetooth Device SPHA640 has connected.
]2008-03-04 21:37:41] DEBUG[28681]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+BRSF=4
[2008-03-04 21:37:41] DEBUG[28682]: chan_mobile.c:1812 do_sco_listen: About to accept() socket.
[2008-03-04 21:37:41] DEBUG[28681]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [+BRSF:37]
[2008-03-04 21:37:41] DEBUG[28681]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [OK]
]2008-03-04 21:37:41] DEBUG[28681]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+CIND=?
[2008-03-04 21:37:41] DEBUG[28681]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [+CIND: ("service",(0,1)),("call",(0,1)),("callsetup",(0,3))]
[2008-03-04 21:37:41] DEBUG[28681]: chan_mobile.c:1345 do_monitor_phone: CIEV_CALL=2 CIEV_CALLSETUP=3
[2008-03-04 21:37:41] DEBUG[28681]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [OK]
]2008-03-04 21:37:41] DEBUG[28681]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+CIND?
   -- Bluetooth Device SPHA640 has disconnected, reason (104).
   -- Bluetooth Device SPHA640 has connected.
]2008-03-04 21:37:49] DEBUG[28683]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+BRSF=4
[2008-03-04 21:37:49] DEBUG[28684]: chan_mobile.c:1812 do_sco_listen: About to accept() socket.
[2008-03-04 21:37:49] DEBUG[28683]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [+BRSF:37]
[2008-03-04 21:37:49] DEBUG[28683]: chan_mobile.c:1304 do_monitor_phone: rfcomm_read() (SPHA640) [OK]
]2008-03-04 21:37:49] DEBUG[28683]: chan_mobile.c:980 rfcomm_write: rfcomm_write() (SPHA640) [AT+CIND=?
   -- Bluetooth Device SPHA640 has disconnected, reason (104).


The device seems to ALWAYS disconnect when I send AT+CND=? to it. I'm not a bluetooth specialist so I have no idea what to do now. Sauce?



By: Jason Parker (jparker) 2008-05-06 15:27:23

Please reopen if you are able to reproduce on 1.6 or trunk, using the bluez/kernel versions suggested by dbowerman.