Attributes
The Hangup element supports the following attributes.reason (string)
Specifies the reason for the hangup.
Allowed values: rejected, busy
schedule (integer)
Schedules a call hangup after the specified number of seconds. Should be followed by an element such as Speak; otherwise, the call hangs up immediately.
Allowed values: integer > 0 (in seconds)
Note:
-
When the Hangup element is the first element in an Answer XML response, the call is hung up with reason
rejectedif no reason attribute is specified.- When Hangup is not the first element, or if the call is already answered, the call is hung up with reason
Normal Hangupif no reason attribute is specified.
- When Hangup is not the first element, or if the call is already answered, the call is hung up with reason
Nesting rules
Hangup takes no child elements and no text content; it is a self-closing top-level child of <Response> (<Hangup/>). Any elements placed after Hangup are not processed.
Examples
End a call gracefully
Reject an inbound call before answering
PlaceHangup first to reject a call without billing it. Use reason="busy" to return a busy signal or reason="rejected" to decline.
Hang up after a fixed duration
Combineschedule with a following element so the call stays up until the timer fires. See Hang up after a minute.
Edge cases and tips
scheduleneeds a following element. If you setschedulebut no element follows, the call hangs up immediately. Add aSpeak,Play, orWaitelement so there is something to run until the timer elapses.- Reject vs hang up. Use
reason="rejected"orreason="busy"on an unanswered inbound call to avoid answering (and billing) it. Once a call is answered, omittingreasonends it withNormal Hangup. - No XML response also ends the call. Returning an empty
<Response></Response>leaves the call connected with no instructions; to actively end it, include<Hangup/>. - The hangup URL still fires. After the call ends, Vobiz posts the final call metadata (duration, hangup cause) to your application’s hangup URL. No XML is expected in that response.