Summary:ASTERISK-08668: [patch] chan_cellphone - use mobile phones with Bluetooth as FXO devices in *
Reporter:Dave Bowerman (dbowerman)Labels:
Date Opened:2007-01-27 01:00:42.000-0600Date Closed:2011-06-07 14:03:03
Versions:Frequency of
Environment:Attachments:( 0) bluetooth_dongles_lsusb_onewayaudio.txt
( 1) cellphone_dtmf.log
( 2) cellphone.txt
( 3) cellphone-corrupt-fix.patch
( 4) chan_cellphone.debug
( 5) chan_cellphone.patch
( 6) chan_cellphone-1.4.1-17.patch.gz
( 7) chan_cellphone-14.patch
( 8) chan_cellphone-14-1.4.1.patch.gz
( 9) chan_cellphone-15.patch
(10) chan_cellphone-16.patch
(11) chan_cellphone-17.patch
(12) chan_cellphone-18.patch
(13) chan_cellphone-19.patch
(14) chan_cellphone-19-1.4.2.patch.gz
(15) chan_cellphone-20.patch
(16) chan_cellphone-21.patch
(17) chan_cellphone-22.patch
(18) chan_cellphone-22-1.4.4.patch.gz
(19) chan_cellphone-5-ericsson.patch
(20) chan_cellphone-debug-free-invalid-pointer.txt
(21) chan_cellphone-debug-free-invalid-pointer-complete.txt
(22) chan_cellphone-debug-segfault
(23) hcidump0.txt.gz
(24) K750i_segmentation_error.txt
(25) malwcal-a701-log.txt
(26) malwcal-nokia-6233.log
Description:Asterisk Channel Driver to allow Bluetooth Cell/Mobile Phones to be used as FXO devices.

Features :-

Multiple cell phones can be connected.
Asterisk automatically connects to each cell phone when it comes in range.
CLI Command to discover bluetooth phones.
CLI Command to show status of connected phones.
Inbound calls to the cell phones are handled by Asterisk, just like inbound calls on a Zap channel.
CLI passed through on inbound calls.
Dial outbound on a cell phone using Dial(CELL/device/nnnnnnn) in the dialplan.
Application CellStatus can be used in the dialplan to see if a cell phone is connected.
Supports devicestate for dialplan hinting.
Calls can be placed / taken from the cellphone or from the Asterisk dialplan.
Inbound and Outbound SMS Messaging from the Dialplan.

See doc/cellphone.txt for configuration.
Comments:By: Dave Bowerman (dbowerman) 2007-01-30 18:08:40.000-0600

If you are having trouble compiling this, be sure to execute ./bootstrap.sh in the top of the Asterisk source dir, then ./configure, make menuselect.

chan_cellphone is dependant on libbluetooth, which the standard configure script does not test for.

./bootstrap.sh will generate the correct configure script.

By: Tristan Mahe (tristan_mahe) 2007-01-31 05:52:40.000-0600

Compiles without trouble with latest trunk, but I always have connection refused to my cellphone even if I enter the right PIN:

[Jan 31 12:45:08] DEBUG[2703]: chan_cellphone.c:614 rfcomm_connect: connect() failed (111).
[Jan 31 12:46:38] DEBUG[2703]: chan_cellphone.c:614 rfcomm_connect: connect() failed (115).

I'm investigating, as it should be a bluetooth issue.
Maybe I shouldn't use your config file on my fedora core 6.

By: jmls (jmls) 2007-01-31 07:52:03.000-0600

how many phones can a bluetooth adapter handle at the same time ?

By: David Svanlund (svanlund) 2007-01-31 15:06:47.000-0600

This patch looks very promising! Got it working in my environment a couple of hours ago, after some initial struggle yesterday. Asterisk with chan_cellphone is running on my laptop, connected to an internal network (10.1.0.x). I also got two different SIP phones on the same network.

I have identified two issues this far. These issues might be caused by human error or stupidity. I'm not sure whether it is related to my configuration and hardware or if it is affecting some/all users.

* If I place an outgoing call from one of my SIP phones and use DTMF during that call, it will not be hungup. When I hangup the SIP phone, my cell phone will "take over" the call. The same thing can happen if I initiate a call and hangup almost immediately.

* When my cell phone gets an incoming call, Asterisk takes control as expected. But if I try to play a file, let's say tt-weasels, I can't hear anything. Asterisk thinks everything is working OK. I have seen this behaviour caused by zaptel in other systems, but it is not involved here. If I dial my SIP phone instead of playing a file, I don't get any sound from Asterisk either, but I do have sound in the incoming direction.

I will try to continue my testing tomorrow. Maybe I can take a closer look at the communication between Asterisk and the phone then.

By: Dave Bowerman (dbowerman) 2007-01-31 22:03:16.000-0600

New patch available :- chan_cellphone-1.patch

Added support for Nokia Series 40 phones.
Addresses 'Hangup' issue reported by some people.

Now tested with :-

LG TU500
RIM Blackberry 7250
Nokia 6230i

By: Tristan Mahe (tristan_mahe) 2007-02-01 07:09:28.000-0600

Hi, I found why I wasn't able to peer with pin, with bluez-utils 3.7 you can't use the pinhelper configuration option, you have to use passkey-agent.

There's one in the bluez-utils src available.

Tested with a Z500 from samsung, peering is ok,

When a call is placed to the cellphone, control of the call is passed to asterisk, but I have issues with the sound: the caller cannot hear the callee, but callee hears the caller.

When i call from asterisk to the cellphone:

   -- Called Z500/0624164301
[Feb  1 14:08:15] ERROR[29206]: chan_cellphone.c:961 do_monitor: Dial failed on CELL/Z500-9ea8
   -- CELL/Z500-9ea8 is circuit-busy

But the destination of the call still rings, seems like there is a timeout there that is too short.

By: David Svanlund (svanlund) 2007-02-01 07:23:23.000-0600


It seems like both of us are experiencing the same sound problem then. I'm using a VK 2020 for my testing. Also got a SonyEricsson k700 I can try with later.

By: Tristan Mahe (tristan_mahe) 2007-02-01 07:29:40.000-0600

I will test with a sony ericsson v600i and a nokia n70 and provide reports.

The timeout that cause my failure on outgoing calls is set on line 790. I will also provide reports about modifying this value.

[EDIT:] modifying the timeout from 8 to 16 allows me to place calls from the mobile. Still the one way audio problem anyway.

I also have an few log lines that appears:

hci_scodata_packet: hci0 SCO packet for unknown connection handle 44.

the sony ericson has the same one way audio trouble.

By: Julian J. M. (julianjm) 2007-02-01 12:36:02.000-0600

Just tested can_cellphone-1.patch

I'm using Centos 4 (just updated to latest), asterisk 1.4.

The bluez-libs that come with Centos4 are quite old:
# rpm -qa | grep bluez

For getting the channel driver to compile, I had to change HANDSFREE_AGW_PROFILE_ID into HANDSFREE_PROFILE_ID, because the former isn't defined in sdp.h for this bluez version.

Outgoing calls through mobile phone core dump asterisk inmediatelly.

Incoming calls have one way audio, the sip phone can hear, the remote phone doesn't.

I'm quite sure it's because this outdated bluez version. Does anyone know of updated rpm packages for Centos4?

Julian J. M.

By: David Svanlund (svanlund) 2007-02-01 15:01:24.000-0600

I just managed to get two way audio. I did some hacking in the method "cel_write".  If I comment out the following two lines, it works fine.

if (pvt->state != CEL_STATE_INCOMING || pvt->state != CEL_STATE_OUTGOING)
return 0;

I have no idea how this break things. It was just a quick hack, which will hopefully get someone on the right path to a solution. Maybe it is just in the wrong state.

I have discovered a new problem: When Asterisk is started, my phone is connected but is in state "Busy". Incoming calls does not get answered. If I place an outgoing call, it will change to state "Free" when completed.

(With the new patch, I still experience the hangup issues I described earlier. If it was supposed to solve any of that, it obviously didn't.)

By: Dave Bowerman (dbowerman) 2007-02-01 21:00:05.000-0600

New patch available :- chan_cellphone-3.patch

Fixes outbound call progress tones.
Implements the dial timeout from Dial(CELL/fred/xxxx dialplan app.

By: David Svanlund (svanlund) 2007-02-02 02:27:59.000-0600

As Sony Ericsson is a major brand, I believe it would be a limitation not to support it. I can try to do some testing with my dusty k700 during the weekend. Any special oddities to look out for?

By: Dave Bowerman (dbowerman) 2007-02-02 03:25:45.000-0600

svanlund: use 'core set debug 3' then load chan_cellphone.so this will log the conversation between the phone and asterisk. the sony's ive seen so far report 'ERROR' when the AT+BRSF command is sent. It would be good to confirm this. thanks

By: Tristan Mahe (tristan_mahe) 2007-02-02 05:39:48.000-0600

using chan_cellphone-3.patch, there's no more timeout trouble with Z500 but i'm still having one way audio.

I also get this new error that repeats a lot:
chan_cellphone.c:541 cel_write: Overrun on sco_out_buf detected.

I have also really bad white noise on the calling side.

I'll test the sony ericsson this afternoon.

By: David Svanlund (svanlund) 2007-02-02 12:28:13.000-0600

dbowerman: I'm not seeing any ERROR message when I connect my Sony Ericsson k700. The initial connection sequence seems to work fine. It actually works better than my VK 2020, which never seems to get fully connected (I don't see the "device online and ready" message).

It seems like I need to do some work to get my odd VK 2020 phone supported ;)

By: Serge Vecher (serge-v) 2007-02-02 12:34:08.000-0600

first of all, nice patch! How about naming the channel according to the tech, say chan_bluetooth?

By: Dave Bowerman (dbowerman) 2007-02-02 16:39:34.000-0600

serge-v: there already is a chan_bluetooth. its old and unmaintained and totally different to chan_cellphone. I dont mind changing, but I thought it would be confusing...

By: Dave Bowerman (dbowerman) 2007-02-02 16:47:22.000-0600

tristan_mahe: with respect to the buffer overrun, could you describe how you are testing?, SIP / IAX ? -> cellphone, Inbound or Outbound ?.
Id like to try and reproduce this. thanks.

By: Dave Bowerman (dbowerman) 2007-02-02 21:51:55.000-0600

svanlund: if you dont see "device online and ready" then it hasnt initialised properly. I'd say the VK 2020 is one of the Sony's that doesnt have the +BRSF command. I'm working on a fix for this.

By: Dave Bowerman (dbowerman) 2007-02-03 00:41:45.000-0600

New patch available :- chan_cellphone-4.patch

addresses sco buffer overrun issue.

By: linuxa (linuxa) 2007-02-03 04:27:12.000-0600

Great work, I've been trying to get Bluetooth working for ages.

Tested with a Nokia 6680 to another mobile, but have one way audio. I have 2 other mobiles in the office (LG & Motorola) and I'll test those during the weekend.

What can I do to help?

By: Dave Bowerman (dbowerman) 2007-02-03 18:44:29.000-0600

New patch available :- chan_cellphone-5.patch

Minor changes.

By: Dave Bowerman (dbowerman) 2007-02-03 18:52:09.000-0600

If you are having trouble with one way audio could you please do the following :-

using chan_cellphone-5.patch

1. check /etc/asterisk/logger.conf to make sure debug messages are displayed on the console. The line (near the bottom) should look like 'console => notice,warning,error,debug'

2. restart asterisk if you made a change to logger.conf

3. module unload chan_cellphone.so (If you auto load it)

4. core set debug 3

5. module load chan_cellphone.so

6. capture the 'DEBUG' messages as a result of the load and post them here

7. try a call and capture the 'DEBUG' messages and post them here

8. post the following : model of cellphone, technology used for call i.e. SIP/IAX etc. was the call inbound or outbound.

I have 2 way audio working fine on the following

Nokia 6230i
LG TU500
Blackberry 7250


By: Ronald Chan (loloski) 2007-02-04 04:53:20.000-0600

dbowerman: Good work, this is another exciting patches for *, although i'm not plugging my Sony Ericsson w800i phone yet, i have a few question what is the minimum version bluez-libs (libbluetooth),autoconf,automake that it requires?

On my FC4 test system, i was force to upgrade autoconf,automake,bluez-libs (libbluetooth) and also dbus system to it's latest source which is fine with me but not for a regular user :(.

I don't want to set a flame bait here i just want others to know, if they are testing this with their old favorite distribution it requires a little more effort on their part than the usual ./configure && make && make install.


By: Alejandro Migliora (amigliora) 2007-02-04 09:12:56.000-0600

Hi all,
I understood this is a patch for 1.4 Trunk.
Is there any way we can use it for 1.2.XX version?
Please advice.


By: Jason Parker (jparker) 2007-02-04 22:08:27.000-0600

amigliora: no, you cannot

By: Tristan Mahe (tristan_mahe) 2007-02-05 05:44:06.000-0600


Using my sony ericsson v600i and chan_cellphone-5.patch, I have two way audio working on receiving calls...

It sometimes segfault on receiving, and I'm currently testing outgoing calls, where it segfault a lot.

]Feb  5 12:49:14] DEBUG[3660]: chan_cellphone.c:651 rfcomm_write: rfcomm_write() (20) [ATD0492909996;
]Feb  5 12:49:16] DEBUG[3660]: chan_cellphone.c:824 do_monitor: rfcomm_read() (20) [
]Feb  5 12:49:16] DEBUG[3660]: chan_cellphone.c:824 do_monitor: rfcomm_read() (20) [OK
]Feb  5 12:49:16] DEBUG[3660]: chan_cellphone.c:824 do_monitor: rfcomm_read() (20) [
]Feb  5 12:49:16] DEBUG[3660]: chan_cellphone.c:824 do_monitor: rfcomm_read() (20) [+CIEV: 10,2
[Feb  5 12:49:16] DEBUG[3660]: chan_cellphone.c:1130 do_sco_listen: Incoming Audio Connection from device 00:12:EE:1E:C4:9D
[Feb  5 12:49:16] DEBUG[3660]: chan_cellphone.c:1145 do_sco_listen: Set Audio Connection fd OK.
Disconnected from Asterisk server

Bt gives me this:

#0  __ast_read (chan=0x89631c0, dropaudio=0) at channel.c:2079
2079                    f = AST_LIST_REMOVE_HEAD(&chan->readq, frame_list);

I'm using you channel on a development server, IAxtrunked with a production one where my phone is plugged. Calls are passed through this Iax trunk.

stopping asterisk, restarting bluetooth, starting asterisk makes the segfault disappear. Strange... I'll investigate this issue.

If i dial too fast, or receive calls too fast there's strange result like this:

]Feb  5 12:58:45] DEBUG[3878]: chan_cellphone.c:651 rfcomm_write: rfcomm_write() (21) [AT+CHUP
]Feb  5 12:58:47] DEBUG[3878]: chan_cellphone.c:651 rfcomm_write: rfcomm_write() (21) [AT+CHUP
]Feb  5 12:58:49] DEBUG[3878]: chan_cellphone.c:651 rfcomm_write: rfcomm_write() (21) [AT+CHUP
]Feb  5 12:58:51] DEBUG[3878]: chan_cellphone.c:651 rfcomm_write: rfcomm_write() (21) [AT+CHUP
]Feb  5 12:58:53] DEBUG[3878]: chan_cellphone.c:651 rfcomm_write: rfcomm_write() (21) [AT+CHUP
]Feb  5 12:58:55] DEBUG[3878]: chan_cellphone.c:651 rfcomm_write: rfcomm_write() (21) [AT+CHUP
]Feb  5 12:58:57] DEBUG[3878]: chan_cellphone.c:651 rfcomm_write: rfcomm_write() (21) [AT+CHUP
[Feb  5 12:59:50] DEBUG[3878]: chan_cellphone.c:634 rfcomm_connect: connect() failed (115).

And on the phone asterisk PBX is disconnected....

By: Dave Bowerman (dbowerman) 2007-02-05 16:04:28.000-0600

tristan_mahe: thanks. I know about the segfault and need to get to the bottom of it.

As for Sony Ericsson's they dont conform properly to the bluetooth HFP spec.
I'm building in explicit support for them using Sony Ericssons command set.

By: Juan Pablo (digitalcom) 2007-02-06 13:51:47.000-0600

Great job! I'm testing with an Motorola V3. It works, but has very poor audio CellPhone -> Asterisk.

By: Dave Bowerman (dbowerman) 2007-02-07 00:29:27.000-0600

New patch available :- chan_cellphone-6.patch

Adds support for Sony Ericsson 'T' Series phones.

i.e. T68, T68i, T300, T310, T610, T630 etc etc.

K Series are already supported. i.e. K700i etc

By: David Svanlund (svanlund) 2007-02-07 12:47:30.000-0600

As I mentioned earlier I'm having some trouble getting my VK 2020 phone fully working. VK is a small brand, at least here in Sweden. It does not complete the initial connection phase. This cause the phone to be in state Busy where no incoming calls work. I need to place an outgoing call to get the state updated. Callerid is unavailable.

I have found a solution to my problem. The phone does not respond to "AT+CMER=3,0,0,1", which prevents it from continuing to the next step. The result is that I never get the "Device xx online and ready" message. With a small fix, everything works as expected. This will allow the connection to proceed, even if the device does not respond to the AT+CMER command.

There is an if statement with the comment "Some devices dont respond to AT+CIND? properly. RIM Blackberry 4 example". The code snippet below is intended to be placed after that if statement. I'll leave it up to the author to include it in his patch if he wishes.

} else if (pvt->state == 3) { /* Some devices dont respond to AT+CMER=3,0,0,1 properly either. VK 2020 for example */
                               rfcomm_write(pvt, "AT+CLIP=1\r");

In context, this would look something like
                     if (pvt->state == 2) { /* Some devices dont respond to AT+CIND? properly. RIM Blackberry 4 example */
                               rfcomm_write(pvt, "AT+CMER=3,0,0,1\r");
                       } else if (pvt->state == 3) { /* Some devices dont respond to AT+CMER=3,0,0,1 properly either. VK 2020 for example */
                               rfcomm_write(pvt, "AT+CLIP=1\r");
                       } else if (pvt->state == CEL_STATE_DIAL) {
                               sprintf(buf, "ATD%s;\r", pvt->dial_number);

(Disclaimer on file, if that matters)

By: Serge Vecher (serge-v) 2007-02-07 13:07:30.000-0600

dbowerman: in response to note ASTERISK-5716696, the "existing chan_bluetooth" is a third-party patch. Since your patch is on track to get into the official tree, I think that you have a legit claim on the name. In either case, if anyone has thoughts on this, please share. Thanks!

By: Jason Parker (jparker) 2007-02-07 13:10:14.000-0600

I would prefer not to use "chan_bluetooth" for two reasons.

1) As has been stated, the name is already in use, and we don't want to pollute the namespace.
2) This isn't a "generic" bluetooth channel driver.  It does require a cellphone.

