***

title: refer
slug: /reference/typescript/relay/call/refer
description: Transfer a SIP call to an external endpoint via SIP REFER.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[transfer]: /docs/server-sdks/reference/typescript/relay/call/transfer

[calling-call-refer]: /docs/server-sdks/reference/typescript/relay/call#events

[call-events]: /docs/server-sdks/reference/typescript/relay/call#events

Transfer a SIP call to an external SIP endpoint using the SIP REFER method.
Unlike [`transfer()`][transfer]
which transfers control within RELAY, `refer()` performs a SIP-level transfer
to an external endpoint.

<Info>
  This method emits [`calling.call.refer`][calling-call-refer] events. See [Call Events][call-events] for payload details.
</Info>

## **Parameters**

<ParamField path="device" type="Record<string, unknown>" required={true} toc={true}>
  The target SIP device for the REFER.
</ParamField>

<Indent>
  <ParamField path="device.type" type="string" required={true} toc={true}>
    Device type. Typically `"sip"`.
  </ParamField>

  <ParamField path="device.params" type="Record<string, unknown>" required={true} toc={true}>
    SIP parameters including `uri` (the SIP URI to refer to).
  </ParamField>
</Indent>

<ParamField path="statusUrl" type="string | undefined" toc={true}>
  URL to receive REFER status webhooks.
</ParamField>

## **Returns**

`Promise<Record<string, unknown>>` -- Server response confirming the refer operation.

## **Example**

```typescript {13}
import { RelayClient } from '@signalwire/sdk';

const client = new RelayClient({
  project: process.env.SIGNALWIRE_PROJECT_ID!,
  token: process.env.SIGNALWIRE_TOKEN!,
  contexts: ['default']
});

client.onCall(async (call) => {
  await call.answer();
  await call.play([{ type: 'tts', text: 'Transferring to another line.' }]);

  const result = await call.refer({
    type: 'sip',
    params: { uri: 'sip:support@example.com' },
  });
  console.log(`SIP REFER result: ${JSON.stringify(result)}`);
});

await client.run();
```