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

Added plugin text to attach success respond #3281

Closed je3f0o closed 11 months ago

je3f0o commented 11 months ago

Hello.

Long time ago I watched Lorenzo Miniero's presentation talking about he wanted to leave his footprint in Linux Open Source community. I liked a lot. Recently I just wanted to use Janus gateway. Then I noticed there is something missed. When I try to attach multiple plugins same time, responses were kinda ambiguous.

{"data": {"id": 1031698377864485}, "janus": "success", "session_id": 3203095836386583, "transaction": "aD1WAa4BgPTi"}
{"data": {"id": 7385971511868724}, "janus": "success", "session_id": 3203095836386583, "transaction": "aD1WAa4BgPTi"}

only different thing is data.id. But I don't know which plugin it is. So I added a property called plugin to data object. Which is looks like this.

{"data": {"id": 5163072378294882, "plugin": "janus.plugin.videocall"}, "janus": "success", "session_id": 4508896580813890, "transaction": "iZ77uvbSIiCT"}
{"data": {"id": 6691722777787441, "plugin": "janus.plugin.echotest"}, "janus": "success", "session_id": 4508896580813890, "transaction": "iZ77uvbSIiCT"}

Now I can determine success reponse messages for which plugins. Which helps a lot for writing my own custom clients.

Please accept. Thank you.

januscla commented 11 months ago

Thanks for your contribution, @je3f0o! Please make sure you sign our CLA, as it's a required step before we can merge this.

lminiero commented 11 months ago

only different thing is data.id. But I don't know which plugin it is

There's no need for this additional property at all. You're supposed to check the transaction ID to see which original request the response is for, which means you'll also know which plugin it referred to. Your additional property serves little purpose, especially considering you may create multiple handles to the same plugin, and so the same ambiguity you see would still apply. Use the transaction ID as conceived, and there will be no ambiguity.