chan_dongle full installation steps UPDATED

4,674 views
Skip to first unread message

Hamza Gad

unread,
Aug 23, 2023, 9:39:15 AM8/23/23
to dongle
Hi everyone, I just created a full steps guide to install chan_dongle On Ubuntu 22 Asterisk 18 FreePBX 16 OS VERSION="22.04.3 LTS (Jammy Jellyfish)" Asterisk 18.19.0 FreePBX 16.0.33 I combined all the required files and sources Except OS in one tar file https://drive.google.com/file/d/1hEt13Y6iALR6aRrM83UD497G_E43LQV0/view?usp=sharing you will find all of these steps in install.sh file inside the tar file it is recommended to copy paste the commands not to run the script, since it is not prepared for autoinstall Install OS ubuntu 18 and enable root on ssh access then follow the steps #bin/bash
#move all files using winscp to root directory

#server update packages and add repos then reboot
curl -o /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc 'https://mariadb.org/mariadb_release_signing_key.asc'
sh -c "echo 'deb https://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.10/ubuntu jammy main' >>/etc/apt/sources.list"
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
apt update
apt upgrade
reboot

#install packages
apt-get install unzip git gnupg2 curl libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential libjansson-dev libxml2-dev uuid-dev subversion apt-transport-https curl sox mpg123 unixodbc unixodbc-dev libmariadb3 libmariadb-dev
apt-get install apache2
apt-get install mariadb-server
apt-get install php7.4 libapache2-mod-php7.4 php7.4-cgi php7.4-common php7.4-curl php7.4-mbstring php7.4-gd php7.4-mysql php7.4-bcmath php7.4-zip php7.4-xml php7.4-imap php7.4-json php7.4-snmp
apt-get install php-pear
apt-get install nodejs npm
apt-get install python3-certbot-apache

#asterisk build
tar zxf asterisk-18-current.tar.gz
cd asterisk-18.*/
./contrib/scripts/get_mp3_source.sh
./contrib/scripts/install_prereq install
./configure
make menuselect
# select app_macro module, format mp3
make -j2
make install install-headers
make samples
make config
ldconfig
groupadd asterisk
useradd -r -d /var/lib/asterisk -g asterisk asterisk
usermod -aG audio,dialout asterisk
chown -R asterisk.asterisk /etc/asterisk
chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk
chown -R asterisk.asterisk /usr/lib/asterisk

#fix asterisk
cd
echo 'AST_USER="asterisk"' >> /etc/default/asterisk
echo 'AST_GROUP="asterisk"' >> /etc/default/asterisk
sed -i 's/;\[radius\]/[radius]/g' /etc/asterisk/cdr.conf
echo 'radiuscfg => /etc/radcli/radiusclient.conf' >> /etc/asterisk/cdr.conf
sed -i 's";radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf"radiuscfg => /etc/radcli/radiusclient.conf"g' /etc/asterisk/cel.conf
systemctl restart asterisk

#fix webserver
a2enmod rewrite
rm -rf /var/www/html
sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
sed -i 's/\(^upload_max_filesize = \).*/\12000M/' /etc/php/7.4/cli/php.ini
sed -i 's/\(^upload_max_filesize = \).*/\12000M/' /etc/php/7.4/apache2/php.ini
sed -i 's/\(^memory_limit = \).*/\1512M/' /etc/php/7.4/apache2/php.ini
systemctl restart apache2

#freePBX install
tar -xvzf freepbx-16.0-latest.tgz
cd freepbx
./install -n
fwconsole ma downloadinstall certman
fwconsole ma install pm2

#install dongles driver
cd
echo 'KERNEL=="ttyUSB*", MODE="0666", OWNER="asterisk", GROUP="uucp"'>/etc/udev/rules.d/92-dongle.rules
echo 'rungroup = dialout'>>/etc/asterisk/asterisk.conf
mv dongle.conf /etc/asterisk/dongle.conf
chown asterisk.asterisk /etc/asterisk/dongle.conf
chmod 664 /etc/asterisk/dongle.conf
mv extensions_custom.conf /etc/asterisk/extensions_custom.conf
chown asterisk.asterisk /etc/asterisk/extensions_custom.conf
chmod 664 /etc/asterisk/extensions_custom.conf

