OpenSight / janus-cloud

a cluster solution for Janus WebRTC server, by API proxy approach
GNU Affero General Public License v3.0
205 stars 49 forks source link

p2p plugin missing SDP error. #6

Closed thevaliio closed 3 years ago

thevaliio commented 3 years ago

in p2p plugin in your demo whenever I hit the the upper buttons(toggle audio/video, change bitrate) I get the error missing sdp:
image

The video stops after that.

thevaliio commented 3 years ago

And the error from logs: 2020-12-13 15:16:45,222 [817229] [januscloud.proxy.plugin.p2pcall] [DEBUG] - handle_message for p2pcall handle 1634401515955855. transaction:mQBVE6hbo4Sl body:{'request': 'set', 'audio': False} jsep:None 2020-12-13 15:16:45,223 [817229] [januscloud.proxy.core.request] [DEBUG] - Response ({'janus': 'ack', 'session_id': 4917037329223066, 'transaction': 'mQBVE6hbo4Sl'}) is to return 2020-12-13 15:16:45,223 [817229] [januscloud.proxy.plugin.p2pcall] [ERROR] - Fail to handle async message ({'request': 'set', 'audio': False}) for handle 1634401515955855 Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/januscloud/proxy/plugin/p2pcall.py", line 239, in _handle_async_message raise JanusCloudError('Missing SDP', JANUS_P2PCALL_ERROR_MISSING_SDP) januscloud.common.error.JanusCloudError: Missing SDP

jamken commented 3 years ago

HI, thevaliio, p2pcall plugin is design to try best to keep the similar api with videocall, but unfortunately it cannot work as videocall plugin because of the peerconnection is built between two peer, not between peer and janus like videocall. So some function of videocall plugin cannot make effect for p2pcall like toggle audio/video, change bitrate. the sample js code is copy from videocall, so that some button is for this test sample which cannot work

thevaliio commented 3 years ago

Now, that you have added redis backend support for the videoroom plugin, I think it should be easier to failover to a 2nd janus-cloud instance correct? May even work with 2 instances in parallel if they are using the same redis instance?

jamken commented 3 years ago

Yes, redis backend database would help to implement the HA for janus-proxy if your application rely on janus-proxy's room config persistance. to implement janus-proxy, I think you can make use of some HA tools, like "heartbeats", when proxy A faults, your application can start up the Proxy B, and transfer the VIP to Proxy B, ProxyB would load the original room configs from redis db, and your application can make all participants rejoin the room. By the way, our company's application does not make use of janus-proxy's room persistance, there is another business layer beyond janus-proxy, which save the real business configuration and select one available janus-proxy to bear one video conference. in that case, if janus-proxy fails, the upper layer application server would detect this situation and pick another available janus-proxy to re-launch the conference and all participant need re-join