Query Extensions' Call Status

Query the call status of an extension, multiple extensions, or all extensions.

Request URL

{base_url}/{api_path}/extension/query_call?token={token}

Request parameters

Parameter Required Type Description
number Yes String Extension number.

Valid values:

  • An extension number: Query the specified extension.

    Example: "number":"1000"

  • Multiple extension numbers: Query multiple extensions. Separate multiple extension numbers with ,.

    Example: "number":"1000,1001"

  • all: Query all extensions.

    Example: "number": "all"

Response parameters

Parameter Type Description
status String Request result.
  • Success.
  • Failed.
calllist Array <ExtesnionInfo> The call list of extension(s).
ExtensionInfo
Parameter Type Description
number String Extension number.
numbercalls Array <CallStatus> The calls information of the extension.
CallStatus
Parameter Type Description
callid String The unique ID of each call.
members Array <MemberType> A list of information for different types of members during a call.
MemberType
Parameter Type Description
ext Object <ExtensionInfo> Extension information.
inbound Object <InboundInfo> Information of inbound calls.
outbound Object <OutboundInfo> Information of outbound calls.
ExtensionInfo
Parameter Type Description
number Integer The extension number.
channelid String The call channel ID of each member during the call.
memberstatus String The member status.
  • ALERT: The caller who initiates the call is in the ringback state.
  • RING: The callee is in the ringing state.
  • ANSWERED: The call initiated by the caller has been answered.
  • ANSWER: The callee has answered a call, and is in the talking state.
  • HOLD: The call is held.
  • BYE: The call is hanged up.
callpath Integer The call path that indicates how the call is established.
Note: callpath parameter only appears when the call passes through IVR, Queue, Ring Group, Paging/Intercom or Conference.

For example, extension user 1000 calls to IVR (6500), and dials extension number 2000, the callpath value is 6500.

InboundInfo
Parameter Type Description
from Integer The caller number.
to Integer The callee number.
trunkname String The name of the trunk that passes the inbound calls.
channelid String The call channel ID of each member during the call.
memberstatus String The member status.
  • ALERT: The caller who initiates the call is in the ringback state.
  • RING: The callee is in the ringing state.
  • ANSWERED: The call initiated by the caller has been answered.
  • ANSWER: The callee has answered a call, and is in the talking state.
  • HOLD: The call is held.
  • BYE: The call is hanged up.
callpath Integer The call path that indicates how the call is established.
Note: callpath parameter only appears when the call passes through trunk, IVR, Queue, Ring Group, Paging/Intercom or Conference.
For example, external user 5503302 calls to IVR (6500), and dials extension number 2000, the callpath value is 6500.
OutboundInfo
Parameter Type Description
from Integer The caller number.
to Integer The callee number.
trunkname String The name of the trunk that passes the outbound calls.
channelid String The call channel ID of each member during the call.
memberstatus String The member status.
  • ALERT: The caller who initiates the call is in the ringback state.
  • RING: The callee is in the ringing state.
  • ANSWERED: The call initiated by the caller has been answered.
  • ANSWER: The callee has answered a call, and is in the talking state.
  • HOLD: The call is held.
  • BYE: The call is hanged up.
callpath Integer
The call path that indicates how the call is established.
Note: callpath parameter only appears when the call passes through IVR, Queue, Ring Group or Conference.

For example, make a call from IVR 6500 to external number 5503302, the callpath value is 6500.

Example

Request example

POST /api/v2.0.0/extension/query_call?token=4dfa215a2a835361425878c43e25dc8d HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 192.168.5.150

{
    "number": "1000"
}

Response example

HTTP/1.1 200 OK
Server: Boa/0.94.14rc21
Accept-Ranges: bytes
Connection: close
Content-Type: application/json
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE

{
    "status": "Success",
    "calllist": [
        {
            "number": "1084",
            "numbercalls": [
                {
                    "callid": "1593507412.76",
                    "members": [
                        {
                            "inbound": {
                                "from": "31622",
                                "to": "1084",
                                "trunkname": "sps-3.183",
                                "channelid": "PJSIP/trunk-sps-3.183-endpoint-00000034",
                                "callpath": "1000"
                            }
                        },
                        {
                            "ext": {
                                "number": "1084",
                                "channelid": "PJSIP/1084-00000035"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}