I'm using the StartOutboundVoiceContactCommand
from the @aws-sdk/client-connect
package to initiate outbound calls from a Lambda function. However, every time I call this function, I receive the following error:
{
"errorType": "Error",
"errorMessage": "LimitExceededException: UnknownError",
"trace": [
"Error: LimitExceededException: UnknownError",
" at initializeCall (file:///var/task/index.mjs:84:15)",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at async Runtime.handler (file:///var/task/index.mjs:29:22)"
]
}
Here's a snippet of my Lambda function where I'm using the StartOutboundVoiceContactCommand
:
const initializeCall = async ({ DestinationPhoneNumber, ContactFlowId, InstanceId, SourcePhoneNumber, attributes }) => {
try {
const input = {
DestinationPhoneNumber,
ContactFlowId,
InstanceId,
SourcePhoneNumber,
Attributes: attributes,
AnswerMachineDetectionConfig: {
EnableAnswerMachineDetection: true,
AwaitAnswerMachinePrompt: false
},
TrafficType: "CAMPAIGN",
};
const command = new StartOutboundVoiceContactCommand(input);
const response = await client.send(command);
return response;
} catch (error) {
throw new Error(error);
}
};
While I've implemented error handling in my code, I'm unsure about the service quotas. I'm still facing the LimitExceededException: UnknownError
.
Has anyone encountered a similar issue or can provide insights into what might be causing this error? Any guidance would be greatly appreciated.
Thank you very much for your response. I appreciate the suggestion regarding the rate limits. However, I don't believe this issue is related to a quota limit. When I call the API without the TrafficType attribute and the AnswerMachineDetectionConfig, it executes without any errors. This leads me to believe that the problem might be elsewhere. Any further insights would be greatly appreciated.
Have you enabled outbound campaigns on your instance? The traffic type you are specifying requires this functionality to be enabled. https://docs.aws.amazon.com/connect/latest/adminguide/enable-outbound-campaigns.html
Yes, I have enabled outbound campaigns on my instance. I followed the documentation thoroughly, but unfortunately, it still didn't work as expected. Do you have any other suggestions or potential solutions?
Sorry you are running into this. I would open up an AWS Support case to have one of our support engineers investigate as a LimitExceeded error typically is related to service quotas associated with your account.
Thank you very much for your support Samfred. I will do that.