RELAYCall

echo

View as MarkdownOpen in Claude

Echo audio back to the caller. This is primarily useful for testing audio quality, latency, and connectivity. The caller hears their own voice repeated back to them.

This method emits calling.call.echo events. See Call Events for payload details.

Parameters

timeout
Optional[float]

Maximum duration of the echo in seconds. The echo stops automatically after this timeout.

status_url
Optional[str]

URL to receive echo status webhooks.

Returns

dict — Server response confirming the echo operation.

Example

1from signalwire.relay import RelayClient
2
3client = RelayClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7 contexts=["default"],
8)
9
10@client.on_call
11async def handle_call(call):
12 await call.answer()
13 await call.play([{"type": "tts", "text": "Starting echo test. You should hear yourself."}])
14
15 result = await call.echo(timeout=30)
16 print(f"Echo completed: {result}")
17
18 await call.play([{"type": "tts", "text": "Echo test complete."}])
19 await call.hangup()
20
21client.run()