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.
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.
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.
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
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.
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.
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.