However, I would be open to a different name if one were proposed.

By: Dave Bowerman (dbowerman) 2007-02-07 16:49:34.000-0600

serge-v: qwell:

I dont mind either way. I think the original chan_bluetooth is probably dead.

chan_cellphone makes no attempt currently to support bluetooth devices other than phones, however, if it proves useful and stable with phones, i'd like to add support for headsets too.

Headsets (IMHO) are not as useful as phones due to a lack of a user interface, thats why im concentrating on phone support first.

By: Andreas Anderson (aanderson) 2007-02-08 06:26:14.000-0600

my 0.02$:

I think spliting it up in different modules is unnessesary and only complicates configuration. If there are different subsets of commands (i.e. nokia, ericsson etc), it would be possible to do this automatically (hcitool info shows the correct vendor for every phone i've ever seen), or by an addition parameter in cellphone.conf in every defined phone.

By: Dave Bowerman (dbowerman) 2007-02-09 00:31:29.000-0600

New patch available :- chan_cellphone-7.patch

Adds support for the VK2020.

Thanks to svanlund:

By: neofita (neofita) 2007-02-09 11:57:44.000-0600

I am trying to install chan_cellphone,

[root@maxserver asterisk-1.4.0]# locate libbluetooth

[root@maxserver asterisk-1.4.0]# ls /usr/include/bluetooth/
bluetooth.h  bnep.h  cmtp.h  hci.h  hci_lib.h  hidp.h  l2cap.h  rfcomm.h  sco.h  sdp.h  sdp_lib.h

I launched bootstrap.sh, configure and menu select but I cannot select chan_cellphone

I am running FC5

Any idea?

By: Dave Bowerman (dbowerman) 2007-02-10 01:03:21.000-0600

neofita: what version of asterisk are you using?

its looks (from your post) that you are using 1.4.0.
the patch wont apply successfully to this version, therefore the ./configure wont find the bluetooth dependencies and you wont be able to select chan_cellphone in menuselect.

the patch is for svn/trunk versions of asterisk.

By: Francesco Romano (francesco_r) 2007-02-10 08:56:36.000-0600

I have tested the last patch(7) with a Siemens SX1 but asterisk core dump when the call is answered. How can i contribute to debug the problem?

By: Helder Rogerio (voipanywhere) 2007-02-10 16:21:35.000-0600

Just wanted to say congratulations to everybody envolved in this channel driver project, this works perfectly with Motorola L6 units. These are cheap cellphones in Potugal, around 70? (including VAT) and the audio quality is 5 stars. It takes only 2 to 3 seconds to ring on the other mobile. With Nokia 6630 had one audio problems with this Motorola is like calling from a cellphone to another.

We wiil try to see how many of these cellphones we can put to work on one machine. :-)

Just one issue that I don't if it has a solution, we have this scenario...

Openser -> Asterisk on location 1 and Asterisk -> Bluetooth -> Motorola L6 on location 2

(this happens even if just using a sip phone on location 2 or calling also thru sip phone on location 1 to location 2. Location 1 and 2 are interconnected in IAX).

As soon as the request for the call is done to channel bluetooth and the cellphone start the dial it bridges the 2 call channels.

   -- Called gsmbox/90036840585
   -- Call accepted by XXX.XX.XX.XX (format gsm) (call accepted on location 2)
   -- Format for call is gsm
   -- IAX2/gsmbox-5 is ringing (i get a ring for 1 second)
   -- IAX2/gsmbox-5 answered SIP/82370428-081f68f0 (the call is bridged right away after 1 second right as the other party accepted the call on the mobile).

Is there any way to avoid this from happening?

By: Dave Bowerman (dbowerman) 2007-02-10 16:48:24.000-0600


could you use gdb to tell where the core dump happens and post it here?

also, some details on your setup would be good.

By: Dave Bowerman (dbowerman) 2007-02-10 16:53:03.000-0600


good, im glad you find it useful.

as for the iax problem you describe, i dont think it is chan_cellphone related, and this is the way its supposed to work.

maybe post your question on one of the mailing lists to get an answer.

By: Helder Rogerio (voipanywhere) 2007-02-10 17:07:07.000-0600


my idea of using chan_cellphone is as a gsm gateway, but this way i always get a 'ANSWER' from the chan_bluetooth so asterisk bridges the channels.

Do you think it is possible to capture some message or event coming from the cellphone bluetooth when the other party answers the call?

If someone else wants/needs to investigate this I'm also available to contribute.

By: Dave Bowerman (dbowerman) 2007-02-10 17:25:05.000-0600


i understand what youre trying to do now. thats an interesting scenario.
the way it currently works, chan_cellphone 'answers' and bridges so it can pass the inband ringing tone etc to the calling party.

it is possible to do answer detection though. maybe contact me on irc and we'll discuss it.

dseeb_ on #asterisk or #asterisk-dev

By: Dave Bowerman (dbowerman) 2007-02-10 21:20:57.000-0600

<b>Status of cell/mobile phones</b>
This is a list of phone known to work and those being tested. ill update as necessary.

LG TU500 - Working
LG CU500 - Working
RIM Blackberry 7250 - Working
Nokia 6230i - Working
VK 2020 - Working
Sony Ericsson T series t610, t630 etc - Working
Sony Ericsson K series k700i etc - Working
Sony Ericsson V series v600i etc - Working
Motorola L6 - Working
Motorola V3 - Working
Motorala V195 - Working
Nokia 6310i - Working
Nokia 7600 - Working
Palm Treo 650 - Working

Nokia 66xx - awaiting testing.

By: Dave Bowerman (dbowerman) 2007-02-11 01:27:15.000-0600

New patch available :- chan_cellphone-8.patch svn/trunk version => 53911

* Adds DTMF detection on inbound calls
* Some extra debugging options for getting phones supported.
* Sorts out some Nokia 6XXX issues.

By: Helder Rogerio (voipanywhere) 2007-02-11 14:56:53.000-0600


Sorry to be posting this, remove it later. dseeb_ on #asterisk or #asterisk-dev, but what irc server, undernet/dalnet/????? send me a mail to helderogerio@yahoo.com

Thanks in advance for your toughts and help
Best regards,

By: Mats Karlsson (matsk) 2007-02-11 15:10:32.000-0600

The irc network is: freenode


By: Jason Parker (jparker) 2007-02-14 01:01:54.000-0600

dbowerman: If you get bored, I think adding support for +CMTI (and maybe +CMGR) (which is incoming SMS messages (and the ability to read an sms message)) would be pretty neat.  All it should really do (for now?) is just print it to the CLI.

By: jmls (jmls) 2007-02-14 01:36:28.000-0600

qwell: noooooooo - what you need to do with an inbound sms is send it on via email (specified in the .conf file)

The ability to send would be neat and desirable.

Exten => sms,1,CellSendSMS(dst|Messsage)

By: darkskiez (darkskiez) 2007-02-14 04:02:55.000-0600

Would it be possible to only enable the audio bridge/intercept (whatever its called) when the call had been placed or answered via the channel driver and not at the handset itself? I have rubbish reception in my flat and am trying to use chan_cellphone to relay my mobile phone calls to my sip phone on my desk so I dont have to stand at the window with my head at a funny angle to make or receive phone calls. However, If I press answer on my mobile phone I have no audio as the car kit is enabled and then I cant answer it from my sip phone as the call has gone away. I acknowledge that is strange request when it comes to this module, and that how I use it is different from most people, so I understand that this isn't a high priority feature request, but I'll add you to my Christmas card list. :)

By: Dave Bowerman (dbowerman) 2007-02-14 04:59:08.000-0600

qwell: jmls:

re SMS
im already on this, thought i might play with app_sms too. i would be cool to send sms's from the dialplan, or other apps maybe...

By: jmls (jmls) 2007-02-14 05:12:19.000-0600

yeah baby! Sending from the dialplan would be very cool indeed. One thought - is it possible to set a "send time" or delay ? We have a system that does some overnight processing (which creates an SMS) but we don't want to send the message before 8am ...

By: Dave Bowerman (dbowerman) 2007-02-14 05:19:21.000-0600

<i>any chance an admin/manager/other guru could do a code review on the latest patch?</i>

ive got a bunch of new features to add, SMS, 3 way calling etc that id like to release, but want to be sure youre happy with structure/logic/formatting with the driver implementing basic telephony, before i go multiplying lines of code...

im particularly interested in the logic around ast_channel* creation (ast_channel_alloc and friends) as im still chasing a bug which causes a segfault in the first ast_read() call after channel allocation very occasionally.


By: Dave Bowerman (dbowerman) 2007-02-14 05:44:42.000-0600


dont see why not. ill factor this in.

By: Juan Pablo (digitalcom) 2007-02-14 09:21:49.000-0600

Great work, still testing with a V3. As voipanywhere I also think i would be great idea to add answer detection. Any help I could give just ask for it!

By: Jason Parker (jparker) 2007-02-14 10:40:48.000-0600

Can you explain the reason for the various ciev_call_ and ciev_callsetup_ variables?

By: Jason Parker (jparker) 2007-02-14 11:01:51.000-0600

Just a tip - it helps if you have kernel support for bluetooth. :)

By: Jason Parker (jparker) 2007-02-14 13:11:25.000-0600

Tested on Motorola V195 - works

Had to run `passkey-agent --default /etc/bluetooth/pinhelper`, or it wouldn't accept the PIN.  (Ubuntu Edgy)

By: Dave Bowerman (dbowerman) 2007-02-14 18:25:24.000-0600


in reponse to 0059276

various phones provide unsolicited call progress events in different ways.
its basically a string that comes from the phone like "+CIEV 1,1".
you need to figure out the ones you want from the CIND reponse that comes from the phone like the folowing
+CIND: ("call",(0,1)),("service",(0,1)),(]call_setup",(0-3)),("callsetup",(0-3))
the two that you need as a minimum are "call" and "callsetup"
different manufacturers use different strings, and they can appear in a random order.
i need to figure them out and store the numerical identifiers in the phone initialisation phase.

By: Jason Parker (jparker) 2007-02-14 19:28:53.000-0600

Well, I understand what +CIEV does, my question was more like "if we only care about 2 statuses, why do we have 6 ciev variables?"

By: Dave Bowerman (dbowerman) 2007-02-14 19:37:21.000-0600


thanks for testing!
im interested in your T610 and N73 experience, as i dont see that with the T610 i have
any chance you could email me the debug output with 'core set debug 1' on?

the T68 is very old and probably wont be supported.


david.bowerman at gmail.com

By: Dave Bowerman (dbowerman) 2007-02-14 20:02:20.000-0600


in response to 0059337

whilst this is only a proposed patch, and i am working to support different types i phones, i have 6 states. you never know whats going to be needed.
e.g. people are already asking for b party answer detection, which will require more call progress states.

when most phones are supported, if we only need 2 then we will only have 2.

By: Jason Parker (jparker) 2007-02-14 20:15:22.000-0600

okay, fair enough.  I think with something like that, it might be best to implement it some other way - perhaps a dynamic list of some sort

By: Jason Parker (jparker) 2007-02-15 00:38:14.000-0600

in the next patch, could you fix the misspelling of "bluettooth" (note the second 't') in the contrib/ dir?

By: Dave Bowerman (dbowerman) 2007-02-15 01:52:34.000-0600

qwell: 0059343

thanks! :)

By: Mats Karlsson (matsk) 2007-02-15 03:22:46.000-0600

I would like to sugest that we create a text file "chan_cellphone_HCL".
HCL = Hardware Compability List

Where testers can add tested phones with status and .....

By: Dave Bowerman (dbowerman) 2007-02-15 23:27:56.000-0600

New patch available :- chan_cellphone-10.patch   svn/trunk ver 54527

* Changes behavior of outbound calls to reflect the state of the cell network progress. i.e. the channel will be set to 'ringing' only once the b-party is ringing. the channel will only answer, if the b-party answers. ${DIALSTATUS} reflects what actually happened.

* Changes to allow incoming call to be answered on the actual cellphone connected to Asterisk. If the 'answer' button on the cell phone is pressed, Asterisk will release the call and transfer the audio channel back to the cell phone.

By: Helder Rogerio (voipanywhere) 2007-02-19 10:52:28.000-0600

I can't get two Motorola L6 to work on same machine using one Bluetooth dongle. when the first registers, everything ok.

-- Bluetooth Device GSM1 has connected.
-- Bluetooth Device GSM1 initialised and ready.

When the second register, 1 or 2 seconds later I get a message:

-- Bluetooth Device GSM2 has connected.
-- Bluetooth Device GSM2 initialised and ready.
-- Bluetooth Device GSM2 has disconnected, reason (110).

----> UPDATE

After a week of testing, we installed another pc but now with debian kernel 2.6 and libbluetooth2 and bluez-utils 3.7

Realized the trouble is the bluetooth hardware on the pc for some reason has periods when it "locks" not sending information, and the phone endsup disconnecting.

I've been using Sitecom Bluetooth 2.0 USB Model CN-521 version 1.001 and Lindy Bluetooth model 52205 Class 1.

Can anyone tell me a model of bluetooth already tested with good results?

By: Denis Luzin (dluzin) 2007-02-24 10:45:53.000-0600

Tested in following configuration:

Fedora Core 6, kernel, blues-libz-2.25, bluez-utils-2.25 (then changed to bluez-libs-3.7 and bluez-utils-3.7), Motorola L6, chan_cellphone-6,7,8, Asterisk - SVN/trunk 54527 and current, USB bluetooth dongle Micronet SP935A (Class 2.0). I have two Asterisk boxes tied by SIP trunks, one is main, another one is for testing (hosts bluetooth, chan_cellphone, etc).
Basically works, but sometimes (randomly) has problem with Cell->Asterisk audio stream (sounds like SLN threated as uLAW or something like this, probably byte-shifted capture from cellphone/transmission to Asterisk). Problem appers on both incoming and outgoing calls.
Change of Asterisk SVN number and bluez-libs doesn't affect the problem.

Asterisk->Cell audio has no problems at all.
Call setup also works well.

Did same testing with SonyEricsson T610 - same things. Looks like dongle/driver/ problem.

chan_cellphone-9 and 10 weren't able to connect to the cellphone (Bluetooth device xxx has a call in progress - delaying connection). I found how to overcome this, but got unstable working, crashing asterisk and hanged computer at the end.

I will try to debug 'cel_read' function of a patch - maybe I will discover what's happening with audio.

By: Dave Bowerman (dbowerman) 2007-02-24 23:21:38.000-0600

New patch available :- chan_cellphone-11.patch SVN/Trunk ver 56683

* Fixes some problems I introduced in patch-10, sorry guys :). Mainly affected non-standard phones like T610 etc.

* Dial from the cellphone now supported.
* Answer from the cellphone now supported. Asterisk will disconnect when both of these are detected and hand the audio back to the cellphone.

* Removed contrib/bluetooth stuff as it was only relevant for bluez-utils < 3.7 and causing mass confusion.

* Start of SMS support. If you send an SMS to the phone while its connected to Asterisk, Asterisk will detect it and read the message. At the moment the sms is displayed on the console (if you have debug turned on). Im still thinking about what to do with incoming SMS's. Ideas anyone???

By: jmls (jmls) 2007-02-25 01:39:21.000-0600

SMS: Send it to an email address specified in the .conf file. Prefably allow an email address for each attached phone.

By: Dave Bowerman (dbowerman) 2007-02-25 01:42:15.000-0600

New patch available :- chan_cellphone-12.patch SVN/Trunk ver 56683

* For those having trouble with multiple devices connected at the same time, this fixes a stupid bug which would be causing you grief.

thanks to Qwell: for finding this :)

By: Denis Luzin (dluzin) 2007-02-25 02:27:09.000-0600

Tested in the same environment (look in my previous message) with chan_cellphone-11.patch
Basically works same (tested nothing more than dial and receive calls through Asterisk using Motorola L6).
Still getting disrupted audio from cellphone to asterisk during some (random) calls. Audio from Asterisk to cellphone always goes properly. Looks like SCO input buffer is shifted by odd number of bytes during read.
Does anybody know how to prevent this?
Is there any function displays which byte (even or odd) will be red next from SCO socket?
Any ideas?

By: Dave Bowerman (dbowerman) 2007-02-25 02:38:29.000-0600

how bad is the audio?
I've been thinking about this for a while...
The S in sco is for synchronous, so im assuming there needs to be one frame in, one frame out etc.
chan_cellphone doesnt necessarily do this, the reads & writes from the sco socket are basically independant the moment. maybe this is causing it.
ive noticed it too by the way...

By: Dave Bowerman (dbowerman) 2007-02-25 02:42:23.000-0600


I had thought about sending them into the dialplan at priority 'sms'.
this way the user can choose what to do like :-

Send as a jabber message if they use res_jabber
Send as 'text' to a SIP phone,
or send as an email, but i guess that would need an app_email??

By: jmls (jmls) 2007-02-25 02:50:49.000-0600

sounds cool to me. But in what context ? The default ? or one specified in the .conf ?

By: Denis Luzin (dluzin) 2007-02-25 03:26:20.000-0600

Audio is like white noise, but a bit 'representing' actual audio sent from another side. Sounds exactly like signed 16bit with swapped hi and lo bytes.
Happens on random calls, no any relation to call frequency, initiating side, hangup side in previus call, etc.

Debugging of Asterisk (and chan_cellphone) doesn't show any difference between normal and disrupted calls.

There are three possibilities I think:
1. Broken digital audio came from BT dongle (very little possibility, my dongle does audio under Windows without any problem)
2. Broken SCO socket queue somewhere in bluez-libs
3. Broken inbound queue somewhere in hci_usb

