From e2ac380d0a6f1f8bc8f0e61d8087b00f2b187aa2 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 26 Nov 2025 00:13:27 +1300 Subject: [PATCH] added ability to mute and unmute inbound/outbound audio --- .../components/telephone/TelephonePage.vue | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/src/frontend/components/telephone/TelephonePage.vue b/src/frontend/components/telephone/TelephonePage.vue index 07946fb..a38afd9 100644 --- a/src/frontend/components/telephone/TelephonePage.vue +++ b/src/frontend/components/telephone/TelephonePage.vue @@ -43,6 +43,32 @@ + +
+ + + + + + + +
+
@@ -253,6 +279,8 @@ export default { config: null, myIdentityHash: null, activeCall: null, + isMicMuted: false, + isSpeakerMuted: false, destinationHash: null, isInitiatingCall: false, @@ -438,6 +466,8 @@ export default { // update ui this.activeCall = response.data.active_call; + this.isMicMuted = response.data.active_call?.is_transmit_muted ?? false; + this.isSpeakerMuted = response.data.active_call?.is_receive_muted ?? false; } catch(e) { // do nothing on error @@ -452,6 +482,52 @@ export default { console.log(e); } }, + async toggleMicrophone() { + if(this.isMicMuted){ + this.unmuteMicrophone(); + } else { + this.muteMicrophone(); + } + }, + async muteMicrophone() { + try { + await window.axios.get(`/api/v1/telephone/mute-transmit`); + await this.getTelephoneStatus(); + } catch(e) { + console.log(e); + } + }, + async unmuteMicrophone() { + try { + await window.axios.get(`/api/v1/telephone/unmute-transmit`); + await this.getTelephoneStatus(); + } catch(e) { + console.log(e); + } + }, + async toggleSpeaker() { + if(this.isSpeakerMuted){ + this.unmuteSpeaker(); + } else { + this.muteSpeaker(); + } + }, + async muteSpeaker() { + try { + await window.axios.get(`/api/v1/telephone/mute-receive`); + await this.getTelephoneStatus(); + } catch(e) { + console.log(e); + } + }, + async unmuteSpeaker() { + try { + await window.axios.get(`/api/v1/telephone/unmute-receive`); + await this.getTelephoneStatus(); + } catch(e) { + console.log(e); + } + }, }, }