Using Voxbone with FreePBX 15

We believe setting up business communications should be a straightforward, painless process. That’s why we build our SIP services to play well with whichever communications platform you might use – whether it’s hardware-based or hosted in the cloud, built internally or bought from a third-party vendor.

What you’ll need to get started:

  1. A registered Voxbone account with assigned numbers. (Create your account here)
  2. A set up from the FreePBX 15 ISO.

Note: For Voxbone, a free test account is enough for you to follow the steps in this guide and complete a technical validation of the integration of our voice services and FreePBX.

How it works

When a call is received on our platform, we deliver it to your designated SIP interface through voice URIs. Behind the scenes, we take care of complex things like least-cost routing, finding the best provider and optimising for maximum call quality. To connect your Voxbone numbers to FreePBX, we need to establish a SIP interface between the platforms.

This can be done in 2 steps:

  1. Setting Up Inbound Call Routing
  2. Setting Up Outbound Call Routing

1. Configuring Your FreePBX Platform for Inbound Call Routing

Here at Voxbone we always look for sensible ways to get platforms up and running. Given FreePBX runs on an Asterisk core, and the soft PBX is a WebFront end for Asterisk, we’ve found setting this up from the web front end is significantly slower.

FreePBX auto generates the PJSip.conf and Extensions.conf to run Asterisk by default. However, we’re providing two files, pjsip_custom.conf and extensions_custom.conf, which enable you to still run and operate core configuration from manual setup.

Once you are happy, if you wish to transition over to the WebUI, you can migrate the setting over the longer term, especially if you wish to manage Extensions
etc from the UI. For Inbound we need to add the following configuration

  pjsip.conf
  ;Voxbone
  [voxbone-uac]
  type=endpoint
  allow= !all,ulaw,alaw
  aors=voxbone-uac
  direct_media=no
  context = outbound-voxbone
  
;Setting up inbound addresses allowed
  [voxbone-uac]
  type=identify
  match=81.201.82.45,81.201.83.45,81.201.84.195,81.201.85.45,81.201.86.45,185.47.148.45 
  endpoint=voxbone-uac
  [voxbone-uac]
  type=aor

Configuring a SIP URI To Point At Asterisk

Next, we will set up the SIP interface from Voxbone to Asterisk in Voxbone’s platform, this is done via Voice URIs.

In order to differentiate between different Voice URIs that might be pointing at your Asterisk, we’ll use a reserved keyword on our platform, “{E164}”, so
that we can use the same voice URI for many different numbers and detect what number is called/who’s calling.

  1. Log in to
    your Voxbone account.
  2. Go to Configure > Configure Voice URIs or, if you’re logged in, click here.
    Then click “New” to create a Voice URI for your Asterisk
  3. Specify the Voice URI as {E164}@YourAsterisk.com  or {E164}@YourAsteriskExternalIP

Adding a Number to the URI So You Can Call it, and Adding an Audio Codec

Now, we need to link one of our phone numbers to the Asterisk URI we just created.

  1. Go to Configure > Configure DIDs or, if you’re logged in, click here.
  2. Use filters to pick a number of your choice to assign for testing and hit “Search”.
  3. Once you’ve picked your number, under the Configuration menu, go to the “Voice” tab and click “Voice URI”. Also, make sure to pick the codecs we set in the dial peer above to prevent any SDP or media-related errors under the “Codecs” menu. Voxbone Platform - National Outbound Enabled
  4. Select the voice URI you created from the previous step, from the popup window.
  5. Hit “Apply” and “Continue”, then finally, “Confirm.”
  6. All set! Now place a call to the number you are using for testing. It should reach your Asterisk

Testing Calls

Any calls placed to the numbers associated with your URI are now delivered by Voxbone to your Asterisk. If you used the {E164} keyword, your platform should
see them as calls received to URI (called Voxbone DID)@YourAsteriskDomain. You should be able to do a packet capture to capture the traffic and see the incoming call.

2. Setting Up Outbound Call Routing

For security reasons, it’s important to look at number permissions and SIP digest headers when setting up outbound calling. These will allow you to use a number
for multiple applications.

But there are a few steps to take before we get there.

Enabling Outbound

Before you start, make sure you have an online account with Voxbone and that Voxbone’s service interoperates with your network by following the inbound guide
above. Then check the following:

  • That your Account Manager or Customer Success Manager has activated Voxbone’s
    outbound service for your account, and for your country of choice
  • That you’ve got 2 test numbers for outbound calling. These are test numbers
    in countries that have our outbound service available. Our team will confirm
    that access has been granted for these numbers.
  • If the country you are using requires Emergency Services to be enabled, please
    ensure you speak to our team about getting this set up at the same time,
    as otherwise it might delay this process.

Go to ‘Configure DIDs’ in the Voxbone platform, and select the numbers you wish to set up for outbound service. Find ‘VoxOut National’ and click it to enable
outbound calls. Be, and then be sure to hit ‘Apply’ to update the configuration.

Voxbone Platform - National Outbound Enabled

This allows you to use this number as an outbound presentation number across any number of integrations.

Enabling SIP Digest Security

The next thing that needs to be set up is the security configuration that Voxbone requires for outbound calling. Voxbone uses SIP Digest headers. To set up the credentials, please go to ‘Configure Outbound Voice’.

Here you can add the username and password used on the system.

Voxbone Platform - Outbound Voice Credentials

Note: We strongly recommend you use the generation tool to create a large, complex key for use within the system. This is a central configuration and only needs setting up once.

Setting Up Call Diversion

To allow call forwarding or call diversion to support passing or presenting third-party call IDs, the system needs to have the following setup.

  • The number listed in the ‘FROM’ field can be either a Voxbone or third-party number
  • The number in the ‘TO’ field can be a number listed in our routing prefix table
  • The number in the ‘DIVERSION’ field must be a Voxbone number activated for outbound voice

Asterisk Settings

We now need to point FreePBX to the AnyCast IP address at Voxbone so calls route
correctly.

 [Voxout] type = endpoint
 allow= !all,ulaw,alaw
 aors = VoxboneOutbound
 direct_media=no
 outbound_auth = VoxboneDigestHeader
 
 [VoxboneOutbound]
 type = aor
 contact = sip:81.201.89.110:5060

We now also need to setup the configuration for the SIP Digest header (VoxboneDigestHeader)
shown above.

[VoxboneDigestHeader]
type=auth
auth_type=md5
md5_cred=c936af1afa3bd7fb36a66e2ed2437ba1  //Generated see below
username={Username from above}
realm = voxbone.com

We need to generate a MD5 Hash for the credentials.    TO do this you need to following:

Put your setup as follows:  ({Username}:voxbone.com:{password}

NotRealUser:voxbone.com:GJIGWn1n10fj1n

You can then generate an MD5 in a number of ways. There are online MD5 generators, but as these are your secure credentials for the Voxbone platform, we suggest using an offline process. One viable alternative it to use a script such as Crypto.Js, which can support generating an MD5 locally within your browser.

For the above example, we end up with an MD5 value of:
c936af1afa3bd7fb36a66e2ed2437ba1

Lastly, you need to extend your Extensions.conf file

[outbound-voxbone]
 exten => +3281998877,1,Dial(PJSIP/[email protected])

The sample Asterisk Configs for pjsip_custom.conf and extensions_custom.conf are available here. Please note you did need to change these as above to ensure they are aligned to your system. They will not work without modification.

For any questions, please contact us