Newer Version Available
InvokeTelephonyIntegrationApiFunction Lambda Function
Configuration: This function is available to Service Cloud Voice customers who are using an Amazon Connect instance thatâs provided by Salesforce. No additional configuration is necessary. See a sample version of the invokeTelephonyIntegrationApi Lambda function in GitHub.
Description: Use this Lambda function to create a VoiceCall record, execute an Omni-Channel flow, create a ContactRequest record for a callback, or route a voice call to a rep, queue, or flow. Creating a VoiceCall is essential to get the call working, which is why this function is typically one of the first blocks in your contact flow for an inbound call. This Lambda is invoked to perform the following actions:
- Create a VoiceCall for an inbound call. This action occurs when a customer calls into the call center.
- Create a VoiceCall for a call transfer. This action occurs when a rep transfers to another rep or queue.
- Create a ContactRequest for a callback. This action occurs when a customer requests a callback and provides their phone number for a rep to return their call.
- Execute an Omni-Channel flow. This action occurs when work is ready to be routed.
- Cancel an Omni-Channel flow. This action occurs when an existing flow needs to be canceled.
- Route a voice call. This action occurs when a voice call or transferred voice call is ready to be routed through Omni-Channel Unified Routing with Salesforce as the routing engine.
Usage: Place this Lambda within one of the relevant contact flows (either for an inbound call or a transfer). This Lambda takes a methodName attribute as an argument. This attribute indicates the specific action that the Lambda must perform.
| Action | Attribute Key | Attribute Value |
|---|---|---|
| Create a voice call for an inbound call | methodName | createVoiceCall |
| Create a voice call for a transfer | methodName | createTransferVC |
|
Request routing instructions from an Omni-Channel flow and create a PendingServiceRequest. Optionally, provide these inputs:
By default, Service Cloud Voice uses the Omni-Channel flow (or fallback queue) specified for the phone channel that matches the dialed number. If the dialed number doesnât match an existing phone channel, you can optionally set the Omni-Channel flow or fallback queue in these input parameters. The fallback queue is used only if the specified flow doesnât exist or one isnât specified. |
methodName | executeOmniFlow |
| Cancels an Omni-Channel flow that was previously executed. This method also calls the Clear Routing REST API to clear the PendingServiceRouting (PSR) record. | methodName | cancelOmniFlowExecution |
| Creates a callback request for a voice call by creating a ContactRequest record. Omni-Channel routes the contact request based on the contact center channelâs Callback Routing selection. For Omni-Channel Unified Routing only. | methodName | callbackExecution |
| Routes or transfers a voice call to a rep, agent, queue, or flow. Creates a
PendingServiceRequest. For Omni-Channel Unified Routing only. Provide these inputs:
|
methodName | routeVoiceCall |
When creating a voice call record, you can also specify custom data to be added to fields on the VoiceCall record. To add custom data, create a Set contact attributes block before the Lambda call. For the destination attribute, specify the name of the custom field with the âsfdc-â prefix added. The value of this attribute is the data to pass into the custom field For an example, see Pass Data from the Interactive Voice Response (IVR) System.
| Output Attribute Name | Description |
|---|---|
| voiceCallId | ID of the voice call. |
| Output Attribute Name | Description |
|---|---|
| agent | The rep to route the call to |
| queue | The queue to route the call to |
| errors | List of errors why the call couldnât be routed |
| Output Attribute Name | Description |
|---|---|
| recordId | ID of the contact request for a callback. |