MT#63449 Add voicemail and call recordings transcript

Display transcriptions in a separate dialog accessible
by the 3 dots menu in the voicebox tables and by the
document icon in the call recordings list.

Change-Id: I6ad42760dc65b3df178afe23ac4c5f19a7c4cf43
mr13.5
Debora Crescenzo 6 months ago committed by Crescenzo Debora
parent 88aacb7fcb
commit 8aa3c2707c

@ -7,6 +7,7 @@ import {
import {
LIST_DEFAULT_ROWS,
apiDownloadFile,
get,
getList,
httpApi
} from 'src/api/common'
@ -140,6 +141,13 @@ export function getOutgoingBlocked (id) {
})
}
export async function getVoicemail (voicemailId) {
return await get({
resource: 'voicemails',
resourceId: voicemailId
})
}
export async function deleteVoicemail (id) {
const res = await httpApi.delete(`api/voicemails/${id}`)
return res.status >= 200

@ -0,0 +1,69 @@
<template>
<csc-dialog
ref="dialog"
:title="$t('Transcript')"
title-icon="description"
@hide="$emit('hide')"
@before-hide="$emit('before-hide')"
>
<template #content>
<div class="q-pa-md">
<div
v-if="isLoading"
class="flex flex-center"
>
<q-spinner
color="primary"
size="3em"
/>
</div>
<p
v-else-if="status === 'done'"
>
{{ text }}
</p>
<p
v-else
class="text-grey"
>
{{ $t('No transcript available.') }}
</p>
</div>
</template>
</csc-dialog>
</template>
<script>
import CscDialog from 'components/CscDialog'
export default {
name: 'CscDialogTranscript',
components: {
CscDialog
},
props: {
text: {
type: String,
default: null
},
status: {
type: String,
default: null
},
isLoading: {
type: Boolean,
default: false
}
},
emits: ['hide', 'before-hide'],
methods: {
show () {
this.$refs.dialog.show()
},
hide () {
this.$refs.dialog.hide()
}
}
}
</script>

@ -30,6 +30,7 @@
:block-both-label="blockBothLabel"
:block-both-possible="unblockedBoth || blockedBoth"
@download-voice-mail="downloadVoiceMail"
@get-voicemail-transcript="getVoicemailTranscript"
@play-voice-mail="playVoiceMail"
@start-call="startCall"
@toggle-block-incoming="toggleBlockIncoming"
@ -71,6 +72,7 @@ export default {
emits: [
'download-fax',
'delete-voicemail',
'get-voicemail-transcript',
'toggle-block-both',
'toggle-block-outgoing',
'toggle-block-incoming',
@ -133,6 +135,9 @@ export default {
downloadVoiceMail (voiceMail) {
this.$emit('download-voice-mail', voiceMail)
},
getVoicemailTranscript (voiceMail) {
this.$emit('get-voicemail-transcript', voiceMail)
},
playVoiceMail (voiceMail) {
this.$emit('play-voice-mail', voiceMail)
},

@ -1,5 +1,13 @@
<template>
<q-item>
<csc-dialog-transcript
ref="transcriptDialog"
:full-width="isTranscriptReady"
:text="getTranscriptText"
:status="getTranscriptStatus"
:is-loading="isLoadingTranscript"
@hide="hideTranscriptDialog"
/>
<q-item-section
side
top
@ -54,6 +62,12 @@
:label="$t('Download voicemail')"
@click="downloadVoiceMail"
/>
<csc-popup-menu-item
icon="description"
color="primary"
:label="$t('Transcript')"
@click="getVoicemailTranscript"
/>
<csc-popup-menu-item-start-call
v-if="callAvailable"
@click="startCall"
@ -86,13 +100,14 @@
<script>
import CscAudioPlayer from 'components/CscAudioPlayer'
import CscDialogTranscript from 'components/CscDialogTranscript'
import CscMoreMenu from 'components/CscMoreMenu'
import CscPopupMenuItem from 'components/CscPopupMenuItem'
import CscPopupMenuItemDelete from 'components/CscPopupMenuItemDelete'
import CscPopupMenuItemStartCall from 'components/CscPopupMenuItemStartCall'
import { showGlobalError } from 'src/helpers/ui'
import { RequestState } from 'src/store/common'
import { mapGetters, mapState } from 'vuex'
import { mapActions, mapGetters, mapState } from 'vuex'
export default {
name: 'CscVoiceMailItem',
@ -101,7 +116,8 @@ export default {
CscPopupMenuItemStartCall,
CscPopupMenuItem,
CscMoreMenu,
CscAudioPlayer
CscAudioPlayer,
CscDialogTranscript
},
props: {
voiceMail: {
@ -129,7 +145,16 @@ export default {
default: false
}
},
emits: ['delete-voicemail', 'toggle-block-both', 'toggle-block-outgoing', 'toggle-block-incoming', 'start-call', 'download-voice-mail', 'play-voice-mail'],
emits: [
'delete-voicemail',
'toggle-block-both',
'toggle-block-outgoing',
'toggle-block-incoming',
'start-call',
'download-voice-mail',
'play-voice-mail',
'get-voicemail-transcript'
],
data () {
return {
platform: this.$q.platform.is
@ -144,12 +169,27 @@ export default {
'playVoiceMailErrors',
'playVoiceMailStates'
]),
...mapGetters('transcriptions', [
'getTranscriptText',
'getTranscriptStatus'
]),
...mapState('transcriptions', [
'transcriptState',
'transcript',
'transcriptError'
]),
direction () {
if (this.voiceMail.direction === 'out') {
return 'to'
}
return 'from'
},
isLoadingTranscript () {
return this.transcriptState === 'requesting'
},
isTranscriptReady () {
return this.getTranscriptStatus === 'done'
},
voicemailCaller () {
return this.voiceMail.caller_phonebook_name || this.voiceMail.caller
},
@ -163,6 +203,7 @@ export default {
voiceMailLoaded () {
return this.playVoiceMailState(this.voiceMail.id) === 'succeeded'
}
},
watch: {
playVoiceMailStates: {
@ -172,9 +213,17 @@ export default {
showGlobalError(this.playVoiceMailErrors[this.voiceMail.id])
}
}
},
transcriptState (state) {
if (state === RequestState.failed) {
return showGlobalError(this.transcriptError)
}
}
},
methods: {
...mapActions('transcriptions', [
'clearTranscriptData'
]),
playVoiceMail () {
this.$emit('play-voice-mail', {
id: this.voiceMail.id,
@ -189,6 +238,14 @@ export default {
this.$refs.voicemailPlayer.setPlayingTrue()
this.$refs.voicemailPlayer.setPausedFalse()
},
getVoicemailTranscript () {
this.$emit('get-voicemail-transcript', this.voiceMail.id)
this.$refs.transcriptDialog.show()
},
hideTranscriptDialog () {
this.$refs.transcriptDialog.hide()
this.clearTranscriptData()
},
startCall () {
this.$emit('start-call', this.voiceMail.callee)
},

@ -44,10 +44,10 @@
"Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).": "Erlauben Sie „mail2fax“-E-Mails nur an diese IP (die IP oder der Hostname ist im \\\"Received\\\" vorhanden).",
"Allowed extensions are between {min} and {max}": "Erlaubte Durchwahlen haben eine Länge zwischen {min} und {max} Zahlen",
"Always": "Ständig",
"An error occured while trying to assign the speed dial slot. Please try again": "Kurzwahl-Eintrag konnte nicht zugewiesen werden. Bitte erneut versuchen",
"An error occured while trying to load the speed dials. Please try again": "Kurzwahlliste konnte nicht geladen werden. Bitte erneut versuchen",
"An error occured while trying to send the fax. Please try again": "Fax konnte nicht gesendet werden. Bitte erneut versuchen",
"An error occured while trying to unassign the speed dial slot. Please try again": "Kurzwahl-Eintrag konnte nicht geändert werden. Bitte erneut versuchen",
"An error occurred while trying to assign the speed dial slot. Please try again": "Kurzwahl-Eintrag konnte nicht zugewiesen werden. Bitte erneut versuchen",
"An error occurred while trying to load the speed dials. Please try again": "Kurzwahlliste konnte nicht geladen werden. Bitte erneut versuchen",
"An error occurred while trying to send the fax. Please try again": "Fax konnte nicht gesendet werden. Bitte erneut versuchen",
"An error occurred while trying to unassign the speed dial slot. Please try again": "Kurzwahl-Eintrag konnte nicht geändert werden. Bitte erneut versuchen",
"An error occurred:": "Ein Fehler ist aufgetreten:",
"Application": "Anwendung",
"Apps": "Apps",
@ -283,6 +283,7 @@
"Join conference with name": "Mit Namen der Konferenz beitreten",
"July": "Juli",
"June": "Juni",
"Label": "Etikett",
"Lamp/Key": "Lampe/Taste",
"Lamps/Keys": "Lampen/Tasten",
"Language": "Sprache",
@ -357,6 +358,7 @@
"No seats created yet": "Noch keine Nebenstellen erstellt",
"No sound sets created yet": "Noch keine Soundsets erstellt",
"No speed dials found": "Keine Kurzwahlen gefunden",
"No transcript available.": "Kein Transkript verfügbar.",
"Normal": "Normal",
"Not modified yet": "Noch nicht geändert",
"November": "November",
@ -556,6 +558,7 @@
"Timerange": "Zeitraum",
"To": "An",
"Today": "Heute",
"Transcript": "Transkript",
"Transfer": "Weiterleiten",
"Tu": "Di",
"Tuesday": "Dienstag",

@ -277,6 +277,7 @@
"January": "January",
"July": "July",
"June": "June",
"Label": "Label",
"Lamp/Key": "Lamp/Key",
"Lamps/Keys": "Lamps/Keys",
"Language": "Language",
@ -343,6 +344,7 @@
"No seats created yet": "No seats created yet",
"No sound sets created yet": "No sound sets created yet",
"No speed dials found": "No speed dials found",
"No transcript available.": "No transcript available.",
"Normal": "Normal",
"Not modified yet": "Not modified yet",
"November": "November",
@ -539,6 +541,7 @@
"Timerange": "Timerange",
"To": "To",
"Today": "Today",
"Transcript": "Transcript",
"Transfer": "Transfer",
"Tu": "Tu",
"Tuesday": "Tuesday",

@ -44,10 +44,10 @@
"Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).": "Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).",
"Allowed extensions are between {min} and {max}": "Las extensiones permitidas están entre {min} y {max}",
"Always": "Siempre",
"An error occured while trying to assign the speed dial slot. Please try again": "Ocurrió un error al intentar asignar la ranura de marcación rápida. Por favor, inténtelo nuevamente.",
"An error occured while trying to load the speed dials. Please try again": "Se produjo un error al intentar cargar las marcaciones rápidas. Por favor, inténtelo nuevamente.",
"An error occured while trying to send the fax. Please try again": "Se produjo un error al intentar enviar el fax. Por favor, inténtelo nuevamente.",
"An error occured while trying to unassign the speed dial slot. Please try again": "Se produjo un error al intentar remover la ranura de marcación rápida. Por favor, inténtelo nuevamente.",
"An error occurred while trying to assign the speed dial slot. Please try again": "Ocurrió un error al intentar asignar la ranura de marcación rápida. Por favor, inténtelo nuevamente.",
"An error occurred while trying to load the speed dials. Please try again": "Se produjo un error al intentar cargar las marcaciones rápidas. Por favor, inténtelo nuevamente.",
"An error occurred while trying to send the fax. Please try again": "Se produjo un error al intentar enviar el fax. Por favor, inténtelo nuevamente.",
"An error occurred while trying to unassign the speed dial slot. Please try again": "Se produjo un error al intentar remover la ranura de marcación rápida. Por favor, inténtelo nuevamente.",
"An error occurred:": "Ocurrió un error:",
"Application": "Aplicación",
"Apps": "Aplicaciones",
@ -283,6 +283,7 @@
"Join conference with name": "Unirse a la conferencia con nombre",
"July": "Julio",
"June": "Junio",
"Label": "Etiqueta",
"Lamp/Key": "Indicador/Tecla",
"Lamps/Keys": "Indicadores/Teclas",
"Language": "Idioma",
@ -356,6 +357,7 @@
"No seats created yet": "Aún no se han creado asientos",
"No sound sets created yet": "Aún no se han creado conjuntos de sonido",
"No speed dials found": "No se encontraron marcaciones rápidas",
"No transcript available.": "No hay transcripción disponible.",
"Normal": "Normal",
"Not modified yet": "No se ha modificado todavía",
"November": "Noviembre",
@ -557,6 +559,7 @@
"Timerange": "Rango de tiempo",
"To": "Para",
"Today": "Hoy",
"Transcript": "Transcripción",
"Transfer": "Transfer",
"Tu": "Tu",
"Tuesday": "Martes",

@ -44,10 +44,10 @@
"Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).": "Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).",
"Allowed extensions are between {min} and {max}": "Les extensions autorisées sont comprises entre {min} et {max}",
"Always": "Toujours",
"An error occured while trying to assign the speed dial slot. Please try again": "Une erreur s'est produite lors de la tentative d'attribution de l'emplacement de numérotation abrégée. Veuillez réessayer",
"An error occured while trying to load the speed dials. Please try again": "Une erreur s'est produite lors du chargement des numéros abrégés. Veuillez réessayer",
"An error occured while trying to send the fax. Please try again": "Une erreur est survenue lors de lenvoi du Fax. Veuillez réessayer",
"An error occured while trying to unassign the speed dial slot. Please try again": "Une erreur est survenue lors de la séassignation de l'emplacement de numérotation abrégée. Veuillez réessayer",
"An error occurred while trying to assign the speed dial slot. Please try again": "Une erreur s'est produite lors de la tentative d'attribution de l'emplacement de numérotation abrégée. Veuillez réessayer",
"An error occurred while trying to load the speed dials. Please try again": "Une erreur s'est produite lors du chargement des numéros abrégés. Veuillez réessayer",
"An error occurred while trying to send the fax. Please try again": "Une erreur est survenue lors de lenvoi du Fax. Veuillez réessayer",
"An error occurred while trying to unassign the speed dial slot. Please try again": "Une erreur est survenue lors de la séassignation de l'emplacement de numérotation abrégée. Veuillez réessayer",
"An error occurred:": "Une erreur sest produite:",
"Application": "Application",
"Apps": "Apps",
@ -283,6 +283,7 @@
"Join conference with name": "Rejoindre la conférence avec le nom",
"July": "Juillet",
"June": "Juin",
"Label": "Étiquette",
"Lamp/Key": "Lampe/clé",
"Lamps/Keys": "Lampes/clés",
"Language": "Langue",
@ -357,6 +358,7 @@
"No seats created yet": "Aucun siège n'a encore été créé",
"No sound sets created yet": "Aucun jeu de sons n'a encore été créé",
"No speed dials found": "Aucun numéro abrégé trouvé",
"No transcript available.": "Aucune transcription disponible.",
"Normal": "Normal",
"Not modified yet": "Pas encore modifié",
"November": "Novembre",
@ -556,6 +558,7 @@
"Timerange": "Période",
"To": "À",
"Today": "Aujourd'hui",
"Transcript": "Transcription",
"Transfer": "Transférer",
"Tu": "Ma",
"Tuesday": "Mardi",

@ -43,10 +43,10 @@
"Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).": "Consenti email mail2fax solo da questo IP (l'IP o il nome host è presente nell'intestazione \\\"Received\\\").",
"Allowed extensions are between {min} and {max}": "Le estensioni consentite sono tra {min} e {max}",
"Always": "Sempre",
"An error occured while trying to assign the speed dial slot. Please try again": "Si è verificato un errore durante l'assegnazione dello slot di chiamata rapida. Si prega di riprovare",
"An error occured while trying to load the speed dials. Please try again": "Si è verificato un errore durante il caricamento delle chiamate rapide. Si prega di riprovare",
"An error occured while trying to send the fax. Please try again": "Si è verificato un errore durante l'invio del fax. Si prega di riprovare",
"An error occured while trying to unassign the speed dial slot. Please try again": "Si è verificato un errore nella cancellazione della selezione rapida. Si prega di riprovare",
"An error occurred while trying to assign the speed dial slot. Please try again": "Si è verificato un errore durante l'assegnazione dello slot di chiamata rapida. Si prega di riprovare",
"An error occurred while trying to load the speed dials. Please try again": "Si è verificato un errore durante il caricamento delle chiamate rapide. Si prega di riprovare",
"An error occurred while trying to send the fax. Please try again": "Si è verificato un errore durante l'invio del fax. Si prega di riprovare",
"An error occurred while trying to unassign the speed dial slot. Please try again": "Si è verificato un errore nella cancellazione della selezione rapida. Si prega di riprovare",
"An error occurred:": "Si è verificato un errore:",
"Apps": "App",
"April": "Aprile",
@ -279,6 +279,7 @@
"Join conference with name": "Partecipa alla conferenza con nome",
"July": "Luglio",
"June": "Giugno",
"Label": "Etichetta",
"Lamp/Key": "Lampada/Tasto",
"Lamps/Keys": "Lampade/Tasti",
"Language": "Lingua",
@ -350,6 +351,7 @@
"No seats created yet": "Nessuna postazione creata",
"No sound sets created yet": "Non è stato creato alcun set di suoni",
"No speed dials found": "Nessuna impostazione di chiamata rapida",
"No transcript available.": "Nessuna trascrizione disponibile.",
"Normal": "Normale",
"Not modified yet": "Non ancora modificato",
"November": "Novembre",
@ -548,6 +550,7 @@
"Timerange": "Intervallo di tempo",
"To": "A",
"Today": "Oggi",
"Transcript": "Trascrizione",
"Transfer": "Trasferisci",
"Tu": "Ma",
"Tuesday": "Martedì",

@ -3,6 +3,14 @@
<csc-page-sticky
id="csc-page-call-recording"
>
<csc-dialog-transcript
ref="transcriptDialog"
:full-width="isTranscriptReady"
:text="getTranscriptText"
:status="getTranscriptStatus"
:is-loading="isLoadingTranscript"
@hide="hideTranscriptDialog"
/>
<template
#header
>
@ -138,6 +146,15 @@
<q-td
class="row justify-end table-td-action-cont"
>
<q-btn
size="md"
color="primary"
icon="description"
dense
class="download-btn"
flat
@click="getTranscript(innerProps.row)"
/>
<csc-audio-player
:pausable="true"
class="player-btns"
@ -171,6 +188,7 @@
<script>
import CscAudioPlayer from 'components/CscAudioPlayer'
import CscDialogTranscript from 'components/CscDialogTranscript'
import CscPageSticky from 'components/CscPageSticky'
import CscRemoveDialog from 'components/CscRemoveDialog'
import CscCallRecordingFilters from 'components/pages/CallRecording/CscCallRecordingFilters'
@ -179,13 +197,14 @@ import moment from 'moment'
import { LIST_DEFAULT_ROWS } from 'src/api/common'
import { showGlobalError, showToast } from 'src/helpers/ui'
import { mapWaitingActions } from 'vue-wait'
import { mapGetters } from 'vuex'
import { mapActions, mapGetters, mapState } from 'vuex'
export default {
name: 'CscPageCallRecording',
components: {
CscAudioPlayer,
CscPageSticky,
CscCallRecordingFilters
CscCallRecordingFilters,
CscDialogTranscript
},
data () {
return {
@ -274,7 +293,22 @@ export default {
computed: {
...mapGetters('callRecordings', [
'recordings'
])
]),
...mapGetters('transcriptions', [
'getTranscriptText',
'getTranscriptStatus'
]),
...mapState('transcriptions', [
'transcriptState',
'transcript',
'transcriptError'
]),
isLoadingTranscript () {
return this.transcriptState === 'requesting'
},
isTranscriptReady () {
return this.getTranscriptStatus === 'done'
}
},
watch: {
recordings () {
@ -318,6 +352,10 @@ export default {
playStreamFile: 'csc-call-recordings',
fetchFile: 'csc-call-recordings'
}),
...mapActions('transcriptions', [
'clearTranscriptData',
'getCallRecordingsTranscript'
]),
...mapGetters('user', [
'getSubscriber'
]),
@ -370,6 +408,17 @@ export default {
showGlobalError(this.$t('Something went wrong. Please retry later'))
}
},
getTranscript (data) {
this.getCallRecordingsTranscript({
transcript: data.transcript,
transcriptStatus: data.transcript_status
})
this.$refs.transcriptDialog.show()
},
hideTranscriptDialog () {
this.$refs.transcriptDialog.hide()
this.clearTranscriptData()
},
isRowExpanded (id) {
const rowStatus = this.rowStatus.filter((row) => row.id === id)[0] || null
return rowStatus && rowStatus.expanded
@ -416,7 +465,7 @@ export default {
.table-td-no-padding
padding: 0px !important // needed to override .q-table td
.table-td-action-cont
min-width: 140px
min-width: 170px
.player-btns
bottom: 9px
left: 8px

@ -64,6 +64,7 @@
:blocked-incoming="blockedIncoming(item)"
:blocked-outgoing="blockedOutgoing(item)"
@start-call="startCall"
@get-voicemail-transcript="getVoicemailTranscription"
@download-fax="downloadFax"
@download-voice-mail="downloadVoiceMail"
@play-voice-mail="playVoiceMail"
@ -294,11 +295,15 @@ export default {
...mapWaitingActions('conversations', {
nextPage: 'csc-conversations',
deleteVoicemail: 'csc-conversations',
getVoicemailTranscript: 'csc-conversations',
toggleBlockIncoming: 'csc-conversations',
toggleBlockOutgoing: 'csc-conversations',
toggleBlockBoth: 'csc-conversations',
deleteFax: 'csc-conversations'
}),
...mapWaitingActions('transcriptions', {
getVoicemailTranscript: 'csc-transcriptions'
}),
...mapMutations('conversations', [
'resetList'
]),
@ -427,6 +432,9 @@ export default {
this.filterDirection = filter
this.forceReload()
},
async getVoicemailTranscription (voicemailId) {
await this.getVoicemailTranscript(voicemailId)
},
addToPhonebookAction (number) {
this.$store.commit('user/setPhonebookNumber', number)
this.$router.push('subscriber-phonebook/create')

@ -20,6 +20,7 @@ import PbxSeatsModule from 'src/store/pbx-seats'
import PbxSoundSetsModule from 'src/store/pbx-soundsets'
import ReminderModule from 'src/store/reminder'
import SpeedDialModule from 'src/store/speed-dial'
import TranscriptionsModule from 'src/store/transcriptions'
import UserModule from 'src/store/user'
import VoiceboxModule from 'src/store/voicebox'
import { createStore } from 'vuex'
@ -57,7 +58,8 @@ export default function (/* { ssrContext } */) {
callForwarding: CallForwardingModule,
pbxAutoAttendants: PbxAutoAttendants,
dashboard: DashboardModule,
customer: Customer
customer: Customer,
transcriptions: TranscriptionsModule
},
state: {
route: null

@ -39,13 +39,13 @@ export default {
return state.speedDialLoadingState
},
speedDialLoadingError (state) {
return state.speedDialLoadingError || i18n.global.t('An error occured while trying to load the speed dials. Please try again')
return state.speedDialLoadingError || i18n.global.t('An error occurred while trying to load the speed dials. Please try again')
},
unassignSlotState (state) {
return state.unassignSlotState
},
unassignSlotError (state) {
return state.unassignSlotError || i18n.global.t('An error occured while trying to unassign the speed dial slot. Please try again')
return state.unassignSlotError || i18n.global.t('An error occurred while trying to unassign the speed dial slot. Please try again')
},
lastUnassignedSlot (state) {
return state.lastUnassignedSlot
@ -59,7 +59,7 @@ export default {
return state.assignSlotState
},
assignSlotError (state) {
return state.assignSlotError || i18n.global.t('An error occured while trying to assign the speed dial slot. Please try again')
return state.assignSlotError || i18n.global.t('An error occurred while trying to assign the speed dial slot. Please try again')
},
lastAssignedSlot (state) {
return state.lastAssignedSlot

@ -0,0 +1,63 @@
import { getVoicemail } from 'src/api/conversations'
import { RequestState } from 'src/store/common'
export default {
namespaced: true,
state: {
transcriptState: RequestState.initiated,
transcriptError: null,
transcript: null
},
getters: {
getTranscriptText (state) {
return state.transcript?.transcript
},
getTranscriptStatus (state) {
return state.transcript?.transcriptStatus
}
},
mutations: {
transcriptRequesting (state) {
state.transcriptState = RequestState.requesting
},
transcriptSucceeded (state, { transcript, transcriptStatus }) {
state.transcriptState = RequestState.succeeded
state.transcript = {
transcript,
transcriptStatus
}
},
transcriptFailed (state, error) {
state.transcriptState = RequestState.failed
state.transcriptError = error
},
clearTranscriptData (state) {
state.transcriptState = RequestState.initiated
state.transcriptError = null
state.transcript = null
}
},
actions: {
getVoicemailTranscript (context, voicemailId) {
context.commit('transcriptRequesting')
getVoicemail(voicemailId).then((data) => {
context.commit('transcriptSucceeded', {
transcript: data.transcript,
transcriptStatus: data.transcript_status
})
}).catch((err) => {
context.commit('transcriptFailed', err.message)
})
},
getCallRecordingsTranscript (context, data) {
context.commit('transcriptSucceeded', {
transcript: data.transcript,
transcriptStatus: data.transcriptStatus
})
},
clearTranscriptData (context) {
context.commit('clearTranscriptData')
}
}
}
Loading…
Cancel
Save