Exemple #1
0
 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()))
Exemple #2
0
 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()))
Exemple #3
0
 def connectRoom(cls, booking, roomId, query):
     confId = booking.getConference().getId()
     bookingId = booking.getId()
     try:
         searchFilter = SOAPObjectFactory.createFilter('user', query)
         userApiAnswer = UserApi.search(searchFilter)
         if userApiAnswer.total == 0:
             return VidyoError(
                 "noExistsRoom", "connect",
                 _("The conference room is not registered in the vidyo service. "
                   ) + VidyoTools.getContactSupportText())
         legacyMember = userApiAnswer.Entity[0].entityID
         AdminApi.connectRoom(roomId, legacyMember)
     except WebFault, e:
         faultString = e.fault.faultstring
         if faultString.startswith('ConferenceID is invalid'):
             return VidyoError("unknownRoom", "connect")
         elif (faultString.startswith('Failed to Invite to Conference')
               or faultString.startswith(
                   'Status of invited member is not Online')):
             message = _("The connection has failed. "
                         ) + VidyoTools.getContactSupportText()
             return VidyoError("connectFailed", "connect", message)
         else:
             Logger.get('Vidyo').exception(
                 """Evt:%s, booking:%s, Admin API's connectRoom operation got WebFault: %s"""
                 % (confId, bookingId, e.fault.faultstring))
             raise
Exemple #4
0
    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())
Exemple #5
0
 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()))
Exemple #6
0
 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())
Exemple #7
0
 def connectRoom(cls, booking, roomId, extension):
     confId = booking.getConference().getId()
     bookingId = booking.getId()
     try:
         searchFilter = SOAPObjectFactory.createFilter('user', extension)
         userApiAnswer = UserApi.search(searchFilter, confId, bookingId)
         if userApiAnswer.total == 0:
             return VidyoError("noExistsRoom", "connect", _("The conference room is not registered in the vidyo service. ") + VidyoTools.getContactSupportText())
         legacyMember = userApiAnswer.Entity[0].entityID
         AdminApi.connectRoom(roomId, confId, bookingId, legacyMember)
     except WebFault, e:
         faultString = e.fault.faultstring
         if faultString.startswith('ConferenceID is invalid'):
             return VidyoError("unknownRoom", "connect")
         if faultString.startswith('Failed to Invite to Conference'):
             message = _("The connection has failed. ") + VidyoTools.getContactSupportText()
             return VidyoError("connectFailed", "connect", message)
         else:
             Logger.get('Vidyo').exception("""Evt:%s, booking:%s, Admin API's connectRoom operation got WebFault: %s""" %
                     (confId, bookingId, e.fault.faultstring))
             raise
Exemple #8
0
 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()))
Exemple #9
0
    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())
Exemple #10
0
 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())