0

概括

我有一个 UCWA 应用程序,我希望它接受传入的 onlineMeetingInvitation 事件,然后监视所有消息。虽然我已经能够成功接受邀请,但我没有收到任何消息的事件。我相信这可能是因为默认情况下未连接消息传递模式,所以我正在尝试addMessaging。不幸的是,这个请求总是返回一个 409 错误和消息,

发生冲突,导致操作无法启动。请稍后再试。

有谁知道,一个。如果尝试添加消息是正确的?湾。为什么我收到上述错误?

细节

我设置了两个正常的 Lync 客户端进行对话。然后我邀请我的 UCWA 应用程序的用户加入对话。这会在我的事件频道上产生以下响应,(包括预期的接受链接)

{
  "_links": {
    "self": {
      "href": "/ucwa/oauth/v1/applications/102547331865/events?ack=28"
    },
    "next": {
      "href": "/ucwa/oauth/v1/applications/102547331865/events?ack=29"
    }
  },
  "sender": [
    {
      "rel": "me",
      "href": "/ucwa/oauth/v1/applications/102547331865/me",
      "events": [
        {
          "link": {
            "rel": "presence",
            "href": "/ucwa/oauth/v1/applications/102547331865/me/presence"
          },
          "type": "updated"
        }
      ]
    },
    {
      "rel": "communication",
      "href": "/ucwa/oauth/v1/applications/102547331865/communication",
      "events": [
        {
          "link": {
            "rel": "onlineMeetingInvitation",
            "href": "/ucwa/oauth/v1/applications/102547331865/communication/onlineMeetingInvitations/6cb18668cbda428e839652ae1f6cd58f"
          },
          "_embedded": {
            "onlineMeetingInvitation": {
              "direction": "Incoming",
              "importance": "Normal",
              "threadId": "AdIw2sMaOjuEJHfcRJiiK5Czug+5Ug==",
              "state": "Connecting",
              "subject": "",
              "onlineMeetingUri": "sip:test.user2@xxx.xxx.xx;gruu;opaque=app:conf:focus:id:KS77KG4B",
              "availableModalities": [
                "Messaging"
              ],
              "_links": {
                "self": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/onlineMeetingInvitations/6cb18668cbda428e839652ae1f6cd58f"
                },
                "to": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/people/test.user1@xxx.xxx.xx"
                },
                "conversation": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d"
                },
                "accept": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/onlineMeetingInvitations/6cb18668cbda428e839652ae1f6cd58f/accept"
                },
                "decline": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/onlineMeetingInvitations/6cb18668cbda428e839652ae1f6cd58f/decline"
                }
              },
              "_embedded": {
                "from": { ....

我在“接受”href 上执行 POST,它成功响应但没有内容。然后我收到 2 个事件响应,其中第二个包括以下内容

...

    {
      "rel": "communication",
      "href": "/ucwa/oauth/v1/applications/102547331865/communication",
      "events": [
        {
          "link": {
            "rel": "conversation",
            "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d"
          },
          "_embedded": {
            "conversation": {
              "state": "Conferenced",
              "threadId": "AdIw2sMaOjuEJHfcRJiiK5Czug+5Ug==",
              "subject": "",
              "activeModalities": [
                "Messaging"
              ],
              "importance": "Normal",
              "participantCount": 3,
              "audienceMute": "Disabled",
              "audienceMessaging": "Enabled",
              "recording": false,
              "_links": {
                "self": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d"
                },
                "applicationSharing": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/applicationSharing"
                },
                "audioVideo": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/audioVideo"
                },
                "dataCollaboration": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/dataCollaboration"
                },
                "messaging": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/messaging"
                },
                "phoneAudio": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/phoneAudio"
                },
                "localParticipant": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/participants/test.user1@xxx.xxx.xx",
                  "title": "Test User1"
                },
                "addParticipant": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/participantInvitations?conversation=3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d"
                },
                "leaders": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/participants?filter=leaders"
                },
                "attendees": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/participants?filter=attendees"
                },
                "lobby": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/participants?filter=lobby"
                },
                "onlineMeeting": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/onlineMeeting"
                },
                "enableAudienceMuteLock": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/enableAudienceMuteLock"
                },
                "disableAudienceMessaging": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/disableAudienceMessaging"
                }
              },
              "rel": "conversation"
            }
          },
          "type": "updated"
        }
      ]
    },

...

{
          "link": {
            "rel": "messaging",
            "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/messaging"
          },
          "_embedded": {
            "messaging": {
              "state": "Disconnected",
              "_links": {
                "self": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d/messaging"
                },
                "conversation": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/conversations/3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d"
                },
                "addMessaging": {
                  "href": "/ucwa/oauth/v1/applications/102547331865/communication/messagingInvitations?conversation=3b80d6be-b57c-4cc1-b10d-cd5c89ffa09d"
                }
              },
              "rel": "messaging"
            }
          },
          "type": "updated"
        },
...

同样,我相信这符合预期,此时原始 Lync 客户端按预期显示 3 个参与者。

接下来,我尝试对上述代码段中的 addMessaging href 进行 POST。POST 没有正文。

URI         : https://xxx.xxx.xx/ucwa/oauth/v1/applications/102547331865/communication/messagingInvitations?conversation=0ae942e4-9133-4888-a0fb-8a7b182fff00
Method      : POST
Headers     : {Accept=[text/plain, application/json, application/*+json, */*], Content-Length=[0]}
Request body:

结果是 409 冲突,我在任何时候都不会收到两个 Lync 客户端添加到对话中的新消息的事件。

Header {Cache-Control=[no-cache], Pragma=[no-cache], Via=[1.1 DEVLYNC2.xxx.xxx.xx RtcInt], Content-Length=[120], Content-Type=[application/json], Expires=[-1], Server=[Microsoft-IIS/7.5], X-MS-Server-Fqdn=[DEVLYNC2.xxx.xx.xx], X-AspNet-Version=[4.0.30319], Strict-Transport-Security=[max-age=31536000; includeSubDomains], X-Powered-By=[ASP.NET], Date=[Fri, 28 Oct 2016 07:31:51 GMT]}

Body {"code":"Conflict","message":"There was a conflict that prevented the operation from starting. Please try again later."}

4

1 回答 1

0

您的问题似乎通过添加 operationId 解决了,即使它在 UCWA 文档中被提及为可选。根本原因可能是在显示有关 UCWA 的 microsoft 文档中存在可重现的错误:例如https://ucwa.skype.com/documentation/resources-startmessaging下拉列表选择 API 的版本不是可见的。此错误仅在 Mozilla Firefox 中发生,我在您的日志中看到它是您正在使用的版本(nb:我使用版本 61 进行了测试)。使用 Chrome,它可以正确显示,您可以看到 operationID 有时是必需的(仅在某些版本的 API 上)。您的服务器使用的 API 版本可以通过此链接确定: https ://docs.microsoft.com/en-us/skype-sdk/ucwa/versioning

我希望这可以帮助您解决 UCWA 的进一步问题 - 无需使用试错法。

于 2018-07-11T11:31:40.587 回答