Sometimes (very rare) bluetooth locks up (looks as working, but not really working, cellphone sees bluetooth requests, but can't recognize them) and this lock can be put off only by reinserting dongle into USB port or rebooting system.

BTW when audio is bridged chan_cellphone shows debug message 'incoming audio ... MTU 64'
What should be SCO MTU? 48 or 64? hciconfig shows SCO MTU 64

By: Dave Bowerman (dbowerman) 2007-02-25 03:38:04.000-0600


the one specified in the .conf file, otherwise default if there is none.
that way you can specify different functionality for different cellphones

im open to ideas though...

By: Dave Bowerman (dbowerman) 2007-02-25 03:42:58.000-0600


thanks thats good. we need to get to the bottom of this...
ive noticed that server horsepower makes a difference too. it happens a lot more often on my 533Mhz VIA C3, than it does on my 1.8GHz centrino laptop.

i put the mtu thing in there for debugging, ive tried reading 'mtu' size frames, but they are only ever 48 bytes in length, it seams to make no difference.

i think i need to read the SCO spec again..

By: Denis Luzin (dluzin) 2007-02-25 22:31:46.000-0600


Just few words on incoming call processing.
I've removed some breaks in do_monitor() function to make incoming call processing quicker (CEL_STATE_IDLE -> CEL_STATE_RING -> CEL_STATE_RING2 -> CEL_STATE_RING3), and now incoming call rings my Asterisk right when it arrived (instead of waiting for 3 rings before Asterisk starts incoming call processing). I understand that change of switch() argument within the switch() and continue the switch() processing is not good thing, so I can suggest you to merge above mentioned states into the one.

Incoming DTMF processing.
Incoming DTMF processing still has a problem when DTMF arrives from another cellphone. Almost all digits (except the first one) are doubled and tripled, some of them dropped at all. So no way to use DISA (my IVR checks only first digit, so this is not a problem in my IVR case) I don't know how Asterisk processes frames with AST_FRAME_DTMF flag, but something needs to be done with DTMF processing, maybe in-channel interdigit pause processing, etc.

I hope my commets will help.

By: Serge Vecher (serge-v) 2007-02-26 11:15:08.000-0600

ok, guys, let's keep things organized on the bug-tracker; please only report successful/unsuccessful testing results here (with debugging information in the latter case). For all other discussion related to this bug [how to apply the patch, hardware discussions, etc], I suggest opening a topic on forums.digium.com. If there is one already, somebody please post the link and I'll update the bug.

Dbowerman: can you please update the "description" field of the bug with the latest list of features / supported phones? Also, please let me know which attachments to delete. Thanks a lot for your work!

And thanks to everyone for testings, reporting and keeping Asterisk strong!

By: Dave Bowerman (dbowerman) 2007-02-26 17:38:21.000-0600


could you please delete all attachments other that chan_cellphone-12.patch

ill upload a new cellphone.txt file after updating features and supported phones.


By: Dave Bowerman (dbowerman) 2007-02-26 17:43:43.000-0600


Incoming call processing. That might be fine for your phone, but not all phones support incoming caller id. its done this way to wait for the callerid.
It also has to be generic enough to support all phones. ill give some thought to speeding it up without breaking it.

Incoming DTMF is still broken (i.e. you get muliple digits), I need to 'debounce' it. hopefully this will be in the next patch.

By: Denis Luzin (dluzin) 2007-02-27 04:09:56.000-0600

Tested chan_cellphone-12 with new cheap USB dongle by ISSC, Motorola L6 cellphone, SIP trunk between two Asterisk boxes.

Basically (call in/call out) works, audio issue (look above) is gone, but overall audio quality is degraded. Strage thing, if I'm connecting through DISA I have much better audio quality, than in direct connection mode, I haven't noticed this before.

Problem with Motorola L6 - right after Asterisk startup the phone state is Connected, Init. No reaction to incoming calls. After first outgoing call state changes to Connected, Free and from this point incoming calls are processed. No such issue with chan_cellphone-8, so something in the phone initialization logic I think.

Another isuue - if you're calling outside and hang up is made from remote side - it may be 10-20 seconds delay before your IP phone got hangup alert (cellphone hang up immediately). During incoming calls - reverted situation, so if you han up your IP phone the cellphone still on line for about 5-10 seconds (delay is less).
Not absolutely sure that this is chan_cellphone issue, but...

Tried to use IAX trunk - got crashed Asterisk, hanged bluetooth modules and kernel panic in 1-2 minutes, brrr..., will not touch it anymore yet...

By: Dave Bowerman (dbowerman) 2007-02-27 19:15:01.000-0600

New patch available :- chan_cellphone-13.patch SVN/Trunk ver 56969

* Sorry guys, SMS support broke initialisation of T610/630 and moto L6's
Ive removed it and am concentrating on stability and voice quality for now.

By: Denis Luzin (dluzin) 2007-02-27 20:10:55.000-0600


You're right, my L6 is stopping after "AT+CNMI=..." returning "ERROR\r". Maybe another port should be used for SMS in my case? I will try later.

During the setup and call there are some successfull rfcomm_read() with buf containing only 0x00. Is it normal?
I've changed:
if (s > 0)
if ((s > 0)&(!(buf[1] == 0x00)))

One more thing, during pvt->state = CEL_STATE_DIAL there may be an incoming call that needs to be processed. In my setup when the call is arrived during this state it is lost and dialing also fails.

Please also extend "+CIEV" processing, there may be some events related to charging for example, if I connect a charger to my L6 during a call - phone disconnects from Asterisk and reconnects again after some time.
Maybe it is better to do events processing before and outside the main state machine?

By: Andrew Kohlsmith (akohlsmith) 2007-02-28 11:14:07.000-0600

WOW (and not in the Vista sense)

This was THE least painful bluetooth-related application I've ever used in a LONG time (in fact, it was painless).  Add my datapoint that incoming cell calls from a Treo 650 work just fine with patch13.

dbowerman, I owe you a big wet sloppy kiss for this.  And be warned that corydon is already trying to steal that kiss.  :-)

By: Denis Luzin (dluzin) 2007-02-28 11:30:47.000-0600


I'm temporarily stopping testing of chan_cellphone till I get bug-free bluetooth dongle (if it exists at all :( ).
For the moment I have only one BT dongle that works without hassles only with Motorola L6.
T610 and Nokia N73 arent working through it, rfcomm_read() can't catch "CIEV:8,0" and/or any reaction to "AT+CHUP".

I have 3 more dongles with different bugs, most compatible is Micronet one (everything works as expected on all three phones except audio issue that appears quite often), so I'm giving up and buying Jabra A320S.
I will let you know results.

Can you post brand and model of your bluetooth dongle/card?

Sorry for off-topic if any.

By: Andrew Kohlsmith (akohlsmith) 2007-02-28 11:48:59.000-0600

Certainly.  I believe the model is a BTA-6030 by Cellink (going from google searches as I've thrown out the boxes and the unit's in use at the moment).

lsusb reports it's a CSR chipset, and it's a BT 2.0+EDR, I specifically looked for BT 2.0 for this.  I have a cheap Dlink one and somewhere a Linksys BT100 too I will try to help solve these other issues reported here.

# lsusb
Bus 1 Device 3: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

By: Dave Bowerman (dbowerman) 2007-02-28 17:25:53.000-0600

dluzin: and others

Bluetooth adaptors:

I mainly use a 'noname' brand usb adaptor
ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

I also use a DLink DBT120.

Both of these seem to perform ok.

Recently ive been looking at the blue-z kernel patches. I suspect there a lot of relevant patches to the linux kernel that we should be using. For example there is a 'sco flow control patch' without which 'your kernel will crash'.

you can find details here http://www.bluez.org/patches.html I havent fully got to the bottom of which ones are needed and which ones arent, but im sure some of these patches will solve some of the adaptor issues.

By: Andrew Kohlsmith (akohlsmith) 2007-02-28 18:57:09.000-0600

If you'll take a look at the 2.6 patch, it doesn't do anything relevant.  I'm running on Slackware 11, 2.6.19 "clean" kernel source.  Oh, and I'm also netbooting that particular box (no hdd at all) since it's my kernel driver development machine.  :-)

By: Andrew Kohlsmith (akohlsmith) 2007-02-28 21:09:47.000-0600

dbowerman - do you have a copy of the bluetooth specifications?  I'd like to take a closer look at several of the profiles, but they're now all locked away behind bluetooth SIG memberships and their respective fees.

By: Jason Parker (jparker) 2007-02-28 21:45:51.000-0600

It actually doesn't cost money to become a bluetooth SIG member.

From https://programs.bluetooth.org/CRM/register/default.aspx

"Adopter members of the Bluetooth SIG may use published Bluetooth Wireless specifications and Bluetooth SIG trademarks, but do not have the opportunity to influence or gain early access to Bluetooth wireless technology. Adopter membership is free."

Once you're registered, you can login and go to https://www.bluetooth.org/spec/

You're going to want this document: https://www.bluetooth.org/foundry/adopters/document/HFP_1.5_SPEC_V10

By: Dave Bowerman (dbowerman) 2007-03-02 16:33:50.000-0600

New patch available :- chan_cellphone-13a.patch SVN/Trunk rev 57241

* Fundamental change in the handling of SCO audio to and from the cell phone,
this version more or less guarantees a 1 to 1 relationship between incoming and outgoing 'sco frames'.

I'd be interested in feedback as to whether or not this improves the audio quality, if so ill adopt this method.

UPDATE: based on tzanger:'s expert testing, 13a produces worse audio than 13
any different views?

By: Andrew Kohlsmith (akohlsmith) 2007-03-02 17:40:23.000-0600

Just tried 13a... no go.  Audio is *horrible*.  Same system, patch 13, everything is a-ok.

Please don't make 13a's audio the standard.  :-)

By: Dave Bowerman (dbowerman) 2007-03-03 21:31:01.000-0600

New patch available :- chan_cellphone-14.patch SVN/Trunk rev 57555

* Revert audio handling method back to patch-13.
* Add SMS Send and Receive.

Note: SMS stuff was done with a Nokia 6230i.

By: Dave Bowerman (dbowerman) 2007-03-03 21:33:51.000-0600

SMS Sending / Receiving

If chan_cellphone has detected your cell phone is capable of SMS via bluetooth, you will be able to send and receive SMS.

Incoming SMS's cause Asterisk to create an inbound call to the context you defined in cellphone.conf or the default context if you did not define one.

The call will start at extension 'sms'. Two channel variables will be available, SMSSRC = the number of the originator of the SMS and SMSTXT which is the text of the SMS.
This is not a voice call, so grab the values of the variables and hang the call up.

So, to handle incoming SMS's, do something like the following in your dialplan

exten => sms,1,Verbose(Incoming SMS from ${SMSSRC} ${SMSTXT})
exten => sms,n,Hangup()

The above will just print the message on the console.

If you use res_jabber, you could do something like this :-

exten => sms,1,JabberSend(transport,user@jabber.somewhere.com,SMS from ${SMSRC} ${SMSTXT})
exten => sms,2,Hangup()

To send an SMS, use the application CellSendSMS like the following :-

exten => 99,1,CellSendSMS(dave,0427123456,Hello World)

This will send 'Hello World' via device 'dave' to '0427123456'

By: jmls (jmls) 2007-03-04 01:22:47.000-0600

This is just such a great project !

is there any way that this can be backported to 1.4 ? I'd love to try it out but we are not running trunk in production.

By: Andrew Kohlsmith (akohlsmith) 2007-03-04 10:34:06.000-0600

I've been noticing that chan_cellphone's been absolutely *killing* my cellphone's battery.  the BT dongle on the Asterisk box and the cell phone are less than 5 feet from each other, but the cellphone (Treo 650 with extended battery) is pretty much killed overnight.

Now, I haven't really got any comparative data -- when I'm using the cellphone with the car handsfree kit the phone's also charging, but I do seem to remember that the BT headset I used before I got the handsfree kit could stay linked to the cell phone all day (with the phone in my pocket, NOT charging) and not kill the battery.

With the chan_cellphone checking interval set to 60 seconds, is it doing anything that would cause excessive battery draw on the phone?

By: Andrew Kohlsmith (akohlsmith) 2007-03-04 13:29:37.000-0600

Just a note about battery drain...  I see that chan_cellphone asks for signal strength updates... my Treo is giving them about two every 5 seconds or so...  indicator 4 value 2 and indicator 5 value 0, which seems to correspond to signal 2/5 and no roaming, but the values never change, so why's the phone keep giving them?

< +BRSF: 49
< OK

< +CIND: ("service",(0,1)),"call",(0,1)),("callsetup",(0,3)),("signal",(0-5)),("roam",(0-1))
< OK

< +CIND: 1,0,0,2,0
< OK

(in service, no call, no call set up, signal 2/5, not roaming)

> AT+CMER=3,0,0,1
< OK

(no idea what mode 3 is, but request signal change updates)

< OK


So that's all fine...  now I get these every 4-5 seconds:

< +CIEV: 4,2
< +CIEV: 5,0

The values don't change, which seems to tell me my phone's on crack (Treo 650 CDMA)

By the way, I'm getting all my AT reference documentation from Nokia's GSM and CDMA phone PDFs, which may not be entirely valid...

The only way I can see of working around this is to not request unsolicited indicator changes from the phone, and occasionally poll (perhaps at the scanning interval) ?

By: Andrew Kohlsmith (akohlsmith) 2007-03-04 14:24:01.000-0600

Nevermind...  the indicator changes are required to pick up on an incoming call... I wonder why it's continuously updating though with same values...

By: Dave Bowerman (dbowerman) 2007-03-04 17:22:43.000-0600


discovery interval is only relevant if the phone is not connected, this is how often chan_cellphone tries to find your phone. once connected it has no bearing and causes no 'transmission' to/from the phone.

your issue is the AT+CMER=3,0,0,1 command causing signal level updates to be sent to asterisk. (some phones do this, some dont).
the '3' means send events directly to chan_cellphone, we need this. the '1' means send indicators as reported by +CIND, we need these too for call setup.

the only ones actually needed by chan_cellphone are 'call' and 'callsetup'.

ill investigate to see if the ones not needed (like 'signal' 'battchg' etc) can be turned off, but at first glance of 3GPP TS 27.007 V7.2.0 i dont think its possible.

By: Dave Bowerman (dbowerman) 2007-03-05 05:26:17.000-0600

chan_cellphone-14-1.4.1.patch.gz is patch-14 for Asterisk 1.4.1

By: iban (iban) 2007-03-05 08:46:21.000-0600

Just wanted to say congratulations!! the patch is working with NOKIA 6111, NOKIA 6830, Sony Ericsson k750i. I have a NOKIA 6233 i didn't check it yet but i am pretty sure it will. However I tried with a Sony Ericsoon S700i and the audio is not working, i can just hear noise. Do you know how could i fix this?
I would also like to ask if anyone can help me with extensions.conf. At the momente i can make phone calls from a sip phone a Gsm phone. On the contrary when i have a call entrance from GSM I only can route the phone call to a specifique sip phone; see example
exten => s,1,Answer
exten => s,2,Wait(2)
exten => s,3,Playback(custom/greeting)
exten => s,4,Dial(SIP/jack,40,Ttr)

This is working but i would like to forward the phone to any place the caller wanted to not just to one especifique. I tried the next but nothing happened when the caller pushes number 1:

exten => s,1,Answer
exten => s,2,Wait(15)
exten => s,3,Hangup

exten => 1,1,Dial (SIP/jack,90,Ttr)
exten => 2,1,Dial (SIP/josu,90,Ttr)

It might not be the right place to post that but i could not find any other place.

Thanks in advance

By: Dave Bowerman (dbowerman) 2007-03-05 16:54:26.000-0600


Inbound DTMF detection is not 100% functional at the moment.
It should be sorted in the next patch.

By: Paul Belanger (pabelanger) 2007-03-06 12:45:48.000-0600

I hate to go off-topic, but I am about to start testing this patch... a quick read through the release notes does not indicate if you can pass out going calls from the bluetooth device (cell phone) through asterisk; rather than the cell network.  Any info would be great.

I'll be sure to post my results shortly.


By: oksijun (oksijun) 2007-03-06 13:21:38.000-0600

Hi, just tested with SVN-trunk-r57799M and patch-14. Cellphone is a nokia 6230i.
Audio on outgoing call is practically all noise, although it is _slightly_ better when I make the call from ekiga than through an spa3000. The main problem is that audio gets routed back to the phone after several seconds. Can't figure out why, this didn't happen with patch-10 (but did with patch-12). The audio was also better (usable) with patch-10, but not perfect. Here's what * has to say:

