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 disconnectRoom(cls, booking, connectionStatus, roomIp="", roomPanoramaUser=""): serviceType = connectionStatus.get("service") # roomName should be empty if we are forcing disconnection (otherwise we'd be sending the wrong name and # disconnetion would fail) if connectionStatus.get("roomName") == booking.getBookingParamByName( "roomName"): roomName = booking.getBookingParamByName("roomName") else: roomName = "" try: if roomIp != "": answer = RavemApi.disconnectLegacyEndpoint( roomIp, serviceType, roomName) else: answer = RavemApi.disconnectVidyoPanorama( roomPanoramaUser, serviceType, roomName) if not answer.ok or "error" in answer.json(): Logger.get('Vidyo').exception("""Evt:%s, booking:%s, Ravem API's disconnect operation not successfull: %s""" % (booking.getConference().getId(), booking.getId(), answer.text)) return VidyoError( "disconnectFailed", "disconnect", _("Vidyo was unable to disconnect the conference room. {0}" ).format(VidyoTools.getContactSupportText())) except Exception: return VidyoError( "disconnectFailed", "disconnect", _("Vidyo was unable to disconnect the conference room. {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 disconnectRoom(cls, booking, roomIp, serviceType): try: answer = RavemApi.disconnectRoom(roomIp, serviceType) if not answer.ok or answer.json.has_key("error"): Logger.get('Vidyo').exception("""Evt:%s, booking:%s, Ravem API's disconnectRoom operation not successfull: %s""" % (booking.getConference().getId(), booking.getId(), answer.text)) return VidyoError("disconnectFailed", "disconnect", _("There was a problem with the videoconference disconnection. ") + VidyoTools.getContactSupportText()) except Exception: return VidyoError("disconnectFailed", "disconnect", _("There was a problem with the videoconference disconnection. ") + VidyoTools.getContactSupportText())
def disconnectRoom(cls, booking, connectionStatus, roomIp="", roomPanoramaUser=""): serviceType = connectionStatus.get("service") # roomName should be empty if we are forcing disconnection (otherwise we'd be sending the wrong name and # disconnetion would fail) if connectionStatus.get("roomName") == booking.getBookingParamByName("roomName"): roomName = booking.getBookingParamByName("roomName") else: roomName = "" try: if roomIp != "": answer = RavemApi.disconnectLegacyEndpoint(roomIp, serviceType, roomName) else: answer = RavemApi.disconnectVidyoPanorama(roomPanoramaUser, serviceType, roomName) if not answer.ok or "error" in answer.json(): Logger.get('Vidyo').exception("""Evt:%s, booking:%s, Ravem API's disconnect operation not successfull: %s""" % (booking.getConference().getId(), booking.getId(), answer.text)) return VidyoError("disconnectFailed", "disconnect", _("There was a problem with the videoconference disconnection. ") + VidyoTools.getContactSupportText()) except Exception: return VidyoError("disconnectFailed", "disconnect", _("There was a problem with the videoconference disconnection. ") + VidyoTools.getContactSupportText())
def disconnectRoom(cls, booking, roomIp, serviceType): try: answer = RavemApi.disconnectRoom(roomIp, serviceType) if not answer.ok or answer.json.has_key("error"): Logger.get('Vidyo').exception( """Evt:%s, booking:%s, Ravem API's disconnectRoom operation not successfull: %s""" % (booking.getConference().getId(), booking.getId(), answer.text)) return VidyoError( "disconnectFailed", "disconnect", _("There was a problem with the videoconference disconnection. " ) + VidyoTools.getContactSupportText()) except Exception: return VidyoError( "disconnectFailed", "disconnect", _("There was a problem with the videoconference disconnection. " ) + 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())