User Tools

Site Tools


api:pbx:cdr-latest

API : PBX : CDR Latest

Request

This request returns the latest 10 outbound, inbound and missed calls.

URL https://api.telecomx.dk/pbx/cdr/latest
Method GET
Access level PERSONAL, VIEWER (only users own calls),
MANAGE, OWNER if calls belongs to the customer
RESELLER if customer belongs to the reseller
or ADMIN.
Query extension Id of extension the calls belongs to.

Query examples

https://api.telecomx.dk/pbx/cdr/latest?extension=12345678901234567890ABCD

Response

JSON object
outbound Array Latest 10 outbound calls
outbound._id Id Unique id of the call record
outbound.pbx string PBX server that handled the call
outbound.channelId String Id of channel
outbound.started Date When the call started
outbound.answered Date When the call was answered
outbound.answeredByCallee Boolean True if call was answered
outbound.ended Date When the call ended
outbound.caller Array Data about the caller
outbound.caller.number String Phone number presented
outbound.caller.name String Name of caller
outbound.caller.privacy Boolean True if caller is hidden
outbound.caller.type String Type of caller: SIPPHONE, MOBILE, EXTERNAL, EXTERNALPHONE, SYSTEM.
outbound.caller.divertedBy String If call was diverted, number of the diverter.
outbound.caller.extension Id Id of extension of the caller, if caller is local.
outbound.caller.sipPhone Id Id of SIP phone if caller is local and call was initiated from a SIP phone.
outbound.callee Object Data about the callee
outbound.callee.number String Phone number called
outbound.callee.name String Name of the called, if available
outbound.callee.extension Id Extension of the called, if callee is local.
outbound.customer Id Id of customer
outbound.terminatedBy String Who terminated the call: A for caller, B for callee or S for system.
outbound.terminatedReason String How was the call terminated:
CANCEL - no answer, cancelled by caller
HANGUP - hangup after answered
BUSY - callee was busy
UNREACHABLE - callee could not be called
ERROR - call ended due to an error
BLOCKED - call blocked due to suspicion of fraud or if blacklisted by user
NOT_FOUND - called number does not exist
inbound Array Latest 10 inbound calls
inbound._id Id Unique id of the call record
inbound.pbx string PBX server that handled the call
inbound.channelId String Id of channel
inbound.started Date When the call started
inbound.answered Date When the call was answered
inbound.answeredByCallee Boolean True if call was answered
inbound.ended Date When the call ended
inbound.caller Array Data about the caller
inbound.caller.number String Phone number presented
inbound.caller.name String Name of caller
inbound.caller.privacy Boolean True if caller is hidden
inbound.caller.type String Type of caller: SIPPHONE, MOBILE, EXTERNAL, EXTERNALPHONE, SYSTEM.
inbound.caller.divertedBy String If call was diverted, number of the diverter.
inbound.caller.extension Id Id of extension of the caller, if caller is local.
inbound.caller.sipPhone Id Id of SIP phone if caller is local and call was initiated from a SIP phone.
inbound.callee Object Data about the callee
inbound.callee.number String Phone number called
inbound.callee.name String Name of the called, if available
inbound.callee.extension Id Extension of the called, if callee is local.
inbound.customer Id Id of customer
inbound.terminatedBy String Who terminated the call: A for caller, B for callee or S for system.
inbound.terminatedReason String How was the call terminated:
CANCEL - no answer, cancelled by caller
HANGUP - hangup after answered
BUSY - callee was busy
UNREACHABLE - callee could not be called
ERROR - call ended due to an error
BLOCKED - call blocked due to suspicion of fraud or if blacklisted by user
NOT_FOUND - called number does not exist
missed Array Latest 10 missed calls
missed._id Id Unique id of the call record
missed.pbx string PBX server that handled the call
missed.channelId String Id of channel
missed.started Date When the call started
missed.answered Date When the call was answered
missed.answeredByCallee Boolean True if call was answered
missed.ended Date When the call ended
missed.caller Array Data about the caller
missed.caller.number String Phone number presented
missed.caller.name String Name of caller
missed.caller.privacy Boolean True if caller is hidden
missed.caller.type String Type of caller: SIPPHONE, MOBILE, EXTERNAL, EXTERNALPHONE, SYSTEM.
missed.caller.divertedBy String If call was diverted, number of the diverter.
missed.caller.extension Id Id of extension of the caller, if caller is local.
missed.caller.sipPhone Id Id of SIP phone if caller is local and call was initiated from a SIP phone.
missed.callee Object Data about the callee
missed.callee.number String Phone number called
missed.callee.name String Name of the called, if available
missed.callee.extension Id Extension of the called, if callee is local.
missed.customer Id Id of customer
missed.terminatedBy String Who terminated the call: A for caller, B for callee or S for system.
missed.terminatedReason String How was the call terminated:
CANCEL - no answer, cancelled by caller
HANGUP - hangup after answered
BUSY - callee was busy
UNREACHABLE - callee could not be called
ERROR - call ended due to an error
BLOCKED - call blocked due to suspicion of fraud or if blacklisted by user
NOT_FOUND - called number does not exist

Example

{
  "outbound": [
    {
      "_id": "62c5843abef10d9b1ff634c7",
      "pbx": "pbx1.telecomx.dk",
      "channelId": "1657111575.373",
      "callId": "8ggngt1bnib7aisgjve0",
      "started": "2022-07-06T12:46:15.571Z",
      "answered": "2022-07-06T12:46:17.579Z",
      "answeredByCallee": true,
      "ended": "2022-07-06T12:46:50.595Z",
      "caller": {
        "number": "101",
        "name": "Anders Madsen",
        "privacy": false,
        "type": "SIPPHONE",
        "divertedBy": null,
        "extension": "619ce1aee37f9bb149dd3393",
        "sipPhone": "62b2e4fa73f34bce6abc4703"
      },
      "callee": {
        "number": "103",
        "name": "Hans Hansen",
        "extension": "619ce2ece37f9bb149dd33a3"
      },
      "customer": "619cd739e37f9bb149dd328b",
      "terminatedBy": "B",
      "terminatedReason": "HANGUP"
    },
    {
      ...
    }
  ],
  "inbound": [
    ...
  ],
  "missed": [
    ...
  ]
}

Errors

Error code Message Description
404 extension Extension not found
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/cdr-latest.txt · Last modified: 2022/07/06 13:36 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki