> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goguava.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# hangup()

> Let the agent close the conversation naturally, then end the call

`call.hangup()` is a soft hangup. Rather than cutting the call immediately, it hands the agent a final instruction and lets it close the conversation naturally before ending the call. Callers hear a proper goodbye.

<Tabs>
  <Tab title="Python">
    ```python signature theme={null}
    call.hangup(final_instructions: str = "")
    ```

    | Parameter | Type | Description |
    | - | - | - |
    | `final_instructions` | `str` | What the agent should do before hanging up. If omitted, the agent ends the conversation naturally with no special instructions. |
  </Tab>

  <Tab title="TypeScript">
    ```typescript signature theme={null}
    await call.hangup(final_instructions?: string): Promise<void>
    ```

    | Parameter | Type | Description |
    | - | - | - |
    | `final_instructions` | `string` | What the agent should do before hanging up. If omitted, the agent ends the conversation naturally with no special instructions. |
  </Tab>
</Tabs>

## Example

<Tabs>
  <Tab title="Python">
    ```python example.py theme={null}
    @agent.on_task_complete("collect_order")
    def on_order_collected(call: guava.Call):
        call.hangup(
            final_instructions="Thank them for their time, mention the confirmation number, then hang up."
        )
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript example.ts theme={null}
    agent.onTaskComplete("collect_order", async (call: guava.Call) => {
      await call.hangup(
        "Thank them for their time, mention the confirmation number, then hang up."
      );
    });
    ```
  </Tab>
</Tabs>

<Tip>
  Be specific in your final instructions. The agent will try to fulfill them naturally — including mentioning a confirmation number, scheduling next steps, or expressing appropriate warmth.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.