End call programmatically?

Is there a way to programmatically end call in Cometchat using JavaScript?

I have a situation where when a game with a friend ends in my app user gets redirected to another page, and if a user tries to play another game with the same friend he can not establish a call because of next error:

Using “@cometchat-pro/chat”: “2.0.5”

1 Like

Hello @Kacha,

Currently, there is no way to programmatically end the call. You can end the call by clicking the hang up button present in the view.

You can create a thread in the feature request section of the forum. This section is monitored by our product team. Once you create a thread in the forum, the product team can then decide when this feature needs to be taken up and provide you with an update regarding the same.

To visit the Feature Request section, you can click on the below link:
https://forum.cometchat.com/c/feature-requests

1 Like

Hello @Kacha,

We have added a method in the latest version of the JS SDK (v2.0.6) to end call programmatically by calling the end call method:

CometChat.endCall(sessionId).then(
    call => {
        console.log("Call ended", call);
    },err => {
        console.log("error while ending call", err);
    }
)

Please check the same and do let us know if you face any issues.

2 Likes

Hello @mayur.bhandari,

The end call method is working like a charm…
Thanks!

2 Likes

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