Table of Contents
API : PBX : Call test finish
Introduction
Deletes the session's SIP phone and returns the result of the call it placed. The browser should
call this as soon as the call ends, including when it failed, and on pagehide with
fetch(…, { keepalive: true }) if the visitor navigates away.
A missed call to this endpoint is not a disaster - Reap collects the phone within 5 minutes - but it holds a slot against the concurrency cap in the meantime, so the next visitor may get a 409.
Request
| URL | https://api.telecomx.dk/pbx/calltest/session/SESSION_ID/finish | ||
|---|---|---|---|
| Method | POST | ||
| Access level | None - unauthenticated | ||
| Param | SESSION_ID | String | The sessionId returned by Session: exactly 32 hex characters. |
Response
The result payload.
Because the PBX writes the CDR when the call ends and attaches its RTP counters on a separate
update a moment later, this endpoint re-reads for up to 2.5 seconds before answering, so the common
case resolves in one round trip. If the counters have still not arrived it answers PENDING with
a retryAfterMs, and the client should poll Result.
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | session | No such session, or it has expired. Unknown, expired and never-existed are deliberately indistinguishable. |
| 422 | validation | The session id is not 32 hex characters. |
| 500 | internal_error | <Unspecified> |