How to Augment SignalWire with thinQ’s Bring Your Own Voice Carrier (BYOC) Solution

Tim McLain

SignalWire can be easily enhanced with a minimum of development lift to augment your inbound and outbound voice with thinQ’s Bring Your Own Carrier (BYOC) solution.

After following these directions, inbound voice calls to your thinQ phone numbers (DIDs) will route to SignalWire, and outbound calls initiated from SignalWire will route through your thinQ outbound voice profile. Following these steps will also eliminate the need for hardcoding a SIP URI to route outbound calls initiated from your application to thinQ, meaning no changes will be needed inside your application.

To start, open both your your SignalWire and thinQ io accounts in two browser tabs. We’ll move between both portals throughout these instructions.

Set Up SignalWire for thinQ

In Signalwire, click SIP > SIP Settings. Leave default settings in place, then Save.

Set up SignalWire SIP Settings for thinQ

Create a Domain Application

Next in SIP > Domain Apps, Click +New.

Name your app thinQBYOC, set the App URL with BYOC in the custom URL slot, then Save.

Copy the full App URL before proceeding, as you’ll need it during your inbound routing profile setup inside thinQ.

SignalWire set new Domain Application for thinQ BYOC

SignalWire set Custom Domain for thinQ BYOC

Create an Inbound Routing Profile at thinQ

In thinq.io > Inbound > Routing Profiles > Inbound Profiles

Click to Add a new profile, and in the pop-up, configure the name to be SignalWire-YourCompanyName or just SignalWire.

You may want to create multiple SIP Domains on SignalWire for different applications, which would allow you to create additional routing profiles. Be sure your naming system is descriptive so you recognize what it matches within SignalWire.

Set up Inbound Profile for SignalWire in thinQ io

Select “DNS A” for Type and enter the full SignalWire App URL from above. Leave the sip: prefix off of the URI, it should just be the full URL.

Configuring SignalWire for thinQ Outbound Call Routing

In thinq.io > Outbound > Trunks > Add New

Set up New Outbound Trunk for SignalWire in thinQ

On the New Trunk configuration page, give it a friendly name, then choose the Profile you wish to associate your trunk with by dropping down Select Trunk Type and selecting Connect.

SignalWire Outbound Profile Selection for thinQ Routing

Select SignalWire from the options, then click Save.

In thinq.io > Outbound > Trunks click the Token icon next to your new SignalWire trunk. Your token and thinQ Account ID information will be needed to configure the SIP URI in SignalWire. This is required for routing outbound calls from SignalWire through thinQ. Copy and paste these values into a text editor or Notepad.

thinQ io Token for SignalWire

Making Outbound Calls via the LaML API

In SignalWire, this method supports a long list of parameters. The relevant parameters for your SIP calls are SipAuthUsername and SipAuthPassword. The URL would support the same structure and SIP options as the LaML version.

A full example:
require ‘signalwire/sdk’
client = Signalwire::REST::Client.new ‘your-project’, ‘your-token’, signalwire_space_url: “example.signalwire.com”

call = client.calls.create(
url: ‘http://YOURSPACE.signalwire.com/YOUR-LAML-BIN-ID’,
to: ‘sip:12155551212@wap.thinq.com?X-account-id=0123&X-account-token=4567890;transport=udp?header1=foo&header2=bar’,
from: ‘+15559988777’,
sip_auth_username: ‘user’,
sip_auth_password: ‘pass’
)

Congratulations! Inbound voice calls to your thinQ numbers will now route to SignalWire, and outbound calls initiated FROM SignalWire will route through thinQ.

Date posted: November 1, 2021

Topic: CPaaS   Inbound Voice   Outbound Voice  

Tags: Intelligent Call Routing   Least Cost Routing  

Tim McLain

A passionate technologist at heart with more than 30 years of marketing experience, Tim loves using technology to help businesses solve problems and grow their bottom line. Tim is happiest brainstorming new approaches to marketing and communications to help Commio's partners better understand, trust, and embrace our cloud communications solutions. In his spare time, he loves shooting and editing video, riding long distances on North Carolina’s amazing bike trails, and enjoying the darkest craft beer he can find.

Recent posts from Tim McLain

Get the latest from Commio

We’ll send you one email a month featuring our latest blog content.

';