Extension routing provides an option to allow callers to dial a specific extension to reach a given representative.This can be useful in circumstances where continuity of the relationship is critical. The basic flow for this experience is as follows:
- Caller selects an option to dial by extension
- Caller enters a 4-6 digit extension, terminating with #
- Lambda query to Salesforce to find an agent by extension
- Lambda function to process the Salesforce response accordingly
- Route to agent personal queue
To enable extension dialing, we need to deploy some resources. There is a slight difference in required resources depending on deployment model (SCV vs CTI), which is noted below:
- AWS Lambda function to query Salesforce for the user ID (CTI deployments)
- AWS Lambda function to parse the REST API reponse from the default InvokeRestApi function and generate the user ID (SCV deployments)
- Amazon Connect contact flows to manage the customer experience
For these deployments, the following AWS Lambda functions are provided:
- awsscv_extension_routing_query_%InstanceName% (AWSSCV-SFQuery.py): Provides ability to query Salesforce to find user based on extension and user ID parameter provided
- awsscv_extension_routing_processor_%InstanceName% (AWSSCV-ProcessExtension.py): Receives the raw user ID from the Salesforce Rest API query and formats it to match the user ID
Example contact flows have been provided to show you how to use the Extension Routing feature.
- AWSSCV-ExtensionRouter-SCV: (SCV ONLY) Standard contact flow that uses the default Service Cloud Voice invoke REST Api Lambda funciton to query for the user by extension, then uses the awsscv_extension_routing_processor_%InstanceName% Lambda function to format the retrieved user ID to match the Amazon Connect user ID.
- AWSSCV-AgentWithStreaming: (SCV ONLY) Agent whisper flow for Service Cloud Voice deployments that iniates realtime transcription (OPTIONAL)
- AWSSCV-ExtensionRouter-CTI: (CTI ONLY) Standard contact flow that uses the default Service Cloud Voice invoke REST Api Lambda funciton to query for the user by extension, then uses the awsscv_extension_routing_query_%InstanceName% Lambda function to find the agent ID based on extension lookup. The Invoke API block must be modified to use the Salesforce field ID that stores the agent username.
- Service Cloud Voice enabled
- Amazon Connect configuration complete
- Users have extensions defined
- REST API authentication for AWS Lambda has been completed
- Access to the AWS Console
- CTI Adaptor for Amazon Connect installed and configured
- AWSSCV Salesforce Config deployed
- AWSSCV Common Layers deployed
- Access to the AWS Console
- Right-click/control-click to download the AWSSCV Extension Routing CloudFormation template.
- In a new browser tab, login to the AWS Console
- Make sure you are in the same region as your Amazon Connect instance. You can set the region by expanding the region selector in the upper right and choosing the region
- Navigate to the CloudFormation console
- Select Create Stack, and choose With new resources (standard)
- In the Specify Template section, choose Upload a template file
- Select Choose file
- Navigate to the folder where you saved awsscv_extension_routing_scv.yaml
- Select Next
- In the Stack Name field, enter
AWSSCV-ExtensionRouting-SCV
- Enter the parameters as follows (most from your notepad): a. AWSRegion: Select the region that you have deployed Amazon Connect in b. ConnectInstanceName: Your connect instance name c. Salesforce Org ID: Provide the ID for your Salesforce Org d. SalesforceRestApiFunctionRole: ARN of the InvokeSalesforceRestApiFunctionRole
- Select Next
- In Service Cloud Voice deployments, it is normal to see a warning on the next page, Configure stack options
- Scroll to the bottom and select Next
- Scroll to the bottom and select Create Stack
- After a minute or two, the stack should complete.
- Right-click/control-click to download the AWSSCV-AgentWithStreaming agent whisper flow.
- Right-click/control-click to download the AWSSCV-ExtensionRouter-SCV Contact Flow.
- Access to the AWS Console
- Navigate to the Amazon Connect Console
- Select your Amazon Connect instance
- Select Contact Flows from the left navigation menu
- Go to the AWS Lambda section
- In the Function Dropdown, choose the function that begins with awsscv_extension_routing_processor_scv
- Select **+ Add Lambda Function
- Select Overview from the left navigation menu
- Select Log in for emergency access to open the Amazon Connect admin UI
- In the left navigation menu, choose Routing, then select Contact flows
- Select the down arrow next to Create contact flow and choose Create agent whisper flow
- In the upper-right, select the down arrow and choose Import flow(beta)
- Choose Select and navigate to the AWSSCV-AgentWithStreaming flow you dowloaded, then select Import
- In the imported flow, modify the Invoke AWS Lambda function block to use the *kvsConsumerTrigger Lambda function that you have assigned to your instance.
- Save and Publish the flow
- Once the flow has published, in the left navigation menu, choose Routing, then select Contact flows
- Select Create contact flow
- In the upper-right, select the down arrow and choose Import flow(beta)
- Choose Select and navigate to the AWSSCV-ExtensionRouter-SCV flow you dowloaded, then select Import
- In the imported flow, find the Set whisper flow block and set it to use the whisper flow that you just published.
- Find the Invoke AWS Lambda function block that includes the soql parameter. In the flow, it should be the first Lambda block the you find.
- Change that block to use the InvokeSalesforceRestApiFunction function configured for your instance.
- Immediately following the previous block, there is another Invoke AWS Lambda function block. Modify it to to use your awsscv_extension_routing_processor function.
- Scroll to the right to find the last Invoke AWS Lambda function block.
- Change that block to ouse the InvokeTelephonyIntegrationApiFunction function configured for your instance.
- OPTIONAL: There is a Set wworking queue block on the bottom of the flow that is connected to the Complete branch on the flow loop. It is set to the default BasicQueue. If you would like calls that fail to connect to an extension to go elsewhere, modify the destination here.
- Save and Publish the flow
- You can now call this flow from your main IVR once a customer has indicated that they want to speak with a specific agent.
- Right-click/control-click to download the AWSSCV Extension Routing CloudFormation template.
- In a new browser tab, login to the AWS Console
- Make sure you are in the same region as your Amazon Connect instance. You can set the region by expanding the region selector in the upper right and choosing the region
- Navigate to the CloudFormation console
- Select Create Stack, and choose With new resources (standard)
- In the Specify Template section, choose Upload a template file
- Select Choose file
- Navigate to the folder where you saved awsscv_extension_routing_cti.yaml
- Select Next
- In the Stack Name field, enter
AWSSCV-ExtensionRouting-CTI
- Enter the parameters as follows (most from your notepad): a. AWSRegion: Select the region that you have deployed Amazon Connect in b. AWSSCVCommonLambdaPythonLayer: ARN of the common python layer c. AWSSCVCommonRole: ARN of the awsscv_common_role role d. ConnectInstanceName: Provide the instance name for Amazon Connect. e. sfConfig: ARN for your Salesforce config in AWS Secrets Manager
- Select Next
- In Service Cloud Voice deployments, it is normal to see a warning on the next page, Configure stack options
- Scroll to the bottom and select Next
- Scroll to the bottom and select Create Stack
- After a minute or two, the stack should complete.
- Right-click/control-click to download the AWSSCV-ExtensionRouter-CTI Contact Flow.
- Access to the AWS Console
- Navigate to the Amazon Connect Console
- Select your Amazon Connect instance
- Select Contact Flows from the left navigation menu
- Go to the AWS Lambda section
- In the Function Dropdown, choose the function that begins with awsscv_extension_routing_query_cti
- Select **+ Add Lambda Function
- Select Overview from the left navigation menu
- Select Log in for emergency access to open the Amazon Connect admin UI
- In the left navigation menu, choose Routing, then select Contact flows
- Select Create contact flow
- In the upper-right, select the down arrow and choose Import flow(beta)
- Choose Select and navigate to the AWSSCV-ExtensionRouter-CTI flow you dowloaded, then select Import
- In the imported flow, find the Invoke AWS Lambda function block
- Change that block to use the awsscv_extension_routing_query_cti function configured for your instance.
- In the same block, modify the sf_sso_object parameter value to match the Salesforce field that contains your Amazon Connect user name. The mos common configurations are:
- Username
- FederationIdentifier
- CommunityNickname
- OPTIONAL: There is a Set wworking queue block on the bottom of the flow that is connected to the Complete branch on the flow loop. It is set to the default BasicQueue. If you would like calls that fail to connect to an extension to go elsewhere, modify the destination here.
- Save and Publish the flow
- You can now call this flow from your main IVR once a customer has indicated that they want to speak with a specific agent.