Skip to content

CallQueuePresenceEventBody does not match Call Queue Member Presence Event payload #82

@mtherriault

Description

@mtherriault

CallQueuePresenceEventBody does not match Call Queue Member Presence Event payload

Problem

The current CallQueuePresenceEventBody model does not match the documented payload for the Call Queue Member Presence Event, nor the payload we receive from RingCentral.

Current SDK model:

public class CallQueuePresenceEventBody
{
    public string extensionId { get; set; }
    public string callQueueId { get; set; }
    public bool? acceptCalls { get; set; }
}

Source:

https://github.com/ringcentral/RingCentral.Net/blob/master/RingCentral.Net/Definitions/CallQueuePresenceEventBody.cs

According to the RingCentral documentation for the Call Queue Member Presence Event, the notification body contains a records array, where each record contains a member object and acceptCurrentQueueCalls.

Documentation:

https://developers.ringcentral.com/api-reference/Call-Queue-Member-Presence-Event

Documented / received payload shape

{
  "uuid": "ed1cf00c-0420-4bf5-a0ae-e659cc9f77e0",
  "event": "/restapi/v1.0/account/{accountId}/call-queues/{groupId}/presence",
  "timestamp": "2019-06-14T12:00:00.000Z",
  "subscriptionId": "3rtt23ryy-56665-t7r7-a0ae-748895yhhf94ujrr",
  "ownerId": "1500723004",
  "body": {
    "records": [
      {
        "member": {
          "id": "411753183004"
        },
        "acceptCurrentQueueCalls": true
      },
      {
        "member": {
          "id": "411753646416541"
        },
        "acceptCurrentQueueCalls": false
      }
    ]
  }
}

Actual SDK model expectation

The current SDK model appears to expect a flat body similar to:

{
  "extensionId": "...",
  "callQueueId": "...",
  "acceptCalls": true
}

However, the actual event body is structured around:

{
  "records": [
    {
      "member": {
        "id": "..."
      },
      "acceptCurrentQueueCalls": true
    }
  ]
}

Expected model

The body should likely be modeled as something similar to:

public class CallQueuePresenceEventBody
{
    public CallQueuePresenceEventRecord[] records { get; set; }
}

public class CallQueuePresenceEventRecord
{
    public CallQueueMemberInfo member { get; set; }

    public bool? acceptCurrentQueueCalls { get; set; }
}

public class CallQueueMemberInfo
{
    public string id { get; set; }
}

Relevant links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions