def isRoomConnected(cls, booking, roomIp="", roomPanoramaUser=""): try: if roomIp != "": answer = RavemApi.isLegacyEndpointConnected(roomIp) else: answer = RavemApi.isVidyoPanoramaConnected(roomPanoramaUser) if not answer.ok or "error" in answer.json(): Logger.get('Vidyo').exception("""Evt:%s, booking:%s, Ravem API's isConnected operation not successfull: %s""" % (booking.getConference().getId(), booking.getId(), answer.text)) return VidyoError("roomCheckFailed", "roomConnected", _("There was a problem obtaining the room status from Vidyo. {0}").format(VidyoTools.getContactSupportText())) result = {"roomName": None, "isConnected": False, "service": None} answer = answer.json() if "result" in answer: for service in answer.get("result").get("services"): if service.get("name", "") == "videoconference": result["roomName"] = VidyoTools.recoverVidyoName(service.get("event_name")) result["isConnected"] = service.get("status") == 1 result["service"] = VidyoTools.recoverVidyoDescription(service.get("event_type")) return result except Exception: return VidyoError("roomCheckFailed", "roomConnected", _("There was a problem obtaining the room status from Vidyo. {0}").format( VidyoTools.getContactSupportText()))
def isRoomConnected(cls, booking, roomIp="", roomPanoramaUser=""): try: if roomIp != "": answer = RavemApi.isLegacyEndpointConnected(roomIp) else: answer = RavemApi.isVidyoPanoramaConnected(roomPanoramaUser) if not answer.ok or "error" in answer.json(): Logger.get('Vidyo').exception("""Evt:%s, booking:%s, Ravem API's isConnected operation not successfull: %s""" % (booking.getConference().getId(), booking.getId(), answer.text)) return VidyoError( "roomCheckFailed", "roomConnected", _("There was a problem obtaining the room status from Vidyo. {0}" ).format(VidyoTools.getContactSupportText())) result = {"roomName": None, "isConnected": False, "service": None} answer = answer.json() if "result" in answer: for service in answer.get("result").get("services"): if service.get("name", "") == "videoconference": result["roomName"] = VidyoTools.recoverVidyoName( service.get("event_name")) result["isConnected"] = service.get("status") == 1 result["service"] = VidyoTools.recoverVidyoDescription( service.get("event_type")) return result except Exception: return VidyoError( "roomCheckFailed", "roomConnected", _("There was a problem obtaining the room status from Vidyo. {0}" ).format(VidyoTools.getContactSupportText()))
def isRoomConnected(cls, booking, roomIp): try: answer = RavemApi.isRoomConnected(roomIp) if not answer.ok or answer.json.has_key("error"): Logger.get('Vidyo').exception( """Evt:%s, booking:%s, Ravem API's isRoomConnected operation not successfull: %s""" % (booking.getConference().getId(), booking.getId(), answer.text)) return VidyoError( "roomCheckFailed", "roomConnected", _("There was a problem obtaining the room status. ") + VidyoTools.getContactSupportText()) result = {"roomName": None, "isConnected": False, "service": None} answer = answer.json if answer.has_key("result"): for service in answer.get("result").get("services"): if service.get("name", "") == "videoconference": result["roomName"] = VidyoTools.recoverVidyoName( service.get("eventName")) result["isConnected"] = service.get("status") == 1 result["service"] = VidyoTools.recoverVidyoDescription( service.get("eventType")) return result except Exception: return VidyoError( "roomCheckFailed", "roomConnected", _("There was a problem obtaining the room status. ") + VidyoTools.getContactSupportText())
def _checkStatus(self): """ Queries the data for the Vidyo Public room associated to this CSBooking and updates the locally stored data. When API problems are solved, uncomment and test the commented code. The User API call of VidyoOperations.queryRoom will not be necessary any more. """ result = VidyoOperations.queryRoom(self, self._roomId) if isinstance(result, VidyoError): self.setBookingNotPresent() return result else: adminApiResult = result[0] userApiResult = result[1] recoveredVidyoName = VidyoTools.recoverVidyoName(userApiResult.displayName) if recoveredVidyoName: self._bookingParams["roomName"] = recoveredVidyoName else: self._warning = "invalidName" self._extension = str(adminApiResult.extension) if bool(adminApiResult.RoomMode.hasPin): self._pin = str(adminApiResult.RoomMode.roomPIN) else: self._pin = "" self._url = str(adminApiResult.RoomMode.roomURL) self.setOwnerAccount(str(adminApiResult.ownerName), updateAvatar=True)
def _checkStatus(self): """ Queries the data for the Vidyo Public room associated to this CSBooking and updates the locally stored data. When API problems are solved, uncomment and test the commented code. The User API call of VidyoOperations.queryRoom will not be necessary any more. """ result = VidyoOperations.queryRoom(self, self._roomId) if isinstance(result, VidyoError): if result.getErrorType() == 'unknownRoom': self.setBookingNotPresent() return result else: adminApiResult = result[0] userApiResult = result[1] recoveredVidyoName = VidyoTools.recoverVidyoName( userApiResult.displayName) if recoveredVidyoName: self._bookingParams["roomName"] = recoveredVidyoName else: self._warning = "invalidName" self._extension = str(adminApiResult.extension) if bool(adminApiResult.RoomMode.hasPIN): self._pin = str(adminApiResult.RoomMode.roomPIN) else: self._pin = "" if bool(adminApiResult.RoomMode.hasModeratorPIN): self._moderatorPin = str(adminApiResult.RoomMode.moderatorPIN) else: self._moderatorPin = "" self._url = str(adminApiResult.RoomMode.roomURL) self.setOwnerAccount(str(adminApiResult.ownerName), updateAvatar=True) recoveredDescription = VidyoTools.recoverVidyoDescription( adminApiResult.description) if recoveredDescription: self._bookingParams["roomDescription"] = recoveredDescription else: self._warning = "invalidDescription" # what to do if the Vidyo group is not Indico? #if str(adminApiResult.groupName) != getVidyoOptionValue("indicoGroup"): # return VidyoError("invalidGroup", "checkStatus") self._bookingParams["autoMute"] = self._getAutomute() self._updateRelatedBookings()
def _checkStatus(self): """ Queries the data for the Vidyo Public room associated to this CSBooking and updates the locally stored data. """ adminApiResult = VidyoOperations.queryRoom(self, self._roomId) if isinstance(adminApiResult, VidyoError): if adminApiResult.getErrorType() == 'unknownRoom': self.setBookingNotPresent() return adminApiResult else: recoveredVidyoName = VidyoTools.recoverVidyoName(adminApiResult.name) if recoveredVidyoName: self._bookingParams["roomName"] = recoveredVidyoName else: self._warning = "invalidName" self._extension = str(adminApiResult.extension) """ We do not update the PIN because in the new version of Vidyo comes encrypted. if bool(adminApiResult.RoomMode.hasPIN): self._pin = str(adminApiResult.RoomMode.roomPIN) else: self._pin = "" if bool(adminApiResult.RoomMode.hasModeratorPIN): self._moderatorPin = str(adminApiResult.RoomMode.moderatorPIN) else: self._moderatorPin = "" """ self._url = str(adminApiResult.RoomMode.roomURL) self.setOwnerAccount(str(adminApiResult.ownerName), updateAvatar = True) recoveredDescription = VidyoTools.recoverVidyoDescription(adminApiResult.description) if recoveredDescription: self._bookingParams["roomDescription"] = recoveredDescription else: self._warning = "invalidDescription" # what to do if the Vidyo group is not Indico? #if str(adminApiResult.groupName) != getVidyoOptionValue("indicoGroup"): # return VidyoError("invalidGroup", "checkStatus") self._bookingParams["autoMute"] = self._getAutomute() self._updateRelatedBookings()
def _checkStatus(self): """ Queries the data for the Vidyo Public room associated to this CSBooking and updates the locally stored data. When API problems are solved, uncomment and test the commented code. The User API call of VidyoOperations.queryRoom will not be necessary any more. """ result = VidyoOperations.queryRoom(self, self._roomId) if isinstance(result, VidyoError): if result.getErrorType() == 'unknownRoom': self.setBookingNotPresent() return result else: adminApiResult = result[0] userApiResult = result[1] recoveredVidyoName = VidyoTools.recoverVidyoName(userApiResult.displayName) if recoveredVidyoName: self._bookingParams["roomName"] = recoveredVidyoName else: self._warning = "invalidName" self._extension = str(adminApiResult.extension) if bool(adminApiResult.RoomMode.hasPIN): self._pin = str(adminApiResult.RoomMode.roomPIN) else: self._pin = "" if bool(adminApiResult.RoomMode.hasModeratorPIN): self._moderatorPin = str(adminApiResult.RoomMode.moderatorPIN) else: self._moderatorPin = "" self._url = str(adminApiResult.RoomMode.roomURL) self.setOwnerAccount(str(adminApiResult.ownerName), updateAvatar = True) recoveredDescription = VidyoTools.recoverVidyoDescription(adminApiResult.description) if recoveredDescription: self._bookingParams["roomDescription"] = recoveredDescription else: self._warning = "invalidDescription" # what to do if the Vidyo group is not Indico? #if str(adminApiResult.groupName) != getVidyoOptionValue("indicoGroup"): # return VidyoError("invalidGroup", "checkStatus") self._bookingParams["autoMute"] = self._getAutomute() self._updateRelatedBookings()
def isRoomConnected(cls, booking, roomIp): try: answer = RavemApi.isRoomConnected(roomIp) if not answer.ok or answer.json.has_key("error"): Logger.get('Vidyo').exception("""Evt:%s, booking:%s, Ravem API's isRoomConnected operation not successfull: %s""" % (booking.getConference().getId(), booking.getId(), answer.text)) return VidyoError("roomCheckFailed", "roomConnected", _("There was a problem obtaining the room status. ") + VidyoTools.getContactSupportText()) result = {"roomName": None, "isConnected": False, "service": None} answer = answer.json if answer.has_key("result"): for service in answer.get("result").get("services"): if service.get("name","") == "videoconference": result["roomName"] = VidyoTools.recoverVidyoName(service.get("eventName")) result["isConnected"] = service.get("status") == 1 result["service"] = VidyoTools.recoverVidyoDescription(service.get("eventType")) return result except Exception: return VidyoError("roomCheckFailed", "roomConnected", _("There was a problem obtaining the room status. ") + VidyoTools.getContactSupportText())