Skip to content

Commit

Permalink
[DONE] force end of BBB meeting if not create or get status (#988)
Browse files Browse the repository at this point in the history
* call end definition if return code is not success in create and get status

* add comment to explain changes

* fix cerate too complex

* add pydoc
  • Loading branch information
ptitloup authored Oct 19, 2023
1 parent e9b9b4a commit 185ce04
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions pod/meeting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,12 +586,8 @@ def is_active(self):
return False

# ############################## BBB API
def create(self, request=None):
"""Make the url with goods parameters to create the meeting.
After create the meeting on the BBB instance, call it.
"""
action = "create"
def get_meeting_parameters(self):
"""Return the meeting's parameters in dict obejct to create the meeting."""
parameters = {}
for param in meeting_to_bbb:
if getattr(self, meeting_to_bbb[param], "") not in ["", None]:
Expand All @@ -600,6 +596,15 @@ def create(self, request=None):
param: getattr(self, meeting_to_bbb[param], ""),
}
)
return parameters

def create(self, request=None):
"""Make the url with goods parameters to create the meeting.
After create the meeting on the BBB instance, call it.
"""
action = "create"
parameters = self.get_meeting_parameters()
# let duration and voiceBridge to default value
parameters["logoutURL"] = (
BBB_LOGOUT_URL
Expand Down Expand Up @@ -639,6 +644,10 @@ def create(self, request=None):
for elt in xmldoc:
meeting_json[elt.tag] = elt.text
if meeting_json.get("returncode", "") != "SUCCESS":
# force end of meeting if create failed
# due to issue bigbluebutton/bigbluebutton#18913
if self.end():
return self.create()
msg = {}
msg["error"] = "Unable to create meeting ! "
msg["returncode"] = meeting_json.get("returncode", "")
Expand Down Expand Up @@ -774,6 +783,10 @@ def get_is_meeting_running(self):
for elt in xmldoc:
meeting_json[elt.tag] = elt.text
if meeting_json.get("returncode", "") != "SUCCESS":
# force end of meeting if create failed
# due to issue bigbluebutton/bigbluebutton#18913
if self.end():
return False
msg = {}
msg["error"] = "Unable to get meeting status ! "
msg["returncode"] = meeting_json.get("returncode", "")
Expand Down

0 comments on commit 185ce04

Please sign in to comment.