Asterisk - the open source soft PBX (PPC)

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
Crystal package settings.png
This page is a user's work in progress page, not an article, and may be incomplete and/or unreliable. The current/final version of this article is, or will be, located at Asterisk - the open source soft PBX (PPC).
Nuvola apps important.png 

Your results may vary if you try to implement what you see here, specifically I'm not sure about all of the packages needed to get Asterisk to compile properly. And I have had some significant problems in getting bluetooth audio (SCO) to work properly to channel the calls from the cellphone to asterisk



The idea for this concept came from a bluetooth cordless cellphone extender that I saw at someone's house like this one: Bluetooth to Cordless Phone. Sometime later, I read about chan_mobile which is an Asterisk channel driver that allows you to use a bluetooth capable cell phone as an FXS channel. Asterisk will accept a ATA that you could "open" from VOIP phone service such as Vonage as an FXO channel.

Well that was enough to get me started, so I implemented this solution first on an Ubuntu box. I'm still working on getting it fully implemented on a PPC linkstation. Bluetooth audio (SCO) has been the sticking point, but I'm confident that kernel 2.6.28+ will be the answer.

This would allow you to use a Linkstation running Asterisk in order to turn a cellphone into a trunk for 1 or more SIP Phones or ATAs. Asterisk is pretty powerful and would allow you to integrate POTS/PSTN lines (with a FXO/FXS adapter like the SPA3102), a VOIP service (such as Vonage), and now a Cell Phone too!


