Objective
To guide users on how to configure Twilio Flex so that different outbound caller IDs (output numbers) are used when making outbound calls from the Flex dialpad or during call transfers, using Flex Plugins.
Product
Twilio Flex
Environment
Twilio Console
User Account Permission/Role(s) Required
- Twilio Console access with Admin or Developer permissions
- Ability to deploy and manage Flex Plugins
Procedure
-
Understand Default Behavior:
By default, Twilio Flex uses a pre-configured caller ID for all outbound calls made from the Flex dialpad. There is no built-in UI option for agents to select a different caller ID per call or per queue. - Customizing Caller ID with a Flex Plugin:
- To set different outbound numbers based on queue, agent, or other criteria, you need to develop a Flex Plugin.
- Use the Flex Plugins CLI to create a new plugin or modify an existing one.
- Override the
StartOutboundCallaction in your plugin code. - Set the
callerIdproperty dynamically based on your business logic (e.g., selected queue, agent, or a custom UI selection).
Example Code Snippet:
flex.Actions.replaceAction("StartOutboundCall", (payload, original) => {
// Custom logic to determine the callerId
payload.callerId = "+1234567890"; // Replace with dynamic logic as needed
return original(payload);
});-
Customizing Caller ID for Transfers:
- Similar logic can be applied to call transfer actions by overriding the relevant transfer actions in your plugin.
- This allows you to control the caller ID presented during a transfer.
-
Deploy and Test:
- Deploy your plugin to your Flex environment.
- Test outbound calls and transfers to ensure the correct caller ID is used according to your logic.
Additional Information
- The native Flex dialpad does not support agent-to-agent direct calls or external transfers unless using the legacy dialpad.
- Caller ID selection is not exposed as a UI option for agents; it must be set programmatically.
- For more details on Flex Plugins, see the Twilio Flex Plugin documentation.
- For information on call transfer logic, refer to the Flex End User Guide: Warm Transfer and Dialpad Use.
If you have further questions or need tailored code examples, consider reaching out to Twilio support.