Updated on 2023-09-27 GMT+08:00

Querying Call Information

Prerequisites

  • The agent has signed in.

Description

This interface is used by a signed-in agent to query call information.

Interface Method

The request method must be set to GET. This interface supports only the GET method.

URI

https://ip:port/agentgateway/resource/calldata/{agentid}/callinfo?isNoContainLastCall={isNoContainLastCall}

In the URL, ip indicates the IP address of the agent gateway, port indicates the HTTPS port number of the agent gateway, and {agentid} indicates the ID of an agent. {isNoContainLastCall} indicates whether to query the last call when the current agent has no call. The value is of the boolean type.

Table 1 Parameters in the URI

No.

Parameter

Data Type

Mandatory (Yes/No)

Description

1

agentid

string

Yes

Agent ID. The value ranges from 101 to 59999.

2

isNoContainLastCall

boolean

No

Whether to query the information about the last call when the current agent has no call. The options are as follows:

  • true: yes
  • false: no

Method Name in Logs

queryCallInfo

Request Description

  • Message header
    Table 2 Parameters in the request message header

    No.

    Parameter

    Value Type

    Mandatory (Yes/No)

    Description

    1

    Content-Type

    string

    Yes

    Coding mode of the message body. The default value is application/json; charset=UTF-8.

    2

    Guid

    string

    Yes

    GUID returned by the sign-in interface during static authentication (AUTHMODE is set to 1) or GUID returned by the polling event query interface during dynamic authentication (AUTHMODE is set to 2).

  • Message body

    None

Response Description

Table 3 Parameters in the message body

No.

Parameter

Value Type

Description

1

message

string

Description.

2

retcode

string

Error code. The options are as follows:

0: success

Other values: failure

3

result

object

Call information returned after a successful query.

For details about the parameters of this object, see Table 4.

Table 4 Parameter description of result

No.

Parameter

Value Type

Description

3.1

callfeature

int

Call type. For details, see Call Type.

3.2

callid

string

Call ID.

3.3

caller

int

Calling number.

3.4

called

int

Called number.

3.5

callskill

string

Call skill description.

3.6

callskillid

int

Call skill ID.

3.7

orgicallednum

string

Original called number.

3.8

calldata

string

Call-associated data.

3.9

begintime

long

Response start time, in milliseconds. The value is a timestamp.

3.10

endtime

long

Call end time, in milliseconds. The value is a timestamp.

3.11

userPriority

int

Customer level.

3.12

trunkNo

int

Trunk number.

3.13

logontimes

int

Total login duration, in seconds.

3.14

mediaType

int

Media type. The options are as follows:

  • 1: text chat
  • 2: click-to-dial call
  • 4: callback request
  • 5: common voice or video call
  • 15: predicted outbound call
  • 16: previewed outbound call
  • 17: message call
  • 19: common video call
  • 51: multimedia web chat
  • 53: social chat

3.15

mediaAbility

int

Media capability. The options are as follows:

  • 1: voice
  • 2: video
  • 3: voice and video

3.16

waitTime

long

Response waiting time, in seconds. The value is a timestamp.

3.17

trace

HWCallDeviceTraceEx

Extended attribute of the call track. For details, see Table 5.

Table 5 Parameter description of the trace object

No.

Parameter

Value Type

Description

3.17.1

waitBeginTime

long

Waiting start time, in milliseconds. The value is a timestamp.

3.17.2

waitEndTime

long

Waiting end time, in milliseconds. The value is in the timestamp format. Information about the last call cannot be queried.

3.17.3

answerBeginTime

long

Response start time, in milliseconds. The value is a timestamp.

3.17.4

answerEndTime

long

Answer end time, in milliseconds. The value is in the timestamp format. Information about the last call cannot be queried.

3.17.5

talkBeginTime

long

Conversation start time, in milliseconds. The value is a timestamp.

3.17.6

talkEndTime

long

Conversation end time, in milliseconds. The value is in the timestamp format. Information about the last call cannot be queried.

3.17.7

deviceNo

int

Device ID.

3.17.8

deviceType

int

Device type. The options are as follows:

  • 1: call queue
  • 2: agent
  • 3: automatic flow
  • 4: conference resource
  • 5: paired call
  • 6: agent queue
  • 7: common call

