RELAYCall

hangup

View as MarkdownOpen in Claude

End the call. The call transitions through the ending state and then to ended. Any active operations (play, record, etc.) are stopped automatically when the call ends.

Parameters

reason
strDefaults to hangup

The end reason string sent to the server. Valid values:

  • "hangup" — normal hangup (default)
  • "cancel" — cancel the call
  • "busy" — signal busy
  • "decline" — decline the call

Returns

dict — Server response confirming the hangup.

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.hangup()
14 print("Call ended")
15
16client.run()