Answering inbound call using JavaScript SDK

Hello,
I am trying to answer an inbound call using the code below:

function connect(callId, participantId) {
	// Create request body, only set desired properties
	const body = {
		state: "connected",
	};

	// Invoke API
	conversationsApi
		.patchConversationsCallParticipant(callId, participantId, body)
		.then(() => {
			console.log("Call connected successfully!");
		})
		.catch(err => {
			console.log(
				"There was a failure calling postConversationsCalls"
			);
			console.error(err);
		});
}

This code works most of the time. However, if the agent tries to answer a call the first time after he logs in, the call is not answered despite displaying the message Call connected successfully!. I will need to place a dummy call and answer it from the Genesys Workspace. Once that is done, this code works fine.

Is there a way to fix this? Thanks in advance

Hi,

If you are using a WebRTC station, the following forum topic should be a help:

Thank you for the reply @ronan.watkins. We are using WebRTC station, and I was able to answer the calls using same pure cloud API that is mentioned in the solution of that thread. The question I have is 'whether it is possible to automate the activation of the WebRTC other than by placing a dummy call'. Thanks once again.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.