# build the driver
unzip asterisk-chan-dongle-master*
cd asterisk-chan-dongle-master/
autoupdate
aclocal
autoconf
automake -a
./bootstrap
./configure --with-astversion=18.19.0
make clean
make
make install

chmod 755 /usr/lib/asterisk/modules/chan_dongle.so
systemctl restart asterisk

#secure mysql database and add root password
mysql_secure_installation

#reboot
apt autoremove
reboot

#navigate through web page to server
# set admin username and password

Hamza Gad

unread,
Aug 23, 2023, 9:42:56 AM8/23/23
to dongle
mv *.txt /var/log/asterisk/
chmod 777 /var/log/asterisk/*.txt
chown asterisk:asterisk /var/log/asterisk/*.txt

CW

unread,
Dec 31, 2023, 10:34:55 PM12/31/23
to dongle

Thank you for preparing this tutorial! It helps me a lot since I find it difficult to identify up to date information for installing it.

Twish Twirl

unread,
Mar 14, 2024, 10:06:55 AM3/14/24
to dongle

Hamza Gad

unread,
Mar 22, 2024, 12:42:43 PM3/22/24
to dongle
You are welcome any time, here is some updates since I can't modify the original message:
this is the alternative command for mariadb repo:
sh -c "echo 'deb https://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.11/ubuntu jammy main' >>/etc/apt/sources.list"

also you may need to configure firewall and timezone, or just disable firewall for now:
timedatectl set-timezone Africa/Cairo
ufw disable

also you may want to install logrotate to help maintaining the logs:
make install install-headers install-logrotate

also you may require to remove modem-manager, so dongles should have a faster performance in the initialization stage:
apt-get remove modemmanager
but consider keeping it if u want to use socat to insert commands to dongles.

Luther Valiente

unread,
Aug 22, 2024, 4:59:36 AM8/22/24
to dongle
is this still working? im install ubuntu 22 on my mini pc.. trying this tutorial now!

Luther Valiente

unread,
Aug 22, 2024, 6:51:36 AM8/22/24
to dongle
i got an error after the input <make menu select>

root@serverpbx:~/asterisk-18.19.0# make menuselect
****
**** The configure script must be executed before running 'make'.
****               Please run "./configure".
****
Makefile:115: makeopts: No such file or directory
make: *** [Makefile:368: makeopts] Error 1

Hamza Gad

unread,
Aug 23, 2024, 3:15:47 PM8/23/24
to dongle

Yes, this guide is still working
just ignore this line:

sh -c "echo 'deb https://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.10/ubuntu jammy main' >>/etc/apt/sources.list"
Also, replace this line:
make install install-headers
with this one:
make install install-headers install-logrotate
and before restarting the asterisk hit this command:
sed -i 's/create 640 root root/create 640 asterisk asterisk/' /etc/logrotate.d/asterisk

Also, Consider disabling the firewall if you don't need it
ufw disable

Also, replace this line:
fwconsole ma install pm2
with this one:
fwconsole ma downloadinstall pm2 --force

Hit this command:
apt-get remove modemmanager before
apt autoremove

Hamza Gad

unread,
Aug 23, 2024, 3:22:17 PM8/23/24
to dongle
follow the steps please, one by one
in the asterisk build section you will find the necessary commands for success

On Thursday, August 22, 2024 at 1:51:36 PM UTC+3 Luther Valiente wrote:

Akroomas

unread,
Sep 11, 2024, 12:22:18 AM9/11/24
to dongle
[root@freepbx asterisk-chan-dongle-master]# automake -a
configure.ac:6: installing './config.guess'
configure.ac:6: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'

Hamza Gad

unread,
Sep 11, 2024, 12:25:12 AM9/11/24
to dongle
Are you trying to install on FreePBX distro? 

Ryan Fadriquela

unread,
Oct 5, 2024, 11:08:18 PM10/5/24
to dongle
got the same error, any solution on this.
I'm running ubuntu 22 on RPi4.

Hamza Gad

unread,
Oct 5, 2024, 11:25:48 PM10/5/24
to dongle
Hi Ryan, I didn't try this on RPi
Which error do you mean?

Ryan Fadriquela

unread,
Oct 6, 2024, 1:24:37 AM10/6/24
to dongle
Hi Hamza, thanks for the reply, yes it works on RPi4. was able to install the dongle properly tested incoming call and received properly. just follow your instruction and did fine.. Thanks..

Akroomas

unread,
Nov 4, 2024, 12:04:33 PM11/4/24
to dongle
what the hell is this?!

On Thursday, March 14, 2024 at 4:06:55 PM UTC+2 Twish Twirl wrote:

Akroomas

unread,
Nov 4, 2024, 12:05:17 PM11/4/24
to dongle
no, installing the dongle files. I already have freepbx running

Mustafa Munawar

unread,
Nov 7, 2024, 2:39:54 AM11/7/24
to dongle

root@ubuntu2204:/home/ubuntu/asterisk-chan-dongle-master# automake -a
automake: error: no 'Makefile.am' found for any configure output
root@ubuntu2204:/home/ubuntu/asterisk-chan-dongle-master#
root@ubuntu2204:/home/ubuntu/asterisk-chan-dongle-master#

error when installing chandongle

os: ubuntu 24 LTS
freepbx: 16 

Hamza Gad

unread,
Nov 9, 2024, 12:24:35 AM11/9/24
to dongle
keep going
and check if it works in the end or not

Mostafa Ashraf

unread,
Jul 14, 2025, 8:07:49 AMJul 14
to dongle

I followed the guide step by step and got everything working up to a certain point.

I'm running a VM inside Proxmox and have successfully passed through the USB modem to the VM. However, after completing the setup, I encountered the following issue in FreePBX with Asterisk 18.19.0:

Connected to Asterisk 18.19.0 currently running on freepbx (pid = 55833)
freepbx*CLI> dongle show devices
ID           Group State      RSSI Mode Submode Provider Name  Model      Firmware          IMEI             IMSI             Number
dongle1      0     Not connec 0    0    0       NONE                                                                          Unknown
dongle2      0     Not connec 0    0    0       NONE                                                                          Unknown
dongle3      0     Not connec 0    0    0       NONE                                                                          Unknown
dongle4      0     Not connec 0    0    0       NONE                                                                          Unknown
dongle5      0     Not connec 0    0    0       NONE                                                                          Unknown
dongle6      0     Not connec 0    0    0       NONE                                                                          Unknown
dongle7      0     Not connec 0    0    0       NONE                                                                          Unknown
dongle8      0     Not connec 0    0    0       NONE                                                                          Unknown
dongle9      0     Not connec 0    0    0       NONE                                                                          Unknown
dongle10     0     Not connec 0    0    0       NONE                                                                          Unknown
freepbx*CLI>
freepbx*CLI>
    -- [dongle1] Trying to connect on /dev/ttyUSB2...
    -- [dongle1] Dongle has connected, initializing...
    -- [dongle2] Trying to connect on /dev/ttyUSB5...
[2025-07-14 15:01:17] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB5: No such file or directory
    -- [dongle3] Trying to connect on /dev/ttyUSB8...
[2025-07-14 15:01:17] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB8: No such file or directory
    -- [dongle4] Trying to connect on /dev/ttyUSB11...
[2025-07-14 15:01:17] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB11: No such file or directory
    -- [dongle5] Trying to connect on /dev/ttyUSB14...
[2025-07-14 15:01:17] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB14: No such file or directory
    -- [dongle6] Trying to connect on /dev/ttyUSB17...
[2025-07-14 15:01:17] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB17: No such file or directory
    -- [dongle7] Trying to connect on /dev/ttyUSB20...
[2025-07-14 15:01:17] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB20: No such file or directory
    -- [dongle8] Trying to connect on /dev/ttyUSB23...
[2025-07-14 15:01:17] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB23: No such file or directory
    -- [dongle9] Trying to connect on /dev/ttyUSB26...
[2025-07-14 15:01:17] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB26: No such file or directory
    -- [dongle10] Trying to connect on /dev/ttyUSB29...
[2025-07-14 15:01:17] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB29: No such file or directory
[2025-07-14 15:01:17] ERROR[57171]: at_response.c:363 at_response_error: [dongle1] Getting IMSI number failed
    -- [dongle1] Error initializing Dongle
    -- [dongle1] Dongle has disconnected
    -- [dongle1] Trying to connect on /dev/ttyUSB2...
    -- [dongle1] Dongle has connected, initializing...
    -- [dongle2] Trying to connect on /dev/ttyUSB5...
[2025-07-14 15:01:32] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB5: No such file or directory
    -- [dongle3] Trying to connect on /dev/ttyUSB8...
[2025-07-14 15:01:32] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB8: No such file or directory
    -- [dongle4] Trying to connect on /dev/ttyUSB11...
[2025-07-14 15:01:32] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB11: No such file or directory
    -- [dongle5] Trying to connect on /dev/ttyUSB14...
[2025-07-14 15:01:32] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB14: No such file or directory
    -- [dongle6] Trying to connect on /dev/ttyUSB17...
[2025-07-14 15:01:32] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB17: No such file or directory
    -- [dongle7] Trying to connect on /dev/ttyUSB20...
[2025-07-14 15:01:32] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB20: No such file or directory
    -- [dongle8] Trying to connect on /dev/ttyUSB23...
[2025-07-14 15:01:32] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB23: No such file or directory
    -- [dongle9] Trying to connect on /dev/ttyUSB26...
[2025-07-14 15:01:32] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB26: No such file or directory
    -- [dongle10] Trying to connect on /dev/ttyUSB29...
[2025-07-14 15:01:32] WARNING[55910]: chan_dongle.c:222 opentty: unable to open /dev/ttyUSB29: No such file or directory
[2025-07-14 15:01:32] ERROR[57172]: at_response.c:363 at_response_error: [dongle1] Getting IMSI number failed
    -- [dongle1] Error initializing Dongle
    -- [dongle1] Dongle has disconnected

It continues to loop with the same behavior, repeatedly failing to open the USB ports and initialize the devices.

Mohamed Tarek

unread,
Jul 14, 2025, 8:46:18 AMJul 14
to chan_...@googlegroups.com
Dear Mostafa , 

You are not mounting the dongles correctly , make sure It mount the ttyusb to the dev at Linux and access them at Linux then restart server and it will be displayed at asterisk by it's IMEI 

Thanks
Br 


--
You received this message because you are subscribed to a topic in the Google Groups "dongle" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chan_dongle/EROaAi-GoUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chan_dongle...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/chan_dongle/6e8e21f4-b145-4080-a57c-4bc34c0277fan%40googlegroups.com.

Musfiq

unread,
Jul 15, 2025, 8:46:27 AMJul 15
to dongle
try run below AT to set dongle to modem only.

enable modem function only
    AT^U2DIAG=0 

Mohamed Tarek

unread,
Jul 15, 2025, 1:53:11 PMJul 15
to chan_...@googlegroups.com
Hello all, 

I believe it's Linux ttyusb grants , as the logs is trying already to connect to modem but didn't find the mount directory or file , 

Musfiq

unread,
Jul 16, 2025, 1:36:07 AMJul 16
to dongle
simply configure the dongle to modem only, it will work. I'm running the same in proxmox without any issue  
Reply all
Reply to author
Forward
0 new messages