1. Teleboard | Support Center
  2. Solution home
  3. API Documentation
  4. REST API - GET Requests
Open navigation

GET/pbx/logs

The GET/pbx/logs request will return a detailed log of PBX call flow records. The response returns records for all calls dialled or received by all users in the requested time frame, regardless of the provided user login credentials. 


Call segment(s) for each PBX call record are included in a "legs" container. 


The response includes the following information fields:


  • callid: Aidentifier for the call itself, including all its segments, created by combining its start time, direction, and other values. Segments of the same call will have the same callid but may have different uniqueids.
  • Legs: A container for call segments. Some calls only have one segment, but it is still listed inside the container.
  • uniqueid: An identifier for the call segment, within a call. It is created by combining its start time, direction, and other values. The first uniqueid in a call flow is almost always identical to the callid because they have the same values.
  • status: A status of the call log segment indicating the 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 registered. Other values indicating routing errors are also possible.
  • start: The start time for the call log segment, in Unix time format
  • end: The end time for the call log segment, in Unix time format
  • totaltime: The total time, in seconds, for the call since it was initiated (including ringing). For calls that were not answered, this will be 0.
  • talktime: The talk time, in seconds, for the call log since it was answered (excluding ringing).
  • sname: An identifier for the source point of the segment based on system information or its caller ID. A "false" value applies if the system cannot obtain the relevant information or when the source is the IVR or a group.
  • stype: The value is "external" for an inbound call from an outside source or "phone" for a user's phone line. It can also be any system points or features "ivr", "accessmenu, "queue", "extension", "huntgroup", etc.
  • snumber: The phone number of the source point, where the call originated or was routed from. Depending on the direction of the call, this can be either an internal line or a full telephone number.
  • scustomer: A custom ID assigned by the system to the source customer (the caller).
  • ctype: The type of called point, where the source customer (caller) dialed to or where the preceding call segment routed the call to. Ctype examples can be  – "ivr", "phone", "huntgroup", "voicemailbox", or "external" for outbound calls.
  • cnumber: The phone number of the called point, where the source customer (caller) dialed to or where the preceding call segment routed the call to.
  • dtype: 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 sometimes be 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 sometimes be identical to cnumber.
  • dcustomer: A custom ID given to the destination customer (call recipient) or the next call flow destination. 
  • callerid_external: A caller ID phone number for the call. For inbound calls, this will be the same as the phone number of the source point (snumber). For outbound calls, this will be the caller ID assigned to the user's line, who initiated the call. An "External" value is assigend by the system when it cannot obtain the caller ID number.
  •  callername_external: A caller ID name for the call. For inbound calls, this will be a name obtained from the source point. If the inbound caller blocked their ID the system may provide an "Anonymous" value here. For outbound calls, this will be the caller ID assigned to the user's line, who initiated the call. An "External" value is assigned by the system when it cannot obtain the caller ID number.
  • recording: A "true" or "false" value indicating if a recording of the call segment took place and was saved on the system.
  • server: A numerical ID or a hostname for the Telebroad server involved in making, receiving, or transferring the call.
  • holdtime: The time in seconds for the call segment that the caller was placed on hold  by the recipient or as he was routed to a group.
  • dir: The direction of the call segment, "in" for inbound call, "out" for outbound call, or "internal" for a segment that was routed internally.
  • answer: A "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 the call segment. 
  • dKey: A string value combining the dtype and dnumber values, showing the destination point for of the call segment.
  • dstPhn: A "true" or "false" value indicating if the destination point is an internal phone line.    
  • srcPhn: A "true" or "false" value indicating if the source point is an internal phone line.    

  • group: A "true" or "false" value indicating if the source point for the call segment is a group.

  • srcExt: A "true" or "false" value indicating if the source point is an external phone number.         

  • dstExt: A "true" or "false" value indicating if the destination point is an internal phone line.  

Parameters


ParameterTypeOperation
callidstringIf used, will limit the response to the one call specified by this parameter
*startstringThe starting time from which point the request is to display the call logs, specified in Unix timestamp.
*endstringThe ending time until which point the request is to display the call logs, specified in Unix timestamp.
descendingBooleanUse this to sort the list -  1 to sort in descending order, 0 not to.
**limitintegerSpecify the number of call log records to be returned by the request.
offsetintegerSpecify 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

          }

       ]

     }

   ]

}