fix(voice): validate conversation_id when resolving Call in ConferenceController

Require the resolved Call to belong to the passed conversation_id so a
request with mismatched (conversation_id, call_sid) fails instead of
silently operating on the call from call_sid. Restores the implicit
authorization the previous conversation-based lookup provided.
This commit is contained in:
Muhsin
2026-04-17 23:38:40 +04:00
parent 7635a538af
commit 081e578a57
@@ -36,7 +36,9 @@ class Api::V1::Accounts::ConferenceController < Api::V1::Accounts::BaseControlle
sid = params[:call_sid].presence
raise ActionController::ParameterMissing, :call_sid if sid.blank?
Call.where(inbox_id: @voice_inbox.id, provider: :twilio).find_by!(provider_call_id: sid)
conversation = fetch_conversation_by_display_id
Call.where(inbox_id: @voice_inbox.id, provider: :twilio, conversation_id: conversation.id)
.find_by!(provider_call_id: sid)
end
def set_voice_inbox_for_conference