LogoLogo
ProductsDevelopersAPI ReferenceContact Us
Super SIM
Super SIM
  • Super SIM
  • Super SIM's Available Networks
  • Super SIM’s Multi-IMSI Applet
  • Over-the-Air Updates
  • Get Started with Super SIM
    • Overview
    • Get Started with Super SIM, the Raspberry Pi 4 and the Waveshare 4G Hat
    • Get Started with Super SIM, the Raspberry Pi 4 and the Sixfab Base Hat
    • Get Started with Data Comms and the Raspberry Pi Pico
    • Get Started with Super SIM SMS Commands and the Raspberry Pi 4
    • Get Started with Super SIM SMS Commands and the Raspberry Pi Pico
    • Get Started with Super SIM IP Commands and the Raspberry Pi
    • Get Started with Super SIM IP Commands and the Raspberry Pi Pico
    • Get Started with Super SIM eSIM Profiles for eUICCs
    • Get Started with Super SIM Connection Events
  • How To
    • How to Set a Device’s APN for Super SIM
    • How to Enable Device Roaming for Super SIM
    • How to Determine Whether a Device Contains a Super SIM
    • How to Set up iPhones for Super SIM
    • How to Determine a Super SIM’s Status
    • How to Use Console Bulk Actions to Update Multiple Super SIMs
    • How to Download Bulk Super SIM Data
    • How to Use Super SIM Fleets and Network Access Profiles
    • How to Understand the Settings on your SIM
      • Base Settings Package
    • How and Why You Can Set Super SIM’s Network Attach Priority List
    • How to Set Up and Use a Super SIM VPN
    • How to Configure AWS for a Super SIM VPN
    • How to Make and Take IoT VoIP Calls via Super SIM
    • How to Use Super SIM Connection Events
    • How to use Super SIM eSIM Profiles
    • How to Monitor Super SIM Connection Events using AWS ElasticSearch and Kibana
    • How to Use OpenAPI Clients with Super SIM
  • Into Production
    • Prepare for Production Deployments with Super SIM
    • Super SIM Datasheet
    • Super SIM Network Timeouts
  • Works with Super SIM
    • Works with Super SIM: Quectel BG95
    • Works with Super SIM: Quectel EG21-G
    • Works with Super SIM: Quectel EG25-G
    • Works with Super SIM: Thales Cinterion EXS62-W
    • Works with Super SIM: u-blox SARA-R5
  • Cellular Module Knowledgebase
    • Overview
    • About AT Commands
    • Nordic Modules with Super SIM
    • Quectel Modules with Super SIM
    • Quectel Modules with the KORE Narrowband SIM
    • Simcom Modules with Super SIM
    • Telit Modules with Super SIM
    • Thales Cinterion Modules with Super SIM
    • U-blox Modules with Super SIM
    • Cellular IoT Terminology
    • Low-power Optimization for Cellular Modules
    • Four Best Practices for Cellular Module Registration
    • How to Determine Good Cellular Signal Strength
    • How Super SIM Devices Connect to Cell Networks
  • Super SIM API
On this page
  • 1. Prepare the Pi
  • 2. Install and configure the Twilio CLI tool
  • 3. Install the Serverless Toolkit
  • 4. Set up Twilio Functions
  • 5. Initialize the SIP service
  • 6. Install a SIP softphone on the Pi
  • 7. Make a call
  • 8. Receive a call
  • What next?

Was this helpful?

  1. How To

How to Make and Take IoT VoIP Calls via Super SIM

A demo showing how to create voice-over-data applications for IoT devices using Super SIM and Twilio services.

PreviousHow to Configure AWS for a Super SIM VPNNextHow to Use Super SIM Connection Events

Last updated 1 year ago

Was this helpful?

Super SIM provides any modem-equipped device with worldwide data connectivity. Once in place, this data channel can be used to send and receive any kind of information — and that includes voice calls.

But while voice apps are ten a penny in mobile operating system app stores, making it easy to try out Super SIM mediated voice-over-data on a phone, how might voice functionality be enabled on an IoT device?

