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.
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.
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
If calls to and from Frontline workers should use the same TwiML (e.g. you want to record all calls), you will need to:
- Set up an endpoint that serves <Connect><Conversation> TwiML (a TwiML Bin, a Twilio Function, a web server endpoint, etc.)
- 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.
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
If you want to use the same endpoint to to handle both directions of calls, you need to:
- Set up an endpoint that checks the direction of the call and creates appropriate TwiML based on the direction of the call.
- 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.
If you want to decouple inbound call handling from the "Voice in Frontline" TwiML App, you need to:
- 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.
- 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.
- 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.
Follow the steps below to customize the configuration of your "Voice in Frontline" TwiML App:
- In the Console, navigate to Voice > Manage > TwiML apps
- On the TwiML Apps page, click on the Voice in Frontline TwiML App.
- 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.)
- Under Voice Configuration, enter your new Request URL for your TwiML endpoint, and set the Request Method to POST.
- Enter your new Fallback URL and select the appropriate Request Method (optional).
- Scroll to the bottom of the page and click the Save button.
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:
- Call behavior before connecting to a Frontline worker.
- Call behavior during the call leg that connects the Frontline worker and customer.
- 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.
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.