Skip to main content

Switching Room in SIP Call

Switching a room can be used to move a call from one room to another while the call is in progress. This is useful for scenarios where you want to move a call to a different room based on certain conditions or events like doing soft call transfer when using AI Agents.

Triggering a Call Switch Room via API

You can initiate a call switch room by making an API request with the following payload:

Sample Request:

  • callId: The unique identifier of the ongoing call you want to switch room.
  • roomId: The VideoSDK Room ID to which the call should be switched.
  • token: The VideoSDK Token which will be used to join the new session.
  • participantId: The participant ID which will be used to join the new session.
POST
|
https://api.videosdk.live/v2/sip/call/switch-room
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
},
body: JSON.stringify({
"callId" : "adasd-asda-sdasd-asdas-dad",
"roomId" : "abcd-abcd-abcd"
}),
};
const url= `https://api.videosdk.live/v2/sip/call/switch-room`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
tip

Call switch room is supported for both inbound and outbound SIP calls, as long as the call is active and the room you are trying to switch is active.

API Reference

Got a Question? Ask us on discord