Archive for March, 2008

chan_mobile on ubuntu

Thursday, March 20th, 2008

here is how i got chan_mobile to work with asterisk 1.4 trunk on ubuntu. i used a acer 600bt bluetooth dongle together with a HTC S710 windows mobile smartphone. it seemed to also work with the msi bluetooth 2.0 dongle. and also with a nokia e70 but the main part of my experiments where made with the first configuration. none of the mobilephones supported sms though.

the howto is copied together from a tutorial at ip-phone-forum.de

i must confess, that sometimes my phone or asterisk crashed and i had to restart either of them in order to be able to place another call again. so currently its really more a proof of concept.. maybe it’ll be more stable once i have a simpler phone which is noted to be fully functional on the compatibility list

first install bluetooth stuff:

apt-get install bluetooth bluez-utils libbluetooth2 libbluetooth2-dev

now install the dependencies for asterisk:

aptitude install gcc libc6 m4 openssl zlibc libkrb5-dev libncurses5 libncurses5-dev libssl-dev zlib1g-dev make wget g++

edit /etc/bluetooth/hcid.conf


options {
  autoinit yes;
  security auto;

  pairing multi;
  passkey "1234";
}

device {
  name "btstick";
  class 0x3e0100;
  iscan enable; pscan enable;
  lm master;
  lp rswitch,hold,sniff,park;
}

now restart bluetooth and start with the installation of asterisk trunk

/etc/init.d/bluetooth restart

cd /usr/src
apt-get install subversion
svn co http://svn.digium.com/svn/asterisk/trunk asterisk-trunk
cd asterisk-trunk
./configure
make && make install

cd ..
svn co http://svn.digium.com/svn/asterisk-addons/trunk asterisk-addons-trunk
cd asterisk-addons-trunk
./configure
make menuselect
==> simply enter "x" to close the menuselect application again
make 
make install
make samples

no lets configure the bluetooth stuff


asterisk-debian:/etc/asterisk# hcitool dev
    Devices:
    hci0 00:02:72:C9:6E:33

now edit /etc/asterisk/mobile.conf
and add the device address

add your adapter to the list:


    [adapter]
    id=bluekosa
    address=00:02:72:C9:6E:33

now start or restart asterisk (don’t reload, you need to restart)


CLI> mobile search
 mobile search 
Address           Name                           Usable Type    Port
00:17:83:33:63:24 XPA v1415                      Yes    Phone   3

now take these results and add them to your /etc/asterisk/mobile.conf file


 [n70]
    address=00:17:4B:13:71:CC
    port=1
    context=incoming-mobile
    adapter=bluekosa
    group=1

now create the incoming-mobile context in extensions.conf

    [incoming-mobile]
    exten => s,1,Answer
    exten => s,n,Playback(demo-congrats)
    exten => s,n,Echo

and to dial out use:

exten => _0X.,1,Dial(Mobile/n70/${EXTEN:1})