[Mar  6 20:48:41] DEBUG[17068] chan_cellphone.c: Loading device nokia.
[Mar  6 20:48:41] DEBUG[17068] channel.c: Registered handler for 'CELL' (Bluetooth Cellphone Driver)
[Mar  6 20:48:45] DEBUG[17068] chan_cellphone.c: rfcomm_write() (nokia) [AT+BRSF=4
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [+BRSF: 47
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [OK
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_write() (nokia) [AT+CIND=?
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [+CIND: ("call",(0,1)),("service",(0,1)),("call_setup",(0-3)),("callsetup",(0-3))
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: CIEV_CALL=1 CIEV_CALLSETUP=4
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [OK
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_write() (nokia) [AT+CIND?
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [+CIND: 0,1,0,0
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [OK
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_write() (nokia) [AT+CMER=3,0,0,1
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [OK
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_write() (nokia) [AT+CLIP=1
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [OK
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_write() (nokia) [AT+CMGF=1
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [OK
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_write() (nokia) [AT+CNMI=2,1,0,1,0
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [OK
[Mar  6 20:48:46] DEBUG[17068] chan_cellphone.c: Incoming Audio Connection from device 00:12:37:58:59:AF MTU is 64
[Mar  6 20:48:58] DEBUG[17068] chan_sip.c: Auto destroying SIP dialog '1babef107b411dce0cf0c4645603c8a8@'
[Mar  6 20:49:01] DEBUG[17068] chan_sip.c: Setting NAT on RTP to Off
[Mar  6 20:49:01] DEBUG[17068] chan_sip.c: Allocating new SIP dialog for fae5ad3e-81ca-db11-8e02-00166f4a1ca7@chomsky - INVITE (With RTP)
[Mar  6 20:49:01] DEBUG[17068] chan_sip.c: Setting NAT on RTP to Off
[Mar  6 20:49:01] DEBUG[17068] chan_sip.c: Stopping retransmission on 'fae5ad3e-81ca-db11-8e02-00166f4a1ca7@chomsky' of Response 1: Match Found
[Mar  6 20:49:01] DEBUG[17068] chan_sip.c: Setting NAT on RTP to Off
[Mar  6 20:49:01] DEBUG[17068] chan_sip.c: Checking SIP call limits for device mike
[Mar  6 20:49:01] DEBUG[17068] pbx.c: Launching 'Dial'
[Mar  6 20:49:01] DEBUG[17068] rtp.c: Channel 'CELL/nokia-8d53' has no RTP, not doing anything
[Mar  6 20:49:01] DEBUG[17068] channel.c: Not copying variable STACK-frommike-0660660001-1.
[Mar  6 20:49:01] DEBUG[17068] channel.c: Not copying variable SIPCALLID.
[Mar  6 20:49:01] DEBUG[17068] channel.c: Not copying variable SIPDOMAIN.
[Mar  6 20:49:01] DEBUG[17068] channel.c: Not copying variable SIPURI.
[Mar  6 20:49:01] DEBUG[17068] chan_cellphone.c: Calling nokia/0660660001 on CELL/nokia-8d53
[Mar  6 20:49:01] DEBUG[17068] channel.c: Set channel CELL/nokia-8d53 to read format gsm
[Mar  6 20:49:01] DEBUG[17068] channel.c: Set channel SIP/mike-08188980 to read format slin
[Mar  6 20:49:02] DEBUG[17068] chan_cellphone.c: rfcomm_write() (nokia) [ATD0660660001;
[Mar  6 20:49:02] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [OK
[Mar  6 20:49:02] DEBUG[17068] chan_cellphone.c: Checking device state for device nokia
[Mar  6 20:49:02] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [+CIEV: 3,2
[Mar  6 20:49:02] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [+CIEV: 4,2
[Mar  6 20:49:06] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [+CIEV: 1,1
[Mar  6 20:49:06] DEBUG[17068] chan_sip.c: SIP answering channel: SIP/mike-08188980
[Mar  6 20:49:06] DEBUG[17068] chan_sip.c: Setting framing from config on incoming call
[Mar  6 20:49:06] DEBUG[17068] chan_cellphone.c: Checking device state for device nokia
[Mar  6 20:49:06] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [+CIEV: 3,0
[Mar  6 20:49:06] DEBUG[17068] chan_cellphone.c: rfcomm_read() (nokia) [+CIEV: 4,0
[Mar  6 20:49:06] DEBUG[17068] chan_sip.c: Stopping retransmission on 'fae5ad3e-81ca-db11-8e02-00166f4a1ca7@chomsky' of Response 2: Match Found
[Mar  6 20:49:06] DEBUG[17068] chan_cellphone.c: Incoming Audio Connection from device 00:12:37:58:59:AF MTU is 64
[Mar  6 20:49:06] DEBUG[17068] rtp.c: Ooh, format changed from unknown to gsm
[Mar  6 20:49:06] DEBUG[17068] rtp.c: Created smoother: format: 2 ms: 20 len: 33
[Mar  6 20:49:13] DEBUG[17068] rtp.c: Got RTCP report of 88 bytes
[Mar  6 20:49:24] DEBUG[17068] rtp.c: Got RTCP report of 88 bytes
[Mar  6 20:49:26] DEBUG[17068] chan_sip.c: Allocating new SIP dialog for (No Call-ID) - OPTIONS (No RTP)
[Mar  6 20:49:26] DEBUG[17068] chan_sip.c: Initializing initreq for method OPTIONS - callid 33610f342ea22d033b92f1671196ba0f@
[Mar  6 20:49:26] DEBUG[17068] chan_sip.c: Stopping retransmission on '33610f342ea22d033b92f1671196ba0f@' of Request 102: Match Found
[Mar  6 20:49:26] DEBUG[17068] chan_sip.c: Allocating new SIP dialog for (No Call-ID) - OPTIONS (No RTP)
[Mar  6 20:49:26] DEBUG[17068] chan_sip.c: Initializing initreq for method OPTIONS - callid 24a897923aeede8f7eb31d252932ed4b@
[Mar  6 20:49:26] DEBUG[17068] chan_sip.c: Stopping retransmission on '24a897923aeede8f7eb31d252932ed4b@' of Request 102: Match Found
[Mar  6 20:49:26] DEBUG[17068] chan_sip.c: Allocating new SIP dialog for (No Call-ID) - OPTIONS (No RTP)
[Mar  6 20:49:26] DEBUG[17068] chan_sip.c: Initializing initreq for method OPTIONS - callid 37c1a3a902a125a37c2d0aac5a564182@
[Mar  6 20:49:26] DEBUG[17068] chan_sip.c: Stopping retransmission on '37c1a3a902a125a37c2d0aac5a564182@' of Request 102: Match Found
[Mar  6 20:49:27] DEBUG[17068] channel.c: Didn't get a frame from channel: SIP/mike-08188980
[Mar  6 20:49:27] DEBUG[17068] channel.c: Bridge stops bridging channels SIP/mike-08188980 and CELL/nokia-8d53
[Mar  6 20:49:27] DEBUG[17068] channel.c: Hanging up channel 'CELL/nokia-8d53'
[Mar  6 20:49:27] DEBUG[17068] chan_cellphone.c: Hanging up device nokia.
[Mar  6 20:49:27] DEBUG[17068] chan_cellphone.c: rfcomm_write() (nokia) [AT+CHUP
[Mar  6 20:49:27] DEBUG[17068] chan_cellphone.c: rfcomm_write() error [9]
[Mar  6 20:49:27] DEBUG[17068] chan_cellphone.c: Checking device state for device nokia
[Mar  6 20:49:27] DEBUG[17068] chan_cellphone.c: Checking device state for device nokia
[Mar  6 20:49:27] DEBUG[17068] rtp.c: Channel '<unspecified>' has no RTP, not doing anything
[Mar  6 20:49:27] DEBUG[17068] app_dial.c: Exiting with DIALSTATUS=ANSWER.

Hope you can see something & thanks for the great work!

By: legion (legion) 2007-03-06 23:43:03.000-0600

Why Asterisk 1.4.1 with chan_cellphone-14-1.4.1.patch crash?
Kernel 2.6.20-mh1
But chan_cellphone-14.patch and SVN/Trunk rev 57555 work well

]Mar  7 08:37:08] DEBUG[3646]: chan_cellphone.c:964 do_monitor: rfcomm_read() (630) [RING
]Mar  7 08:37:08] DEBUG[3646]: chan_cellphone.c:1058 do_monitor: Device 00:0F:DE:1C:1E:06 630 [RING
[Mar  7 08:37:08] DEBUG[3646]: chan_cellphone.c:964 do_monitor: rfcomm_read() (630) [+CLIP: "xxx",129,,,"?????????????????"
]Mar  7 08:37:10] DEBUG[3646]: chan_cellphone.c:964 do_monitor: rfcomm_read() (630) [+CIEV: 2,2
 == Starting CELL/630-1331 at incoming-mobile,s,1 failed so falling back to exten 's'
 == Starting CELL/630-1331 at incoming-mobile,s,1 still failed so falling back to context 'default'
[Mar  7 08:37:10] DEBUG[3655]: pbx.c:1791 pbx_extension_helper: Launching 'Wait'
   -- Executing [s@default:1] Wait("CELL/630-1331", "1") in new stack
[Mar  7 08:37:11] DEBUG[3655]: pbx.c:1791 pbx_extension_helper: Launching 'Answer'
   -- Executing [s@default:2] Answer("CELL/630-1331", "") in new stack
]Mar  7 08:37:11] DEBUG[3655]: chan_cellphone.c:759 rfcomm_write: rfcomm_write() (630) [ATA
[Mar  7 08:37:11] DEBUG[3655]: devicestate.c:303 __ast_device_state_changed_literal: Notification of state change to be queued on device/channel CELL/630-1331
[Mar  7 08:37:11] DEBUG[3655]: pbx.c:1791 pbx_extension_helper: Launching 'Set'
   -- Executing [s@default:3] Set("CELL/630-1331", "TIMEOUT(digit)=5") in new stack
   -- Digit timeout set to 5
[Mar  7 08:37:11] DEBUG[3655]: pbx.c:1791 pbx_extension_helper: Launching 'Set'
   -- Executing [s@default:4] Set("CELL/630-1331", "TIMEOUT(response)=10") in new stack
   -- Response timeout set to 10
[Mar  7 08:37:11] DEBUG[3655]: pbx.c:1791 pbx_extension_helper: Launching 'BackGround'
   -- Executing [s@default:5] BackGround("CELL/630-1331", "demo-congrats") in new stack
[Mar  7 08:37:11] DEBUG[3655]: channel.c:2845 set_format: Set channel CELL/630-1331 to write format gsm
   -- <CELL/630-1331> Playing 'demo-congrats' (language 'en')
[Mar  7 08:37:11] DEBUG[3615]: chan_cellphone.c:671 cel_devicestate: Checking device state for device 630
[Mar  7 08:37:11] DEBUG[3615]: devicestate.c:287 do_state_change: Changing state for CELL/630 - state 2 (In use)
[Mar  7 08:37:11] DEBUG[3656]: app_queue.c:546 changethread: Device 'CELL/630' changed to state '2' (In use) but we don't care because they're not a member of any queue.
]Mar  7 08:37:11] DEBUG[3646]: chan_cellphone.c:964 do_monitor: rfcomm_read() (630) [OK
[Mar  7 08:37:11] DEBUG[3655]: sched.c:204 sched_settime: Request to schedule in the past?!?!
[Mar  7 08:37:11] DEBUG[3641]: chan_cellphone.c:1379 do_sco_listen: Incoming Audio Connection from device 00:0F:DE:1C:1E:06 MTU is 64
Segmentation fault

By: iban (iban) 2007-03-08 06:21:10.000-0600

I sorted out my problem of DTMF... seems it was bad configuration.What I did is to write the next code in my extension.conf:
exten => s,1,Wait(2); this is optional
exten => s,2,Answer
exten => s,3,Background(en/welcome_ncl)
exten => s,4,WaitExten(10)

/*********with the section below i choose which internal sip phone i want to talk. If i push button 3 the communication is finished.

exten => 1,1,Goto(internal,122,1)
exten => 2,1,Goto(internal,123,1)
exten => 3,1,Hangup

However, now i wanted to work with an internal modem to connect to a PSTN. I am working with a Aztech MDP3880-W V90 56K PCI with a conexant chipset. I read on the internet that i need the chan_modem_bestdata.c for that. I check it out if there was this code in /usr/src/aterisk/channels and there was nothing. I also go on menuselect but i did not find anything related with modems. I hav already done make and make install of libpri and zaptel. How i can i give to my asterisk modem drivers?


By: Earle Clubb (eclubb) 2007-03-08 09:23:14.000-0600

I posted this on the users list two days ago but received no replies.  Could someone give me a hand with this?

I'm running chan_cellphone version 13 on the latest svn trunk (as
root).  I believe I have chan_cellphone set up correctly (bt addr and
port retrieved from the "cell search" CLI command).  When I load the
chan_cellphone module, my Motorola V3m asks if I want to allow "Asterisk
PBX", I say yes and enter the 0000 for the pin, then my phone tells me
the pin is invalid.  Here is the log entry generated by chan_cellphone:

*CLI> [Mar  3 22:53:12] DEBUG[16888]: chan_cellphone.c:682
rfcomm_connect: connect() failed (111).

*CLI> cell show devices
ID              Address           Connected State
razr            xx:xx:xx:xx:xx:xx No        Init

I'm running:
- Fedora Core 6 - kernel 2.6.19-1.2911.6.4.fc6
- bluez-libs (libbluetooth) 3.7-1
- bluez-utils 3.7-2

I'm using the hcid.conf and pinhelper script from contrib/bluetooth
(which I moved to /etc/bluetooth).

I'm not sure how to debug this further.  Any ideas?



Here's the directory listing and the contents of the files (comments
removed for brevity):

[root@server ~]# ls -l /etc/bluetooth/
total 12
-rw-r--r-- 1 root root 1428 Mar  3 18:36 hcid.conf
-rwxr-xr-x 1 root root   27 Mar  3 18:36 pinhelper
-rw-r--r-- 1 root root  297 Oct  2 18:40 rfcomm.conf

--- pinhelper ---
echo "PIN:0000"

--- hcid.conf ---
options {
  autoinit yes;
  security auto;
  pairing multi;
  pin_helper /etc/bluetooth/pinhelper;
device {
  name "Asterisk PBX";
  class 0x3e0100;
  iscan enable; pscan enable;
  lm accept;
  lp rswitch,hold,sniff,park;
  auth enable;
  encrypt enable;

--- cellphone.conf ---
interval=60        ; Number of seconds between trying to connect to

address=xx:xx:xx:xx:xx:xx     ; retrieved from "cell search" CLI command


By: Denis Luzin (dluzin) 2007-03-08 11:19:05.000-0600


Try to do the following:

1. Stop Asterisk
2. Using hciconfig hci0 check (and set if not active) ISCAN and PSCAN
3. Try to add your computer to paired devices (or handsfrees) of your phone (search, then add somewhere in the phone menu)
4. Password that phone will ask in this case is stored in /etc/bluetooth/hcid.conf as "passkey" parameter.

If this is not working you can download bluez-utils-3.7 from www.bluez.org, do configure and make, then look in 'hcid' folder inside freshly compiled bluez-utils for 'passkey-agent' executable.
While Asterisk is online, run this utility (in my case 'passkey-agent --default 0000', where '0000' is the password that utility will supply during bluetooth pairing) and when Asterisk will try to connect to your phone enter '0000' as a password - this way it should work.
After your phone and Asterisk are paired you can stop passkey-agent by ^C or ^Z.

By: divb (divb) 2007-03-08 20:21:44.000-0600


I've tried chan_cellphone and I've the following problem. When I call out, I get this message and nothing happens:

*CLI> free(): invalid pointer 0xb71f59e4!
   -- Executing Dial("SIP/sip1-081a4d00", "CELL/T68i/0123423452") in new stack
   -- Called T68i/0123423452
 == Spawn extension (internal, 3333, 1) exited non-zero on 'SIP/sip1-081a4d00'
      > cdr_odbc: Query Successful!

The pointer address seems always to be the same. The problem does not occur when the phone is disconnected. Then I get the appropriate message.

I'm trying this with


And as you can see, I use a T68i mobile phone.

My cellphone.conf looks like this:



Is there any way to solve this problem?

Thank you very much in advance!


PS: I looked through the code but I can't find any free()s except in unload and mobile-phone-detection code...

By: Serge Vecher (serge-v) 2007-03-09 08:37:56.000-0600

When posting console output, it is helpful to include verbose / debug information. Please always *attach* any output, not post it inline.
1) Make sure your logger.conf has the following line:
  console => notice,warning,error,debug
2) restart Asterisk with the following command:
  'asterisk -Tvvvvvdddddngc | tee /tmp/verbosedebug.txt'
3) core set debug 4
core set verbose 4
4) Reproduce the problem
5) Trim startup information and attach verbosedebug.txt to the issue.

By: divb (divb) 2007-03-09 08:58:20.000-0600

Ok, then I'll do this way.

I already wondered why there was no debug output!

I've attached whole debug output as 'http://bugs.digium.com/file_download.php?file_id=13360&type=bug'

Best Regards,

By: Sergey Basmanov (sb) 2007-03-09 10:05:53.000-0600

Good question in note ~60441 - is this possible?
Also, another question: is it possible to place calls from asterisk to bt device? I mean to use phone as handset. Something like this:
exten => 1234,1,CellStatus(dave,DAVECELL)
exten => 1234,2,GotoIf($["${DAVECELL}" = "1"]?3:5)
exten => 1234,3,Dial(ZAP/g1/0427466412,45,tT)
exten => 1234,4,Hangup
exten => 1234,5,Dial(CELL/dave,45,tT)
exten => 1234,6,Hangup
In this case all calls to ext 1234 will go to bt phone (directly) when it in range, or go to cell network when phone not in range. Also, ability to place call from bt phone to asterisk will be great.

By: Dave Bowerman (dbowerman) 2007-03-09 16:04:52.000-0600


The t68i is probably the worst phone to use with chan_cellphone, of all those tested it seems to be the most unpredictable, and does not conform to the HFP spec. It is also very old...

Ive had a look at it before and dont think its supportable.

Could you post the startup debug output?, i.e. the conversation between the driver and the phone when it first connects to asterisk. its missing from your last post.

By: Dave Bowerman (dbowerman) 2007-03-09 16:12:49.000-0600


No its not possible to do this. chan_cellphone uses the phone as an 'audio gateway' to the cell/mobile phone network. so its basically an FXO device.

What you are talking about is FXS functionality.

What you need is 'headset' support, which is coming soon.

By: Dave Bowerman (dbowerman) 2007-03-09 16:16:27.000-0600


is it possible for me to somehow update the description field of this bugnote?
its somewhat out of date now, and patches 1 through 13 are also redundant.
i only have 'reporter' status and i cant modify or delete.

By: jmls (jmls) 2007-03-09 16:19:38.000-0600

I can do that for you. Post the text you want and I'll update it.

By: divb (divb) 2007-03-09 16:25:52.000-0600


Sorry, I didn't find any useful debug info. But I've a complete tee-log now from the beginning: startup, one call with chan_cellphone and then exit: File chan_cellphone-debug-free-invalid-pointer-complete.txt (http://bugs.digium.com/file_download.php?file_id=13366&type=bug).

T68i: That would make me very, very sad! I bought the phone only for the Asterisk GSM gateway for just 7 Euro! And this phone is free for all networks!
Another phone would cost too much :-(


By: Andrew Kohlsmith (akohlsmith) 2007-03-10 22:22:04.000-0600

dbowerman: I wasn't aware that cellphones could support the HS side of the connection as well (i.e. just using them as a bluetooth mic+ear).  That could be handy, although I tend to hate talking on my cell, which is why I'm so excited about chan_cellphone being able to "redirect" my incomign cell calls so I can pick up my desk phone to talk instead.  :-)

Or do you mean you're hoping to support BT headsets with the HS profile?  (e.g. chan_cellphone implementing either the AG or HF side of the connection on a per-device basis instead of what chan_cellphone does now?)

By: Jason Parker (jparker) 2007-03-10 22:42:06.000-0600

He means actual headsets, using the HFP profile (not the HS profile - though I guess it's probably possible to do that instead/also).

I'm working on support for it, but I'll need to update my patch...  probably this weekend I'll post something here.

By: Dave Bowerman (dbowerman) 2007-03-11 01:26:59.000-0600


sorry for the confusion, i mean headset support. i have it working, just testing now and should be able to post a patch soon.

By: Dave Bowerman (dbowerman) 2007-03-11 06:44:34

New patch available :- chan_cellphone-15.patch SVN/Trunk rev 58738

* Headsets now supported ! (see doc/cellphone.txt) for details, but basically allows you to send incoming calls to your bluetooth headset.

* Performance improvements to incoming cell network calls. Your cell phone and sip phone should ring at the same time now...almost.

By: Dave Bowerman (dbowerman) 2007-03-11 23:50:29

New patch available :- chan_cellphone-16.patch SVN/Trunk rev 58817

* Headset optimisations
* Set default Speaker and Mic gain on headsets.

By: federicoco (federicoco) 2007-03-12 04:25:21

hello i have patched  my asterisk-trunk version but when digit make menuconfig, the label chan_cellphone is not availabel ([XXX] ) why??????????????
i have patched...

patch -p1 < cell......
make menuconfig

help me!!!
thank you!!!!!

By: Dave Bowerman (dbowerman) 2007-03-12 05:43:07


you need to have the libbluetooth development package installed for you distro.

look for a package called libbluetooth-dev or libbluetooth2-dev

after you have installed it, do ./configure; make menuselect again

By: federicoco (federicoco) 2007-03-12 08:17:56

thank ypu for all dbowerman
ok ...now i have connected my heandset on command

hcitool cc MAC heandset

on asterisk

*CLI> cell show devices
ID              Address           Connected State SMS
SBS             00:0A:3A:02:D3:7A No        Init  No

but when try to call is fail ??

By: Serg V (__serg__) 2007-03-12 11:59:11

Asterisk Ready.
[Mar 12 18:49:07] ERROR[26088]: chan_cellphone.c:1509 do_sco_listen: Unable to create sco listener socket.
*CLI> cell search
Address           Name                           Usable Type    Port
00:15:A0:33:83:10 6230i                          No     Headset 0

Why i have error "Unable to create sco listener socket" and why Usable="No"

Help me please.

P.S. Asterisk SVN-trunk-r58822M, chan_cellphone-16.patch

By: Dave Bowerman (dbowerman) 2007-03-12 18:01:15

federicoco: and __Serg__:

I'd say you havent paired your phone/headset, or entered the wrong PIN.

By: Ronald Chan (loloski) 2007-03-12 23:43:32

dbowerman: thanks a lot man, it work's on Sony Ericsson K608i phone with both inbound/outbound call using chan_cellphone-15.patch

It's great nice work !!!


By: Andreas Anderson (aanderson) 2007-03-13 06:36:12

Can this go into trunk? At the moment it is updated so quickly that removing-applying of the patches is a bit of a PITA ;-)

What has to be done for inclusion into trunk?

By: federicoco (federicoco) 2007-03-13 08:06:34

>>>dbowerman my angel!!!!

now my asterisk is ready ...or not...
accept the call from cell
outgoing call from asterisk trughout cell,
send sms
recive sms

but when i speak on sip phone, the audio is not felt and viceversa
i have nokia 6021
have you idea?
thank you advance

By: divb (divb) 2007-03-13 10:27:26

Hi dave,

Concerning the free()-pointer error: This message has gone in version 16! :-)

However, I'm trying to get the T68i working.

I found out:
1.) connect works fine.
2.) The AT+BRSF=4 works without error
3.) But after that, I get a timeout!! But the flow should always go through the first if clause after the AT+BRSF=4, shouldn't it?
4.) In the second if-clause ("timeout") the state is still 0 (pvt->state=0). But there is not if-clause for pvt->state == 0. I think it shouldn't reach here

I looked in the specs from T68i and saw that there is no (!) command AT+BRSF!!! Could this be the problem?

Thanks in advance,

PS: Might it be possible that the T68i does not support voice over bluetooth? In the manual there is always info about talking to the "modem" but nothing concerning voice. Does it make a difference? I wonder why you've written "T68i" support in patch-6...

By: divb (divb) 2007-03-13 11:22:11

One more news: In my last post I said that there's always a timeout so the phone can't connect!

Therefore I searched for a way to contact the phone directly and was happy to find it: rfcomm.

The big problem: With rfcomm, the phones does not send anything back too!! What could be the problem?

In my cellphone I've port 6. So I tried with "channel 0" and "channel 6". Same result: Nothing:

asterisk:~ # rfcomm connect 0
Connected /dev/rfcomm0 to 00:0E:07:37:A8:A4 on channel 6
Press CTRL-C for hangup


As you can the see, I can write "AT" without any problem. Normally, I should receive an "OK"?!. But nothing arrives.

Thanks again,


By: Juan Pablo (digitalcom) 2007-03-13 12:12:01

I'm getting problem with making or receiving calls. After the telephone rings (on any side), I take the call and the asterisk restarts. Also I have a message in the console that sais "hci_scodata_packet: hci0 SCO packet for unknown connection handle 41" sometimes. The phone is a Motorola V3 and the usb dongle version that I'm using is
[root@asterisk ~]# hciconfig hci0 version
hci0:   Type: USB
       BD Address: 00:09:DD:50:2A:C1 ACL MTU: 384:8  SCO MTU: 64:8
       HCI Ver: n/a (0x3) HCI Rev: 0x7a6 LMP Ver: n/a (0x3) LMP Subver: 0x7a6
       Manufacturer: Cambridge Silicon Radio (10)

Sometimes just before I reboot the server, it works really great, then it doesn't. Any suggestion?
Thanks in advance

By: Serg V (__serg__) 2007-03-13 14:00:29

[Mar 13 20:26:24] DEBUG[10296]: pbx.c:1716 pbx_extension_helper: Launching 'Dial'
   -- Executing [100@from-sip:1] Dial("SIP/serg-081d0fd8", "CELL/nokia6230i/80984061993") in new stack
[Mar 13 20:26:24] DEBUG[10296]: rtp.c:1645 ast_rtp_make_compatible: Channel 'CELL/nokia6230i-7c2d' has no RTP, not doing anything
[Mar 13 20:26:24] DEBUG[10296]: channel.c:3244 ast_channel_inherit_variables: Not copying variable STACK-from-sip-100-1.
[Mar 13 20:26:24] DEBUG[10296]: channel.c:3244 ast_channel_inherit_variables: Not copying variable SIPCALLID.
[Mar 13 20:26:24] DEBUG[10296]: channel.c:3244 ast_channel_inherit_variables: Not copying variable SIPDOMAIN.
[Mar 13 20:26:24] DEBUG[10296]: channel.c:3244 ast_channel_inherit_variables: Not copying variable SIPURI.
[Mar 13 20:26:24] DEBUG[10296]: chan_cellphone.c:451 cel_call: Calling nokia6230i/80684061993 on CELL/nokia6230i-7c2d
[Mar 13 20:26:24] DEBUG[10296]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (nokia6230i) [
[Mar 13 20:26:24] DEBUG[10296]: devicestate.c:444 __ast_device_state_changed_literal: Notification of state change to be queued on device/channel CELL/nokia6230i-7c2d
   -- Called nokia6230i/80684061993
[Mar 13 20:26:24] DEBUG[10296]: channel.c:2791 set_format: Set channel CELL/nokia6230i-7c2d to read format ulaw
[Mar 13 20:26:24] DEBUG[10296]: channel.c:2791 set_format: Set channel SIP/serg-081d0fd8 to read format slin
   -- CELL/nokia6230i-7c2d is ringing
[Mar 13 20:26:24] DEBUG[10296]: devicestate.c:302 ast_device_state: No provider found, checking channel drivers for CELL - nokia6230i
[Mar 13 20:26:24] DEBUG[10296]: chan_cellphone.c:704 cel_devicestate: Checking device state for device nokia6230i
[Mar 13 20:26:24] DEBUG[10296]: devicestate.c:428 do_state_change: Changing state for CELL/nokia6230i - state 2 (In use)
[Mar 13 20:26:24] DEBUG[10296]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (nokia6230i) [

why chan_cellphone send
rfcomm_write() (nokia6230i) [ RING ]
need send somthing like:
rfcomm_write() (nokia6230i) [ ATD80984061993; ]

By: Sergey Basmanov (sb) 2007-03-13 14:47:28

Interesting thing. Just compiled current trunk with Your patch. It connected to my Motorola L7e without any problems. But. BT link on phone shows permanent connection. No sound on phone (at all). Seems phone sends everything to *
Attached is hcidump output. Do You have any idea what happens?
And it seems to me, it's possible to use phone as handset :)
At least this one.
And if You will need - I can provide any additional information.

By: Dave Bowerman (dbowerman) 2007-03-13 17:48:08


RE (0060808)

Do you have 'type=headset' in your cellphone.conf file? If so remove it.
It looks like you are trying to use a phone as a headset, this cant be done.

By: Dave Bowerman (dbowerman) 2007-03-13 17:52:53


Could you do the following and email me the output?

1. start asterisk without chan_cellphone auto loaded.
2. core set debug 1
3. module load chan_cellphone.so
4. copy all the the debug output from the console and email me.

You need to make sure that the 'console' line in your /etc/asterisk/logger.conf file looks like this :-

console => notice,warning,error,debug

By: Dave Bowerman (dbowerman) 2007-03-13 17:57:17


could you do the same as note number 0060821 and make a call then capture the debug output?. Unfortunately I dont have a Nokia 6021 to test with.

By: federicoco (federicoco) 2007-03-14 05:26:50

log from my console for nokia 6021

[Mar 14 11:23:50] DEBUG[8453]: chan_cellphone.c:1590 cel_load_config: Loading device SBS.
[Mar 14 11:23:50] DEBUG[8453]: chan_cellphone.c:1590 cel_load_config: Loading device BACONGO.
 == Registered application 'CellStatus'
 == Registered application 'CellSendSMS'
[Mar 14 11:23:50] DEBUG[8453]: channel.c:429 ast_channel_register: Registered handler for 'CELL' (Bluetooth Cellphone Driver)
 == Registered channel type 'CELL' (Bluetooth Cellphone Driver)
Loaded chan_cellphone.so => (Bluetooth Cellphone Driver)
   -- Bluetooth Device BACONGO has connected.
]Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (BACONGO) [AT+BRSF=4
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+BRSF: 47]
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [OK]
]Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (BACONGO) [AT+CIND=?
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+CIND: ("call",(0,1)),("service",(0,1)),("call_setup",(0-3)),("callsetup",(0-3))]
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1074 do_monitor_phone: CIEV_CALL=1 CIEV_CALLSETUP=4
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [OK]
]Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (BACONGO) [AT+CIND?
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+CIND: 0,1,0,0]
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [OK]
]Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (BACONGO) [AT+CMER=3,0,0,1
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [OK]
]Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (BACONGO) [AT+CLIP=1
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [OK]
]Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (BACONGO) [AT+CMGF=1
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [OK]
]Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (BACONGO) [AT+CNMI=2,1,0,1,0
[Mar 14 11:23:54] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [OK]
   -- Bluetooth Device BACONGO initialised and ready.
[Mar 14 11:24:13] DEBUG[8453]: chan_sip.c:4665 sip_alloc: Allocating new SIP dialog for (No Call-ID) - OPTIONS (No RTP)
[Mar 14 11:24:13] DEBUG[8453]: chan_sip.c:1720 initialize_initreq: Initializing initreq for method OPTIONS - callid 3e16f63555b0cf796dcd56c71acf9273@
[Mar 14 11:24:13] DEBUG[8453]: chan_sip.c:2236 __sip_ack: Stopping retransmission on '3e16f63555b0cf796dcd56c71acf9273@' of Request 102: Match Found
[Mar 14 11:24:14] DEBUG[8453]: chan_cellphone.c:776 rfcomm_connect: connect() failed (112).
[Mar 14 11:24:19] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [RING]
[Mar 14 11:24:19] DEBUG[8453]: chan_cellphone.c:1126 do_monitor_phone: Device 00:17:B0:4C:74:89 BACONGO [RING]
[Mar 14 11:24:19] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+CLIP: "",128]
[Mar 14 11:24:19] DEBUG[8453]: pbx.c:1716 pbx_extension_helper: Launching 'Dial'
   -- Executing [s@frommobile:1] Dial("CELL/BACONGO-2e40", "SIP/201") in new stack
[Mar 14 11:24:19] DEBUG[8453]: chan_sip.c:15996 sip_request_call: Asked to create a SIP channel with formats: 0x40 (slin)
[Mar 14 11:24:19] DEBUG[8453]: chan_sip.c:4665 sip_alloc: Allocating new SIP dialog for (No Call-ID) - INVITE (With RTP)
[Mar 14 11:24:19] DEBUG[8453]: chan_sip.c:2844 do_setnat: Setting NAT on RTP to Off
[Mar 14 11:24:19] DEBUG[8453]: rtp.c:1652 ast_rtp_make_compatible: Channel 'CELL/BACONGO-2e40' has no RTP, not doing anything
[Mar 14 11:24:19] DEBUG[8453]: channel.c:3244 ast_channel_inherit_variables: Not copying variable STACK-frommobile-s-1.
[Mar 14 11:24:19] DEBUG[8453]: chan_sip.c:3124 sip_call: Outgoing Call for 201
[Mar 14 11:24:19] DEBUG[8453]: chan_sip.c:1720 initialize_initreq: Initializing initreq for method INVITE - callid 0b21f742798f287e2dcf187f6f3db3b9@
   -- Called 201
[Mar 14 11:24:19] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+CIEV: 3,1]
[Mar 14 11:24:19] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+CIEV: 4,1]
[Mar 14 11:24:19] DEBUG[8453]: chan_sip.c:2279 __sip_semi_ack: (Provisional) Stopping retransmission (but retaining packet) on '0b21f742798f287e2dcf187f6f3db3b9@' Request 102: Found
   -- SIP/201-081b7e90 is ringing
[Mar 14 11:24:19] DEBUG[8453]: channel.c:2379 ast_indicate_data: Driver for channel 'CELL/BACONGO-2e40' does not support indication 3, emulating it
[Mar 14 11:24:19] DEBUG[8453]: channel.c:2531 ast_prod: Prodding channel 'CELL/BACONGO-2e40'
[Mar 14 11:24:19] DEBUG[8453]: chan_cellphone.c:1543 do_sco_listen: Incoming Audio Connection from device 00:17:B0:4C:74:89 MTU is 64
[Mar 14 11:24:22] DEBUG[8453]: chan_sip.c:4438 sip_rtp_read: Oooh, format changed to 4
[Mar 14 11:24:22] DEBUG[8453]: channel.c:2791 set_format: Set channel SIP/201-081b7e90 to read format slin
[Mar 14 11:24:22] DEBUG[8453]: channel.c:2791 set_format: Set channel SIP/201-081b7e90 to write format slin
[Mar 14 11:24:22] DEBUG[8453]: chan_sip.c:2220 __sip_ack: Acked pending invite 102
[Mar 14 11:24:22] DEBUG[8453]: chan_sip.c:2236 __sip_ack: Stopping retransmission on '0b21f742798f287e2dcf187f6f3db3b9@' of Request 102: Match Found
--- set_address_from_contact host ''
   -- Call on SIP/201-081b7e90 left from hold
   -- SIP/201-081b7e90 answered CELL/BACONGO-2e40
[Mar 14 11:24:22] DEBUG[8453]: channel.c:2791 set_format: Set channel CELL/BACONGO-2e40 to read format ulaw
[Mar 14 11:24:22] DEBUG[8453]: channel.c:2791 set_format: Set channel SIP/201-081b7e90 to write format ulaw
]Mar 14 11:24:22] DEBUG[8453]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (BACONGO) [ATA
[Mar 14 11:24:22] DEBUG[8453]: chan_cellphone.c:704 cel_devicestate: Checking device state for device BACONGO
[Mar 14 11:24:22] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [OK]
[Mar 14 11:24:22] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+CIEV: 1,1]
[Mar 14 11:24:22] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+CIEV: 3,0]
[Mar 14 11:24:22] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+CIEV: 4,0]
[Mar 14 11:24:22] NOTICE[8453]: rtp.c:853 process_rfc3389: Comfort noise support incomplete in Asterisk (RFC 3389). Please turn off on client if possible. Client IP:
[Mar 14 11:24:29] DEBUG[8453]: channel.c:3746 ast_generic_bridge: Didn't get a frame from channel: SIP/201-081b7e90
[Mar 14 11:24:29] DEBUG[8453]: channel.c:4074 ast_channel_bridge: Bridge stops bridging channels CELL/BACONGO-2e40 and SIP/201-081b7e90
[Mar 14 11:24:29] DEBUG[8453]: channel.c:1622 ast_hangup: Hanging up channel 'SIP/201-081b7e90'
[Mar 14 11:24:29] DEBUG[8453]: chan_sip.c:3605 sip_hangup: Hangup call SIP/201-081b7e90, SIP callid 0b21f742798f287e2dcf187f6f3db3b9@
[Mar 14 11:24:29] DEBUG[8453]: app_dial.c:1711 dial_exec_full: Exiting with DIALSTATUS=ANSWER.
[Mar 14 11:24:29] DEBUG[8453]: pbx.c:2312 __ast_pbx_run: Spawn extension (frommobile,s,1) exited non-zero on 'CELL/BACONGO-2e40'
 == Spawn extension (frommobile, s, 1) exited non-zero on 'CELL/BACONGO-2e40'
[Mar 14 11:24:29] DEBUG[8453]: channel.c:1622 ast_hangup: Hanging up channel 'CELL/BACONGO-2e40'
[Mar 14 11:24:29] DEBUG[8453]: chan_cellphone.c:481 cel_hangup: Hanging up device BACONGO.
]Mar 14 11:24:29] DEBUG[8453]: chan_cellphone.c:793 rfcomm_write: rfcomm_write() (BACONGO) [AT+CHUP
[Mar 14 11:24:29] DEBUG[8453]: chan_cellphone.c:704 cel_devicestate: Checking device state for device BACONGO
[Mar 14 11:24:29] DEBUG[8453]: chan_cellphone.c:704 cel_devicestate: Checking device state for device BACONGO
[Mar 14 11:24:29] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [OK]
[Mar 14 11:24:29] DEBUG[8453]: chan_cellphone.c:1032 do_monitor_phone: rfcomm_read() (BACONGO) [+CIEV: 1,0]
[Mar 14 11:24:29] DEBUG[8453]: chan_cellphone.c:1126 do_monitor_phone: Device 00:17:B0:4C:74:89 BACONGO [+CIEV: 1,0]
[Mar 14 11:24:39] DEBUG[8453]: chan_cellphone.c:776 rfcomm_connect: connect() failed (112).

By: Serg V (__serg__) 2007-03-14 10:16:56

The problem was the phone.
Motorolla l7e earned immediately, and then earned nokia 6230i.
Thank you very much for your patch and your help!!!

P.S. Sorry my bad English :)

By: Ade Onanuga (ade) 2007-03-14 12:32:37

If anyone can point me in the right direction, I would very much appreciate it.

I am looking to try out chan_cellphone. Found the patches and *.txt files, but I have not been able to find the driver files.

I am currently running * 1.2.10 looking to upgrade to * SVN trunk version. This version does not have chan_cellphone either (except if I am looking in all the wrong places). I intend to test with a Motorola v710.  PBX server is on Fedora 2.6.18.

Any help will be greatly appreciated.

By: Serge Vecher (serge-v) 2007-03-14 13:23:13

once again, please do not turn the bug-report into a discussion forum. If you need help with basics of patching a system, use the #asterisk IRC channel, asterisk-users mailing list, or open a thread on the forums. At this point, the issue is only to be used to report test results, provide code comments and for patch authors updates.

By: Ade Onanuga (ade) 2007-03-14 15:24:49

Thanks for the pointer.

By: anthony george (furrymitn) 2007-03-14 23:48:12

I'm hoping this is the right place to report this:

Using a Sony Ericsson w310i, I was having an issue where the phone would never show beyond init, never free, debug showed the following:
Mar 14 23:52:46] DEBUG[31768] chan_cellphone.c: rfcomm_write() (Tony) [AT+CMGF=1
Mar 14 23:52:46] DEBUG[31768] chan_cellphone.c: rfcomm_read() (Tony) [+CMS ERROR: 303

line 2007 of the patch(14-1.4.1) shows:
+                               if (strstr(buf, "ERROR\r")) { /* No SMS Support ! */

But the phone returns +CMS ERROR: 303. Changing the patch to not look for the carriage return lets the phone pass.  

Thanks for the great work!

By: Dave Bowerman (dbowerman) 2007-03-15 00:05:51


Thanks, this is actually fixed in patch-16.

By: Ronald Chan (loloski) 2007-03-16 00:24:32

dbowerman: Your code works also on Sony Ericsson W800i phone :) i will test a few more cell this week and report it back!!

By: Dave Bowerman (dbowerman) 2007-03-18 02:50:05

New patches available :

chan_cellphone-17.patch SVN/Trunk Rev 59032
chan_cellphone-1.4.1-17.patch.gz Asterisk release 1.4.1

* Minor performance improvements and bug fixes.

By: Thomas Hollstegge (-thomas-) 2007-03-18 17:48:31

Is there news on the segfault issue? I attached some gdb debugging output as chan_cellphone-debug-segfault.

I tried to call out over my SonyEricsson K610i but * crashes. Do I have to use the chan_cellphone-5-ericsson.patch rather than the chan_cellphone-1.4.1-17.patch?

Keep up the great work!

By: Maxim Samo (maxim) 2007-03-19 20:41:55


First: This is fantastic. Great work!!

Unfortunately I could not get it to work with the Motorola RAZR. I can pair it though and place an outgoing call however there's one way audio: I receive audio from the cellphone but from asterisk there's no audio going out. Also incoming calls doesn't work at all. There's numerour errors in debug when I load the module that I can paste here:

[Mar 19 21:36:30] DEBUG[6602]: chan_cellphone.c:1596 cel_load_config: Loading device razr.
[Mar 19 21:36:30] DEBUG[6602]: channel.c:524 ast_channel_register: Registered handler for 'CELL' (Bluetooth Cellphone Driver)
[Mar 19 21:36:34] DEBUG[6641]: chan_cellphone.c:819 rfcomm_write: rfcomm_write()](razr) [AT+BRSF=4
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [+MBAN: Copyright 2000-2002 Motorola, Inc.]
[Mar 19 21:36:35] DEBUG[6637]: chan_cellphone.c:1549 do_sco_listen: Incoming Audio Connection from device 00:17:00:3F:CE:9B MTU is 16
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [+BRSF: 63]
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [OK]
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:819 rfcomm_write: rfcomm_write()](razr) [AT+CIND=?
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [+CIND: ("Voice Mail",(0,1)),("service",(0,1)),("call",(0,1)),("Roam",(0-2)),("signal",(0-5)),("callsetup",(0-3)),("smsfull",(0,1))]
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:1083 do_monitor_phone: CIEV_CALL=3 CIEV_CALLSETUP=6
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [OK]
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:819 rfcomm_write: rfcomm_write()](razr) [AT+CIND?
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [+CIND: 0,1,0,0,5,0,0]
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [OK]
[Mar 19 21:36:35] DEBUG[6641]: chan_cellphone.c:819 rfcomm_write: rfcomm_write()](razr) [AT+CMER=3,0,0,1
[Mar 19 21:36:36] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [OK]
[Mar 19 21:36:36] DEBUG[6641]: chan_cellphone.c:819 rfcomm_write: rfcomm_write()](razr) [AT+CLIP=1
[Mar 19 21:36:36] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [OK]
[Mar 19 21:36:36] DEBUG[6641]: chan_cellphone.c:819 rfcomm_write: rfcomm_write()](razr) [AT+CMGF=1
[Mar 19 21:36:36] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [OK]
[Mar 19 21:36:36] DEBUG[6641]: chan_cellphone.c:819 rfcomm_write: rfcomm_write()](razr) [AT+CNMI=2,1,0,1,0
[Mar 19 21:36:36] DEBUG[6641]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [ERROR]
   -- Bluetooth Device razr initialised and ready.

then when I place a call either I get one-way audio or (as in this case) asterisk crashes:

[Mar 19 21:44:40] DEBUG[6701]: chan_cellphone.c:479 cel_call: Calling razr/12......... on CELL/razr-8e9f
[Mar 19 21:44:40] DEBUG[6701]: chan_cellphone.c:632 cel_read: cel_read() read error 104.
[Mar 19 21:44:41] DEBUG[6694]: chan_cellphone.c:819 rfcomm_write: rfcomm_write()](razr) [ATD12.........;
[Mar 19 21:44:42] DEBUG[6694]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [OK]
[Mar 19 21:44:42] DEBUG[6570]: chan_cellphone.c:719 cel_devicestate: Checking device state for device razr
[Mar 19 21:44:42] DEBUG[6694]: chan_cellphone.c:1041 do_monitor_phone: rfcomm_read() (razr) [+CIEV: 6,2]
[Mar 19 21:44:44] DEBUG[6690]: chan_cellphone.c:1549 do_sco_listen: Incoming Audio Connection from device 00:17:45:AB:4A:69 MTU is 16

I'm using asterisk-1.4.1 with patch 17 ... I couldn't get it to work with trunk as menuselect thinks I'm missing a dependancy and won't let me include chan_cellphone. I haven't figured out yet what I'm missing there esp. since it works with 1.4.1 ...

let me know if you need more than this. I'm a beginner when it comes to bug reporting etc. but I'm happy to learn and help.

By: Steve (802) 2007-03-20 10:19:55

Having an issue on 1.4.1 with patch17, if the call coming in on the cellular handset sends a dtmf tone, the tone keeps playing and never stops, call doesnt end even with hangup of mobile device, asterisk has to close the channel.

By: henkie (henkie) 2007-03-20 11:25:51

When receiving an inbound call (on the cellphone, a nokia 6230i) asterisk is unable to process the dtmf-codes. The cellphone itself goes from the 'handset' mode, and seems to pick up the phone. No data seemed to arrive at asterisk (according to the debug code)

The caller was also a cellphone.

This was tested with "chan_cellphone-1.4.1-17.patch.gz"

By: Steve (802) 2007-03-22 09:01:58

Upgraded to kernel, audio distortion is all gone. DTMF issues persists though not everytime now. Can we disable dtmf processing(it might not be need in all situations)?

By: Juan Pablo (digitalcom) 2007-03-22 10:42:15

I've been trying chan_cellphone-1.4.1-17.patch.gz with 1.4.2 version, because 1.4.1 is no longer available. That's wonderfull because SVN versiona had some problems. The cellphone I'm using is a Razr V3, to make outbound calls ( VoIP -> Cellphone) works really great, but i can't make incoming calls (cellphone -> VoIP), asterisk never answers the call. I have at extensions.conf
exten => s,1,Dial(SIP/240,30,Ttr)
exten => i,1,Goto(s,1)
but doesn't work. Can anyone tell me if I'm making any mistake? I've also defined context=incoming-mobile in cellphone.conf.

And the last, it would be wonderfull If someone can post a txt where tell exactly what you must install to make it work. I have to asterisk servers and works only in one and I can't find the diference between configurations.

Thanks in advance, and congratulations again for this wonderfull job!

P.S.: Do NOT eliminate DTMF!

By: Dave Bowerman (dbowerman) 2007-03-23 01:42:37


can you post or email me the console log output with 'core set debug 1' on when an incoming call happens.


By: legion (legion) 2007-03-23 05:42:11

Can you make SMS send-only option (use AT+CNMI=2,1,0,0,0 instead AT+CNMI=2,1,0,1,0 for check SMS support) in config of cellphone channel?
Also has been well make feature for control cellphone without bluetooth, through Data cable, for SMS send/recieve and CID use only. Because  most of cellphone can recieve SMS through Data cable.

P.S. Sorry for my bad English.

By: Joerg Bliesener (jbliesener) 2007-03-25 09:46:22

Running on Fedora Core 5, Kernel 2.6.20-1.2307.fc5, Acer USB adapter, bluez-libs/-utils 2.25, Sony Ericsson T610.

Phone connects, originates and receives calls.

Three issues:

1) CellStatus ALWAYS returned 1 (not connected), until I notices that I was doing something stupid here:

exten => s,1,CellStatus(${ARG1},CELLStat)
exten => s,n,Noop(CellStatus: ${CELLStat})
;exten => s,n,GotoIf($[${CELLStat} = 1]?s-CHANUNAVAIL)  ; Commented out, does not work, CelLStatus always returns 1
;exten => s,n,GotoIf($[${CELLStat} = 3]?s-CHANUNAVAIL)
exten => s,n,Dial(${ARG1}/${ARG2})
exten => s,n,NoOp(${DIALSTATUS})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n,Hangup


   -- Executing [84288944@outgoing-analog:1] Macro("OSS/dsp", "forward-cellphone|CELL/T610|84288944|""") in new stack
   -- Executing [s@macro-forward-cellphone:1] CellStatus("OSS/dsp", "CELL/T610|CELLStat") in new stack
   -- Executing [s@macro-forward-cellphone:2] NoOp("OSS/dsp", "CellStatus: 1") in new stack
   -- Executing [s@macro-forward-cellphone:3] Dial("OSS/dsp", "CELL/T610/84288944") in new stack
   -- Called T610/84288944
   -- CELL/T610-0c25 answered OSS/dsp


See it? The problem was in using "CELL/T610" instead of "T610" as CellStatus argument. Inserting a "Set(CellID=${CUT(ARG1,/,2)})" and using ${CellID} in CellStatus resolved it.

Suggestion: Modification of CellStatus to ignore a possible "CELL/" in front of the Device ID.

2) At some calls, audio is distorted from Cellphone to PC. Not understandable, same situation as dluzin's note (0059898). No prob with audio from PC to Cellphone.

3) T610 does not send or receive SMSs:

linux3*CLI> cell show devices
ID              Address           Connected State SMS
T610            00:0E:07:28:49:B3 Yes       Free  No


Feature request:
Possibly off-topic, but my the audience decide: My Motorola V3 supports the Bluetooth CTP profile, which stands for Cordless Telephony. I also have a Bluetooth CTP access point, which connects to my fixed POTS line and transmits incoming calls via Bluetooth CTP to my V3. Same with outgoing calls originated on the V3: I'm being asked if I would like to route the call over GSM or over my fixed line, using the access point.

Wouldn't it be great to use the access point as another FXO interface, implementing the CTP profile? And even more, this profile offers an FXS interface to my V3.

Any plans to implement? Are there other cellphones out there using CTP?

By: Juan Pablo (digitalcom) 2007-03-26 14:59:00

Dear dbowerman:
 I got nothing with debug 1 neither with debug 10, asterisk is just doing nothing when the cell phone is ringing. Below I post and hcidump, I thought it may be usefull.
[root@asterisk1 ~]# hcidump
HCIDump - HCI packet analyzer ver 1.11
device: hci0 snap_len: 1028 filter: 0xffffffff
> ACL data: handle 0x0001 flags 0x02 dlen 22
   L2CAP(d): cid 0x0040 len 18 [psm 0]
> ACL data: handle 0x0001 flags 0x02 dlen 35
   L2CAP(d): cid 0x0040 len 31 [psm 0]
> ACL data: handle 0x0001 flags 0x02 dlen 35
   L2CAP(d): cid 0x0040 len 31 [psm 0]
> ACL data: handle 0x0001 flags 0x02 dlen 36
   L2CAP(d): cid 0x0040 len 32 [psm 0]
> ACL data: handle 0x0001 flags 0x02 dlen 22
   L2CAP(d): cid 0x0040 len 18 [psm 0]
< ACL data: handle 0x0001 flags 0x02 dlen 9
   L2CAP(d): cid 0x0040 len 5 [psm 0]
> ACL data: handle 0x0001 flags 0x02 dlen 22
   L2CAP(d): cid 0x0040 len 18 [psm 0]
> HCI Event: Number of Completed Packets (0x13) plen 5

Thanks in advance.

By: Roel Cuppen (cuppie) 2007-03-26 17:05:07


Thanks for the great job !

I'm using the following
-latest version of ubuntu feisty. (kernel 6.2.20)
-AVM fritzfon 7150 as a sip device (G711)
-Sitecom CN521 (CSR Chipset) (also an Etech dongle, and Eminent dongle)
-Nokia 6230i
-current svn trunk of asterisk

When calling from the sip device (avm 7150) to a destination via the cellphone (nokia 6230i) i'm getting lots of 'Overrun on sco_out_buf detected' like reporter stan_mahe has.
In this case, audio from the sip phone to the destination (another cellphone) is horrible. Audio from the destination to the sip phone is perfect.

Tested with 4 different types of BT dongles. Always the same.
-Patching kernel with latest BT patches doesn't make sense
-Recent firmware in nokia 6230i even doesn't make sense
-Changing SCOMTU sizes doesn't make sense

When changing the following in the source

char sco_out_buf[352];
char sco_out_buf[480];

The messages 'Overrun on sco_out_buf detected' are gone.
But in this case , audio from the sip device to the destination is perfect.
Audio from the destination to the sip device is not really bad , but could be a lot better. There are a lot of hickups, like rtp packets are dropped.

Changing char sco_out_buf to a value lower than 480 , the overrun messages are back, and i got the primary problem.


By: Dave Bowerman (dbowerman) 2007-03-27 01:53:22


check your /etc/asterisk/logger.conf file and make sure the 'console' line looks like this :-

console => notice,warning,error,debug

By: Sabin (binsa) 2007-03-27 04:38:10


I've tested chan_ceelphone 17 patch on Fedora core6, kernel 2.6.20.with Asterisk 1.4.1 and 1.4.2. My cellphone is Sony-Ericsson K510i
First: from X-Lite softphone to mobile all is right and sound is perfect.
The problem comes when I try call from other asterisk through IAX to mobile. I have messages 'Overrun on sco_out_buf detected', the sound is distorted and after about a minute bluetooth hangs and disconnect or all pc hangs.


By: Juan Pablo (digitalcom) 2007-03-27 06:05:59

Many thanks, sorry, the line 'console => notice,warning,error,debug' was commented. I've also changed port number and worked, but I have no incoming (from cellphone) DTMF.

Many thanks in advance ando sorry for my mistake.

By: Serge Vecher (serge-v) 2007-03-27 09:02:47

digitalcom: the line you've uncommented will not fix your DTMF issues, but allow the debug output to go to the console. Please produce the log with core set debug 4. This is stated both in the bug and in accompanying documentation.

Same goes for all other people reporting problems and not providing any debug information.

By: Zden (mhz) 2007-03-29 03:55:43

First of all let me congratulate you for taking the time and working on chan_cellphone. I've been waiting for this chan a long time. Even tried the old chan_bluetooth, but I never managed to get it working with two way audio...
So I've tested chan_cellphone patch 17 with the svn build it was released for. Compiles fine, loads fine.
My test involves SE k700i which is claimed to work but I get one way audio.
I have also tried my new k800i where its the same story. Everithing seems working but there's one way audio.
Here is the DEBUG output of a call to the k800i.

Again one way audio.

The call in answered by an echo test app, which works from a SIP phone.
It is clearly executed but the calling party gets no audio.
Thus, Audio is not sent to the Cell.
Bluetooth is built-in in a HP nw8240 Notebook. I believe its not the cause.
I'll be happy to continue testing and support this project/effort with whatever I can.

By: Dave Bowerman (dbowerman) 2007-03-29 05:06:46

New patch available :- chan_cellphone-18.patch SVN/Trunk Rev 59251

* Different sco audio synchronisation method.
Id be interested in feedback on the audio quality of this versus previous versions.

By: Dave Bowerman (dbowerman) 2007-03-29 05:19:10


could you try cellphone <-> sip phone and eliminate the echo and playback apps?


By: Zden (mhz) 2007-03-29 07:07:59

Ok, updated to patch 18.
The situation is pretty much the same.
I think the one way audio is actually not a one way audio but the asterisk> cellphone audio  is either very quiet or extremely noised as sometimes when blowing in the headset, I actually manage to pick up some audio that sound too quiet and distorted like white noise and sometimes not. It could be just me though. Or is it really that audio is messed up to the extent of silence and white noise? I cant say for sure.

Here is the Log
k700>asterisk>SIP phone

I get audio on the SIP phone but not the other way around.
Cellphone sending audio, not receiving.
Or maybe just white noise and garbage or .... I don't know.


By: heavenx (heavenx) 2007-03-29 10:31:09

I'm sorry.
has someone tested chan_cellphone and SonyEricsson K750i ?
I've got a verry terrible sound.

By: Serge Vecher (serge-v) 2007-03-29 10:42:29

mhz, Heaven-X: bug lines state that all debug is to be attached, not posted in the notes, I've been asking people to do that numerous times in this report, dbowerman's documentation in the patch clearly states that. If you can't follow directions, I kindly ask that you don't post here at all.

By: Zden (mhz) 2007-03-29 15:44:08

serge-v, Sorry I dont know how I've missed that rule. I hate that and I completely agree with you. Sorry it wont happen again. I dont like off-topics and nonsens content. So please feel free to delete that. Sorry again.

By: Sabin (binsa) 2007-03-30 06:07:10

I've just tried 18-th patch. I have not problem with the sound - it is clear in both direction, with both SIP and IAX calls/incomming and outgoing. Great project!
Also I made DTMF detection to work. I've attached cellphone.c with my changes.
Is anybody tested with multiply concurent gsm calls?

By: Serge Vecher (serge-v) 2007-03-30 09:20:14

please attach your changes as a patch to dbowerman's latest chan_cellphone.c, so we can see exactly what changes you've made. Also, you need to get a disclaimer on file and mention it in this note.

By: Roel Cuppen (cuppie) 2007-03-30 14:48:10


Great work on patch 18 !

I'm using the following
-latest version of ubuntu feisty. (kernel 6.2.20)
-AVM fritzfon 7150 as a sip device (G711)
-Sitecom CN521 (CSR Chipset)
-Nokia 6230i
-current svn trunk of asterisk

Perfect two way audio !

Thanks again !

By: Sabin (binsa) 2007-03-31 01:20:37

Hello serge-v,
I disclaimer on file, but my problem is that i don't know how to make the patch with changes, sorry. I'm new in this issue tracker and have not experience with the patch tool. I just decided that my changes will be useful. Sorry.

By: Dave Bowerman (dbowerman) 2007-03-31 23:18:29

New patches available :-

chan_cellphone-19.patch SVN/Trunk Rev 59605
chan_cellphone-19-1.4.2 Asterisk Release 1.4.2

* Inbound DTMF detection now works properly. Thanks to Binsa.
* Feature Complete.

By: heavenx (heavenx) 2007-04-01 09:35:28

I have tested all patchs and i get all the time a verry terrible audio in both directions.
I'm using SonyEricsson K750i with the last asterisk svn trunk.
Can someone confirm that chan_cellphone still doesnt support K750i ?

Thank you for this great job ;)

By: Alexander Toloka (alexclark) 2007-04-02 02:47:34

Please tell me, how cellphones can I connect via chan_cellphone? Trying connect two phones: first dialed phone works fine, second - have one-way audio problem (sometimes voice may listened/switched on/to cellphone). Is there solution to solve problem, like connect second cellphone via secondary bluetooth dongle (hci1,hciX) or it may be solved in chan_cellphone?

Thanks for great job! :)

By: Dave Bowerman (dbowerman) 2007-04-02 07:32:49


what sort of hardware are you using? and what version of bluez?

By: heavenx (heavenx) 2007-04-02 08:32:39

dbowerman :

I'm using an ISSC Bluetooth Device (IVT Corporation)i dont know exactly what brand :\, and bluez 3.7-1

By: Alexander Toloka (alexclark) 2007-04-02 20:48:49

HeavenX: SE Z600, Nokia 6230, SE 230; BlueTake BT009X Bluetooth dongle (CSR based). Asterisk 1.4.1 with chan_cellphone-1.4.1-17, 1.4.2 with chan_cellphone-19-1.4.2 patches, using SIP; bluez-3.7-1 on FC6. Works fine, but problem is in simultaneous use. I want use some cellphones simultaneously with one dongle, but in doesn't work. In bluetooth specification told about 3 voice channels (2 for stereoheadset and 1 for mic). It mean that one dongle not support more than one voice connection? Is there solution to connect two different cellphones via two different dongles on one PC?

By: Malcolm Caldwell (malwcal) 2007-04-03 03:04:41

I have a samsung A701 phone.  When I do cell search I see my phone but it says:
Address           Name                     Usable Type    Port
XX:XX:XX:XX:XX:XX myphone                  No     Headset 0

What am I missing?  I have paired the phone with the computer, and my phone does work with by bluetooth headset.  Any advice?

from what I can tell my phone does support the required profile.
sdptool browse
Inquiring ...
Browsing 00:18:AF:33:EE:D9 ...
Service RecHandle: 0x10000
Service Class ID List:
 "PnP Information" (0x1200)

Service Name: HSP PS Audio Gateway
Service RecHandle: 0x10001
Service Class ID List:
 "Headset Audio Gateway" (0x1112)
 "Generic Audio" (0x1203)
Protocol Descriptor List:
 "L2CAP" (0x0100)
 "RFCOMM" (0x0003)
   Channel: 1
Profile Descriptor List:
 "Headset" (0x1108)
   Version: 0x0100

Service Name: HFP PS Audio Gateway
Service RecHandle: 0x10002
Service Class ID List:
 "Handfree Audio Gateway" (0x111f)
 "Generic Audio" (0x1203)
Protocol Descriptor List:
 "L2CAP" (0x0100)
 "RFCOMM" (0x0003)
   Channel: 2
Profile Descriptor List:
 "Handsfree" (0x111e)
   Version: 0x0105

Service Name: Dialup Networking
Service RecHandle: 0x10003
Service Class ID List:
 "Dialup Networking" (0x1103)
Protocol Descriptor List:
 "L2CAP" (0x0100)
 "RFCOMM" (0x0003)
   Channel: 3
Profile Descriptor List:
 "Dialup Networking" (0x1103)
   Version: 0x0100

Service Name: Serial Server
Service RecHandle: 0x10004
Service Class ID List:
 "Serial Port" (0x1101)
Protocol Descriptor List:
 "L2CAP" (0x0100)
 "RFCOMM" (0x0003)
   Channel: 4
Profile Descriptor List:
 "Serial Port" (0x1101)
   Version: 0x0100

Service Name: Object Exchange
Service RecHandle: 0x10005
Service Class ID List:
 "OBEX Object Push" (0x1105)
Protocol Descriptor List:
 "L2CAP" (0x0100)
 "RFCOMM" (0x0003)
   Channel: 5
 "OBEX" (0x0008)
Profile Descriptor List:
 "OBEX Object Push" (0x1105)
   Version: 0x0100

Service Name: File Transfer
Service RecHandle: 0x10006
Service Class ID List:
 "OBEX File Transfer" (0x1106)
Protocol Descriptor List:
 "L2CAP" (0x0100)
 "RFCOMM" (0x0003)
   Channel: 6
 "OBEX" (0x0008)
Profile Descriptor List:
 "OBEX File Transfer" (0x1106)
   Version: 0x0100

Service Name: PBAP PCE
Service RecHandle: 0x10007
Service Class ID List:
 "Phonebook Access - PCE" (0x112e)
Profile Descriptor List:
 "Phonebook Access - PCE" (0x112e)
   Version: 0x0100

Service Name: Advanced Audio source
Service RecHandle: 0x10008
Service Class ID List:
 "Audio Source" (0x110a)
Protocol Descriptor List:
 "L2CAP" (0x0100)
   PSM: 25
 "AVDTP" (0x0019)
   uint16: 0x100
Profile Descriptor List:
 "Advanced Audio" (0x110d)
   Version: 0x0100

Service RecHandle: 0x10009
Service Class ID List:
 "AV Remote Target" (0x110c)
Protocol Descriptor List:
 "L2CAP" (0x0100)
   PSM: 23
 "AVCTP" (0x0017)
   uint16: 0x100
Profile Descriptor List:
 "AV Remote" (0x110e)
   Version: 0x0100
The HFP PS Audio Gateway with "Handfree Audio Gateway" (0x111f)
would seem to be what the code is looking for.

I am running patch 19 and asterisk 1.4.2.

narrowing down my problem.  With debugging on:
cell search
Address           Name                           Usable Type    Port
00:18:AF:33:EE:D9 Mal's SGH-A701                 No     Headset 0
[Apr  3 22:25:41] DEBUG[5212]: chan_cellphone.c:952 sdp_search: sdp_connect() failed on device 00:18:AF:33:EE:D9.
[Apr  3 22:25:41] DEBUG[5212]: chan_cellphone.c:952 sdp_search: sdp_connect() failed on device 00:18:AF:33:EE:D9.

By: Zden (mhz) 2007-04-03 03:41:45

I'm still trying to get the one way audio sound fixed.
Once I was able to get it working perfectly both ways on my SE k800i, clear sound, both directions.
I've tried with three different USB Bluetooth dongles , one is built in. Two of them have one way sound and when scanning cell search they show that the phones are not usable. One of them works great and shows correct ports and usability in cell search. It is a cambridge silicon radio chipset.
My system is Debian Etch 4.0/testing on a HP/Compaq nw8240 Notebook. The built in bluetooth has the one way audio problem also.
My bluez-utils 3.7-1.
I'm attaching the lsusb spects of the three dongles and the output of the cell search with the one way audio ones.
Also I confirm that SE k800i is working fine with the non problematic dongle.

By: Dave Bowerman (dbowerman) 2007-04-03 05:05:38


Could you post (as an attachment) here the console output of the call during which you have one way audio, right from when the phone connects thru to the end of the call.

make sure you have console DEBUG output enabled.

By: jmls (jmls) 2007-04-03 05:10:21

how many phones can a bluetooth adapter handle at the same time ? Has anyone been able to test the sms send functions  (is there a limit on the number of messages that can be sent, are they queued for sending etc)

Thanks ! I hope to be in a position to test this with 1.4 very soon

By: Dave Bowerman (dbowerman) 2007-04-04 02:47:21


* In theory 7 per adaptor. In practice over USB, not sure. It will totally depend on bluetooth hardware, protocol stack version etc. The most I have ever tried (with calls) is two. Additionally, chan_cellphone will only deal with one adaptor (the 1st one it finds) in its current form. There is no reason why this cant be changed though.

* SMS sending works fine, at least on the devices ive tested on. Mainly Nokia 6230i. There is no limit (other than one your provider may impose on SMS sending). SMS's are not queued by Asterisk, each is sent as requested via the Dialplan function. This doesnt work like app_sms where they are 'queued' on disk first.

By: Malcolm Caldwell (malwcal) 2007-04-05 00:18:09

Ok, by putting my bdaddr into /etc/asterisk/cellphone.conf and using the channel reported by sdptool I have now been able to connect my phone to asterisk.

My first attempt at a call resulted in a segmentation fault.  So I ran asterisk under gdb and tried again.  This time it worked, but there was one way audio.  Attached is the log with debugging.

File is malwcal-a701-log.txt

By: jishi (jishi) 2007-04-05 22:56:11

Tested with BenQ-Siemens S68 and chan_cellphone-16.
Works fine, but the sound quality poor.
Fresh chan_cellphone will check later

By: Malcolm Caldwell (malwcal) 2007-04-06 23:45:04

chan_cellphone-19-1.4.2.patch.gz segfaults if you type the command "cell rfcomm" (ie without any arguments)

By: Dave Bowerman (dbowerman) 2007-04-07 04:03:45


It looks to me that your bluetooth voice setting is not set correctly. Your A701 is reporting an MTU of 16, it should be 64. The setting should be 0x60 meaning straight PCM audio.

have a play with 'hciconfig hci0 voice' on your machine. you have 1-way audio because reads on the sco socket are failing.

chan_cellphone.c:1546 do_sco_listen: Incoming Audio Connection from device 00:18:AF:33:EE:D9 MTU is 16

chan_cellphone.c:640 cel_read: cel_read() read error 107.

By: Fabiano Heringer (fabianoheringer) 2007-04-07 16:24:23

Hi, I installed the cellphone successfuly in * 1.4.2 on Slackware 11 and kernel 2.6.18, I got make call and receive with sucess, but I have a problem:

I call once, this call work great (good audio, etc)
I hungup the call normally (no erros on asterisk and cellphone, an nokia 6111)

But when a try to make the same call, doesn?t work...asterisk hangs and I need to kill manualy the process and start again, after kill I can make the call again, but if a tried than more once happens the same problem.


By: Dave Bowerman (dbowerman) 2007-04-08 03:47:22


could you attach the console debug output right from when your cellphone connects thru to the end of the call.


By: Jeff Hansen (jhansen) 2007-04-12 00:45:30

It's kinda almost working perfectly here, using a recent IOGear Bluetooth dongle (based on the BCM2045 chip), and a SLVR L7 cell phone.  I had to add my USB IDs to the list of devices that have the HCI_WRONG_SCO_MTU bug in drivers/bluetooth/hci_usb.c

Sometimes the audio passed from the other end (coming in through my cell phone, then passed on to my VOIP gateway) sounds perfect.  However, most of the time the audio sounds like a lot of loud static (it's almost as if the amplifier of the phone is WAY too high).  I think it's an issue with my phone, not by dongle, since I've tried an Actiontec dongle as well; same problem :(.  The audio going the other way (from my VOIP gateway through the cell phone to the other end) works perfectly every time.

[update] Just found out that it's a problem in the way that Asterisk is encoding the PCM data from my phone into ulaw/alaw.  I can write the SCO data received from my phone directly to a file, play it back, and it sounds great.  But then when I sniff the RTP stream to my SIP phone and play that back, it's just a bunch of static.  I would guess that it's just a problem with chan_bluetooth inserting the PCM data into the channel misaligned.

[update] It looks like there may be some corruption or incorrect setup going on.  When I use a static char array to record my data (like chan_alsa.c does), instead of using pvt->fr.data, the calls work perfectly every time; no static.  Hopefully I can find the cause of the corruption soon.

[update] I found the source of the corruption !  The static char[] type variable was being used in the code as if it were a normal char * pointer (in fr.type when the frame is being initialized), which is a no-no.  I changed everything to #define strings, so that gcc will take care of them.

By: Dave Bowerman (dbowerman) 2007-04-13 01:37:15


Thanks, ill merge this into the mainline patch.

By: Joerg Bliesener (jbliesener) 2007-04-13 17:53:39

jhansen's patch resolved the distorted audio issue - at least with my phone. THANKS A LOT!

I do have some issues remaining:

- After hanging up a received call on my T610, chan_cellphone sometimes remains in the "BUSY" state, not permitting other calls. Unloading chan_cellphone.so in this state hangs asterisk. Task has to be killed manually. Call state handling would help. How can we achieve this?

- Still no SMS with T610. Checked the startup dialog:
rfcomm_write() (T610) [AT+CNMI=2,1,0,1,0
rfcomm_read() (T610) [ERROR]

Downloaded Sony's developer's manual at http://developer.sonyericsson.com/getDocument.do?docId=65054. Found another good thread about SMSs is http://www.esato.com/board/viewtopic.php?topic=88354.

It turned out that my version of the T610 does not support SMS status routing:

+CNMI: (2),(0,1,3),(0,2),(0),(0)

So, the init code should be AT+CNMI=2,1,0,0,0

I suggest sending this code if the original init code fails. Or, even better, check the cellphones capabilites and mount the init string accordingly.

[update] Did a test implementation. Now it SAYS that it will send SMSs, but still doesn't. The problem is the Text mode. Although the T610 accepts AT+CMGF=1 (contrary to it's own specification), the common advice I found on the net is to enable PDU mode (AT+CMGF=0), which requires an additional level of de/encoding. However, it's safer and offers more options than text mode, as it allows international character transmission. Furthermore, AT+CMGR does not work (returns "ERROR") and leaves chan_cellphone in state CEL_STATE_INSMS...

Anyone who has a UTF-8 <-> PDU en/decoder?

By: Dave Bowerman (dbowerman) 2007-04-13 20:53:24

New patch available :- chan_cellphone-20.patch SVN/Trunk Rev 61660

* Note you need trunk rev 61660 or greater as some changes have been made to the channel driver api

* Includes changes suggested by jhansen
* Fixes for T610 busy issue.

Could those with one way audio test this please and post some feedback.

By: Zden (mhz) 2007-04-14 11:49:05

I just tried patch 20. The static is gone, which means its working well. Outgoing calls sound somewhat clear than incoming. Incoming call have outgoing audio rather low and not so clear. Its like the gain is low. I'm not sure why this is, but generally both are working fine.

One way audio in my case is still a problem with some bluetooth dongles that report strange MTUs. Even setting them manually to correct values like sco mtu 68:8 (which works perfect on one of the dongles) does not make a difference with these dongles. I take it this issue is really not chan_cellphone related but is in the bluetooth stack and drivers for the other dongles. Any ideas on this one?
Thanks and good work. This is really progressing.

By: Jeff Hansen (jhansen) 2007-04-14 14:02:00

You could try applying the bluetooth SCO fixes maintained by the bluetooth-alsa group:

cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sourceforge.net:/cvsroot/bluetooth-alsa login
cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sourceforge.net:/cvsroot/bluetooth-alsa co plugz

There's a patch in there that may help with SCO-related bugs.  They didn't really affect me, since everything works anyway, but they'll probably go into the main line at some point.

By: Dave Bowerman (dbowerman) 2007-04-14 20:24:46

New patch available :- chan_cellphone-21.patch SVN/Trunk Rev 61661

* Finally got to the bottom of the rare random segfault issue on low powered Asterisk boxes (VIA's etc)

* chan_cellphone now registers the Headset service with the SDP Daemon. This allows phones like the IMate Jasjam and Nokia 66x0 etc to work. (Ive tested the Jasjam but not the Nokia as I dont have one)

By: Fabiano Heringer (fabianoheringer) 2007-04-16 08:16:03

hi, anybody can give any help about the note 0062278?

Thank you...

By: heavenx (heavenx) 2007-04-20 07:45:39

I'm using:
-Debian Etch
-The last Asterisk svn trunk
-bluez-utils Version: 3.7-1
-SonyEricsson K750i

Whene i start making an outbound call from a SIP client, my cell phone makes the call and just after got disconnected from asterisk then i got a segmentation Error and i dont know what is the problem.
My debug infos here K750i_segmentation_error.txt

By: Michael Kamleitner (subnet) 2007-04-26 09:24:13

first of all: thx to all contributers, chan_cellphone so far looks great!

now my setup:

Asterisk SVN-trunk-r61767M
Nokia 6630 & Nokia N73 (both show same problems)

setup in general went smooth - Asterisk connects perfectly to the phone, incoming calls are handeld nice as well. what I'm trying to do is building a voicebox-only system, with an extension.conf like this:

exten => s,1,Answer ented XXX
exten => s,n,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n(restart),BackGround(intro)
exten => s,n,Read(Enter,4,4)
exten => s,n,Voicemail(${Enter},u)

the Read-command lets the user enter a max. 4digit extension and connects the user to the according voicemail-box. everything is working nice when users punch in the extension 'slowly', i.e. with a certain period (about 0.5sec) of time/silence between the single digits. however, when users type in 4 digits quickly, asterisk doesn't seem to receive all digits. f.e. I enter '1055', but on the console asterisk gets only:

[Apr 26 16:56:59] DEBUG[6048]: chan_cellphone.c:638 cel_read: DTMF digit 1 detected.
[Apr 26 16:56:59] DEBUG[6048]: chan_cellphone.c:638 cel_read: DTMF digit 0 detected.
[Apr 26 16:56:59] DEBUG[6048]: chan_cellphone.c:638 cel_read: DTMF digit 5 detected.

the fourth digit has somehow disappeard. has somebody got an idea what could be the reason for this behaviour? I experienced same problems with a nokia 6630 and a nokia n73.

(attached you find the full debug-output, however it's the lines _missing_ in the output which are the root of the problem ;) )

thx in advance...

By: Sabin (binsa) 2007-04-27 02:56:19

Please, find in the chan_cellphone.c row pvt->skip_frames=200 and try to decrease the value, but too low value may cause doube digit detection.
Please feedback about results.

By: Michael Kamleitner (subnet) 2007-04-27 07:56:26

thx binsa, tried 180 and 150 at first without any changes notably. now I'm runnign with skip_frames=50 and so far everything seems to work! thx!! :)

By: Dave Bowerman (dbowerman) 2007-04-27 19:47:24

Is anyone else having trouble detecting DTMF?

It seems like we need to make this configurable per phone.
If this is the case, post some feedback and I'll add something to cellphone.conf so you can tune the skip time per phone.

By: heavenx (heavenx) 2007-04-27 20:08:40

Can someone answer my last question please :)

By: Dave Bowerman (dbowerman) 2007-04-27 20:15:02


I suspect it is your bluetooth adaptor.
Your incoming sco connection is reporting an MTU size of 48

[Apr 20 16:30:48] DEBUG[3411]: chan_cellphone.c:1641 do_sco_listen: Incoming Audio Connection from device 00:16:B8:B3:FC:AA MTU is 48

Normally this is 64.
Can you try another different BT adaptor?
Also does it happen both inbound and outbound?

By: Dave Bowerman (dbowerman) 2007-04-27 21:43:27

New patch available :- chan_cellphone-22.patch SVN/Trunk Rev 62262

* Added configurable DTMF detection so you can debounce per phone.


alter the dtmfskip value to suit your phone. Default is 200
the bigger the number the more chance of missed digits.
the smaller the number the more chance of duplicate digits.

By: Julian J. M. (julianjm) 2007-04-28 05:41:42

I found a little problem with callerid handling. When receiving a call with restricted callerid (anonymous), when my phone rings, I see the callerid from previous call (non-anonymous).

I'm using patch 21, Centos 5, and a Blackberry 8700.

Can anyone confirm this?


By: Sabin (binsa) 2007-04-28 06:29:49

Helllo dbowerman, chan_cellphone in multichannel mode performs very bad. The reason is that phone monitor threads uses the function select() to wait for response from rfcomm. This takes all BT dongle resources and other phones cell devices can't be monitored at this time. I tried to resolve this. The changes comments are in the source. You can download from http://thenetbg.net/asterisk/chan_cellphone.c

By: Michael Kamleitner (subnet) 2007-04-28 10:42:04

thx for the quick patch, dbowerman!

By: Luke McKee (lintelsystems) 2007-04-28 10:47:44

re: binsa patch.

I did a diff on the patch vs. the chan_cellphone.c taken from patch-21
Are these issues still outstanding in -22?

(i'll package this for feature gentoo soon)

By: Sabin (binsa) 2007-04-28 11:22:53

I still didn't tried with ver 22, but at first look I don't see changes in rfcomm functions

By: Dave Bowerman (dbowerman) 2007-04-28 18:07:19


when you say it 'performs bad' what do you mean? does it affect audio, or is it just control of the phones?

i have 2 phones and a headset connected to the same adaptor and it works fine for me.

By: heavenx (heavenx) 2007-04-28 18:42:58


Can you tel me please witch adapter are you using, so i can buy the same, or better if you can give me a link on ebay ...thx

By: Dave Bowerman (dbowerman) 2007-04-28 19:02:05


Its a noname brand

Bus 002 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

By: Matthias Fleischer (mafl) 2007-04-28 19:16:34


I also have strange problems running it with a K750i

Sometimes inbound works, sometimes outbound (more rarely).
So far I found absolutely no logic, it seems random.

But anyway... tnx for this very cool project!


By: pablo umanzor (pablou) 2007-04-29 00:41:54

hello I have nokia6230 with patch-21, the cellphone is well in the free and connected with asterisk (cell show device , soo ok), when I do a call of the asterisk using chan_cellphone from sip phone every okey (ring, dial, etc), but when the call is answered the sound is not listened in the phone called, the log in asterisk when it happens this:

call from **Unknown**


By: Sabin (binsa) 2007-04-29 01:17:42

dbowerman: I can't say nothing about audio, because if I try to connect two devices I have not stable rfcomm connection - when I try concurent calls, one allways disconnects without my changes. My USB port is ver. 1.1 - maybe this affects I/O.

By: spblinux (spblinux) 2007-04-30 09:56:53

patch 20,21,22... is for asterisk trunk and >=1.4.3, not for 1.4.0-1.4.2

To compile with asterisk <=1.4.2 edit chan_cellphone.c, lookup ast_channel_alloc(...):
 the sourcecode in trunk has got 4 additional arguments in this function
 which have to be removed in <=1.4.2:
-       chn = ast_channel_alloc(1, state, 0, 0, 0, 0, 0, 0, "CELL/%s-%04lx", pvt->id, ast_random() & 0xffff);
+       chn = ast_channel_alloc(1, state, 0, 0, "CELL/%s-%04lx", pvt->id, ast_random() & 0xffff);          

Not sure, if other changes required. At least **Unknown** disappears then.


edit: corrected which versions have older api; thanks @lintelsystems!

By: Luke McKee (lintelsystems) 2007-05-01 12:36:21

Nope I think the API has been updated in 1.4.4.

chan_cellphone.c: In function ?cel_new?:
chan_cellphone.c:758: warning: passing argument 7 of ?ast_channel_alloc? makes pointer from integer without a cast
chan_cellphone.c:758: error: too few arguments to function ?ast_channel_alloc?

Patch-22 compiles cleanly against 1.4.4. I'll test it soon :)


By: Juan Pablo (digitalcom) 2007-05-01 15:22:52

Dear dbowerman: Would you mind posting last patch file for 1.4.4 version?

Great job! I love this patch!

Many thanks in advance and congratulations.

By: Dave Bowerman (dbowerman) 2007-05-02 01:19:50

chan_cellphone-22 for Asterisk release 1.4.4 available.

By: spblinux (spblinux) 2007-05-02 11:52:00

Overrun on sco_out_buf detected:

observations with chan_cellphone patch 22 on asterisk 1.4.2 mipsel (ar7 linux-2.6.13) and on asterisk 1.4.4 x86 (linux 2.6.20)
connection from sip phone to bluetooth headset (and, at least seen once, with cellphone):
when connected chan_cellphone drops frames:
debug message: Overrun on sco_out_buf detected

If the size of sco_out_buf is increased to 10 asterisk frames plus 16 bytes (=496 bytes) the overrun message disappears because asterisk sends at max 10 frames.
-       char sco_out_buf[352];
+       char sco_out_buf[496];  // was 352
With the bigger buffer asterisk itself handles the queuing of the frames. - Of course chan_cellphone runs also with the smaller buffer.

On the ar7 platform I have no audio yet which seems to be a linux kernel module issue and not a chan_cellphone issue (asterisk debug messages on both platforms are very similar). If someone has a hint for mipsel I would be glad. However I am bound to kernel version 2.6.13 because of proprietary drivers (avm fritz!box).

a) on x86 sound is noisy with buffer size 352 bytes and this noise disappears with buffer 492.
b) chan_cellphone patch 22 asterisk 1.4.4 on x86 with linux works (using same bluetooth dongle and same headset as with mipsel); so the bug on mipsel might be some mipsel alignment issue.

By: Malcolm Caldwell (malwcal) 2007-05-02 21:58:51

Trying patch 22 for 1.4.4 with a nokia 6233 chan_celphone fails to connect:

See file malwcal-nokia-6233.log

Issues seems to be with AT+CNMI=2,1,0,1,0 which the nokia responds to with ERROR

By: Juan Pablo (digitalcom) 2007-05-03 12:59:08

Dear friends:

I?m trying to make two concurrent calls. I make the firt call, but when I try to make the second the second cell phone disconects immediately when the other end answers. I?m using Asterisk 1.4.4 with chan_cellphone-22-1.4.4.patch.gz. This is my dongle hci0:   Type: USB
       BD Address: 00:09:DD:50:2A:C1 ACL MTU: 384:8 SCO MTU: 64:8
       HCI Ver: 2.0 (0x3) HCI Rev: 0x7a6 LMP Ver: 2.0 (0x3) LMP Subver: 0x7a6
       Manufacturer: Cambridge Silicon Radio (10)
The debug is

[May  3 14:32:55] DEBUG[3272]: chan_cellphone.c:1120 do_monitor_phone: rfcomm_read() (GSM2) [+CIEV: 5,4]
[May  3 14:32:56] DEBUG[3272]: chan_cellphone.c:1120 do_monitor_phone: rfcomm_read() (GSM2) [+CIEV: 5,5]
[May  3 14:33:02] DEBUG[3272]: chan_cellphone.c:1120 do_monitor_phone: rfcomm_read() (GSM2) [+CIEV: 6,3]
   -- CELL/GSM2-6c98 is ringing
[May  3 14:33:02] DEBUG[3589]: rtp.c:1468 ast_rtp_early_bridge: Channel 'IAX2/voip-1' has no RTP, not doing anything
[May  3 14:33:02] DEBUG[3252]: chan_cellphone.c:1635 do_sco_listen: Incoming Audio Connection from device 00:1A:1B:E1:86:61 MTU is 64
[May  3 14:33:12] DEBUG[3272]: chan_cellphone.c:1120 do_monitor_phone: rfcomm_read() (GSM2) [D: VOICE]
   -- Bluetooth Device GSM2 has disconnected, reason (104).
[May  3 14:33:15] DEBUG[3277]: chan_cellphone.c:1120 do_monitor_phone: rfcomm_read() (GSM1) [+CIEV: 5,4]
[May  3 14:33:16] DEBUG[3277]: chan_cellphone.c:1120 do_monitor_phone: rfcomm_read() (GSM1) [+CIEV: 5,5]
[May  3 14:33:18] DEBUG[3277]: chan_cellphone.c:1120 do_monitor_phone: rfcomm_read() (GSM1) [+CIEV: 5,4]

Many thanks in advance.

By: Sabin (binsa) 2007-05-04 00:27:01

I've already explained this issue in note 0062820, you can try with my changes
and share the results, the problem is that the file is for trunk version.

By: Juan Pablo (digitalcom) 2007-05-04 05:41:45

binsa: Thanks for your comment. I?ve tried with your modifications and I couldn?t tested because Asterisk crashed on the first call. The debug output was a lot of "[May  4 07:35:19] DEBUG[15260]: chan_cellphone.c:686 cel_write: Overrun on sco_out_buf detected." messages, and then ended with
"[May  4 07:35:19] DEBUG[15260]: chan_cellphone.c:645 cel_read: cel_read() read error 103.
   -- Bluetooth Device GSM1 has disconnected, reason (103).
[May  4 07:35:19] DEBUG[3569]: chan_cellphone.c:814 rfcomm_connect: connect() failed (113)"
And the computer got stucked. Overrun on sco_out_buf was already known, but on your patch I believe was big enough (char sco_out_buf[4800]). So I can?t find the problem.
Thanks again to all.

By: Fabiano Heringer (fabianoheringer) 2007-05-07 10:39:24

Hi, I am trying to apply the patch (22) , but I receive this:

patching file build_tools/menuselect-deps.in
patching file channels/chan_cellphone.c
patching file configure.ac
Hunk #1 FAILED at 6.
Hunk #2 FAILED at 183.
Hunk #3 succeeded at 352 with fuzz 1 (offset -4 lines).
2 out of 3 hunks FAILED -- saving rejects to file configure.ac.rej
patching file doc/cellphone.txt
patching file makeopts.in
Hunk #1 succeeded at 64 (offset -1 lines).
patching file configs/cellphone.conf.sample

I?m trying to patch the version 1.4.4 of Asterisk...

By: Dave Bowerman (dbowerman) 2007-05-10 05:22:33

im working on fixing the multiple phone thing now, while im at it is anyone interested in multiple BT adapters?

By: Sabin (binsa) 2007-05-10 08:56:02

Yes, I'm very interested multiply phones. I thought about multiply BT devices,
it is good idea. Thank you.

By: Juan Pablo (digitalcom) 2007-05-10 08:59:50

  I'm very interested in multiple phones and also multiples bluetooth dongles. Many thanks for all.!

By: Jason Parker (jparker) 2007-05-10 10:59:32

The following users have uploaded the following patches/code.  I need each of you to please verify your disclaimer status with Digium, and it would be good if somebody (dbowerman?) could verify whether any of this code is in the "main" patch.

jhansen - cellphone-corrupt-fix.patch
binsa - chan_cellphone.c
oys_ - chan_cellphone-5-ericsson.patch
dbowerman - umm...a bunch...

I plan on committing this to trunk in asterisk-addons in the very near future, so the sooner that gets done, the sooner this great contribution can be added.

By: Jeff Hansen (jhansen) 2007-05-10 11:07:18

As far as I know, my patch is included in dbowerman's main patch.  I worked on the bug for my own personal projects.  I was just having a problem with the patch, so I found the cause and fixed it.

By: Dave Bowerman (dbowerman) 2007-05-11 20:13:10


re 0063307

My disclaimer was posted to digium around may 2006 when I worked on bug 3596 (Australian caller-id detection).

jhansen's patch was 3 or 4 lines, I made the changes suggested rather than patch my code.

oys_'s patch commented out some logic to make his sony-erricson work. This issued has since been fixed, not using that patch.

binsa's patch addresses an outstanding issue which I have not yet resolved. I have discovered there is more to this issue and will probably fix it without applying his patch to the main one.

Is there a reason why this is being merged into -addons and not asterisk?. I havent seen any discussion on the list about it...

By: Mark Monnin (wrmem) 2007-05-14 08:04:24

I know it's not a democracy, so votes don't count, but I'd like to add my "vote" for adding this to mainline asterisk instead of addons too.  

Previous bluetooth implementations haven't made it into asterisk and then experienced 'bit rot' issues.  Putting this in mainline would avoid some issues such as if there are incompatible changes made to channel.c, and would encourage even more development.  This is would be a nice addition to mainline.

By: jabroni (jabroni) 2007-05-14 17:40:27

Was wondering if there will be a backport of this drivers for the Asterisk 1.2 branch, since I guess there are people wanting to try out this channel but cant since it would require a 1.4 upgrade, and that would implicate some compatibility changes on current PBX deploys (as some of us uses freepbx, and the current release doesnt support 1.4 yet). I tried a binary posted on another page (he just changed some headers off this drivers in order to make it compile for 1.2) but I couldnt get it to work. I was just wanted to know if there is any 1.2 support planned on the roadmap of this great channel driver.

By: Alex Murray (alexmurray) 2007-05-14 23:41:53

I am having the previosly mentioned problem of one-way audio for INCOMING calls - outgoing calls from my SIP phone work fine with two-way audio, but with incoming calls I only get audio from the SIP phone out to the caller, and I hear nothing on the SIP phone itself.

Attached is a debug log - if anyone could give me some advice that'd be great.

I am running Ubuntu Feisty, with Asterisk 1.4.4, cellphone-22 and am using a DLink DBT-120 Usb bluetooth dongle.

I have been testing with both a Nokia 6230 and a Sony Ericcson k700i and both have this problem.

By: Alex Murray (alexmurray) 2007-05-15 00:01:22

Looks like the attachment didn't work - trying again...

Also, I would love to see support for multiple BT adapters, as I plan to run with atleast 20 cellphones for the one asterisk box, and so will obviously need to use multiple adapters.

By: Jason Parker (jparker) 2007-05-16 18:43:14

dbowerman, the reason this has to go into asterisk-addons, is due to libbluetooth being GPL.  The file asterisk/branches/1.4/doc/mysql.txt explains the reasoning behind this (it's for the mysql client libraries specifically, but it applies to all GPL libraries that we link against).

As for the disclaimers, the patch from oys_ has been removed (per dbowerman), the patch from jhansen has been removed/re-written by me (it's now done the same way that SIP/IAX2 do it), and after re-reading all of the comments here, I found that binsa already has a disclaimer on file with Digium.

I've renamed the channel driver to chan_mobile - as that seems to make the most sense now.  That means that anybody currently using this patch is going to have to do a few things.  1) The config filename must be changed to mobile.conf from cellphone.conf.  2) Before installing from asterisk-addons, you will need to remove /usr/lib/asterisk/modules/chan_cellphone.so  3) CLI/config syntax changes - anywhere you used CELL, you would now use Mobile - ie; Dial(Mobile/fred) instead of Dial(CELL/fred) or "mobile search" instead of "cell search".  4) I can't think of anymore - but I'm sure there are some.

I'm going to attempt to commit this to asterisk-addons trunk tonight or more likely tomorrow.  Once that's done, I'm going to close this bug, and ask that all issues be posted to new bug reports, so that they can be tracked.  Per the bug guidelines, please do not open reports for configuration help or similar - dbowerman spent time on the documentation - please read it thoroughly (doc/chan_mobile.txt).

By: Jason Parker (jparker) 2007-05-17 10:50:03

Added to svn trunk of asterisk-addons in revision 384.

Thanks to David Bowerman for his great work with this.