Virtual dual sim with GSM Gateway Raspbx & Acrobits app

In the follow a guide to use 2 sim on a phone IOS/Android without physical second slot for sim.

The system exploit voip protocol and second sim goes be mounted on a 3G/GSM adapter. I used Vodafone Huawei K3715 like below. (fw

But you can use other adapter however it must have ‘voice function’. Here a list of other compatible Hw.
And then USB GSM adapter go into a Raspberry. I used with success a Raspberry zero, but i council a Raspberry zero W because it have already wireless lan built in and you dont need a usb switch like me.

Whats you need:
– Raspberry Pi Zero W
– Huawei USB 3G adapter K3715 (Unlocked no operator lock)
– Power supply 5 Volt with at least 2 Ampere out
– At least 4 Gb Sd memory.
– Pc debian like as Ubuntu for work around
– Raspbx distro here
– App “Acrobits Softphone” installed on phone as Voip client for Android or IOS

Start with pc linux terminal, write Raspbx.img into Sd with:
sudo dd if=raspian.img of=/dev/sdb
Change path and name of raspbx.img as your path and real usb device.

Now last operation with SD on Pc linux for configure Wireless Lan. Edit in the sd card sudo nano /etc/network/interfaces as below:

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid your-SSID
wpa-psk your-password

Save and put sd into Raspberry, discover IP and if nothing wrong you can be abled to connect to it with SSH client.
In recent version of Raspian SSH Service is disabled at boot, enable it creating an empty file named ssh into /boot/.
Connect at Raspi from pc in SSH with ssh root@(raspi_IP) password raspberry.

Scheduled restart at 9 am

sudo nano crontab -e
0 9 * * * /sbin/shutdown -r now
save and close.

Disk check at boot

To enable disk check at boot edit:
sudo nano /etc/default/rcS

Verify Hw
Verify with lsusb if adapter is recognized, in my case:
Bus 001 Device 005: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
Bus 001 Device 004: ID 148f:7601 Ralink Technology, Corp.
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

If lsusb dont work install lsbutils with apt-get install usb-utils

Install minicom
apt-get install minicom
Start minicom: minicom -s

select "serial port setup" then option "A"
insert ttyUSB1 and then press Return
Exit with “Esc” and then "save setup as dfl"
then "exit"

(Note down, ttyUSB* port go discovered with command dmesg)

It should appear:
Welcome to minicom 2.4
Compiled on Jan 25 2010, 06:49:09.
Port /dev/ttyUSB1
Press CTRL-A Z for help on special keys
AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0

AT^U2DIAG=0 for disable virtual CD-ROM of usb key.
AT^CVOICE=? for verify voice function. Response ^CVOICE=(0)if already enabled.
If needed enable it with AT^CVOICE=0
Optionally lock usb key in 2G mode with AT^SYSCFG=13,1,3FFFFFFF,2,4

Configure Chan Dongle
Start with install-dongle follow the instructions of the script, insert number provided with country prefix, in my case +393471234567.
If needed insert email address for receive sms throuth it.
Test chan_dongle config with asterisk -r then write dongle show devices
It should appear:
ID Group State RSSI Mode Submode Provider Name Model Firmware IMEI IMSI Number
dongle0 0 Free 16 3 3 Wind Telecomun K3715 111111111111111 222222222222222 +393471234567

Note down IMEI and IMSI and edit dongle.conf with nano /etc/asterisk/dongle.conf
This file will be useful for adjust tx or rx volume, however in the [dongle0] label comment with # audio=/dev/ttyUSB1 & data=/dev/ttyUSB2 and insert IMEI and IMSI, this change will allow us not to lose the connection to the usb key in case of change of the port number.

Freepbx/Asterisk configuration
Login in “FreePBX Administration” area with user admin pswadmin

Inside tab connectivity select trunk and create new one as below:

Important in the Dial patterns wizard insert ‘match pattern’NXXNXXXXXX

In the Custom Dial String insert dongle/dongle0/$OUTNUM$

Inside tab Applications select extensions and create new one as below:

Create an extension choosing ‘Add new custom extension’ with number ‘100’ in user extensio and set a strong Secret.

Right now Outbound Routes alway in tab connectivity:

In the ‘Trunk Sequence fo Matched Routes’ select ‘dongle’ created before.

Insert ‘match pattern’ NXXNXXXXXX in dial pattern wizard.
I inserted 4030 for call from voip client operator service and specify 4030 is not a internal extension.


Right now Inbound Routes alway in tab connectivity:

In tab general choose ‘Extensions’ and select your extension ‘100’ before created.

Now Reboot pi.

Acrobits Softphone
For use voip out home you need to create a free dns account like ‘noip’and setup your router for dynamic dns and open port 5060 UDP and interveal 10000/20000 UDP.

Install in your smartphone acrobits and setup it with:
– in Domain section
– Username: 100
– Secret as: your password

In advanced settings:
– NAT traversal —> Media ICE —> Default ICE candidate —> Server reflexive

During installation, acrobits will ask for login credentials. this is normal as it is the only app that does not drain the battery.
In fact, in case of incoming call the app will be awakened via the acrobits servers and in the meantime goes into stanby and never listens like other voip clients.

Last operation, go in the tab admin then module admin and uninstall packet not useful for preserve your sd-memory life.

That’s all enjoy !!

3 replies on “Virtual dual sim with GSM Gateway Raspbx & Acrobits app”

Guida molto interessante e dettagliata nei particolari.Basta avere un pó di conoscenza e manualità ed il gioco è fatto.Mi sono piaciute molto anche le foto dei vari passaggi.Grazie

I’m usually to running a blog and i actually appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and hold checking for brand spanking new information.

Leave a Reply

Your email address will not be published. Required fields are marked *