> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# play_ringtone

> Play a named ringtone on a call.

[play]: /docs/server-sdks/reference/python/relay/call/play

Play a named ringtone by country code. A typed convenience over [`play()`][play]
that builds the `{"type": "ringtone", "params": {...}}` media item for you.

## Parameters

**`name`** `str` — required

Ringtone name, a country code such as `"us"`.

---

**`duration`** `float | None` — default: None

Seconds to play the ringtone. Keyword-only.

---

**`volume`** `float | None` — default: None

Volume adjustment in dB, from `-40.0` to `40.0`. Keyword-only.

---

**`on_completed`** `Callable[[RelayEvent], Any] | None` — default: None

Callback invoked when the operation reaches a terminal state. Can be a regular
function or async coroutine. Keyword-only.

---

## Returns

[`PlayAction`](/docs/server-sdks/reference/python/relay/actions) -- An action handle with `stop()`, `pause()`, `resume()`, `volume()`, and `wait()` methods.

## Example

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

client = RelayClient(
    project="your-project-id",
    token="your-api-token",
    contexts=["default"],
)

@client.on_call
async def handle_call(call):
    await call.answer()
    action = await call.play_ringtone("us", duration=10)
    await action.wait()

client.run()
```