Jump to content

TuCloudAPI getlivestatus

From Wiki 7Kas

TuCloudAPI function to manage FuturePBX (the cloud PBX). Available to: SuperRoot, Operator, Client.

ℹ Requires the pbx parameter (the PBX name, e.g. tucall). The server verifies that your ukey's own account owns that PBX, whatever its role; otherwise, and also for a PBX that does not exist, it returns {"ok":false,"code":"forbidden"}.

Description

LIVE state of the PBX as ONE snapshot of the presence feed: each extension's state (unregistered/idle/ringing/busy, "unknown" when it is not published) and its calls in progress (ringing/talking/hold/dialing, the other party, seconds since start and since answer), and each queue's live picture (agents logged in / available / paused, the waiting calls in queue order with their wait, every member with its status). The server sends the PBX's own presence keys over one TCP connection, reads one reply per key and closes: it is a READ on demand, NOT a feed — the live panels subscribe to presence directly and must never poll this. Tenant from (ukey, pbx); section queue_live or operator_panel.

Call

https://tucloudapi.7kas.com:9087/tucloud?func=getlivestatus&ukey=YOUR_KEY&pbx=PBX_NAME

GET, or POST with the parameters form-urlencoded in the body. Requires the ukey parameter. Always HTTP 200; the response is a JSON envelope.

Parameters

Parameter Type Required Default Meaning
pbx string Yes — FuturePBX name (tenant boundary).
ext string No — One extension number: answer only that extension (and no queues).
queue_id integer No 0 One queue _id (getqueues): answer only that queue (and no extensions).

Example

https://tucloudapi.7kas.com:9087/tucloud?func=getlivestatus&ukey=KEY&pbx=tucall

Response

{ok, now, extensions:[{_id,num,name,state,devices,calls:[{state,direction,with,with_name,since_s,talk_s,srv}]}], queues:[{_id,title,name,loggedin,available,paused,waiting,longest_wait_s,callers:[{position,wait_s,srv}],members:[{exten,name,interface,member,status,status_text,paused,reason,calls_taken,srv}]}]}. Errors: invalid_param, not_found, presence_unavailable (the feed did not answer), forbidden.

Errors

Always HTTP 200. On failure the body is {"ok":false,"code":"...","message":"..."}. Common codes: missing_pbx, forbidden, invalid_param, not_found, conflict, in_use, db_error, server_busy; the Response section above lists any specific to this function.


Back to TuCloudAPI