SkypeSDK Video and audio issue - mediaRelayAccessToken not found

瘦欲@ 提交于 2019-12-11 08:49:18

问题


I'm having problems with adding an audio or a video service to a coversation. The chat service works fine for me. When I add a video or an audio service I get following error:

Error: GET /ucwa/oauth/v1/applications/113925534802/communication/mediaRelayAccessToken failed: 404
{
  [functions]: ,
  __proto__: { },
  code: "RequestFailed",
  description: "GET /ucwa/oauth/v1/applications/113925534802/communication/mediaRelayAccessToken failed: 404",
  message: "GET /ucwa/oauth/v1/applications/113925534802/communication/mediaRelayAccessToken failed: 404",
  name: "Error",
  req: { },
  rsp: { },
  stack: "Error: GET /ucwa/oauth/v1/applications/113925534802/communication/mediaRelayAccessToken failed: 404
at process (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8079:29)
at Anonymous function (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8018:29)
at Anonymous function (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:1714:25)
at map (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:1331:25)
at decompose (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8017:25)
at Anonymous function (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8007:29)
at handle (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:2220:33)
at Anonymous function (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:698:25)"
}

The Skype For Business Plugin is installed and works fine. A Skype Edge server is currently not installed. I'm using Internet Explorer 11.

The error occurs with the Skype Web SDK On Prem Sample from Microsoft as well as on my own website.

When I try to add video or audio for the second time to the same conversation i dont get any error message at all, but it still doesn't work. The request doesnt show up in the dev tools nor in fiddler. I'm using the latest version of the Skype SDk bootstrapper.

Both clients and server are in the same subnet.

Thanks in advance.


回答1:


I encountered the same problem. Not sure how it happens, but the sdk has troubles to fetch or apply the media config. You can use the this workaround:

Following line 18,892 in the debug version of the sdk, comment out both calls:

uninit(); throw error;

in the function init() of the section MediaConfig. Resulting in:

function init() { pcMediaConfig = mediaPlugin.createComponent({ type: 'MediaPlatformConfig', hide: true, inproc: false }); pcMediaConfig.event(onPluginComponentEvent); pcMediaConfig.state.changed(function (state) { log('pcMediaConfig.state = ' + state); }); var p = pcMediaConfig.load().then(getMediaConfig).then(setMediaConfig).then(null, function (error) { log('MediaConfig::init rejected'); //uninit(); //throw error; }); return p; }

Therefore you have to download the bootstrapper and the sdk to permanently apply the patch. To do this just fetch both in the debug version (bootstrapper version 1.2.5) and replace in function onConfig(config) line 48

}, config.corsScript && (scriptAttributes.crossOrigin = ""), loader.loadScript(getPackageUrl(config), null, handleError, scriptAttributes);

with

}, config.corsScript && (scriptAttributes.crossOrigin = ""), loader.loadScript("./scripts/SkypeSDK.js", null, handleError, scriptAttributes);

or your equivalent path




回答2:


This is currently a limitation of the Skype Web SDK: it has a dependency on the mediaRelayAccessToken to proceed with audio/video calls. The dev team is aware of this issue and it may be fixed in a future release of Skype Web SDK.

The hacky way recommended above is basically to allow the SDK to continue the call upon missing mediaRelayAccessToken, so it may let you bypass the issue.

The media relay access token is returned by an edge server, so you may also try to deploy an edge server to work around this issue.



来源:https://stackoverflow.com/questions/39631648/skypesdk-video-and-audio-issue-mediarelayaccesstoken-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!