- Newest
- Most votes
- Most comments
The availability of contact data at different events in Amazon Connect is related to how the system processes and streams contact information.
Contact data becomes fully available only after the contact has been completed, which is why it's accessible at the "onDestroy" event. This is because Amazon Connect needs to compile all the information about the contact, including its entire lifecycle, before making it available.
To get more real-time information about contacts, including data that would be available during "onConnected" and "onConnecting" events, you have a few options:
-
Enable data streaming for your Amazon Connect instance. This allows you to export contact records and agent events in real-time using Amazon Kinesis. By setting up data streaming, you can access more granular information about contacts as events occur.
-
Use Amazon Connect contact events with Amazon EventBridge. This provides near real-time streams of events such as when a call is queued or connected to an agent. You can subscribe to these events and use them to trigger actions or collect data as the contact progresses.
-
Utilize the agent event stream. This stream provides detailed information about agent activities and the contacts they're handling, including the current state of the contact (e.g., CONNECTING, CONNECTED).
By implementing one or more of these approaches, you can gather more detailed contact information throughout the contact lifecycle, rather than waiting for the "onDestroy" event. However, it's important to note that some information may still only be fully available once the contact is completed.
Remember that handling real-time data streams requires additional setup and possibly changes to your application architecture to process and utilize the information effectively.
Sources
Amazon Connect contact events - Amazon Connect
Enable data streaming for your Amazon Connect instance - Amazon Connect
About contact states in Amazon Connect - Amazon Connect
