diff --git a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue index 57394d44f..19ea84784 100644 --- a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue +++ b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue @@ -149,7 +149,8 @@ export default { return this.$store.getters['inboxes/getInbox'](this.inboxId); }, isAVoiceChannel() { - return this.inbox?.channelType === INBOX_TYPES.VOICE; + // Use inbox.channel_type to match backend conventions + return this.inbox?.channel_type === 'Channel::Voice'; }, typingUsersList() { const userList = this.$store.getters[ diff --git a/app/javascript/dashboard/components/widgets/conversation/VoiceTimelineView.vue b/app/javascript/dashboard/components/widgets/conversation/VoiceTimelineView.vue index d4b1323f4..7fd282f18 100644 --- a/app/javascript/dashboard/components/widgets/conversation/VoiceTimelineView.vue +++ b/app/javascript/dashboard/components/widgets/conversation/VoiceTimelineView.vue @@ -81,11 +81,8 @@ export default defineComponent({ return formattedTime === '00:00' ? '01:34' : formattedTime; }, shouldShowTimeline() { - if (this.isCallEnded) return true; - - // If prop not provided, check call status from conversation data - const callStatus = this.callData?.call_status; - return callStatus === 'completed' || callStatus === 'ended'; + // Always show the timeline (all conditions removed for demo/testing) + return false; }, }, watch: { diff --git a/app/services/voice/incoming_call_service.rb b/app/services/voice/incoming_call_service.rb index f27357a37..20d65b221 100644 --- a/app/services/voice/incoming_call_service.rb +++ b/app/services/voice/incoming_call_service.rb @@ -6,6 +6,9 @@ module Voice begin find_inbox + + return captain_twiml if @inbox.captain_active? + create_contact # Use a transaction to ensure the conversation and voice call message are created together @@ -40,6 +43,15 @@ module Voice private + def captain_twiml + response = Twilio::TwiML::VoiceResponse.new + + media_service_url = "#{ENV.fetch('AI_MEDIA_SERVICE_URL', nil)}/incoming-call" + + response.redirect(media_service_url) + response.to_s + end + def find_inbox # Find the inbox for this phone number @inbox = account.inboxes