refer

View as MarkdownOpen in Claude

Send a SIP REFER on an active call. This initiates a SIP-level transfer, asking the remote endpoint to connect to a new destination. Unlike transfer(), which is handled by SignalWire, a SIP REFER delegates the transfer to the remote SIP endpoint.

SIP REFER is only applicable to SIP calls. It will not work on PSTN calls.

Request

idstringRequiredformat: "uuid"
The unique identifying ID of a existing call.
paramsobjectRequired
An object of parameters that will be utilized by the active command.

Response

Call LegobjectRequired
Returned when the call is a standard PSTN, SIP, or WebRTC call.
OR
Fabric Subscriber Device LegobjectRequired

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com"
7});
8
9await client.calling.refer("call-id-xxx", {
10 device: { type: "sip", params: { to: "sip:sales@example.com" } },
11});