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

GET/call/flow

Function

The GET/call/flow reuqest returns a list of call segments in the flow sequence for a call as it moves in the PBX system.


The concept of a flow is easy to illustrate with an example:


segment #1 - from the source number to the IVR (the phone audio menu).

segment #2 - from the IVR to a queue.


Segment #3 - from the queue to an agent.


Segment #4 - from the agent to an extension of another agent.



The response has the following fields of information for each segment:


  • stype - the type of device/segment-component for the source number in the particular sequence of the flow. For example "external" number, "ivr", "queue", "phone", etc.

  • snumber - the source phone number in the particular sequence of the flow. 
  • callername_external - the name for the source caller in the particular sequence of the flow. 
  • dtype - the type of device/segment-component for the destination number in the particular sequence of the flow. For example "external" number, "ivr", "queue", "phone", etc.

    Note how the dtype becomes the new stype in each consecutive segment.

  • dnumber - the destination phone number in the particular sequence of the flow. 
  • start - the time when the segment the flow started, given in Unix time format.
  • totaltime - the total duration of the segment including any hold time and actual talk time, given in seconds.
  • talktime -  the total duration of talk time for the segment, given in seconds.
  • uniqueid - a unique ID given to the segment. 
  • status - the eventual status of the call , either "answer", "hangup" (by the recipient), or "cancel" (by the caller.)
  • recording - a path for an audio recording of the segment, if one was performed.
  • calluid - unique ID given to the call in the sense that each segment is also considered a separate call. This can be further explained by IDs being derived from the start time of a call and of course each segment starts on a different time.

Parameters


All parameters go in the header.


ParameterTypeOperation
callidstringThe ID for the call for which for the flow sequence is requested.

You obtain this ID using the GET/call/history request, where it looks like this -

"callid":"1526062490.371076"
limitintegerSpecify the number of messages to be returned by the request.
offsetintegerSpecify the first message to display. For example an offset of 3 will start the list on the 3rd message. If left empty the default will be the first record.

Example


To get the details of a flow sequence for a call use this syntax:


HTTPS method: GET


webserv.telebroad.com/api/teleconsole/rest/call/flow?callid=1524800377.1223783


Response:


Note the call flow as it moves from stype to dtype on the various segments - phone>ivr>queue>phone (another phone line.)


{error": null,
"result":[
{
stype": "phone",
"snumber": "1113848",
"callername_external": "Melanie Fisher",
"dtype": "ivr",
"dnumber": "6208",
"start": "1474440979",
"totaltime": "846",
"talktime": "846",
"uniqueid": "1474440978.934821-2-24710-internal",
"status": "answer",
        "recording":
"1532/657/2016/09/21

        /record_1474440978934821_21255",
"calluid": "1474440978.9348210002"
},
{
"stype": "ivr",
"snumber": "6208",
"callername_external": "Melanie Fisher",
"dtype": "queue",
"dnumber": "1409",
"start": "1474440987",
"totaltime": "839",
"talktime": "839",
"uniqueid": "1474440978.934821-3-24710-internal",
"status": "answer",
        "recording": "1532/657/2016/09/21/

        record_1474440978934821_21255",
"calluid": "1474440978.9348210003"
},
{
"stype": "queue",
"snumber": "1409",
"callername_external": "Melanie Fisher",
"dtype": "phone",
"dnumber": "1113843",
"start": "1474441223",
"totaltime": "676",
"talktime": "652",
"uniqueid": "1474441222.934982-2-24506-internal",
"status": "answer",
        "recording":         "1532/657/2016/09/21/

        record_1474441222934982_22609",
"calluid": "1474441222.9349820002"
        },

    ]

}