***

title: hangup
slug: /reference/python/agents/function-result/hangup
description: End the call immediately.
max-toc-depth: 3
---------------------

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

[functionresult]: /docs/server-sdks/reference/python/agents/function-result

End the call immediately.

<Warning>
  This is a terminal action. Any actions chained **after** `hangup()` may not execute.
  Always place `hangup()` last in the chain.
</Warning>

## **Parameters**

None.

## **Returns**

[`FunctionResult`][functionresult] — self, for chaining.

## **Example**

```python {12}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="end_call", description="End the call")
def end_call(args, raw_data):
    return (
        FunctionResult("Thank you for calling. Goodbye!")
        .update_global_data({"call_ended": True})
        .hangup()
    )

agent.serve()
```