JSON API » calls » calls/active/list
Lists active calls.
Input parameters
Requires authentication and the callshop, telephone line reports, or user role privileges.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
customer | String or integer | Customer to get calls for. See below for more details. | No | Customer of authentication user. |
direction | String | Direction of calls to get. See below for more details. | No | Empty string. |
sort | String | Field to sort by. "cnumber", "ctype", "direction", "dnumber", "dtype", "machine", "peer", "scustomer", "snumber", "stype", or "uniqueid". | No | "start" |
descending | Integer | 1 to sort descending, 0 not to. | No | 0 |
names | Integer | 1 to set number names, 0 not to. | No | 0 |
callid | String | The call ID of a specific call. | No | Empty string. |
The customer field may have the following values:
Field value | Returns calls for |
---|---|
Field not set | Customer of authentication user. |
ID of a customer | That customer. |
"all" | All customers directly under customer of authentication user. |
"recursive" | All customers under customer of authentication user, recursively. |
"system" | All customers on system. |
The direction field may have the following values:
Field value | Returns calls for |
---|---|
Empty string or field not set | All calls. |
"in" | Inbound calls only. |
"internal" | Internal calls only. |
"in_out" | Inbound and outbound calls, but not internal. |
"out | Outbound calls only. |
Responses
Code | Description |
---|---|
200 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
Data returned
An array of fields, one row for each call leg. Commonly used fields are:
Name | Type | Description |
---|---|---|
answered | Integer | Unix timestamp the call was answered at. 0 if unanswered. |
billing_peer | Integer | ID of the peer used for billing if outbound, else 0. |
callerid_external | String | Callerid that will be sent if routed to an external destination. |
callerid_internal | String | Callerid that will be sent if routed to an internal destination. |
callername_external | String | Caller name that will be sent if routed to an external destination. |
callername_internal | String | Caller name that will be sent if routed to an internal destination. |
callid | String | A unique identifier for the call. All legs of the same call have the same callid. |
channel | String | Asterisk channel. |
cnumber | String | Called number. |
ctype | String | Called type. Usually empty string. |
dcustomer | Integer | ID of the customer owning the destination the call is routed to. |
dnumber | String | Destination number the call is routed to. |
dtype | String | Destination type the call is routed to. |
ingroup | Integer | ID of the inbound group used to bill the call if inbound, else 0. |
machine | Integer | ID of the Asterisk machine handling the call. |
outgroup | Integer | ID of the outbound group used to bill the call if outbound, else 0. |
overmax | Integer | 1 if the call will be billed as over maximum calls, 0 if not. |
peer | Integer | ID of the peer the call is sent to if outbound, else 0. |
recording | String | Path of recording. Empty string if not recording. |
scustomer | Integer | ID of the customer making the call, and to which the call will be billed. |
sip_callid | String | SIP callid if the call arrived via SIP, else empty string. |
snumber | String | Source number the call came from. |
spresent | Integer | Presentation of the source number. |
start | Integer | Unix timestamp the call started at. |
status | String | The current status of the call. |
stype | String | Source type the call came from. |
uniqueid | String | A unique identifier for the call leg. Each leg in a call has a different uniqueid. |
Example: With required parameters
http://enswitch.example.com/api/json/calls/active/list/?auth_username=user;auth_password=password{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "uniqueid":"1234567890.123456", "start":1234567890, ... }, { "uniqueid":"1234567890.123457", "start":1234567890, ... } ] }
Change history
Version | Changes |
---|---|
3.13 | Function added. |