Call segement(s) for each PBX call record are included in a "legs" container.
The response includes the following information fields:
- callid - an ID for the call itself including all its segments. It is created by combining its start time, direction and other values.
- Legs - a container for the the call segments (some calls only have one segment, but it is still listed inside the container.)
- uniqueid - a unique ID for the particular call log segment. It is created by combining its start time, direction and other values. Note that the first uniqueid in a call flow will almost always be idential to the callid because all of their values are the same.
- status - indication of the status of the call log segment in terms of connection between the source and destination points. Possible responses include "answer","noanswer" (by the recipient), "cancel" (by the caller), "congestion" (too much traffic preventing a connection), "busy" (the recipient is on another call), or "chanunavail" - the destination communication channel is unavailable or the requested peer is not be registered.
- start - the start time for the call log segment, in Unix time format.
- end - the start time for the call log segment, in Unix time format.
- totaltime - the total time, in seconds, for the call log segment since it was initiated.
- talktime - the talk time, in seconds, for the call log segment since it was answered.
- sname- a name identified by the system for the source point of the call log segment based on internal PBX information or caller ID. A "false" value will appear here if the system cannot obtain the relevant information or when the source is the IVR or a group.
- stype - a definition for the type of source point, where the call or call flow segment started or came from. This will always be "external" for an inbound call from an outside source. Otherwise it can be any of numerous points on the PBX - "ivr", "accessmenu, "queue", "extension", "huntgroup", etc.
- snumber - the phone number of the source point, where the call or call flow segment started or came from. This can be either an internal extension or a full telephone number, depending on the direction of the call.
- scustomer - a custom ID assigned by the system to to the source customer (caller) of the call.
- ctype- definition of the type of called point, where the source customer (caller) originally dialed to or where the preceding call segment transfered the call to. Examples of type of points are "ivr", "phone", "huntgroup", "voicemailbox", or "external" for outbound calls.
- cnumber- the phone number of tcalled point, where the source customer (caller) originally dialed to or where the preceding call segment transfered the call to.
- dtype - a definition for the type of destination point (where the call was routed to). Examples can be "ivr", "accessmenu, "queue", "external" etc. As a call progresses through a call flow this may be sometimes identical to ctype.
- dnumber - the phone number of the destination point, where the call was routed to. As a call progresses through a call flow this may be sometimes identical to cnumber.
- dcustomer - a custom ID given to the destination customer (recipient) of the call or following destination point in the call flow.
- callerid_external - a full length caller ID phone number information for the call. "External" in this sense means it is not the PBX phone number (which is shorter than a full length number). For inbound calls this will be the same as the phone number of the source point (snumber). For outbound calls this will be the default caller ID assigned or active for the user who initiated the call.
- callername_external - the caller ID name information for the call. "External" in this sense means it is not the PBX name. For inbound calls this will be a name obtained from the source point (If the inbound caller has blocked his ID the system may provide an "Anonymous" value here.) For outbound calls this will be the default caller ID name assigned or active for the user who initiated the call.
- recording - a "true" or "false" value indicating if a recording of the call segment too place and wassaved on the system.
- server - a numerical ID for the Telebroad server involved in making, receiving, or transferring the call segment.
- holdtime - the time in seconds for the call segment that the caller was placed on hold either by the recipient or as he was transferred to a queue.
- dir - direction of the call segment, "in" for inbound call, "out" for outbound call, or "internal" for a segment that has been routed internally.
- answer - "true" or "false" value indicating if the call segment was answered or not.
- sKey - a string value combining the stype and snumber values, showing the source point for of the call segment.
- dKey - a string value combining the dtype and dnumber values, showing the destination point for of the call segment.
- dstPhn - "true" or "false" value indicating if the destination point is a PBX phone number.
srcPhn - "true" or "false" value indicating if the source point is a PBX phone number.
group - "true" or "false" value indicating if the source point for the call segment is a hunt group.
srcExt - "true" or "false" value indicating if the source point is an external phone number.
dstExt - "true" or "false" value indicating if the destination point is a PBX phone number.
Parameters
Parameter | Type | Operation |
callid | string | If used, will limit the response to the one call specified by this parameter |
*start | string | The starting time from which point the request is to display the call logs, specified in Unix timestamp. |
*end | string | The ending time until which point the request is to display the call logs, specified in Unix timestamp. |
descending | Boolean | Use this to sort the list - 1 to sort in descending order, 0 not to. |
**limit | integer | Specify the number of call log records to be returned by the request. |
offset | integer | Specify the first call log record to display. For example an offset of 3 will start the list on the 3rd record. If left empty the default will be the first record. |
* Use start=0 and end=-1 to display all records.
** The returned list may be many pages long. Using the limit parameter is particularly useful in this situation.
Example
To request the first three available PBX logs records:
HTTPS method: GET
webserv.telebroad.com/api/teleconsole/rest/pbx/logs?descending=1&end=-1&start=0&limit=3
Response:
The first call has multiple segments in the leg container while the two others have only one segment.
{ "error": null,
"result":[
{
"callid": "1581026861.367959",
"legs": [
{
"uniqueid": "1581026861.367959",
"status": "mailbox",
"start": 1581026861,
"end": 1581026872,
"totaltime": 11,
"talktime": 11,
"sname": false,
"stype": "external",
"snumber": "17162214325",
"scustomer": 1532,
"ctype": "external",
"cnumber": "16312828888",
"dtype": "phone",
"dnumber": "1113840",
"dcustomer": 1532,
"callerid_external": "17162214325",
"callername_external": "CLARENCE CTR NY",
"recording": true,
"server": "14",
"calluid": "1581026861.36795900",
"holdtime": 0,
"dir": "in",
"type": "inc",
"answer": false,
"sKey": "external_17162214325",
"dKey": "phone_1113840",
"dstPhn": true,
"srcPhn": false,
"group": false,
"srcExt": true,
"dstExt": false
},
{
"uniqueid": "1581026861.504700",
"status": "answer",
"start": 1581026861,
"end": 1581026872,
"totaltime": 11,
"talktime": 11,
"sname": false,
"stype": "phone",
"snumber": "1113840",
"scustomer": 1532,
"ctype": "mailbox",
"cnumber": "1113840",
"dtype": "mailbox",
"dnumber": "1113840",
"dcustomer": 1532,
"callerid_external": "17162214325",
"callername_external": "CLARENCE CTR NY",
"recording": true,
"server": "14",
"calluid": "1581026861.50470000",
"holdtime": 0,
"dir": "internal",
"type": "out",
"answer": true,
"sKey": "phone_1113840",
"dKey": "mailbox_1113840",
"dstPhn": false,
"srcPhn": true,
"group": false,
"srcExt": true,
"dstExt": false
}
]
},
{
"callid": "1580921152.934188",
"legs": [
{
"uniqueid": "1580921152.934188",
"status": "answer",
"start": 1580921152,
"end": 1580921161,
"totaltime": 9,
"talktime": 9,
"sname": false,
"stype": "external",
"snumber": "13479706849",
"scustomer": 1532,
"ctype": "external",
"cnumber": "13474367740",
"dtype": "accessmenu",
"dnumber": "",
"dcustomer": 1532,
"callerid_external": "15558887706",
"callername_external": "BROOKLYN NY",
"recording": false,
"server": "5",
"calluid": "1580921152.93418800",
"holdtime": 0,
"dir": "in",
"type": null,
"answer": true,
"sKey": "external_13479706849",
"dKey": "accessmenu_",
"dstPhn": false,
"srcPhn": false,
"group": false,
"srcExt": true,
"dstExt": false
}
]
},
{
"callid": "1580762582.509745",
"legs": [
{
"uniqueid": "1580762582.509745",
"status": "answer",
"start": 1580762582,
"end": 1580762593,
"totaltime": 11,
"talktime": 11,
"sname": false,
"stype": "external",
"snumber": "19177271057",
"scustomer": 1532,
"ctype": "external",
"cnumber": "17329942081",
"dtype": "mailbox",
"dnumber": "1113845",
"dcustomer": 1532,
"callerid_external": "19177271057",
"callername_external": "simon",
"recording": true,
"server": "15",
"calluid": "1580762582.50974500",
"holdtime": 0,
"dir": "in",
"type": null,
"answer": true,
"sKey": "external_19177271057",
"dKey": "mailbox_1113845",
"dstPhn": false,
"srcPhn": false,
"group": false,
"srcExt": true,
"dstExt": false
}
]
}
]
}