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

# hangup

> End a RELAY call.

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**

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**

```python {13}
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()
    await call.hangup()
    print("Call ended")

client.run()
```