Using Voxbone with SignalWire

Using Voxbone with SignalWire

BYOC, or Bring Your Own Carrier, is a way to integrate a carrier of your choice with your existing comms platforms and services, to get the best out of every supplier and benefit from Voxbone’s compliant, reliable voice infrastructure around the globe.

This guide shows you how to bring your Voxbone numbers to SignalWire. It’s easy to connect numbers from your Voxbone account to SignalWire using their RELAY API. This requires setting up a FreeSWITCH instance that’s connected to Voxbone. To learn how that can be done, refer to our guide on using Voxbone with FreeSWITCH.

A little disclaimer: This is a guide developed by Voxbone’s Product team to help you get the most out of our platform. It isn’t necessarily supported or endorsed by the other platform, but we’re confident in its technical accuracy.

What you’ll need to get started:

  1. A registered Voxbone account complete with phone numbers. (Create your account here)
  2. A running FreeSWITCH instance.
  3. A SignalWire account (Create your account here)

 

How it works

When a call is received by Voxbone, we deliver it to your SignalWire app through your FreeSWITCH instance through something called voice URIs – a kind of address for your voice services. Behind the scenes, we take care of complex things like least-cost routing, finding the best provider and optimizing for maximum call quality.

SignalWire provides a very simple way to connect your FreeSWITCH instance automagically to their platform via simple commands. This is achieved using the mod_signalwire module on FreeSWITCH. Unfortunately, as this module isn’t yet capable of triggering specific hosted apps on SignalWire, we will use a workaround with calling a dummy (and virtual) phone number.

This can be done in three steps:

  1. Connect your FreeSWITCH to SignalWire. (Follow the official guide here)
  2. Configure dialplans
  3. Reload configs to apply changes!

 

Connect FreeSWITCH to SignalWire

SignalWire provides an easy way to connect a VoIP server to their cloud platform. This is an easy way to automatically configure things like ACLs and gateways and ensure they remain up to date. FreeSWITCH is currently the only VoIP software supported, but it’s intended to extend support to other popular solutions. When you’ve successfully connected your FreeSWITCH to SignalWire, take note of the connection name as it will become the SIP domain we’ll be using for the rest of the integration. The domain will be in the following format:

{your-connector-name}.sip.signalwire.com
Example : voxbone-fs.sip.signalwire.com

 

Configure a SIP Endpoint

In order to use the connection we just created, we need a SIP Endpoint on SignalWire to authenticate and route calls to SignalWire from FreeSWITCH.

  1. Log in to SignalWire
  2. Click “SIP” under your project and create a new endpoint.
  3. Take note of the SIP domain, username and password, which will be needed in the next steps. For this tutorial, we created an endpoint called “freeswitch-handler”

Configure Voxbone Integration with SignalWire on FreeSWITCH

To start using the integration, we need to create a gateway on FreeSWITCH for handling incoming calls from Voxbone with SignalWire, and finally update the dialplan with necessary routing to forward certain calls to SignalWire.

  1. Gateway configuration : Once the Connector is successfully activated, the SignalWire gateway and ACL configs will be automatically configured. We just need to add the username and password of the SIP Endpoint we created to the existing configuration. Modify the SignalWire gateway or create a new file named signalwire.xml under /sip_profiles/external/
<include>
<gateway name="signalwire_outbound">
<!-- This is the FQDN of your SignalWire Space. Change the part yourSpace-r18fd1198h1fhf with the SIP domain for your Space. -->
<param name="proxy" value="yourSpace-r18fd1198h1fhf.sip.signalwire.com"/>
<!-- Use the username and password of the SIP endpoint you created for Voxbone integration. -->
<param name="username" value="SIPEndpointUsername"/>
<param name="password" value="SIPEndpointPassword"/>
<param name="register" value="false"/>
</gateway>
<gateway name="signalwire_inbound">
<!-- This is the FQDN of your SignalWire Space. Change the part yourSpace-r18fd1198h1fhf with the SIP domain for your Space. -->
<param name="proxy" value="yourSpace-r18fd1198h1fhf.sip.signalwire.com"/>
<!-- Use the username and password of the SIP endpoint you created for Voxbone integration. -->
<param name="username" value="SIPEndpointUsername"/>
<param name="password" value="SIPEndpointPassword"/>
<param name="register" value="false"/>
<param name="dtmf-type" value="rfc2833"/>
<param name="context" value="public"/>
</gateway>
</include>
  1. Now you can update your dialplan to route an incoming call from Voxbone to SignalWire. In this example, we’re routing the call to the dummy DID we have on SignalWire that’s configured the handle the call with a DialogFlow Agent. Append the following to your public dialplan (/dialplan/public.xml)
<extension name="voxbone_signalwire">
<!-- Replace the expression attribute of the condition with a regular expression based on your use case. This one only matches calls placed to a specific number -->
<condition field="destination_number" expression="^\+32466900884$">
<action application="set" data="domain_name=$${domain}"/>
<action application="playback" data="phrase:greeting"/>
<!-- Now, instead of forwarding the call to a user or extension that’s registered on FreeSWITCH, we will forward the call through the SignalWire Connector to the dummy SignalWire DID -->
<!-- <action application="transfer" data="1000 XML default"/> -->
<action application="bridge" data="sofia/gateway/signalwire_outbound/+12243863869"/>
</condition>
</extension>

The dummy DID we used from SignalWire is configured to handle the call using Google DialogFlow, but you’re free to choose any call handler supported by SignalWire.

Testing your SignalWire integration with Voxbone

Any calls placed to the numbers routed to your FreeSWITCH are delivered by Voxbone to your FreeSWITCH instance. Now, you can forward that call via the dummy SignalWire DID to any app hosted/integrated to SignalWire!