Links
Comment on page

Live Call Routing

Route incoming phone calls to the right person with the on-call schedules and escalation policies you already use. Add real-time conversations to your support workflow!
Company
Estimated Time
Vendor Docs
Open Source
7 minutes
view
v3.rb
Twilio Live Call Routing

What is Twilio Live Call Routing Integration?

Twilio is a cloud communications platform for building SMS, Voice & Messaging applications on an API built for global scale.
With Twilio Live Call Routing, PagerTree users can:
  • Purchase and manage global phone numbers using Twilio.
  • Route incoming phone calls to PagerTree teams with on-call schedules and escalation layers.
  • Have the caller leave a voicemail if for some reason the on-call can’t answer.
  • Customize “hold music” and “voicemail message”.
Additionally, live call routing can be configured to route to multiple teams. When configured to route to multiple teams, callers will be presented with team options. For example: “Press 1 for Devops, Press 2 for Network Operations, Press 3 for Security”.

How it works

Twilio users can route incoming phone calls to on-call customer support.
  • When a new call comes in from Twilio, an alert is created in PagerTree automatically.

Integration Walkthrough

In this integration tutorial we will show you how to route an incoming phone call from Twilio into PagerTree. The estimated time for this integration is 7 minutes. We assume that you already have a PagerTree and Twilio account setup.

In Twilio - Create API Credentials

  1. 1.
    Open a text editor, as we’ll need to copy several pieces of data.
  2. 2.
    In the top right menu bar, navigate to Account -> Keys & Credentials -> API Keys & tokens.
    Click API keys & tokens
  3. 3.
    Ensure the United States (US1) Region is selected and click Create API key button.
    Ensure the United States (US1) Region is selected and click Create API key button.
  4. 4.
    Give your key the following:
    1. 1.
      Friendly name - Something you will easily remember
    2. 2.
      Region - This must be United States (US1)
    3. 3.
      Key type - Standard
      When you create the API Key, make sure you've set all the correct settings.
  5. 5.
    Copy the SID and Secret to your text editor.
  6. 6.
    Check the "Got it! I have saved my API..." and click Done.
    Copy the Twilio API Key SID and Secret
  7. 7.
    Your text editor should now have the API Key SID and Secret.
    Text editor with our API Key SID and Secret

Find the Twilio Account SID

Please note the API Key SID is different from the Account SID, so do not get them confused.
  1. 1.
    From the Twilio dashboard, under account info, copy the Account SID. (It should begin with "AC")
    Copy the Twilio Account SID
  2. 2.
    Your text editor should now have:
    1. 1.
      API Key SID and Secret
    2. 2.
      Account SID

In PagerTree - Create the Integration

  1. 1.
    Create the integration by clicking the Twilio Live Call Routing logo.
  2. 2.
    In the Options section, edit each option accordingly
    1. 1.
      Paste the API Key SID you copied earlier to the Twilio API Key field. (Should start with "SK")
    2. 2.
      Paste the API Secret you copied earlier to the Twilio API Secret field.
    3. 3.
      Paste the Account SID you copied earlier to the Twilio Account SID field. (Should start with "AC")
      Your Twilio live call routing integration should look like the above.
  3. 3.
    Click “Create”

In Twilio - Configure a Phone Number

  1. 1.
    If you haven’t already, upgrade to a paid Twilio account.
  2. 2.
    If you haven’t already, buy a phone number.
  3. 3.
    Navigate to your purchased number Develop -> Phone Numbers -> Manage -> Active Numbers.
  4. 4.
    Select the phone number that will be used for Live Call Routing.
  5. 5.
    On the Phone Number Configure Tab, under Voice & Fax -> A Call Comes In
    1. 1.
      Paste the PagerTree Endpoint URL you copied earlier
    2. 2.
      Ensure the type is Webhook
    3. 3.
      Ensure the action is HTTP POST
    4. 4.
      Click Save
      Configure the Twilio phone number to send incoming calls to PagerTree.
You have successfully completed the Twilio (Live Call Routing) Integration.

Prompt the caller for a team selection

You can set the destinations of the Live Call Routing integration to be multiple teams. When this is done, the caller will be prompted to select the team they wish to connect to. The team name will be used when reading the presentable options. Team names will be read in alphabetical order.
Push 1 for Customer Support. Push 2 for DevOps - api.pagertree.com.
Set the destinations to multiple teams to prompt the user for a selection.

Integration Options

Option
Description
Default
Welcome Recording
A recording that will be played first to caller (ex: "Hello, you have reached the Devop's on-call support line.")
Before Wait Music Recording
A recording to be played before wait music music.
Wait Music Recording
A recording or wait music to be played while the caller waits for someone to acknowledge the alert.
Before Connect Recording
A recording played before connecting the caller to the acknowledger.
Voicemail
Record a voicemail when no one acknowledges the call?
False
Voicemail Greeting Recording
A recording to be played when no one answers.
No answer
After Voicemail Greeting Recording
A recording played after the caller leaves a voicemail.
Voicemail Emails
A list of emails to send a notification to when the caller leaves a voicemail.
Force Caller Input
Should PagerTree force caller input even if there is only one team assigned as a destination?
False

Special uses with routers

The Twilio Live Call Routing can be used with *limited* router functionality for dynamic selection of teams to be present to the caller.
  • When using this configuration, set the destinations of the integration to be only the router.
  • You can only use the assign action.
  • Team options will be read out in the order they are assigned (not alpha order)

Example - Time of day router to present different teams to the caller

---
rules:
- match:
$timeBetween:
timeformat: 'hh:mm a'
timezone: 'America/New_York'
starttime: '12:00 pm'
endtime: '12:00 am'
actions:
- type: assign
receiver: tem_aaaaa # Team A
- type: assign
receiver: tem_bbbbb # Team B
- match:
$timeBetween:
timeformat: 'hh:mm a'
timezone: 'America/New_York'
starttime: '12:00 am'
endtime: '12:00 pm'
actions:
- type: assign
receiver: tem_ccccc # Team C
- type: assign
receiver: tem_ddddd # Team D