3.17.9

callDirectMode

string

Processing mode of the device, that is, reason for leaving the device. The options are as follows:

  • NORMAL_DIRECT: The device leaves normally.
  • KEEP_DIRECT: The call is held.
  • WAIT_DIRECT: The call is waiting.
  • RELEASE_DIRECT: The call is released.

3.17.10

enterReason

int

Reason for accessing the device. For details, see Table 6.

3.17.11

enterReasonDesc

string

Description of the reason for accessing the device.

3.17.12

leaveReason

int

Reason for leaving the device. For details, see Table 6. The call information of the previous call cannot be queried.

3.17.13

leaveReasonDesc

string

Description of the reason for leaving the device. The call information of the previous call cannot be queried.

3.17.14

vdnId

int

VDN ID

Table 6 Reason codes

Reason Code

Description

0

Common access or transfer.

1

The call is transferred due to overflow.

2

The call is transferred due to timeout.

3

The call is transferred when no one is on duty.

4

The call is transferred when queuing is cancelled.

5

The call is transferred when an agent does not answer for a long time.

6

The suspended call is resumed.

7

The held call is connected.

8

Three-party help is initiated.

9

The call is unheld.

10

The three-party call is initiated.

11

The call is released by the party who sends the internal help request.

12

The call is intercepted.

13

The call is picked up.

14

Called number analysis is not configured for a call.

15

The user releases the call.

16

The agent releases the call.

17

The call is transferred out.

18

The call is held.

19

Internal processing error.

20

The called party is busy.

21

The line is busy.

22

The phone is powered off.

23

The phone is out of service.

24

The number is invalid.

25

No resource is available on the ACD.

26

The user does not answer the call.

27

The called party rejects the call.

28

The connected call is transferred to a queue.

29

The three-party call is transferred to a queue.

30

The connected call times out when being transferred to a queue.

31

The three-party call times out when being transferred to a queue.

34

The failed network call queues due to timeout, overflow, or busy.

35

The network call queues at the original call center.

36

The queuing call is rerouted.

37

The call enters the CDN through the inbound route.

38

The call enters the CDN from agent consultation.

39

The CDN returns the routing result.

40

CDN routing times out.

41

The agent cancels the call during consultation.

42

The call enters the PGR from a timeout CDN route.

43

The call enters the PGR from a normal CDN route.

44

The call enters the PGR through the inbound route.

45

The call enters the PGR from agent consultation.

46

The CDN reroutes the call because the agent is unreachable.

47

The call queues in multiple queues.

48

The call in the master queue is answered from the slave queue.

50

The agent rejects the call.

51

A user call joins a conference.

52

The conference chairperson proactively releases the conference, or the conference is released due to a CSS exception.

53

The participant is removed from the conference.

54

The call is transferred when the call completion rate is lower than the threshold.

88

The user hangs up after the agent answers the call.

89

The user hooks on after the agent answers the call.

Triggered Event

  • None

Error Code

  • 100-006

Example

  • Message header
    Content-Type:application/json; charset=UTF-8
    Guid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.AgentGateway1
  • Request parameter

    None

  • Response parameter
    {
        "message": "",
        "retcode": "0",
        "result": {
            "callfeature": 0,
            "callid": "1476838963-224",
            "caller": "70004",
            "called": "60015",
            "callskill": "voice",
            "callskillid": 20011,
            "orgicallednum": "",
            "calldata": "",
            "begintime": 1476838963000,
            "endtime": null,
            "userPriority": 0,
            "trunkNo": 65535,
            "logontimes": 0,
            "mediaType": 5,
            "mediaAbility": 1,
            "waitTime": 0,
            "trace": {
                "waitBeginTime": 1626179227000,
                "waitEndTime": 1626179227000,
                "answerBeginTime": 1626179227000,
                "answerEndTime": 1626179227000,
                "talkBeginTime": 1626179227000,
                "talkEndTime": 1626179227000,
                "deviceNo": 2005,
                "deviceType": 2,
                "callDirectMode": "NORMAL_DIRECT",
                "enterReason": 0,
                "enterReasonDesc": "Normal reason",
                "leaveReason": 0,
                "leaveReasonDesc": "Normal reason",
                "vdnId": 214
            }
        }
    }