meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.17k stars 2.47k forks source link

AudioBridge: (re) configure remote rtp #3380

Open keremcadirci opened 4 months ago

keremcadirci commented 4 months ago

This PR is intended to address the topic discussed in https://janus.discourse.group/t/audiobridge-rtp-join-sip-scenarios/1049/3
This PR enhance slightly SIP interoperability provided by the plain RTP join feature of AudioBridge, such as in the case of an 18x message with SDP. Specifically, during an outbound SIP call, there is currently no way to direct RTP issued from a SIP 18x Ringing or Session Progress (e.g., ringback tone provided by RTP or a custom message sent by the operator during ringing), into the AudioBridge room.

Solution Proposal:

I believe this approach is backward compatible.

How this enhancement improve SIP interoperability? How will SIP/janus flow will be?

Implementation & Tests

We have well tested with real word use cases:

Tests successfully made:

Not Tested:

lminiero commented 4 months ago

To be honest, I don't like this approach, which seems wasteful. It creates a socket already knowing it will be destroyed shortly thereafter. I'd rather see a possible alternative to RTP participants creation, where the plugin is asked to provide a port first, and the application will then provide their own later on (e.g., via a configure). This would map better to an inverted negotiation pattern (where the plugin "offers" and the application "answers"). We have both approaches already on the WebRTC side, for instance, so you can see how that's done for WebRTC to possibly reuse the same methods and just add the required attributes there.

keremcadirci commented 4 months ago

Do you suggest something like generate-offer with join request ?

In that case which of two join request would you prefer (or a 3rd suggestion):

lminiero commented 4 months ago

I think the second one is better, since it adds the property as part of the already existing rtp container. For consistency it should use a generate_offer, though (notice the underscore), since that's how the property is called for WebRTC usage.

keremcadirci commented 3 months ago

The fallowing rtp.generate_offer is added

{
    "request" : "join",
    "room" : <numeric ID of the room to join>,
        [..]
        "rtp" : {
                "generate_offer: <true|false, whether audioroom reserve a local port to receive rtp. configure request should be later usedd to setup the PeerConnection. If true all other rtp properties are discarded\>,
                [..] <other properties are discarded\>
    }
}

@lminiero My previous remarks about limitations and tests remains the same

lminiero commented 3 months ago

That's a LOT of new code... I'm not sure I'm comfortable with that many changes in critical parts of the plugin. I'll need some time to review this.