RelayCall

disconnect

View as MarkdownOpen in Claude

Disconnect a previously bridged call, breaking the connection between the two call legs. Both parties return to their respective Relay applications for further processing. Use this after connect() to separate bridged calls.

Parameters

None.

Returns

dict — Server response confirming the disconnect.

Example

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()
# Bridge to an agent
await call.connect([
[{"type": "phone", "params": {"to_number": "+15551234567", "from_number": "+15559876543"}}],
])
# Disconnect (unbridge) the connected call
result = await call.disconnect()
print(f"Disconnected: {result}")
await call.play([{"type": "tts", "params": {"text": "The other party has disconnected."}}])
await call.hangup()
client.run()