Jump to: navigation, search

CometD notifications

You can subscribe to the following Voice API-related topics to receive CometD notifications:

  • /v2/me/devices — messages related to devices. For example, changes to agent state, do-not-disturb, call forwarding, and supervisor monitoring. This topic supports the following message types:
  • /v2/me/calls — messages related to calls. For example, changes to call state, updates to call participant information, and updates to call data. This topic supports the following message types:

DeviceStateChangeMessage

Property Description
data The data element is present in all CometD notifications and is the root JSON element. You can use data.messageType to identify the message and determine what other properties should be present.
data.messageType This property identifies the message type, in this case DeviceStateChangeMessage.
data.devices An array of device resources.
channel The topic to which the message was published.

Example

{
  "data": {
    "messageType": "DeviceStateChangeMessage",
    "devices": [
      {
        "id": "efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
        "deviceState": "Active",
        "userState": {
          "id": "900D55CC-2BB0-431F-8BF9-D3525B383BE6",
          "displayName": "Not Ready",
          "state": "NotReady"
        },
        "phoneNumber": "5005",
        "e164Number": "5005",
        "telephonyNetwork": "Private",
        "doNotDisturb": "Off",
        "voiceEnvironmentUri": "http://127.0.0.1:8080/api/v2/voice-environments/370ef5e6-9e3c-4d91-9588-7f4dfe67e011",
        "capabilities": [
          "DoNotDisturbOn",
          "ForwardCallsOn",
          "ListenIn",
          "Coach",
          "BargeIn"
        ]
      }
    ]
  },
  "channel": "/v2/me/devices"
}

CallStateChangeMessage

Property Description
data The data element is present in all CometD notifications and is the root JSON element. You can use data.messageType to identify the message and determine what other properties should be present.
data.messageType This property identifies the message type, in this case CallStateChangeMessage.
data.notificationType This property further identifies the type of notification and can have one of the following values:
  • StatusChange — The status of the call has changed.
  • ParticipantsUpdated — The call participants have changed.
  • AttachedDataChanged — The call data has changed.
  • DtmfSent — This is sent as confirmation that the SendDtmf operation was successful.
  • CallRecordingStateChange — The state of call recording has changed.
  • MonitoredUserMutedStateChange — The monitored user's muted state has changed.
data.extensions This property contains additional key/value properties from the Genesys platform.
data.call A call resource with the updated state and capabilities.
channel The topic to which the message was published.

Example

{
  "data": {
    "notificationType": "StatusChange",
    "call": {
      "id": "013V08JRL498H1OI04000VTAES000015",
      "state": "Established",
      "callUuid": "013V08JRL498H1OI04000VTAES000015",
      "connId": "0072026cb98d140f",
      "deviceUri": "http://127.0.0.1:8080/api/v2/devices/efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
      "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"5000",
               "phoneNumber":"5000",
               "digits":"5000"
            }
      ],
      "dnis": "5000",
      "callType": "Internal",
      "capabilities": [
        "UpdateUserData",
        "SingleStepConference",
        "DeleteUserData",
        "Hangup",
        "SendDtmf",
        "Hold",
        "AttachUserData",
        "SingleStepTransfer",
        "InitiateConference",
        "DeleteUserDataPair",
        "InitiateTransfer"
      ],
      "duration": "1",
      "mute": "Off",
      "supervisorListeningIn": false,
      "monitoredUserMuted": false,
      "uri": "http://127.0.0.1:8080/api/v2/me/calls/013V08JRL498H1OI04000VTAES000015",
      "path": "/calls/013V08JRL498H1OI04000VTAES000015",
    },
    "phoneNumber": "5005",
    "extensions": {
        "WrapUpTime": 0,
        "BusinessCall": 0
    },
    "messageType": "CallStateChangeMessage"
  },
  "channel": "/v2/me/calls"
}

ErrorMessage

Property Description
data The data element is present in all CometD notifications and is the root JSON element. You can use data.messageType to identify the message and determine what other properties should be present.
data.messageType This property identifies the message type, in this case ErrorMessage.
data.deviceUri The URI of the device to which the error message is related.
data.callUri The URI of the call to which the error message is related. May not be present if the error is not related to a call.
data.errorMessage The description of the error. If no error description is provided by T-Server, this may not be present.
channel The topic to which the message was published.
Important
Errors Web Services receives from T-Server always relate to a device, but may not relate to a call, depending on the specific scenario.

Examples

{
  "data": {
    "messageType": "ErrorMessage",
    "deviceUri": "http://127.0.0.1:8080/api/v2/devices/efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
    "errorMessage": "Invalid Called Dn"
  },
  "channel": "/v2/me/devices"
}
{
  "data": {
    "messageType": "ErrorMessage",
    "deviceUri": "http://127.0.0.1:8080/api/v2/devices/efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
    "callUri": "http://127.0.0.1:8080/api/v2/calls/0071023821aec021",
    "errorMessage": "Incorrect object state"
  },
  "channel": "/v2/me/calls"
}
This page was last edited on February 15, 2024, at 19:11.
Comments or questions about this documentation? Contact us for support!