Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.09k stars 1.2k forks source link

[Communication Services - Call Automation] Raw media access on the server (Rooms Calls) #30647

Open yxor opened 3 months ago

yxor commented 3 months ago

Describe the bug The raw media access documentation here says that it's possible to access raw call media (audio data in my case) on the server side, but I can't find any code samples or any documentation on this

To Reproduce Cannot access raw call media on the server side

Expected behavior I need the ability to access raw call media on the server side

Screenshots N/A

Additional context I need to do some real-time processing on the audio data of the call

github-actions[bot] commented 3 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @akucer.

yxor commented 3 months ago

Update: I reviewed the recently published documentation and set up a sample using the Call Automation library to initiate media streaming by passing a URL to a WebSocket server that I configured.

Please note that the call I am trying to stream media from is a Room's call. Here is how I initiate the media streaming:

        const mediaStreamingOptions: MediaStreamingOptions = {
            transportUrl: `${process.env.PUBLIC_CALLING_SERVER_URL}`,
            transportType: "websocket",
            contentType: "audio",
            audioChannelType: "mixed",
            startMediaStreaming: true,
        };
        const response = await callAutomationClient.connectCall(
            {
                id: room.id,
                kind: "roomCallLocator",
            },
            callbackUrl,
            {
                mediaStreamingOptions,
            },
        );

This is the error I received:

 {
  "name": "RestError",
  "code": "8520",
  "statusCode": 405,
  "request": {
    "url": "https://xxxxxxx.unitedstates.communication.azure.com/calling/callConnect
ions/19003b80-646c-4e42-99f2-6b6b3c4b16e7:startMediaStreaming?api-version=2024-06-15
-preview",
    "headers": {
      "content-type": "application/json",
      "accept": "application/json",
      "accept-encoding": "gzip,deflate",
      "user-agent": "azsdk-js-communication-call-automation/1.3.0-beta.1 core-rest-p
ipeline/1.15.2 Node/20.10.0 OS/(x64-Windows_NT-10.0.19045)",
      "x-ms-client-request-id": "0a490dd6-32fd-4e37-9636-c4bd41c7f431",
      "host": "REDACTED",
      "x-ms-date": "REDACTED",
      "x-ms-content-sha256": "REDACTED",
      "authorization": "REDACTED",
      "content-length": "49"
    },
    "method": "POST",
    "timeout": 0,
    "disableKeepAlive": false,
    "streamResponseStatusCodes": {},
    "withCredentials": false,
    "requestId": "0a490dd6-32fd-4e37-9636-c4bd41c7f431",
    "allowInsecureConnection": false,
    "enableBrowserStreams": false
  },
  "details": {
    "error": {
      "code": "8520",
      "message": "MediaStreaming is not supported for connection created with Connec
t interface."
    }
  },
  "message": "MediaStreaming is not supported for connection created with Connect in
terface."
}

Is there a workaround for this? My end goal is to achieve media streaming on the server side for Room calls. Your urgent response would be greatly appreciated.

realjesset commented 2 months ago

any updates on this? I am searching for something similar at the moment

valindrae commented 1 month ago

Hi @yxor and @realjesset server side media streaming features are not yet supported in a Rooms call using the Connect APIs. This is something we are looking to enable in future versions.

Tryptophan commented 1 month ago

@yxor @realjesset Did you ever find a workaround for this using create/answer call? Trying to achieve something similar.

Tryptophan commented 2 weeks ago

Hi @valindrae is there an expected date this would be in a new version of call automation by?