User Tools

Site Tools


api:pbx:calls

API : PBX : Calls list

Request

This request returns a list of all of the current calls on the PBX servers.

URL https://api.telecomx.dk/pbx/calls
Method GET
Access level ADMIN.
Query pbx [optional] Hostname of pbx - to limit result to a single pbx server.
customer [optional] Id of customer to return calls for.
full [optional] True to return detailed call data.

Query examples

https://api.telecomx.dk/pbx/calls
https://api.telecomx.dk/pbx/calls?pbx=pbx2.telecomx.dk
https://api.telecomx.dk/pbx/calls?customer=12345678901234567890ABCD
https://api.telecomx.dk/pbx/calls?full=true

Response

Array of calls with call objects.

When not full, the array contains strings with <pbx>:<channel-id>. When full is true it contains call objects:

Call object
call string Call identifier
handler Object Call details
handler.channelId String Channel id
handler.sessionId String Session id
handler.channelClosed Boolean Has channels been closed
handler.caller Object Caller details
handler.caller.number String Phone number
handler.caller.name String Name
handler.caller.type String Type of caller: EXTERNAL, SIPPHONE, MOBILE, SYSTEM
handler.caller.arguments Object Key/value arguments for call
handler.caller.pai String P-Asserted-Identity
handler.caller.sipPhone String ID of sip phone used
handler.caller.realIP String IP address of sip phone used
handler.caller.realPort Number Port number of sip phone used
handler.caller.extensionId String Id of extension making the call
handler.caller.deviceId String Id of SIP device making the call
handler.caller.extension Object Extension data
handler.caller.extension._id String Id of extension
handler.caller.extension.name String Name of caller
handler.caller.extension.number String Phone number
handler.caller.extension.direct String Direct phone number
handler.caller.extension.autoMaster Boolean Auto master
handler.caller.extension.mobileUseOwnNumber Boolean True if mobile uses own phone number
handler.caller.extension.outbound Object Call settings
handler.caller.employee Object Employee settings
handler.customer String Id of customer
handler.callee Object Callee details
handler.callee.number String Phone number
handler.callee.name String Name
handler.callee.extension Object Extension settings
handler.callee.calledNumber String The original called number
handler.callee.employee Object Employee settings
handler.history Array Call history
handler.history[].date Date When it happended
handler.history[].action String What happened
handler.history[].callerNumber String Phone number
handler.history[].callerName String Name
handler.history[].callerExtension String Caller extension
handler.history[].calleeNumber String Phone number
handler.history[].calleeName String Name
handler.history[].calleeExtension String Callee Extension
handler.started Date when call started
handler.answered Date when call was answered
handler.ended Date When call ended
handler.terminatedBy String Who terminated call
handler.terminatedReason String Why call has ended
handler.callId String Call ID
handler.variables Object Key/value store of call variables
handler.cdrNote String CDR note
handler.pbx String PBX hostname
handler.customerName string Name of customer

Example - normal

[
  "pbx2.telecomx.dk:37gh48ghv28vbnwi8cvhd",
  "pbx3.telecomx.dk:vne48348gh489thvhbwiu"
]

Example - full=true

[
  "call": "pbx3.telecomx.dk:1656667086.16435",
  "handler": {
  "channelId": "1656667086.16435",
  "sessionId": "62bebbcee6878a7e42e6fa1b",
  "channelClosed": false,
  "caller": {
  "number": "+4535395025",
  "name": "",
  "type": "EXTERNAL",
  "arguments": {},
  "pai": "<sip:+4550802900@ims.mnc002.mcc238.3gppnetwork.org;user=phone>"
  },
  "customer": "54803a24cdbc05492dde87db",
  "callee": {
  "number": "+4535370100",
  "name": ""
  },
  "history": [
    {
      "date": "2022-07-01T09:18:06.750Z",
      "action": "Initializing call from external source",
      "callerNumber": "+4550802900",
      "callerName": "",
      "callerExtension": null,
      "calleeNumber": "+ 4570305050",
      "calleeName": "",
      "calleeExtension": null
    },
    {
      "date": "2022-07-01T09:18:06.772Z",
      "action": "Module TRUNK:  named \"Hovednummer\" with id 605db42d327821663c4fb132 entered",
      "callerNumber": "+ 4550802900",
      "callerName": "",
      "callerExtension": null,
      "calleeNumber": "+ 4570305050",
      "calleeName": "",
      "calleeExtension": null
    },
    {
      "date": "2022-07-01T09:18:06.774Z",
      "action": "Module VALUE_ROUTER:  named \"Switch\" with id 605db451327821663c4fb134 entered",
      "callerNumber": "+ 4550802900",
      "callerName": "",
      "callerExtension": null,
      "calleeNumber": "+ 4570305050",
      "calleeName": "",
      "calleeExtension": null
    },
    {
      "date": "2022-07-01T09:18:06.775Z",
      "action": "Evaluating 2 rule sets",
      "callerNumber": "+ 4550802900",
      "callerName": "",
      "callerExtension": null,
      "calleeNumber": "+ 4570305050",
      "calleeName": "",
      "calleeExtension": null
    },
    {
      "date": "2022-07-01T09:18:06.776Z",
      "action": "Rule set \"Ferie læge\" matched - performing 0 actions and then directing to dialplan item 605db59f327821663c4fb13c",
      "callerNumber": "+ 4550802900",
      "callerName": "",
      "callerExtension": null,
      "calleeNumber": "+ 4570305050",
      "calleeName": "",
      "calleeExtension": null
    },
    {
      "date": "2022-07-01T09:18:06.777Z",
      "action": "Module PLAYBACK:  named \"Ferie\" with id 605db59f327821663c4fb13c entered",
      "callerNumber": "+ 4550802900",
      "callerName": "",
      "callerExtension": null,
      "calleeNumber": "+ 4570305050",
      "calleeName": "",
      "calleeExtension": null
    },
    {
      "date": "2022-07-01T09:18:07.160Z",
      "action": "Playing start audio with id 62bdaa4bdb4ce67cd6e51f14",
      "callerNumber": "+ 4550802900",
      "callerName": "",
      "callerExtension": null,
      "calleeNumber": "+4570305050",
      "calleeName": "",
      "calleeExtension": null
    }
  ],
  "started": "2022-07-01T09:18:06.709Z",
  "answered": "2022-07-01T09:18:06.909Z",
  "ended": null,
  "terminatedBy": null,
  "terminatedReason": null,
  "callId": "A3847CD4E538D836A44FF017@0170ffffffff",
  "variables": {
    "language": "da"
  },
    "cdrNote": null,
    "pbx": "pbx3.telecomx.dk",
    "customerName": "Lægehuset Langtbortistan" 
  }
  },
  { ... }
]

Errors

Error code Message Description
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/calls.txt · Last modified: 2022/07/01 09:53 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki