Monitor VoiceCall Limit Errors
The output of the InvokeTelephonyIntegrationApi Lambda function is stored in a contact attribute. If the contact attribute’s value is set to 429, it means that an error occurred. Go to AWS Cloudwatch to view the logs and search for error messages that contain the prefix SCV_LIMITS_ERROR. This prefix indicates a VoiceCall limit error.
You can address these errors in two ways. One way creates a fallback mechanism that times out after a certain number of attempts. The other way writes a value to a contact attribute so you can see when errors occur.
OPTION 1: Use a fallback mechanism that times out
This approach creates a fallback mechanism that you can add to the contact flow. In this approach, the system attempts to create the VoiceCall record for a certain number of times and then times out.
- From the inbound contact flow, set the contact attribute, name it, and set its value to FALSE. For this use case, we name it "sf_voicecall_limit_error". To learn more about contact attributes, see the Amazon Connect Administrator Guide on setting contact attributes.
- Modify the InvokeTelephonyIntegrationApi Lambda function to catch any 429 API response codes returned from the CreateVoiceCall API. This 429 error code is returned by the API when it hits any limit errors. Once you catch the error, update the contact attribute you previously created by setting the value to TRUE.
- From within the contact flow, the Lambda errors out, so as part of the error branch of the Lambda block, place a check contact attribute block and verify if the attribute is TRUE. If so, you can put a loop block in the contact flow and play a prompt before trying to create a VoiceCall record. Track of the number of retries using another contact attribute. You can put a limit on the number of times the system tries to create the VoiceCall record. To learn more about contact attributes, see the Amazon Connect Administrator Guide on checking contact attributes.
This approach uses a fallback mechanism when the per second limit is hit.
OPTION 2: See the number of failed calls
- Write the error to a contact attribute such as Voice_Call_Creation_Status.
- To identify how many calls failed as a result of the limit error, do a contact search using the contact attribute. Use a filter to search based on contract attributes. Update the Lambda function to check a condition on the contact attribute.