open sight official website source code
opensight / janus-cloud Goto Github PK
View Code? Open in Web Editor NEWa cluster solution for Janus WebRTC server, by API proxy approach
License: GNU Affero General Public License v3.0
a cluster solution for Janus WebRTC server, by API proxy approach
License: GNU Affero General Public License v3.0
Hi
I have setup with 1 yanus proxy and 2 janus servers behind it. It works good for all demos and test calls with 5-10 participants.
Now I'm testing it, trying to get stable 3 rooms with 20 members in each - but this doesn't work for now.
I see such logs in janys-proxy log file:
BrokenPipeError: [Errno 32] Broken pipe
2022-04-21 12:47:50,795 [1690018] [januscloud.proxy.core.frontend_session] [ERROR] - Asynchronous event ({'janus': 'event', 'session_id': 7324896184483668, 'plugindata': {'plugin': 'janus.plugin.videoroom
', 'data': {'videoroom': 'event', 'room': 1743988738, 'leaving': 8968357616118914}}, 'sender': 5720134667431144}) transport failed on session (id:7324896184483668)
Traceback (most recent call last):
File "/opt/janus-cloud/lib/python3.8/site-packages/januscloud/proxy/core/frontend_session.py", line 36, in notify_event
self.ts.send_message(event)
File "/opt/janus-cloud/lib/python3.8/site-packages/januscloud/transport/ws.py", line 132, in send_message
self.send(self._msg_encoder.encode(message), binary=False)
File "/opt/janus-cloud/lib/python3.8/site-packages/ws4py/websocket.py", line 303, in send
self._write(m)
File "/opt/janus-cloud/lib/python3.8/site-packages/ws4py/websocket.py", line 285, in _write
self.sock.sendall(b)
File "/opt/janus-cloud/lib/python3.8/site-packages/januscloud/transport/ws.py", line 67, in sendall
_sendall(data)
File "/opt/janus-cloud/lib/python3.8/site-packages/gevent/_socket3.py", line 534, in sendall
return _socketcommon._sendall(self, data_memory, flags)
File "/opt/janus-cloud/lib/python3.8/site-packages/gevent/_socketcommon.py", line 392, in _sendall
timeleft = __send_chunk(socket, chunk, flags, timeleft, end)
File "/opt/janus-cloud/lib/python3.8/site-packages/gevent/_socketcommon.py", line 321, in __send_chunk
data_sent += socket.send(chunk, flags)
File "/opt/janus-cloud/lib/python3.8/site-packages/gevent/_socket3.py", line 515, in send
return self._sock.send(data, flags)
BrokenPipeError: [Errno 32] Broken pipe
Any idea why this happen and how to fix?
With gevent==22.10.2
and greenlet==2.0.1
, websocket server failed to handle new connection.
2023-06-26 21:45:01,709 [138221] [ws4py] [INFO] - Managing websocket [Local => 127.0.0.1:8288 | Remote => 127.0.0.1:35588]
2023-06-26 21:45:01,710 [138221] [januscloud.transport.ws] [INFO] - Closed websocket server connection with ('127.0.0.1', 35588): Going away
Traceback (most recent call last):
File "src/gevent/greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run
File "/opensight/pyenv/janus_cloud/lib64/python3.9/site-packages/ws4py/websocket.py", line 526, in run
self.opened()
File "/root/deploy/janus-cloud-master/januscloud/transport/ws.py", line 72, in opened
self.sock.sendall = sendall
AttributeError: 'socket' object attribute 'sendall' is read-only
2023-06-26T13:45:01Z <Greenlet at 0x7f6e59f26b80: <bound method WebSocket.run of <januscloud.transport.ws.WSServerConn object at 0x7f6e59decf70>>> failed with AttributeError
The offending code is used to prevent sending message from multiple greenlets concurrently.
cluster supports 10k user in one video room??
I added my own cert and key files in janus-proxy.yml to use "wss".
My key file needs passphrase and I added cert_pwd beside cert_pem and cert_key.
But when running janus-proxy, it asks me the passphrase.
Can janus-cloud be clustered itself for high-availability? What if the janus-proxy "dies" during a conference?
Thank you!
Vali
Does it support docker deployment? If so, is there a configuration tutorial?
{"videoroom":"event","error_code":430,"error":"Invalid element type (id should be a string)","traceback":[" File "/usr/local/lib/python3.6/dist-packages/januscloud/proxy/plugin/videoroom.py", line 2391, in _handle_async_message\n new_publisher.connect_backend(backend_server)\n"," File "/usr/local/lib/python3.6/dist-packages/januscloud/proxy/plugin/videoroom.py", line 786, in connect_backend\n _send_backend_message(backend_handle, body)\n"," File "/usr/local/lib/python3.6/dist-packages/januscloud/proxy/plugin/videoroom.py", line 279, in _send_backend_message\n data.get('error_code', JANUS_VIDEOROOM_ERROR_UNKNOWN_ERROR))\n"]} on session 852580733184344
Hello
I have a question.
While running janus-cloud
I want to add one more janus server.
How to add a server without shutting down the proxy server
How should I implement it?
Hello,
When we create a new videoroom
videoRoomHandle.create(videoRoomOptions).then((result) => {
janusRoomId = result.room;
})
The result.room is different from what we receive from janus.eventhandler.sampleevh.jcfg !
It is usefull the "talking" key from participants list:
https://github.com/OpenSight/janus-cloud/wiki/VideoRoom-plugin-documentation
But in this moment it is not so useful without webhooks, because we cant make requests every second or more then one per second to get the list of participants.
Thanks!
When is support janus-1.0.4 planned?
No 'enable_recording' api in function 'handle_message'
janus-cloud/januscloud/proxy/plugin/videoroom.py
Lines 2004 to 2007 in bdecbba
Another bug: Replace 'enable_recording' with 'record'
janus-cloud/januscloud/proxy/plugin/videoroom.py
Line 1107 in bdecbba
VideoRoom plugin: Other people in the room cannot receive the “destroyed” message.
It can be received in Janus gateway.
I have two servers with janus service installed, only server1 is started, server2 is not started, server1 and server2, server1 starts janus-proxy, and janus_server is configured, and I start janus-sentinel service on server2. Then configure post_urls, and fill in the IP address of server1. My front-end connection is the 8288 service of server1. In theory, if configured like this, it should not be forwarded to server2. But the facts will still be forwarded. Is there a problem with the configuration?
我有两台服务器,都安装了janus服务,只有server1启动了,sever2未启动,server1和server2,server1启动了janus-proxy,并且配置了janus_server,我在server2启动了janus-sentinel服务。然后配置了post_urls,里面填了server1的IP地址。我前端连接的是server1的8288服务。理论上这样配置的话,应该不会转发到server2吧。但事实还是会转发,哪里配置有问题吗?
I have 3 janus-gateway-server , 3 janus-sentinel server, 1 janus-proxy-server
I try to join video room with over 20 members for one room.
when I try to join 20 user, I got error like this.
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.8/site-packages/januscloud/proxy/plugin/videoroom.py", line 2481, in _handle_async_message
raise JanusCloudError('No such feed ({})'.format(feed_id),
januscloud.common.error.JanusCloudError: No such feed (397335007101711)
2021-09-23 06:46:20,414 [74514] [januscloud.proxy.core.frontend_session] [DEBUG] - an asynchronous event messge ({'janus': 'event', 'session_id': 4664431968098588, 'transaction': 'MhTSs4JWaQd6', 'plugindata': {'plugin': 'janus.plugin.videoroom', 'data': {'videoroom': 'event', 'error_code': 428, 'error': 'No such feed (397335007101711)', 'traceback': [' File "/home/ubuntu/.local/lib/python3.8/site-packages/januscloud/proxy/plugin/videoroom.py", line 2481, in _handle_async_message\n raise JanusCloudError('No such feed ({})'.format(feed_id),\n']}}, 'sender': 2371321868134035, 'opaque_id': 'videoroomtest-C5iYNyro5sMT'}) is sent back asynchronous for session "4664431968098588"
Can anyone let me know, what the problem is...
Hello!
Tell me, did you not consider support for the sip plugin in janus?
I am very interested in its implementation, but I don’t know python.
Thank!
Hi, thank you for the awesome work!
This is no bug, just a question.
I'm trying to run a typical videoroom, with some extra constraints on aliases, among other things. It seems to me that my options are either to create a second proxy in front of Janus Cloud, or to modify Janus Cloud's code to implement my constraints.
If I create a second proxy, the client acts as a normal Janus client using the standard API, but my proxy chooses to reject certain requests and not pass them on to Janus Cloud if they fall afoul of certain conditions I code.
I find myself preferring the proxy option because I won't have to dive into janus-cloud's code, and the update process for new versions of janus-cloud would be much simpler.
I am struggling to make janus-proxy work.
I am getting this error
[Tue Oct 05 2021 11:11:52.613] LOG {"async": true, "cache": false, "conten
tType": "application/json", "data": "{\"janus\":\"create\",\"transaction\":\"fKh
cjWeL66Ut\"}", "dataType": "json", "error": [Function error], "success": [Functi
on success], "type": "POST", "url": "https://52.90.187.34:8288"}
[Tue Oct 05 2021 11:11:52.613] WARN creating session....
[Tue Oct 05 2021 11:11:52.998] LOG *********error***********
[Tue Oct 05 2021 11:11:53.470] LOG {"DONE": 4, "HEADERS_RECEIVED": 2, "LOA
DING": 3, "OPENED": 1, "UNSENT": 0, "_aborted": false, "_cachedResponse": undefi
ned, "_hasError": true, "_headers": {"content-type": "application/json"}, "_incr
ementalEvents": false, "_lowerCaseResponseHeaders": {}, "_method": "POST", "_per
fKey": "network_XMLHttpRequest_https://52.90.187.34:8288", "_requestId": null, "
_response": "Handshake failed", "_responseType": "", "_sent": true, "_subscripti
ons": [], "_timedOut": false, "_trackingName": "unknown", "_url": "https://52.90
.187.34:8288", "readyState": 4, "responseHeaders": undefined, "status": "error",
"timeout": 0, "upload": {}, "withCredentials": true}
Looking at the logs only thing I see is /janus 500
and some unreadable characters
I am not sure how to debug this
JANUS_SERVER_STATUS_HWM status can be set here
if self._hwm_threshold and ping_latency > self._hwm_threshold:
self.set_status(JANUS_SERVER_STATUS_HWM)
else:
self.set_status(JANUS_SERVER_STATUS_NORMAL)
but it is not supported by the schema here
server_update_schema = Schema({
'name': StrRe('^[\w-]{1,64}$'),
'url': StrRe('^(ws|wss)://\S+$'),
'status': IntVal(values=(JANUS_SERVER_STATUS_NORMAL, JANUS_SERVER_STATUS_ABNORMAL, JANUS_SERVER_STATUS_MAINTENANCE)),
Optional("session_timeout"): IntVal(min=0, max=86400),
Optional("session_num"): IntVal(min=0, max=10000),
Optional("handle_num"): IntVal(min=0, max=100000),
Optional("location"): StrVal(min_len=0, max_len=64),
Optional("isp"): StrVal(min_len=0, max_len=64),
Optional("expire"): IntVal(min=0, max=86400),
Optional("start_time"): FloatVal(),
AutoDel(str): object # for all other key we must delete
})
When janus-proxy is run, the error "socket operation on non-socket" appears.
Janus-proxy loads the config file: /opt/janus-cloud/conf/janus-proxy.yml
Traceback (most recent call last):
File "/usr/local/bin/janus-proxy", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/januscloud/proxy/main.py", line 16, in main
with DaemonContext(stdin=sys.stdin,
File "/usr/local/lib/python3.8/dist-packages/daemon/daemon.py", line 273, in init
detach_process = is_detach_process_context_required()
File "/usr/local/lib/python3.8/dist-packages/daemon/daemon.py", line 821, in is_detach_process_context_required
if is_process_started_by_init() or is_process_started_by_superserver():
File "/usr/local/lib/python3.8/dist-packages/daemon/daemon.py", line 798, in is_process_started_by_superserver
if is_socket(stdin_fd):
File "/usr/local/lib/python3.8/dist-packages/daemon/daemon.py", line 764, in is_socket
file_socket = socket.fromfd(fd, socket.AF_INET, socket.SOCK_RAW)
File "/usr/local/lib/python3.8/dist-packages/gevent/_socket3.py", line 715, in fromfd
return socket(family, type, proto, nfd)
File "/usr/local/lib/python3.8/dist-packages/gevent/_socket3.py", line 142, in init
self._sock = self._gevent_sock_class(family, type, proto, fileno)
OSError: [Errno 88] Socket operation on non-socket
Are you going to support the unified plan sdp? This is in the multistream branch of janus already.
Vail
janus-cloud/januscloud/proxy/plugin/videoroom.py
Line 2306 in 729dcad
Hi @jamken,
It looks like we need to detect the number of janus-gateway, when having more than one we don't need to forward room's max publishers but for only 1, we need to do it
janus-cloud brought us scalable media-server.
But is there way to make janus-proxy scalable too?
Generally, websocket can be scaled out with using Redis's pub/sub function.
Is it possible doing like that currently?
Hey,
please can you guide me to how to use just p2pcall without janus media streaming ?
Hi,
We are using Janus as a streaming server, and we want to implement the cascade of janus in the next step.
From some articles, I know that I need to implement an rpt-forward listener.
Could you provide some idea?
Thanks.
reconnect janus cloud in 2 seconds
{"janus": "claim", "transaction": "l6u02dI18dT8", "session_id": "3709398412711189"}
received from janus cloud
{
"janus": "error",
"session_id": 3709398412711189,
"transaction": "l6u02dI18dT8",
"error": {
"code": 458,
"reason": "No such session 3709398412711189",
"traceback": [
" File \"/usr/local/lib/python3.6/dist-packages/januscloud/proxy/core/request.py\", line 295, in incoming_request\n response = handler(request)\n",
" File \"/usr/local/lib/python3.6/dist-packages/januscloud/proxy/core/request.py\", line 187, in _handle_claim\n session = self._get_session(request)\n",
" File \"/usr/local/lib/python3.6/dist-packages/januscloud/proxy/core/request.py\", line 120, in _get_session\n session = self._frontend_session_mgr.find_session(request.session_id)\n",
" File \"/usr/local/lib/python3.6/dist-packages/januscloud/proxy/core/frontend_session.py\", line 124, in find_session\n raise JanusCloudError('No such session {}'.format(session_id), JANUS_ERROR_SESSION_NOT_FOUND)\n"
]
}
}
Is my configuration file wrong?
thank you.
We need janus-proxy plugin for janus.plugin.streaming.
regards,
Hi @jamken we have done the janus clustering proxy setup with 2 pods running behind the proxy. when the call in initiated we have received the following error form the pod. kindly assist.
ERROR:
[ERR] [record.c:janus_recorder_create_full:154] mkdir () error: 2 (No such file or directory)
[ERR] [plugins/janus_videoroom.c:janus_videoroom_recorder_create:5782] Couldn't open an audio recording file for this publisher!
Hi, Is there any update for audiobridge plugin support ?
Hi,
Is Janus v1 supported?
Thank you
Hello, is there a document for the videoroom plugin to implement a cross-server deployment solution? I don’t know where I want to achieve cross-server audio and video communication
At the setup.py we see gevent being set to 'gevent==20.9.0'
https://github.com/OpenSight/janus-cloud/blob/master/setup.py#L9
However, there is an error with gevent with Cython update: gevent/gevent#1899
As suggested there, I could build janus-cloud with gevent 21.12.0, while 20.9.0 fails.
its very usefull tool but there is no guide to create room dynamically.
Hi
Currently, when using redis, the message "Failed to delete the empty rooms from DB: wrong number of arguments for 'del' command keeps popping up.
Also videoroom is not created in redis
Just show januscloud:backend_servers:~
Is something wrong?
Does this process run multithreaded?
We want to handle more than 5000 users.
Is this a possible process if there are enough servers?
Unable to get the recorded .mjr file from the provided /opt/janus/share/janus/recordings/ path in janus-proxy.plugin.videoroom.yml and janus.plugin.videoroom.jcfg file on both config file record is set to true and rec_dir.
parameters:
----janus.plugin.videoroom.jcfg----
general :
{
string_ids = "false";
publishers = "8";
bitrate = "128000";
bitrate_cap = "true";
request = "enable_recording";
rec_dir = "/opt/janus/share/janus/recordings/";
record = "true";
};
----------------janus-proxy.plugin.videoroom.yml----
rooms:
room_id: 1234
description: "Demo Room"
secret: "adminpwd"
publishers: 6
bitrate: 128000
fir_freq: 10
#audiocodec: "opus"
#videocodec: "vp8"
record: true
rec_dir: "/opt/janus/share/janus/recordings"
=============Error Receiving while the call connected is given below=====================
[WARN] Unsupported combination of dir and filename /opt/janus/share/janus/recordings/[email protected]
[ERR] [record.c:janus_recorder_create_full:154] mkdir () error: 2 (No such file or directory)
[ERR] [plugins/janus_videoroom.c:janus_videoroom_recorder_create:5731] Couldn't open an audio recording file for this publisher!
[WARN] Unsupported combination of dir and filename /opt/janus/share/janus/recordings/[email protected]
[ERR] [record.c:janus_recorder_create_full:154] mkdir () error: 2 (No such file or directory)
[ERR] [plugins/janus_videoroom.c:janus_videoroom_recorder_create:5760] Couldn't open an video recording file for this publisher!
@jamken kindly assist
Note: This setup is done after janus clustering. with 2 pods. we are able to make calls video and voice. but failed to get the .mjr files. kindly assist
I get coredump on python3.7:
janus-proxy /usr/local/opt/janus-cloud/conf/janus-proxy.yml
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
Janus-proxy loads the config file: /usr/local/opt/janus-cloud/conf/janus-proxy.yml
/usr/lib64/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
2020-11-21 18:16:25,883 [3096169] [januscloud.proxy.main] [INFO] - Janus Proxy is starting...
2020-11-21 18:16:25,884 [3096169] [januscloud.proxy.core.backend_server] [INFO] - Backend Server server1 (ws://127.0.0.1:8188) is added into proxy
Segmentation fault (core dumped)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.