Skip to navigation
Calling

hangup

View as MarkdownOpen in Claude

End the call with an optional reason.

Properties

hangup
objectRequired

An object that accepts the following properties.

hangup.reason
string

The reason for hanging up the call. One of hangup, cancel, busy, noAnswer, decline, or error. Also accepts a SWML variable reference (string) that resolves to one of these values.

The reason only affects an inbound call that hasn’t been answered yet. If reason is omitted or set to hangup or busy, the call is rejected as busy (SIP 486 Busy Here); any other value rejects it as declined (SIP 603 Decline). An answered call ends normally, and an unanswered outbound call is canceled, whatever the reason.

Variables

Set by the method:

  • hangup_result: (out) success if the hangup request succeeded (including when the call had already ended), or failed if it didn’t.

Examples

No parameters

version: 1.0.0
sections:
main:
- answer: {}
- hangup: {}

Reject an unanswered inbound call as declined

The call isn’t answered first, so the reason applies.

version: 1.0.0
sections:
main:
- hangup:
reason: "decline"