From 03a494b9a11ad9f86ff801ee1a7e57c49dbdcf15 Mon Sep 17 00:00:00 2001 From: Nouhaila Idrissi Zouggari Date: Fri, 19 Jan 2024 15:39:26 +0100 Subject: [PATCH] MT#58958 Add support to call hold/unhold to the webrtc client Change-Id: I4dc2e692ab25db1e126651e690583310db7b3a39 --- src/api/ngcp-call.js | 20 ++++++++++++++++++++ src/components/call/CscCall.vue | 26 +++++++++++++++++++++++++- src/layouts/CscLayoutMain.vue | 4 ++++ src/router/routes.js | 2 +- src/store/call/actions.js | 5 +++++ src/store/call/mutations.js | 6 ++++++ src/store/call/state.js | 1 + 7 files changed, 62 insertions(+), 2 deletions(-) diff --git a/src/api/ngcp-call.js b/src/api/ngcp-call.js index 0b1a876d..5cf901b8 100644 --- a/src/api/ngcp-call.js +++ b/src/api/ngcp-call.js @@ -405,3 +405,23 @@ export function callEnd () { $audioTransceiver = null $videoTransceiver = null } +/** + * Hold on. + */ +export function callToggleHold () { + const rtcSession = callGetRtcSession() + if (rtcSession) { + if (rtcSession.isOnHold().local) { + rtcSession.unhold() + callEvent.emit('callResumed') + } else { + rtcSession.hold() + callEvent.emit('callOnHold') + } + } +} + +export function callIsOnHold () { + const rtcSession = callGetRtcSession() + return rtcSession ? rtcSession.isOnHold().local : false +} diff --git a/src/components/call/CscCall.vue b/src/components/call/CscCall.vue index c21cf512..d322287a 100644 --- a/src/components/call/CscCall.vue +++ b/src/components/call/CscCall.vue @@ -169,6 +169,16 @@ size="large" @click="toggleMicrophone()" /> +