cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
718
Views
10
Helpful
2
Replies

Identify Call End

Badar Ali
Level 1
Level 1

Hi,

We wanted to differentiate the call-end event from all participants vs the call-end event for a particular participant.

Let me explain by an example, let's say we have an inbound call between agent A and a customer, and then agent A direct transfers it to agent B. Now we want to differentiate that when agent A transferred the call, the call wasn't ended it was transferred to B however when agent B will end the call, it will end for all participants. 

I have looked at dialog events and tried to use dialog state and event type for this purpose, but this approach doesn't work since the dialog event is different for various scenarios. 

Best Regards,
Badar

2 Replies 2

Yugandhar reddy
Level 1
Level 1

Hi Badar,

you can verify combination of current agent extension against the dialog participants matching with device address and state as dropped

I know this is an old post..

 

handleEndDialog = function (dialog) {

			callType = dialog.getCallType();
			mediaType = dialog.getMediaType();
			dialogUri = dialog.getDialogUri();
			dialogState = dialog.getState();
			getToAddress = dialog.getToAddress();
			getFromAddress = dialog.getFromAddress();


			var callVars = dialog.getMediaProperties();
			var callParticipants = dialog.getParticipants()

			for (var i = 0; i < callParticipants.length; i++) {
				if (callParticipants[i]["mediaAddress"] === user.getExtension()) {
						// The agent event
				} else {
						// Other call event
				}
			}
		}

Hope that helps

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.