import { CodeTabs } from '../views/docs/CodeTabs';
import { Callout, NextLink, PropTable } from '../views/docs/prose';
import {
  HANGUP_SIG_PY, HANGUP_SIG_TS,
  HANGUP_EX_PY, HANGUP_EX_TS,
} from './sdk-reference-constants';

## hangup()

`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.

<CodeTabs
  python={{ code: HANGUP_SIG_PY, filename: "signature" }}
  typescript={{ code: HANGUP_SIG_TS, filename: "signature" }}
/>

<PropTable rows={[
  {
    name: "final_instructions",
    type: "str",
    desc: "What the agent should do before hanging up. If omitted, the agent ends the conversation naturally with no special instructions.",
  },
]} />

### Example

<CodeTabs
  python={{ code: HANGUP_EX_PY, filename: "example.py" }}
  typescript={{ code: HANGUP_EX_TS, filename: "example.ts" }}
/>

<Callout>
  <span className="text-primary font-semibold">Tip:</span> 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.
</Callout>

<NextLink section="reach-person" label="reach_person()" />
