diff --git a/enterprise/app/controllers/api/v1/accounts/contacts/calls_controller.rb b/enterprise/app/controllers/api/v1/accounts/contacts/calls_controller.rb index 88290a999..64c41993b 100644 --- a/enterprise/app/controllers/api/v1/accounts/contacts/calls_controller.rb +++ b/enterprise/app/controllers/api/v1/accounts/contacts/calls_controller.rb @@ -41,11 +41,14 @@ class Api::V1::Accounts::Contacts::CallsController < Api::V1::Accounts::BaseCont end # Reuse the open conversation when the caller is already inside it; ignore - # the hint if it doesn't belong to the picked voice inbox. + # the hint if it doesn't belong to the picked voice inbox or dialed contact. def existing_conversation return nil if params[:conversation_id].blank? conversation = Current.account.conversations.find_by(display_id: params[:conversation_id]) - conversation if conversation && conversation.inbox_id == voice_inbox.id + return nil unless conversation + return nil unless conversation.inbox_id == voice_inbox.id && conversation.contact_id == contact.id + + conversation end end