So far we are able to start conference calls using the webrtc library and the endpoints to create a conference token and bring in the participants. Is there a way to be able to know when a participant hangs up or when a new participant is brought in so that we can update the interface accordingly (display new participant or remove the one that hung-up)? Also, how can we remove a participant in the conference call?
How to manage the participants of a conference call using the webrtc library?
You can use the telephony session event notifications to catch telephony events to detect participants (added and removed) in a conference call. It is very complicated and I cannot explain how to detect here. Pay attention to the event similar to the example event below when a participant is added to a conference:
{ "uuid": "1025258805069352046", "event": "/restapi/v1.0/account/80964XXXX/extension/622953XXXXX/telephony/sessions", "timestamp": "2024-02-27T16:04:52.558Z", "subscriptionId": "3ca0ec27-a916-4260-82ad-035752e61da2", "ownerId": "6228832XXXX", "body": { "sequence": 9, "sessionId": "1229016182016", "telephonySessionId": "s-a0d17b82ddacdz18deb4ee132z1878e190000", "serverId": "10.13.23.184.TAM", "eventTime": "2024-02-27T16:04:52.223Z", "parties": [ { "accountId": "80964XXXX", "extensionId": "622953XXXXX", "id": "p-a0d17b82ddacdz18deb4ee132z1878e190000-1", "direction": "Outbound", "to": { "phoneNumber": "11119", "name": "Paco Vu", "extensionId": "622883XXXXX" }, "from": { "phoneNumber": "+1650XXXXXXX", "name": "Agent 122", "extensionId": "622953XXXXX", "deviceId": "80254586XXXX" }, "status": { "code": "Gone", "reason": "Conference", "peerId": { "telephonySessionId": "s-a0d7bfa2dd198z18deb4fcc72z184536c0000", "sessionId": "0", "partyId": "p-a0d7bfa2dd198z18deb4fcc72z184536c0000-2" }, "rcc": false }, "park": {}, "missedCall": false, "standAlone": false, "muted": false } ], "origin": { "type": "Call" } } }
And similar to this example event when a participant is removed from the conference call:
{ "uuid": "6754846377425683265", "event": "/restapi/v1.0/account/80964XXXX/extension/622953XXXXX/telephony/sessions", "timestamp": "2024-02-27T16:06:13.233Z", "subscriptionId": "3ca0ec27-a916-4260-82ad-035752e61da2", "ownerId": "6228832XXXX", "body": { "sequence": 11, "sessionId": "1229016182016", "telephonySessionId": "s-a0d17b82ddacdz18deb4ee132z1878e190000", "serverId": "10.13.23.184.TAM", "eventTime": "2024-02-27T16:06:13.166Z", "parties": [ { "accountId": "80964XXXX", "extensionId": "622953XXXXX", "id": "p-a0d17b82ddacdz18deb4ee132z1878e190000-1", "direction": "Outbound", "to": { "phoneNumber": "11119", "name": "Paco Vu", "extensionId": "622883XXXXX" }, "from": { "phoneNumber": "+1650XXXXXXX", "name": "Agent 122", "extensionId": "622953XXXXX", "deviceId": "80254586XXXX" }, "status": { "code": "Disconnected", "rcc": false }, "park": {}, "missedCall": false, "standAlone": false, "muted": false } ], "origin": { "type": "Call" } } },
The best way to learn about this is to implement the notification, run a test conference call and print out all the events and learn from the event payloads.
You can call the Delete call party API to delete a party (from the original direct call) and that will disconnect that party from the conference call he was added to the conference call.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.