***

title: rpc_dial
slug: /reference/python/agents/function-result/rpc-dial
description: Dial out to a phone number with a destination SWML URL via RPC.
max-toc-depth: 3
---------------------

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

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

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

Dial out to a phone number with a destination SWML URL that handles the
outbound call leg. This is commonly used in call screening scenarios: place the
caller on hold with [`hold()`][hold],
then dial out to a human whose call is handled by a separate SWML agent.

## **Parameters**

<ParamField path="to_number" type="str" required={true} toc={true}>
  Phone number to dial in E.164 format.
</ParamField>

<ParamField path="from_number" type="str" required={true} toc={true}>
  Caller ID to display in E.164 format.
</ParamField>

<ParamField path="dest_swml" type="str" required={true} toc={true}>
  URL of the SWML document that handles the outbound call leg. The SWML at this
  URL typically runs a screening agent that can accept, reject, or take a message.
</ParamField>

<ParamField path="device_type" type="str" default="phone" toc={true}>
  Device type for the outbound leg.
</ParamField>

## **Returns**

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

## **Example**

```python {14}
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="screen_call", description="Screen a call by dialing out")
def screen_call(args, raw_data):
    human_number = args.get("phone_number")
    caller_name = args.get("caller_name", "Unknown")
    return (
        FunctionResult("Please hold while I connect you.")
        .hold(timeout=120)
        .rpc_dial(
            to_number=human_number,
            from_number="+15559876543",
            dest_swml=f"https://example.com/screening-agent?caller={caller_name}"
        )
    )

agent.serve()
```