How to manually accept new conversation when using persistent connections?

Hi,

We have integrated purecloud-webrtc-sdk to our website to handle the webrtc sessions. We have a backend service watching state change for a user, and push that change to the frontend.

The frontend uses onPendingSession to collect all pending sessions. When a new call starts for a user, backend pushes the conversationID to frontend, Frontend then use that conversationID to find the related session and call sdk.acceptPendingSession to answer the call.

This all worked fine until we recently enabled WebRTC Persistent Connection. Because the WebRTC session is now persisted, we are not able to accept the conversation by accepting the pending session.

My questions:

  1. Is there a way to answer a call with conversationID using the SDK? If not, how should we handle this (not able to answer subsequent calls when WebRTC Persistent Connection is enabled)?
  2. Is our way of answering calls the right approach? Or did we handle this all wrong? What is the right way to do?

Thanks!

@Cheng_Kang we are still working on getting a uniform api/flow between initiating calls for poly, webrtc, and webrtc persistent-connection. As you mentioned, you'll only get a pending session when setting up the persistent connection initially. After the connection is set up, you'll need to use the conversations api to answer calls. I know this is not ideal and we are working on fixing this in the future.

I'm not sure which sdk you are using, but here's a link to the api in the javascript docs (it should be named similarly in the other sdks): patchConversationsCallParticipant

The body of the request you'll need here is { "state": "connected" }. Making this request will route the call through the persistent connection.

Thanks for your reply, I'll try it out.

Hi, thanks for the suggestion, it works.

Some more questions:

  1. Is there a way to manually establish a WebRTC persistent connection? So that we don't need to wait for the first session to come and switch between two ways of answering calls.
  2. Is there any API to tell if Persistent Connection is enabled for current user?

1: Unfortunately there's not a good way to do this. Most people in this situation just make an outbound call to their voicemail to establish the initial connection.

2: There is no API that indicates whether or not a persistent connection is active for a given user. I'm assuming that's what you meant. You can see if persistent connection setting is enabled on the station by using the station apis however.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.