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);
+ }
+ },
},
}