Asterisk 11 USB GSM Trunk and Gateway Using Chan_Dongle


Chan_Dongle is driver to use when using USB Dongle such as Huawei 3G Dongle to use for GSM Trunk and GSM SMS Gateway.

Now Let’s start to installing the Asterisk 11 Chan_Dongle driver to your Asterisk 11 or 13 

Step 1: install the required packages needed

  • libbluetooth-dev libncurses5 libncurses5-dev
  • uuid-dev
  • libxml2-dev
  • git-core libtools
  • automake make
  • usb-modeswitch
  • vim vim-common
  • ntp
  • asterisk-dev

Step 1: Go to your favorite directory to download the driver to be use and after Extract the downloaded zip file.

[email protected]:~# cd /home/user/download
[email protected]:~# wget
[email protected]:~# unzip
[email protected]:~# cd asterisk-chan-dongle-asterisk11

Step 2: Create Auto-generating aclocal.m4. Automake includes a number of Autoconf macros that can be used in your package (see Macros); some of them are actually required by Automake in certain situations. These macros must be defined in your aclocal.m4 ; otherwise they will not be seen by autoconf

[email protected]:~# aclocal
[email protected]:~# autoconf
[email protected]:~# automake -a

Step 3: After successfully done the above steps we can now start to compile the package using ./configure in below steps

[email protected]:~# ./configure
[email protected]:~# make
[email protected]:~# make install

Step 4: Now compilation is done copy the dongle.conf that was created in your ‘asterisk-chan-dongle-asterisk11/etc’ folder to /etc/asterisk

[email protected]:~# cp etc/dongle.conf /etc/asterisk
[email protected]:~# chmod -R 0777 /etc/asterisk

Step 5: Load the chan_dongle module into your asterisk.

[email protected]:~# asterisk -rvvv
asterisk*CLI> module load

Step 6: Edit the dongle.conf file and change the settings of your audio and data tty according to your USB

 exten=0912345678;your mobile number here
 audio=/dev/ttyUSB1 ; tty port for audio connection; no default value
 data=/dev/ttyUSB2 ; tty port for AT commands; no default value
                    ; or you can omit both audio and data together
                    ; and use imei=123456789012345 and/or imsi=123456789012345
                    ; imei and imsi must contain exactly 15 digits !
                    ; imei/imsi discovery is available on Linux only

Step 7: Edit the /etc/udev/rules.d/92-dongle.rules file and append below text in your file.

[[email protected]]# vim /etc/udev/rules.d/92-dongle.rules

KERNEL==”ttyUSB[012345]”, OWNER=”root”, GROUP=”root”, MODE=”660″

Step 8: Edit your file in /etc/asterisk/extensions.conf to add context to call the chan_dongle


; Global variables here

exten => 09123456789,1,Log(NOTICE, Incoming call from ${CALLERID(all)})
exten => 09123456789,n,Dial(SIP/4001)
exten => 09123456789,n,Hangup()

exten =>
 _X.,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} through Dongle0 Provider)
exten => _X.,n,Dial(dongle/dongle0/${EXTEN},60)
exten => _X.,n,Playtones(congestion)
exten => _X.,n,Hangup()

exten => 4001,1,Dial(SIP/4001)
exten => 4001,n,Hangup()
exten => 4002,1,Dial(SIP/4002)
exten => 4002,n,Hangup()

Step 9: Edit /etc/asterisk/sip.conf file and add the extension numbers that will be use in your hardphone or softphone

 deny=; to deny all traffic and only allow the valid subnet of your VoIP in permit
 permit=; make sure you only allow your network and no other 

 context=outgoing ;This is the context in extensions.conf

 context=outgoing ;This is the context in extensions.conf

Step 10: Now reload the asterisk dialplan and sip configuration this is to apply the changes we made during the configuration.

[email protected]:~# asterisk -rvvv
asterisk*CLI> dialplan reload
asterisk*CLI> sip reload

Now you can make test call in your mobile

2 Comments on "Asterisk 11 USB GSM Trunk and Gateway Using Chan_Dongle"

  1. Thank for this tutorial. It is very helpful for me.
    But i still have an issue when running automake -a: The error message is shown bellow
    automake: no `’ found for any configure output

Leave a comment

Your email address will not be published.