Twilio's Programmable Voice product supports the Session Initiation Protocol (SIP) for starting, maintaining, and ending interactive sessions over IP networks, in particular voice communications sessions. Programmable Voice lets you set up a SIP Domain, which is a unique point of presence that SIP clients — say, a VoIP softphone running on a Super SIM-enabled IoT device — can connect to and call other SIP clients, and phone numbers on public switched telephone networks (PSTNs).

The result: any cellular IoT device fitted with Super SIM and suitable audio IO can participate in voice calls with similar devices and even landlines and mobiles via Twilio and the Internet. Calling is two-way: calls can be made by an IoT device and received by it too.

1. Prepare the Pi

2. Install and configure the Twilio CLI tool

Install twilio on distributions such as Debian, Ubuntu, Linux Mint, and more with apt:

wget -qO- https://twilio-cli-prod.s3.amazonaws.com/twilio_pub.asc \
  | sudo apt-key add -
sudo touch /etc/apt/sources.list.d/twilio.list
echo 'deb https://twilio-cli-prod.s3.amazonaws.com/apt/ /' \
  | sudo tee /etc/apt/sources.list.d/twilio.list
sudo apt update && sudo apt install -y twilio
brew tap twilio/brew && brew install twilio
scoop bucket add twilio-scoop https://github.com/twilio/scoop-twilio-cli

Install the app:

scoop install twilio

Now you're ready to set twilio up with:

twilio login

You'll be asked to name a profile — make sure you note the name and then run:

twilio profiles:use <YOUR_PROFILE_NAME>

3. Install the Serverless Toolkit

Twilio's Serverless Toolkit is a twilio plugin that considerably simplifies the process of initializing, uploading, and starting a Twilio Functions environment. It uses the core Functions API as exposed by twilio and adds convenient bulk-upload functionality that will save you a lot of set up time.

Install the plugin with:

twilio plugins:install @twilio-labs/plugin-serverless

4. Set up Twilio Functions

First, clone the repo:

git clone https://github.com/korewireless/super-sim-raspberry-pi-voip-demo.git
cd super-sim-raspberry-pi-voip-demo

Optionally, you can edit the repo's .env file, which contains your application's admin and SIP client passwords. If you'd rather not use the default passwords, change these now.

Now upload and deploy the code:

twilio serverless:deploy

5. Initialize the SIP service

The last command you ran will upload and deploy your Twilio Functions environment's functions and assets, and activate the environment. Look at the command's output in the terminal: there will be an /admin/index.html URL listed under Assets:. Copy the full URL and paste into into a browser window:

When the page loads, you'll first be asked to log in — use the password from the repo's .env file — and then be invited to initialize the environment:

If you have multiple Twilio phone numbers available, the admin page will inform you of this and provide a list of numbers from which you can select the one you want to use for incoming calls.

Scroll up the admin page and click the View your running application link to jump to the list of available SIP clients. These are mock users and they're defined in the repo file assets/extensions.private.js. It also includes the extension numbers at which they can be reached. Feel free to make changes, but make sure you re-run twilio serverless:deploy every time you do so.

Pick one of the users as your Raspberry Pi SIP account and make a note of the SIP Registration Domain. Alternatively, note the page's address, enter that into the browser on the Pi when you jump across to it in the next step, and then copy the domain directly.

6. Install a SIP softphone on the Pi

  1. Switch over to the Raspberry Pi. If it hasn't already booted to the desktop, just enter startx at the command line.

  2. Select the Raspberry > Accessories > Terminal menu entry.

  3. Enter the following lines:

    sudo apt install gnupg dirmngr \
      ca-certificates curl --no-install-recommends
    curl -s https://dl.jami.net/public-key.gpg \
      | sudo tee /usr/share/keyrings/jami-archive-keyring.gpg \
      > /dev/null
    sudo sh -c "echo 'deb [signed-by=/usr/share/keyrings/jami-archive-keyring.gpg] \
      https://dl.jami.net/nightly/debian_11/ jami main' > \
      /etc/apt/sources.list.d/jami.list"
    sudo apt-get update && sudo apt-get install -y jami
  4. Launch Jami by selecting the Raspberry > Internet > Jami menu entry.

  5. On the Welcome to Jami page that appears, click on Advanced features at the bottom:

  1. Click the Add a SIP account button:

  1. Enter the account name you selected earlier, in Step 5 — or pick one of the names from your IoT VoIP Demo browser window — into the Jami Username field.

  2. Enter the SIP Registered Domain from Step 5 into the Jami Server field.

  3. Enter ThisIs1Password! — or your own password if you changed it earlier — into the Jami Password field:

  1. Click the Create SIP Account button.

  2. Back at the main Jami UI, click the gearwheel icon to the left of your SIP account name, then click the Media button.

  3. Set your Ringtone, Output and Input Device to your USB audio adapter. This may not be listed as it appears in the screenshot below, so just make sure you don't select Default , HDMI or AV Jack :

  1. Click the < to the left of your SIP account name to go back to the main screen.

