fix(voice): thread callSid through agent leg + conference API clients

Required by the stricter server-side call_sid requirements from the
previous commit. Without this, agents would fail to join or leave calls
because the client side still sent only conversation_id.

- TwilioVoiceClient.joinClientCall now forwards callSid as a Device.connect
  param, which becomes params[:call_sid] on the TwiML webhook.
- VoiceAPI.leaveConference takes callSid and passes it as a query param
  so the DELETE /conference endpoint can resolve the exact call.
- useCallSession and FloatingCallWidget pass callSid through.
This commit is contained in:
Muhsin
2026-04-17 22:41:20 +04:00
parent 12dc22b693
commit 4282dec7d6
4 changed files with 8 additions and 5 deletions
@@ -42,8 +42,8 @@ export function useCallSession() {
);
});
const endCall = async ({ conversationId, inboxId }) => {
await VoiceAPI.leaveConference(inboxId, conversationId);
const endCall = async ({ conversationId, inboxId, callSid }) => {
await VoiceAPI.leaveConference({ inboxId, conversationId, callSid });
TwilioVoiceClient.endClientCall();
durationTimer.stop();
callsStore.clearActiveCall();
@@ -66,6 +66,7 @@ export function useCallSession() {
await TwilioVoiceClient.joinClientCall({
to: joinResponse?.conference_sid,
conversationId,
callSid,
});
callsStore.setCallActive(callSid);