Skip to content

Commit

Permalink
WIP feat(SIP): allow to dial-out participants via SIP
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Oct 22, 2023
1 parent ca827de commit 7d08d80
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@
</template>
{{ t('spreed', 'Send call notification') }}
</NcActionButton>
<NcActionButton v-if="isInCall && participantPhoneNumber"
close-after-click
@click="dialOutPhoneNumber">
<template #icon>
<Phone :size="20" />
</template>
{{ t('spreed', 'Dial-out phone number') }}
</NcActionButton>
<NcActionButton v-if="participantPhoneNumber"
close-after-click
@click="copyPhoneNumber">
Expand Down Expand Up @@ -251,6 +259,7 @@ import ParticipantPermissionsEditor from './ParticipantPermissionsEditor/Partici
import { useIsInCall } from '../../../../../composables/useIsInCall.js'
import { CONVERSATION, PARTICIPANT, ATTENDEE } from '../../../../../constants.js'
import { callSIPDialOut } from '../../../../../services/callsService.js'
import { readableNumber } from '../../../../../utils/readableNumber.js'
import { formattedTime } from '../../../../../utils/formattedTime.js'
import { getStatusMessage } from '../../../../../utils/userStatus.js'
Expand Down Expand Up @@ -389,6 +398,9 @@ export default {
return this.isParticipantSpeaking
? '💬 ' + t('spreed', '{time} talking …', { time: formattedTime(this.timeSpeaking, true) })
: '💬 ' + t('spreed', '{time} talking time', { time: formattedTime(this.timeSpeaking, true) })
} else if (this.isPhoneActor && this.isInCall) {
// FIXME get statuses from SIP Bridge
return t('spreed', 'Calling …')
} else {
return getStatusMessage(this.participant)
}
Expand Down Expand Up @@ -436,6 +448,10 @@ export default {
return this.participant.actorType === ATTENDEE.ACTOR_TYPE.EMAILS
},
isPhoneActor() {
return this.participant.actorType === ATTENDEE.ACTOR_TYPE.PHONES
},
isUserActor() {
return this.participant.actorType === ATTENDEE.ACTOR_TYPE.USERS
},
Expand Down Expand Up @@ -818,6 +834,14 @@ export default {
}
},
async dialOutPhoneNumber() {
try {
await callSIPDialOut(this.token, this.participantPhoneNumber)
} catch (error) {
showError(t('spreed', 'Phone number could not be called'))
}
},
async copyPhoneNumber() {
try {
await navigator.clipboard.writeText(this.participantPhoneNumber)
Expand Down

0 comments on commit 7d08d80

Please sign in to comment.