Query Calls
Get the detailed information of a specified call or a specified type of calls.
Request URL
{base_url}/{api_path}/call/query?token={token}
Request parameters
- Query a specified call
Parameter Required Type Description callid Yes String The unique ID of each call. - Query calls by type
Parameter Required Type Description type Yes String Call type. Valid values:
- inbound: Query the information of inbound calls.
- outbound: Query the information of outbound calls.
Response parameters
Parameter | Type | Description |
---|---|---|
calls | Array <CallInfo> | The call information. |
status | String | Request result.
|
- CallInfo
-
Parameter Type Description members Array <MemberType> A list of information for different types of members during a call. callid String The unique ID of each 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 String 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:For example, external user 5503302 calls to IVR (6500), and dials extension number 2000, thecallpath
parameter only appears when the call passes through trunk, IVR, Queue, Ring Group, Paging/Intercom or Conference.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 1
Query information of a specified call.
Request example
POST /api/v2.0.0/call/query?token=4dfa215a2a835361425878c43e25dc8d HTTP/1.1 Content-Type:application/json; charset=utf-8 Host: 192.168.5.150 { "callid": "1571386069.8" }
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 { "Calls": [ { "members": [ { "inbound": { "from": "500", "to": "1023", "trunkname": "siptrunk", "channelid": "PJSIP/trunk-API-endpoint-00000005", "memberstatus": "ANSWERED" } }, { "ext": { "number": "1023", "channelid": "PJSIP/1023-00000006", "memberstatus": "ANSWER" } } ], "callid": "1571386069.8" } ], "status": "Success" }
Example 2
Query call information of a specified type.
Request
example
POST /api/v2.0.0/call/query?token=4dfa215a2a835361425878c43e25dc8d HTTP/1.1 Content-Type:application/json; charset=utf-8 Host: 192.168.5.150 { "type": "inbound" }
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 { "Calls": [ { "members": [ { "inbound": { "from": "3000", "to": "4000", "trunkname": "siptrunk", "channelid": "PJSIP/trunk-siptrunk-endpoint-000000a2", "memberstatus": "ANSWERED" } }, { "ext": { "number": "4000", "channelid": "PJSIP/4000-000000a3", "memberstatus": "ANSWER" } } ], "callid": "1571639442.264" }, { "members": [ { "inbound": { "from": "2000", "to": "1023", "trunkname": "siptrunk", "channelid": "PJSIP/trunk-siptrunk-endpoint-00000098", "memberstatus": "ANSWERED" } }, { "ext": { "number": "1023", "channelid": "PJSIP/1023-00000099", "memberstatus": "ANSWER" } } ], "callid": "1571639198.248" } ], "status": "Success" }