finos / SymphonyMediaBridge

The Symphony Media Bridge (SMB) is a media server application that handles audio, video and screen sharing media streams in an RTC conference system.
Apache License 2.0
54 stars 18 forks source link

MEDIA-2265: Change the api in order to support Named Telephone Events #352

Closed RicardoMDomingues closed 4 months ago

RicardoMDomingues commented 5 months ago

Change API in order to support Named Telephone Events.

Currently API contains a single json object to describe the audio payload. With this change, we are making it an array of payloads instead, in the similar way we do for video payloads. The json property was then renamed from payload-type to payload-types.

If you need to support multiple SMB versions, then your code should be prepared to encounter payload-type as a single object xor payload-types as an array of objects when you allocate an endpoint, pseudo-code example:

if (audioJsonNode.has("payload-type")) {
    // old version. Process as you did before
    addPayloadToMediaDescription(audioJsonNode.get("payload-type"));
} else if (audioJsonNode.has("payload-types"))
    // New version
     auto payloadsArray = audioJsonNode.get("payload-types");
     for (auto payloadJsonObject : payloadsArray) {
          addPayloadToMediaDescription(payloadJsonObject);
      }
}

If you are supporting multiple SMB versions, then you need to keep in mind to use payload-type or payload-types in configuration and reconfiguration actions, depending on which SMB version you are calling

Main Modifications

RicardoMDomingues commented 5 months ago

Hey @marcusspangenberg I know you are/were using SMB. I am doing this breaking change on API to support Named Telephone Events. While this requires code changes on components that communicates with SMB, I believe the changes should be pretty straight forward and it should be relatively easy if you need to support multiple SMB versions.

Please let me know if you might encounter any obstacles with this change in your project.

marcusspangenberg commented 5 months ago

Hey @marcusspangenberg I know you are/were using SMB. I am doing this breaking change on API to support Named Telephone Events. While this requires code changes on components that communicates with SMB, I believe the changes should be pretty straight forward and it should be relatively easy if you need to support multiple SMB versions.

Please let me know if you might encounter any obstacles with this change in your project.

Thanks for the mention @RicardoMDomingues. Much appreciated. The change won't cause any problems for our use case.