***

title: refer
slug: /reference/python/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/python/relay/call/transfer

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

[call-events]: /docs/server-sdks/reference/python/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="dict" required={true} toc={true}>
  The target SIP device for the REFER.
</ParamField>

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

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

<ParamField path="status_url" type="Optional[str]" toc={true}>
  URL to receive REFER status webhooks.
</ParamField>

## **Returns**

`dict` -- Server response confirming the refer operation.

## **Example**

```python {15}
from signalwire.relay import RelayClient

client = RelayClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
    contexts=["default"],
)

@client.on_call
async def handle_call(call):
    await call.answer()
    await call.play([{"type": "tts", "text": "Transferring to another line."}])

    result = await call.refer(
        device={
            "type": "sip",
            "params": {"uri": "sip:support@example.com"},
        },
    )
    print(f"SIP REFER result: {result}")

client.run()
```