Hang up a leg (asynchronous)
Changed onValidates the leg exists and queues a hangup. The HTTP call returns 202 as soon as the leg is found; the SIP work and cleanup run in the background, and the eventual disconnection is observed via the leg.disconnected event.
Without a request body the leg ends with cdr.reason: "api_hangup": SIP BYE on connected legs, or, on unanswered inbound legs, the INVITE is dropped without any final SIP response.
With {"reason": "<value>"} and an unanswered SIP inbound leg (state ringing or early_media), VoiceBlender sends a final non-2xx response instead of BYE/cancel: busy→486, declined/rejected→603, unavailable→480, not_found→404, forbidden→403, server_error→500. The reason value is passed through to leg.disconnected's cdr.reason.
For connected legs the request body is ignored.
Request
- Base URLhttp://localhost:8080/v1
- URLhttp://localhost:8080/v1/legs/{id}
- Authnone declared
Request body
Response
Hangup queued
Changes
- breaking
removed the success response with the status
- info
added optional request body
- info
added the non-success response with the status
- info
added the success response with the status
- breaking