hangup
End the call with an optional reason.
Properties
hangup
An object that accepts the following properties.
hangup.reason
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)
successif the hangup request succeeded (including when the call had already ended), orfailedif it didn’t.
Examples
No parameters
Reject an unanswered inbound call as declined
The call isn’t answered first, so the reason applies.