[chan_mobile] phone not connected

Hi. I come to you after days of searching through forums, Google and blogs. So I’m kinda desperate :frowning:

I’ve got a Debian (6.0.0) box with Asterisk (1.8.3.3) installed on it. I managed to install a Digium TDM411B card and it’s working.

Here is my problem :

I want to connect a cellphone to Asterisk so I can make/receive calls through it. I re-compiled Asterisk with chan_mobile included. Everything’s loading well. I managed to pair the cellphone (Blackberry Curve 8520) with the box using a MSI BToes 2.0 EDR Micro Dongle and bluetooth-agent (comes in some bluez package). But mobile show devices indicates that the cellphone is not connected. I tried a different bluetooth dongle, it doesn’t make a difference.

Here are some outputs :

[quote]sudo hciconfig -a
hci0: Type: BR/EDR Bus: USB
BD Address: 00:15:83:15:A3:10 ACL MTU: 339:8 SCO MTU: 128:2
UP RUNNING PSCAN
RX bytes:15732 acl:175 sco:0 events:480 errors:0
TX bytes:5914 acl:192 sco:0 commands:146 errors:1
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)
[/quote]

[quote]/etc/bluetooth/rfcomm.conf
rfcomm0 {
bind yes;
device 40:5F:BE:33:AA:F6;
channel 1;
comment “blackb”;
}
[/quote]

[quote]sudo hcitool con
Connections:
> ACL 40:5F:BE:33:AA:F6 handle 5 state 1 lm MASTER AUTH ENCRYPT
[/quote]

[quote]CLI> mobile search
Address Name Usable Type Port
40:5F:BE:33:AA:F6 blackb Yes Phone 3
[/quote]

[quote]/etc/asterisk/chan_mobile.conf
[general]
interval=5

[adapter]
id = blue
address = 00:15:83:15:A3:10

[blackb]
address = 40:5F:BE:33:AA:F6
port = 3
adapter = blue
[/quote]

[quote]CLI> mobile show devices
ID Address Group Adapter Connected State SMS
blackb 40:5F:BE:33:AA:F6 0 blue No None Yes
[/quote]

As you probably see, I’m new to Asterisk. Sorry if all this sounds a bit foolish.
If anyone could indicate me how to go further in resolving this problem, I’d much appreciate it.
Thank you for your time.

Me too, my cellphone isn’t connect to asterisk…
… I have been paired bt dongle with phone.

I have debian sid with these packages:

ii bluez 4.93-3 Bluetooth tools and daemons ii bluez-utils 4.93-3 Transitional package ii asterisk 1:1.8.4-1 Open Source Private Branch Exchange (PBX) ii asterisk-mobile 1:1.8.4-1 Bluetooth phone support for the Asterisk PBX

root@debian:/etc/bluetooth# hcitool scan Scanning ... 00:11:9F:BE:79:60 Nokia 6630

root@debian:/etc/bluetooth# hciconfig hci0: Type: BR/EDR Bus: USB BD Address: 00:24:94:00:24:5D ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:10553 acl:46 sco:0 events:314 errors:0 TX bytes:2496 acl:27 sco:0 commands:157 errors:0

[code][general]
interval=30 ; 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=blue
address=00:24:94:00:24:5D
;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.

