[How-To] Install Asterisk 11 and chan_dongle on Odroid C2

Just a quick How-To about installing Asterisk 11 and Chan_Dongle (GSM audio & SMS channel for Huawei USB dongles) on Odroid C2.

Chan_dongle project: https://www.google.it/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=2ahUKEwiTm8XgkeLdAhVISxoKHexcDuUQFjAAegQICRAB&url=https%3A%2F%2Fgithub.com%2Fbg111%2Fasterisk-chan-dongle&usg=AOvVaw33ocbduA5SQvFdPTce1TOc
NOTE: chan_dongle works with just a few of Huawei USB dongle models, see the above link.

Instructions:

system update

su - root
apt-get update
apt-get dist-upgrade
apt-get clean
apt-get autoclean
apt-get autoremove
reboot

pre-requisites

su - root
apt-get install git
apt-get install build-essential
apt-get install libncurses5-dev
apt-get install libxml2
apt-get install libxml2-dev
apt-get install libsqlite3-dev
apt-get install libiksemel-dev libssl-dev
apt-get install usbutils unzip autoconf automake
apt-get install linux-headers-`uname -r` gcc g++ make libnewt-dev openssl libssl-dev zlib1g-dev
apt-get clean
apt-get autoclean
apt-get autoremove
reboot

Asterisk 11 installation

su - root
git clone -b 11 http://gerrit.asterisk.org/asterisk asterisk-11
cd  asterisk-11
./configure
make
make menuconfig # optional
make install
make samples
/usr/sbin/asterisk # first run of asterisk
asterisk -vvvvvr # Asterisk CLI: type "core show help" to test it
killall asterisk  # kill Asterisk process
reboot

chan dongle install

su - root
wget https://github.com/jstasiak/asterisk-chan-dongle/archive/asterisk11.zip
unzip asterisk11.zip
cd asterisk-chan-dongle-asterisk11/
cp configure.in configure.ac
aclocal
autoconf
automake -a
./configure
make all
make install
reboot

Asterisk configuration, modify example files for your needs

su - root
nano /etc/asterisk/dongle.conf
nano /etc/asterisk/voicemail.conf
nano /etc/asterisk/extensions.conf
nano /etc/asterisk/asterisk.conf
nano /etc/asterisk/sip.conf
reboot

Asterisk start & test

su - root
/usr/sbin/asterisk
asterisk -vvvvvr # Asterisk CLI

Tips:

in the Asterisk CLI type: “core show help” to see available commands,
to test dongle type: “dongle show devices”, you should see something like this:

> dongle show devices
ID           Group State      RSSI Mode Submode Provider Name  Model      Firmware          IMEI             IMSI             Number        
dongle0      1     Free       14   5    4       3 Italy        E169       11.314.11.00.00   358109024xxxxxxx  22299210xxxxxx  +393935xxxxx

I will post configuration examples ASAP, anyway you might find a lot of interesting guides about that. :wink:

Hi pilovis.
Thanks for your tutorial.

I try compile it and i received that error:

[CC] tcptls.c -> tcptls.o
tcptls.c: In function ‘tcptls_stream_close’:
tcptls.c:401:20: error: dereferencing pointer to incomplete type ‘SSL {aka struc                                                           t ssl_st}’
    if (!stream->ssl->server) {
                    ^~
tcptls.c:404:5: warning: ‘ERR_remove_thread_state’ is deprecated [-Wdeprecated-d                                                           eclarations]
     ERR_remove_thread_state(NULL);
     ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/e_os2.h:13:0,
                 from /usr/include/openssl/ssl.h:45,
                 from /root/asterisk-11/include/asterisk/tcptls.h:66,
                 from tcptls.c:44:
/usr/include/openssl/err.h:248:1: note: declared here
 DEPRECATEDIN_1_1_0(void ERR_remove_thread_state(void *))
 ^
tcptls.c: In function ‘__ssl_setup’:
tcptls.c:779:31: warning: implicit declaration of function ‘SSLv2_client_method’                                                            [-Wimplicit-function-declaration]
    cfg->ssl_ctx = SSL_CTX_new(SSLv2_client_method());
                               ^~~~~~~~~~~~~~~~~~~
tcptls.c:779:31: warning: passing argument 1 of ‘SSL_CTX_new’ makes pointer from                                                            integer without a cast [-Wint-conversion]
In file included from /root/asterisk-11/include/asterisk/tcptls.h:66:0,
                 from tcptls.c:44:
/usr/include/openssl/ssl.h:1336:17: note: expected ‘const SSL_METHOD * {aka cons                                                           t struct ssl_method_st *}’ but argument is of type ‘int’
 __owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
                 ^~~~~~~~~~~
tcptls.c:789:4: warning: ‘TLSv1_client_method’ is deprecated [-Wdeprecated-decla                                                           rations]
    cfg->ssl_ctx = SSL_CTX_new(TLSv1_client_method());
    ^~~
In file included from /usr/include/openssl/e_os2.h:13:0,
                 from /usr/include/openssl/ssl.h:45,
                 from /root/asterisk-11/include/asterisk/tcptls.h:66,
                 from tcptls.c:44:
/usr/include/openssl/ssl.h:1629:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_client_method(void)) /* TLSv1                                                           .0 */
 ^
/root/asterisk-11/Makefile.rules:143: recipe for target 'tcptls.o' failed
make[1]: *** [tcptls.o] Error 1
Makefile:397: recipe for target 'main' failed
make: *** [main] Error 2

It’s relative with SSL. You have any idea, to solve that compile issue?

Best Regards