This article assumes that you have installed FreeLink on PPC Box that has been U-booted. You also will need to upgrade to a 2.6.28+ Kernel, (the bluetooth SCO audio driver doesn't seem to work right otherwise).

In order to implement this on a ARM box you would need to cross compile asterisk, as it will not natively compile on this architecture. Your results may vary with MIPSel, but this article might be a good starting point: Asterisk - the open source soft PBX (MIPSel)

What you'll need

Kuro-box.jpg or HD-H(G).jpg A FreeLinked PowerPC Linkstation like a LS1, HG, or Kurobox. You will need to have the U-boot bootloader installed to load a 2.6.28+ Kernel with modules (which you'll have to make too).
Linksys pap2 01.jpg One or more Unlocked Analog telephony adapters or IP Phones. Something like the Linksys PAP2 is common. A softphone such as Zoiper! can be used as a test bed if you don't have a IP Phone/ATA lying around.
DBT-120.jpg A Bluetooth USB Dongle, preferably one with a Cambridge Silicon Radio Chipset (it works better with chan_mobile) The Dlink DBT-120 is listed by default in the chan_mobile configuration file.
Iphone.jpg A Bluetooth capable Cell Phone of course! Review the chan_mobile - page to see if your bluetooth dongle and bluetooth cellphone will work properly.

Install Asterisk

Install various pre-requisite libraries

 apt-get install make
 apt-get install gcc
 apt-get install g++
 apt-get install libc-dev
 apt-get install bison
 apt-get install ncurses-dev
 apt-get install libssl-dev
 apt-get install libnewt-dev
 apt-get install zlib1g-dev
 apt-get install initrd-tools
 apt-get install cvs
 apt-get install procps
 apt-get install doxygen
 apt-get install adduser  
 apt-get install libasound2
 apt-get install libc-client2007b  
 apt-get install libc6 
 apt-get install libcap2
 apt-get install libcurl3 
 apt-get install libgcc1 
 apt-get install libgsm1 
 apt-get install libncurses5
 apt-get install libnewt0.52 
 apt-get install libogg0  
 apt-get install libpopt0 
 apt-get install libpri1.0  
 apt-get install libradiusclient-ng2 
 apt-get install libsnmp15 
 apt-get install libspeex1 
 apt-get install libspeexdsp1  
 apt-get install libsqlite0 
 apt-get install libssl0.9.8
 apt-get install libstdc++6
 apt-get install libtonezone1  
 apt-get install libunwind7 
 apt-get install libvorbis0a  
 apt-get install libvorbisenc2 
 apt-get install libvpb0 
 apt-get install unixodbc  
 apt-get install zlib1g
 apt-get install bluetooth bluez-utils libbluetooth2 libbluetooth2-dev

Get Asterisk package

 tar xvzf asterisk-
 cd asterisk-

Complete Asterisk Installation


If you see asterisk symbol in the end, configuration is successful. Else, grep for “no” in config.log and try to install those missing libraries/utilities.

 make install
 make samples 
 make progdocs 

Install Asterisk Addons and chan_mobile

tar zxvf asterisk-addons-1.6.0.tar.gz
 cd /usr/src/asterisk/asterisk-addons-1.6.0
make menuselect 

Choose chan_mobile press x to exit


As root user

make install

Configure chan_mobile

Bluetooth settings and pairing

edit /etc/bluetooth/hcid.conf and replace the contents with:

options {
autoinit yes;
security auto;
pairing multi;
passkey "1234";
}# Default settings for HCI devices
device {
name "Asterisk PBX";
class 0x000100;
iscan enable; pscan enable;
lm accept;
lp rswitch,hold,sniff,park;

Restart bluetooth

/etc/init.d/bluetooth restart

Makre sure bluetooth works and get MAC address for bluetooth adapter

hcitool dev

You should see something like this:

hci0 00:16:38:39:44:88

Copy the hardware address from the output of the following command for the next step. (eg. xx:xx:xx:xx:xx:xx). Use this address for /etc/asterisk/mobile.conf

Pair your cellphone with your "asterisk box"

dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/hci0 org.bluez.Adapter.SetMode string:discoverable
  1. Grab your cell phone, turn Bluetooth on and search for devices.
  2. You should find your PBX as Asterisk PBX.
  3. Pair with a pin of 1234.
  4. Make your phone discoverable via Bluetooth.


hcitool scan 

You should see something like this:

hcitool scan
Scanning ...
00:1B:XX:XX:XX:XX Someones iPhone

If you see your phone above all is well and we can now search for your bluetooth devices using the CLI command 'mobile search'. Be patient with this command as it will take 8 - 10 seconds to do the discovery.

First start the asterisk console

asterisk –r

In the console type in the command mobile search

asterisk*CLI> mobile search 

This will return something like the following:

Address Name Usable Type Port
00:1B:XX:XX:XX:XX Someones iPhone Yes Phone 8
1 2 3 4 5
Address Name Usable Type Port
00:1B:XX:XX:XX:XX Someones iPhone Yes Phone 8

This is a list of all bluetooth devices seen and whether or not they are usable with chan_mobile.

  1. The Address field contains the 'bd address' of the device. This is like an ethernet mac address.
  2. The Name field is whatever is configured into the device as its name.
  3. The Usable field tells you whether or not the device supports the Bluetooth Handsfree Profile or Headset profile.
  4. The Type field tells you whether the device is usable as a Phone line (FXO) or a headset (FXS).
  5. The Port field is the number to put in the configuration file: /etc/asterisk/mobile.conf.

Configuration Files

To be done





Choose which device(s) you want to use and edit /etc/asterisk/mobile.conf, For a phone create a stanza like the one below and paste:

  1. The MAC address on the address line
  2. The port that was displayed during the mobile search.
  3. The 'id' of the device [bitinbrackets] can be anything you like, just make the unique.
interval=30		; Number of seconds between trying to connect to devices. 
; The following is a list of adapters we use.
; id must be unique and address is the bdaddr of the adapter from hciconfig.
; Each adapter may only have one device (headset or phone) connected at a time.
; Add an [adapter] entry for each adapter you have.
;forcemaster=yes	; attempt to force adapter into master mode. default is no.
;alignmentdetection=yes ; enable this if you sometimes get 'white noise' on asterisk side of the call
; its a bug in the bluetooth adapter firmware, enabling this will compensate for it.
; default is no.
; The following is a list of the devices we deal with.
; Every device listed below will be available for calls in and out of Asterisk. 
; Each device needs an adapter=xxxx entry which determines which bluetooth adapter is used.
; Use the CLI command 'mobile search' to discover devices.
; Use the CLI command 'mobile show devices' to see device status.
; To place a call out through a mobile phone use Dial(Mobile/[device]/NNN.....) or Dial(Mobile/gn/NNN......) in your dialplan.
; To call a headset use Dial(Mobile/[device]).
address=00:1B:XX:XX:XX:XX	; the address of the phone
port=8				; the rfcomm port number (from mobile search)
context=from-mobile		; dialplan context for incoming calls
adapter=blue			; adapter to use
group=1				; this phone is in channel group 1
;nocallsetup=yes		; set this only if your phone reports that it supports call progress notification, but does not do it. Motorola L6 for example.


This article was HEAVILY plagarized from the references below, but I figured I'd try to gather the information in one place. Unfortunately chan_mobile does not have great documentation, the best documentation for it seems to be at

  1. Asterisk on Debian 4.0
  2. Setup Asterisk 1.6 with DAHDI on Debian Etch
  3. chan_mobile -
  4. chan-mobile for Asterisk®
  5. HOWTO build and configure chan_mobile on Trixbox
Link.png This article is currently a stub. You can help this Wiki by expanding it

. This template will categorize articles that include it into Category:Stubs.