Menu

Expand
Rate this page:

Advanced Voice Configuration

Frontline's default behavior handles call routing to and from a Frontline worker, as well as creating new Conversations and assigning workers to those new Conversations. If you already like Frontline's default behavior for your use case, you don't need to configure anything.

Don't have Voice integrated into Frontline yet? Go to the Voice in Frontline onboarding guide first.

If, however, your use case requires any of the behaviors in the list below, you will need to customize your Frontline Voice configuration:

  • Executing other Voice TwiML instructions before connecting a customer and a Frontline worker (e.g. customers are sent to an IVR before being connected to a Frontline worker)
  • Configuring in-call behavior (e.g. call recording is enabled for all calls)
  • Configuring call behavior after a participant leaves the call or when an error occurs (e.g. a customer is prompted to leave a voicemail message in the event no Frontline worker answers their call)

Custom Frontline Voice configuration always requires the use of <Connect><Conversation> TwiML.

If you want to change outbound call behavior, you will need to change the Voice Configuration Request URL for the "Voice in Frontline" TwiML App as outlined below. Depending on your use case, you may need to update your Frontline Phone Number configuration, as well.

To make your custom Frontline Voice configuration process go as smoothly as possible, you should:

Frontline Voice calling and the Voice SDK

Frontline's Voice functionality leverages the Voice SDK in the background, so you will need to understand how the Voice SDK works with a TwiML App and AccessTokens. Read more about how the Voice SDKs work on the Voice SDK Overview Page.

Frontline handles the creation of AccessTokens for your Frontline workers. These AccessTokens contain the SID for a TwiML App that is automatically created when enabling Frontline Voice capabilities. For this reason, all outgoing calls will be handled by the "Voice in Frontline" TwiML App's Voice Configuration Request URL.

When you integrated Voice into Frontline, you configured your Frontline Phone Number(s) to also use this TwiML App's Voice Configuration Request URL to handle incoming calls.

Use your own custom Frontline Voice Configuration

When you select the Use your custom configuration option on your "Voice in Frontline" TwiML App's Console page, you are granted the ability to change the Voice Configuration URLs for the TwiML App.

Your next steps depend on your use case. Consider which of the following scenarios meets your use case's needs:

  • Inbound calls (calls to Frontline workers) and outbound calls (calls from Frontline workers) will both use the same TwiML instructions
  • Inbound calls and outbound calls will use different TwiML instructions

Inbound and outbound calls use the same TwiML

If calls to and from Frontline workers should use the same TwiML (e.g. you want to record all calls), you will need to:

  1. Set up an endpoint that serves <Connect><Conversation> TwiML (a TwiML Bin, a Twilio Function, a web server endpoint, etc.)
  2. Configure your "Voice in Frontline" TwiML App following the steps listed in the Use custom configuration in the TwiML App section below.

Outbound Frontline calls are always handled by the "Voice in Frontline" TwiML App and your Frontline Phone Numbers are already configured to use that same TwiML App for call handling.

Inbound and outbound calls use different TwiML

If calls to and from Frontline workers should behave differently (e.g. customers are sent to an IVR before reaching a Frontline worker), you need to decide how you want to handle inbound calls.

You can choose one of the following strategies:

  • Use the same the same endpoint to handle inbound and outbound calls
  • Decouple inbound call handling from the "Voice in Frontline" TwiML App
Use the same endpoint for all calls

If you want to use the same endpoint to to handle both directions of calls, you need to:

  1. Set up an endpoint that checks the direction of the call and creates appropriate TwiML based on the direction of the call.
  2. With this endpoint, configure your "Voice in Frontline" TwiML App following the steps listed in the Use custom configuration in the TwiML App section below.
Decouple inbound call handling from the TwiML App

If you want to decouple inbound call handling from the "Voice in Frontline" TwiML App, you need to:

  1. Set up an endpoint that contains the TwiML instructions for handling inbound calls. At least one path for inbound calls must lead to <Connect><Conversation> TwiML instructions in order to connect to Frontline.
  2. Reconfigure your Frontline Phone Number Voice Configuration to use this new endpoint (instead of the "Voice in Frontline" TwiML App).
    • Find your Frontline Phone Number(s) in the Console by navigating to Phone Numbers > Manage > Active Numbers and clicking on your Frontline Phone Number.
    • Under Voice & Fax, configure the CONFIGURE WITH and A CALL COMES IN options with the endpoint that will serve your new TwiML instructions and click Save.
  3. Optionally, you can modify outbound call behavior by changing your "Voice in Frontline" TwiML App's Voice Configuration URL to another endpoint that serves <Connect><Conversation> TwiML that is appropriate for outbound calls.

Use custom configuration in the TwiML App

Follow the steps below to customize the configuration of your "Voice in Frontline" TwiML App:

  1. In the Console, navigate to Voice > Manage > TwiML apps
  2. On the TwiML Apps page, click on the Voice in Frontline TwiML App.
  3. On the Voice in Frontline TwiML App page, under Voice Configuration heading, select the Use your custom configuration radio button. (You will see a new Voice Configuration section on the page.)
  4. Under Voice Configuration, enter your new Request URL for your TwiML endpoint, and set the Request Method to POST.
  5. Enter your new Fallback URL and select the appropriate Request Method (optional).
  6. Scroll to the bottom of the page and click the Save button.

What's next?

Now that you've decided how you want to handle inbound and outbound calls, you need to decide which of the following call behaviors you want to modify:

  1. Call behavior before connecting to a Frontline worker.
  2. Call behavior during the call leg that connects the Frontline worker and customer.
  3. Call behavior after the call leg between the Frontline worker and customer, and/or error handling.

The <Connect><Conversation> TwiML doc guides you through how to modify these call behaviors using <Connect> and <Conversation> TwiML.

Test <Connect><Conversation>

Ready to test out <Connect><Conversation>? The fastest way to do this is with a TwiML Bin.

For inbound call testing, make sure your Twilio Phone Number is configured to use the TwiML Bin for incoming calls (or that the Voice in Frontline TwiML App is configured with the TwiML Bin's URL).

For outbound call testing, make sure your Voice in Frontline TwiML App's Voice URL is configured with the TwiML Bin's URL.

Learn more about Frontline's Voice functionality

If you want to learn more about TwiML Apps and how calls are handled by Frontline, read the TwiML Apps and Configure Call Handling sections on the Voice SDK Overview page.

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more