A few things, mostly technical notes...

Sunday, December 31, 2017

chan_mobile on raspberry pi3, Asterisk 15.1.5


I wanted to route calls from my Asterisk 15.1.5 on my pi3 over Bluetooth from my cellphone.

Wasted a few days trying to get chan_mobile working. Followed this guide and this post. I could get the phones to dial out etc, but there was something missing - audio! 

I could not hear audio in either direction - dialing in our dialing out.

Turns out the pi3's Bluetooth controller is useless in this context, since it seems to use eSCO (Extended Synchronous Connection Oriented) link. There are no SCO packets passed during the phone call. These are the two posts that gave me the clue, although on the 3rd day.

I could not get eSCO disabled either:

root@jungle:~# modinfo bluetooth -p
disable_esco:Disable eSCO connection creation (bool)
disable_ertm:Disable enhanced retransmission mode (bool)
root@jungle:~# 

Luckily I had an old usb bluetooth adapter lying around in my spares collection:

root@jungle:~# lsusb |grep -i blue
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
root@jungle:~#

I am happy to report this adapter ended up working perfectly for me.

jungle*CLI> mobile show devices
ID              Address           Group Adapter         Connected State      SMS
nexus5x         XX:YY:ZZ:AA:BB:CC 1     dlink           Yes       Free       No 
jungle*CLI>; 


You may also find this post useful when dealing with multiple BT adapters, and if one of those require a pairing challenge.

Free Tip:

Did you know, 19252590082 is a publicly available Echo Test Number?

Saturday, December 30, 2017

Compiling g.729 on raspberry pi3 for asterisk 15.1.5

saving my bash history so it may be useful for others. Below is how I configured g729 on my pi3:
  601  mkdir ~/somefolder; cd ~/somefolder
  602  git clone git://git.linphone.org/bcg729.git
  603  cd bcg729/
  604  ./configure --libdir=/lib
  605  make
  606  sudo make install
  607  cd ..; wget http://asterisk.hosting.lv/src/asterisk-g72x-1.2.tar.bz2
  608  ls -ltr
  609  tar -xvjf asterisk-g72x-1.4.2.tar.bz2
  610  cd asterisk-g72x-1.4.2/; ./autogen.sh
  614  ./configure CFLAGS='-march=native'  --with-bcg729  --with-asterisk-includes=/usr/include
  615  make
  616  sudo make install

Added allow=g729 into my sip.conf, restarted asterisk .
In action:

jungle*CLI> core show version
Asterisk 15.1.5 built by root @ jungle on a armv7l running Linux on 2017-12-29 21:50:04 UTC
       > Saved useragent "LinphoneAndroid/3.3.1 (belle-sip/1.6.3)" for peer 300_test
jungle*CLI> core show translation recalc 10
         Recalculating Codec Translation (number of sample seconds: 10)

         Translation times between formats (in microseconds) for one second of data
          Source Format (Rows) Destination Format (Columns)

           ulaw  alaw   gsm  g726 g726aal2 adpcm  slin  slin  slin  slin  slin  slin  slin  slin  slin lpc10  g729 speex speex speex  ilbc  g722 testlaw
     ulaw     -  9150 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
     alaw  9150     - 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
      gsm 15000 15000     - 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
     g726 15000 15000 15000     -    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
 g726aal2 15000 15000 15000 15000        - 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
    adpcm 15000 15000 15000 15000    15000     -  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
     slin  6000  6000  6000  6000     6000  6000     -  8000  8000  8000  8000  8000  8000  8000  8000  6000  6000  6000 14000 14000  6000  8250    6000
     slin 14500 14500 14500 14500    14500 14500  8500     -  8000  8000  8000  8000  8000  8000  8000 14500 14500 14500 14000 14000 14500 14000   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500     -  8000  8000  8000  8000  8000  8000 14500 14500 14500  6000 14000 14500  6000   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500     -  8000  8000  8000  8000  8000 14500 14500 14500 14500 14000 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500     -  8000  8000  8000  8000 14500 14500 14500 14500  6000 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500  8500     -  8000  8000  8000 14500 14500 14500 14500 14500 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500  8500  8500     -  8000  8000 14500 14500 14500 14500 14500 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500  8500  8500  8500     -  8000 14500 14500 14500 14500 14500 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500  8500  8500  8500  8500     - 14500 14500 14500 14500 14500 14500 14500   14500
    lpc10 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000     - 15000 15000 23000 23000 15000 17250   15000
     g729 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000     - 15000 23000 23000 15000 17250   15000
    speex 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000     - 23000 23000 15000 17250   15000
    speex 23500 23500 23500 23500    23500 23500 17500 17500  9000 17000 17000 17000 17000 17000 17000 23500 23500 23500     - 23000 23500 15000   23500
    speex 23500 23500 23500 23500    23500 23500 17500 17500 17500 17500  9000 17000 17000 17000 17000 23500 23500 23500 23500     - 23500 23500   23500
     ilbc 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000     - 17250   15000
     g722 15600 15600 15600 15600    15600 15600  9600 17500  9000 17000 17000 17000 17000 17000 17000 15600 15600 15600 15000 23000 15600     -   15600
  testlaw 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250       -
jungle*CLI> 


Followers


Creative Commons License
This work is licensed under a Creative Commons License.