7. Make a call

  1. In Jami, enter your own cellphone number into the Find or start a conversation field in the left-hand column:

  1. Click on the phone handset icon at the top right to call the number:

  1. Take the call on your phone!

8. Receive a call

  1. On your cellphone, dial the number back.

  2. You'll hear a request for the extension of the party you're trying to reach. Key in 100 on your phone keypad.

  3. Talk!

What next?

You've built yourself a working demo IoT VoIP system that connects a softphone running on a Raspberry Pi computer, via a Twilio Programmable Voice SIP Domain and a cloud-side application constructed with Twilio Functions, to a cellphone for the purpose of making and taking voice calls.

The crucial point to recall, however, is that it is a demo, not a full application. But it neatly shows how you might architect such an application — imagine an industrial IoT unit in the field capable of hosting back-to-base support calls — and of what it would be capable.

Now it's over to you. We can't wait to see what you build.

By way of demonstration, this guide shows you how to set up a Programmable Voice SIP Domain, set up an IoT client device, and connect them. You'll need a Twilio phone number as an entry point for inbound calls and as an outgoing Caller ID. We also make use of another Twilio product, Functions, to provide a basic admin dashboard and allow incoming calls to be routed to specific devices. A stands in as the IoT device.

First, you'll need a Raspberry Pi that has been set up and is ready to use. The Raspberry Pi Foundation if you've just unboxed your first Pi.

You'll also need a cellular module board — we'll use the same that's used in our main Super SIM tutorial. It will need to be fitted with a .

We have a. You should jump to it now and come back here when you've completed it. It will show you how to put in place the services you need to connect to the Internet using Super SIM. If you wish, you can skip Step 3, "Attach to a cellular network", to save a little time.

Finally, you'll need a USB audio adapter. The Raspberry Pi has a 3.5mm AV jack which can output to headphones, but it has no audio in. To remedy that, and plug a headset into it. This is just one USB audio adapter — there are many, many similar ones available.

We'll interact with Twilio using the twilio command line tool. Unfortunately, support for twilio and the Serverless Toolkit plugin you'll use alongside it is not optimal on the Pi, so steps 2 through 4 need to be done on your primary computer. You may already have the Twilio CLI installed — if so, you can .

Install twilio on macOS using :

Install twilio on Windows using . Run and:

Add the twilio-cli :

Now grab the source code files that underpin the Twilio-mediated SIP service that your IoT device will use to host calls. We have a and which the twilio tool will use to set up your service.

Click the Initialize... button to do so. The underlying code will set up your SIP Domain and an associated Credential List, which you can take a look at later in the . It will also configure the voice and fax functionality of your Twilio phone number: it will be set to accept voice calls and to route them to devices via the uploaded functions. When the service is configured, the admin page will look something like this:

A real IoT application would have to incorporate its own code for communicating via SIP and handling the audio IO. For this demo, however, we're using a . It's open source, free, and runs on the Raspberry Pi.

Raspberry Pi single-board computer
has a great guide to help you
Waveshare SIM7600X 4G Hat
configured Super SIM
detailed guide to bringing the Pi and the modem together
fit a USB audio IO adapter like this one
Homebrew
Scoop
PowerShell as an administrator
Bucket
GitHub repo that contains all the files you need
Twilio Console under Voice > Credential lists
softphone called Jami
jump straight to Step 3