***

title: sip_refer
slug: /reference/python/agents/function-result/sip-refer
description: Send a SIP REFER message to transfer the call in a SIP environment.
max-toc-depth: 3
---------------------

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

[connect]: /docs/server-sdks/reference/python/agents/function-result/connect

[functionresult]: /docs/server-sdks/reference/python/agents/function-result

Send a SIP REFER message to transfer the call in a SIP environment. This is
used for attended or blind transfers within SIP-based phone systems and PBX
deployments.

<Tip>
  For standard phone-number or SIP-address transfers, use
  [`connect()`][connect]
  instead. Use `sip_refer()` when the transfer must be performed via the SIP
  REFER mechanism (e.g., transferring to a PBX extension).
</Tip>

## **Parameters**

<ParamField path="to_uri" type="str" required={true} toc={true}>
  SIP URI to send the REFER to (e.g., `"sip:1001@pbx.example.com"`).
</ParamField>

## **Returns**

[`FunctionResult`][functionresult] — self, for chaining.

## **Example**

```python {12}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="transfer_to_extension", description="Transfer to a PBX extension")
def transfer_to_extension(args, raw_data):
    extension = args.get("extension")
    return (
        FunctionResult(f"Transferring to extension {extension}.")
        .sip_refer(f"sip:{extension}@pbx.example.com")
    )

agent.serve()
```