jlee | 2017-06-29 15:12:05 UTC | #1
I am subscribing to get all calls on a number of queues via the notification API and am trying to trigger some logic when I identify a call as being 'complete'. However, the payload I get back from the notification API is not very explicit in this regard. I have created a few heuristics to try and capture this but am wondering if anyone else has found any foolproof methods.
The first method I tried was to check and see if all participants had an end time (indicating that all steps of the call; were complete) but ran into issues with scheduled callbacks behaving differently. What I am testing now is checking when all agent participants have a wrap up code and an end time but I am worried about what happens when an agent forwards a call to another agent (using this logic I feel like it would prematurely see the call as "complete").
Any help would be great, thank you!
tim.smith | 2017-06-29 15:26:03 UTC | #2
You should be able to just check for the presence of segmentEnd for all segments for all sessions for all participants to determine if the conversation is "over" (using analytics conversation detail query). However, keep in mind that just because all segments have ended doesn't prohibit the conversation data from being modified in the future.
I tested this with scheduled callbacks and they will continue to have a segment without a segmentEnd value until the callback is fully concluded. Are you seeing something different?
jlee | 2017-06-29 16:04:28 UTC | #3
I see the same thing when using the analytics endpoint. I was hoping to only use the payload that I get from the notifications API to determine the calls status as complete to keep down on API chatter, but it sounds like I will need to do another call to analytics to be sure?
tim.smith | 2017-06-29 16:14:58 UTC | #4
My apologies. That was clear in your post and I didn't answer your question.
For the notification schema for v2.users.{id}.conversations, it's actually easier. You can determine if the conversation is over by checking the state of each media object (calls, callbacks, etc). If the state is disconnected for all media, then the conversation has ended. In the case of scheduled callbacks, the state for the callback will be scheduled until it's been handled.
system | 2017-07-30 16:15:43 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 1485