-
-
-
- {{ contact.full_name }}
-
-
-
-
- {{ counterUp?.updatedTime }}
-
-
-
-
-
- {{ callStatus == 'ringing' ? 'Ringing...' : 'Calling...' }}
-
-
-
-
-
-
+
+
+
+
+ {{ contact.full_name }}
-
+
+
+ {{ counterUp?.updatedTime }}
+
+
+
+
+
+ {{ callStatus == 'ringing' ? 'Ringing...' : 'Calling...' }}
+
+
+
+
+
@@ -187,7 +184,7 @@ import { Device } from '@twilio/voice-sdk'
import { useDraggable, useWindowSize } from '@vueuse/core'
import { contactsStore } from '@/stores/contacts'
import { Avatar, call } from 'frappe-ui'
-import { onMounted, provide, ref, watch } from 'vue'
+import { onMounted, ref, watch, getCurrentInstance } from 'vue'
import NoteModal from './NoteModal.vue'
const { getContact } = contactsStore()
@@ -292,15 +289,6 @@ function addDeviceListeners() {
})
}
-// function update_call_log(conn, status = 'Completed') {
-// console.log('connection', conn)
-// if (!conn.parameters.CallSid) return
-// call('crm.twilio.api.update_call_log', {
-// call_sid: conn.parameters.CallSid,
-// status: status,
-// })
-// }
-
function toggleMute() {
if (_call.value.isMuted()) {
_call.value.mute(false)
@@ -492,7 +480,8 @@ watch(
{ immediate: true }
)
-provide('makeOutgoingCall', makeOutgoingCall)
+const app = getCurrentInstance()
+app.appContext.config.globalProperties.makeCall = makeOutgoingCall