Query Calls

Get the detailed information of calls that are in progressing.

Request URL

GET {base_url}/{api_path}/call/query?access_token={access_token}

Request parameters

Query a specific call
Table 1.
Parameter Required Type Description
call_id Yes String The unique ID of each call.
Note: You can obtain the call ID in the (30011) Call Status Changed event.
Query calls by communication type
Table 2.
Parameter Required Type Description
type Yes String Communication type.
Valid value:
  • inbound: Query the information of inbound calls.
  • outbound: Query the information of outbound calls.
  • internal: Query the information of internal calls.
Query calls by extension number
Table 3.
Parameter Required Type Description
number Yes String Extension number.

Response parameters

Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
data Array<Call_Info> The detailed information of the calls.
Call_Info
Table 4.
Parameter Type Description
call_id String The unique ID of each call.
members Array<Members> A list of information for different types of members during the call.
Members
Table 5.
Parameter Type Description
extension Object<Extension_Info> The information of the extensions.
inbound Object<Inbound_Info> The information of the inbound calls.
outbound Object<Outbound_Info> The information of the outbound calls.
Extension_Info
Table 6.
Parameter Type Description
number String Extension number.
channel_id String The call channel ID of each member during the call.
member_status String The current call status of the member.
  • 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 the call, and is in the talking state.
  • HOLD: The call is held.
  • BYE: The call is hung up.
call_path String The call path that indicates how the call is established.
Note: This parameter returns the call path when the call passes through IVR, Queue, Ring Group, Paging/Intercom or Conference.

For example, a caller calls to IVR (6400), and dials extension number 2000, then the call_path will return "6400".

Inbound_Info
Table 7.
Parameter Type Description
from String The caller number.
to String The callee number.
trunk_name String The name of the trunk that passes the inbound call.
channel_id String The call channel ID of each member during the call.
member_status String The current call status of the member.
  • 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 the call, and is in the talking state.
  • HOLD: The call is held.
  • BYE: The call is hung up.
call_path String The call path that indicates how the call is established.
Note: This parameter returns the call path when the call passes through IVR, Queue, Ring Group, Paging/Intercom or Conference.

For example, a caller calls to IVR (6400), and dials extension number 2000, then the call_path will return "6400".

Outbound_Info
Table 8.
Parameter Type Description
from String The caller number.
to String The callee number.
trunk_name String The name of the trunk that passes the outbound call.
channel_id String The call channel ID of each member during the call.
member_status String The current call status of the member.
  • 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 the call, and is in the talking state.
  • HOLD: The call is held.
  • BYE: The call is hung up.
call_path String The call path that indicates how the call is established.
Note: This parameter returns the call path when the call passes through IVR, Queue, Ring Group, Paging/Intercom or Conference.

For example, a caller calls to IVR (6400), and dials extension number 2000, then the call_path will return "6400".

Examples

Request example

Query the information of a specific call with the call id.

GET /openapi/v1.0/call/query?access_token=bKLJMkg5taCtUEdDy7MmLZfRXqiDEboh&call_id=1650012665.266 HTTP/1.1
Host: 192.168.5.150:8088

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "data": [
        {
            "call_id": "1650012665.266",
            "members": [
                {
                    "extension": {
                        "number": "2000",
                        "channel_id": "PJSIP/2000-0000008a",
                        "member_status": "ANSWERED",
                        "call_path": ""
                    }
                },
                {
                    "outbound": {
                        "from": "2000",
                        "to": "1003",
                        "trunk_name": "test-peer-trunking",
                        "channel_id": "PJSIP/trunk-test-peer-trunking-endpoint-0000008b",
                        "member_status": "ANSWER",
                        "call_path": ""
                    }
                }
            ]
        }
    ]
}