|
|
|
@ -70,13 +70,11 @@ def done(cmd, success, exit_code): |
|
|
|
|
@jwt_optional |
|
|
|
|
def rtp_forward(rid, publisher): |
|
|
|
|
r = Room.objects.get(ridn=rid) |
|
|
|
|
user = get_current_user() |
|
|
|
|
if user: |
|
|
|
|
if user.root_access or r.creator == user: |
|
|
|
|
if not sh_coms.get(r.room_id,None) or sh_coms.get(r.room_id).exit_code: |
|
|
|
|
room_sh = sh.python(['forward_stream.py', '--room',r.room_id, "https://vid.w3ic.org/janus"],_bg=True, _done=done) |
|
|
|
|
|
|
|
|
|
sh_coms.update({r.room_id:room_sh}) |
|
|
|
|
if not sh_coms.get(r.room_id,None) or sh_coms.get(r.room_id).exit_code: |
|
|
|
|
room_sh = sh.python(['forward_stream.py', '--room',r.room_id, "https://kahvehane.oyd.org.tr/janus"],_bg=True, _done=done) |
|
|
|
|
|
|
|
|
|
sh_coms.update({r.room_id:room_sh}) |
|
|
|
|
return "ok" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|