[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.
[/code]

debian*CLI> mobile search Address Name Usable Type Port 00:11:9F:BE:79:60 Nokia 6630 Yes Phone 28

debian*CLI> mobile show devices ID Address Group Adapter Connected State SMS NOKIA6630 00:11:9F:BE:79:60 1 blue No None Yes

I haven’t hcid.conf in /etc/bluetooth

root@debian:/etc/bluetooth# ls -la totale 32 drwxr-xr-x 2 root root 4096 1 giu 00.13 . drwxr-xr-x 57 root root 4096 1 giu 00.13 .. -rw-r--r-- 1 root root 1482 31 mag 14.53 audio.conf -rw-r--r-- 1 root root 262 31 mag 14.53 input.conf -rw-r--r-- 1 root root 2448 31 mag 14.53 main.conf -rw-r--r-- 1 root root 120 31 mag 14.53 network.conf -rw-r--r-- 1 root root 297 31 mag 14.53 rfcomm.conf -rw-r--r-- 1 root root 248 31 mag 14.53 serial.conf

but I have /var/lib/bluetooth/MAC-DEVICE

root@debian:/var/lib/bluetooth/00:24:94:00:24:5D# ls -la totale 56 drwxr-xr-x 2 root root 4096 1 giu 01.03 . drwxr-xr-x 3 root root 4096 1 giu 00.13 .. -rw-r--r-- 1 root root 27 1 giu 00.14 classes -rw-r--r-- 1 root root 84 1 giu 01.04 config -rw-r--r-- 1 root root 35 1 giu 00.17 features -rw-r--r-- 1 root root 42 1 giu 01.34 lastseen -rw-r--r-- 1 root root 42 1 giu 01.31 lastused -rw------- 1 root root 55 1 giu 01.04 linkkeys -rw-r--r-- 1 root root 28 1 giu 00.17 manufacturers -rw-r--r-- 1 root root 29 1 giu 00.14 names -rw-r--r-- 1 root root 23 1 giu 01.03 pincodes -rw-r--r-- 1 root root 351 1 giu 00.43 profiles -rw-r--r-- 1 root root 3526 1 giu 00.43 sdp -rw-r--r-- 1 root root 21 1 giu 00.43 types

Asterisk in full log write:

[Jun 1 01:32:43] DEBUG[6261] chan_mobile.c: bind() failed (98). [Jun 1 01:33:13] DEBUG[6261] chan_mobile.c: bind() failed (98). [Jun 1 01:33:43] DEBUG[6261] chan_mobile.c: bind() failed (98). [Jun 1 01:34:13] DEBUG[6261] chan_mobile.c: bind() failed (98). [Jun 1 01:34:43] DEBUG[6261] chan_mobile.c: bind() failed (98). [Jun 1 01:35:13] DEBUG[6261] chan_mobile.c: bind() failed (98). [Jun 1 01:35:43] DEBUG[6261] chan_mobile.c: bind() failed (98). [Jun 1 01:36:13] DEBUG[6261] chan_mobile.c: bind() failed (98).

Please,
help me :slight_smile:

Regards,
Elia

Add a hcidump:

[code]root@debian:~# hcidump
HCI sniffer - Bluetooth packet analyzer ver 2.0
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Read Voice Setting (0x03|0x0025) plen 0

HCI Event: Command Complete (0x0e) plen 6
Read Voice Setting (0x03|0x0025) ncmd 1
status 0x00 voice setting 0x0060
[/code]

but chan_mobile.c: bind() failed (98).

I win :smiley:

Connected to Asterisk 1.8.4 currently running on debian (pid = 18564) Verbosity was 0 and is now 3 Core debug was 0 and is now 3 -- Bluetooth Device NOKIA6630 has connected, initializing... -- Bluetooth Device NOKIA6630 initialized and ready. debian*CLI> mobile show devices ID Address Group Adapter Connected State SMS NOKIA6630 00:11:9F:BE:79:60 1 blue Yes Free No

the error is in source, chan_mobile.c

wrong:

memset(&addr, 0, sizeof(addr)); addr.rc_family = AF_BLUETOOTH; bacpy(&addr.rc_bdaddr, &src); [b]addr.rc_channel = (uint8_t) 1;[/b] if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { ast_debug(1, "bind() failed (%d).\n", errno); close(s); return -1; }

correct:

memset(&addr, 0, sizeof(addr)); addr.rc_family = AF_BLUETOOTH; bacpy(&addr.rc_bdaddr, &src); [b]addr.rc_channel = (uint8_t) 0;[/b] if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { ast_debug(1, "bind() failed (%d).\n", errno); close(s); return -1; }

recompile and all works good!

https://issues.asterisk.org/view.php?id=17635

another problem, SMS=no, why?

Can this be stickied or fixed permanently? This has been on ongoing issue for a long time with asterisk and chan_mobile, the issue is still not resolved even on the recent source tree. Every time I upgrade Asterisk, I forget about this and start pounding my head trying to figure out why it’s not connecting and I realize I have to do this fix every time when a new version is out.

Regarding a permanent fix, see:
issues.asterisk.org/jira/browse/ASTERISK-16357

waiting on a proper patch to move forward, but note that chan_mobile falls under Extended support, so someone in the community will need to carry it forward.

Is this issue only affecting debian based installs? Just seems silly to use an older Bluez version, when the svn is still being changed and modified, so it must work fine for someone. I’d rather track down the problem than use this ugly fix all the time.