Пример #1
0
 def connectionStatus(self):
     return VidyoOperations.isRoomConnected(
         self,
         VidyoTools.getLinkRoomAttribute(self.getLinkObject(),
                                         attName="h323-ip"),
         VidyoTools.getLinkRoomAttribute(self.getLinkObject(),
                                         attName="vidyopanorama-id"))
Пример #2
0
    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)
Пример #3
0
    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()
Пример #4
0
    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()
Пример #5
0
    def _search(cls, user, query, offset=0, limit=None):

        if not query.strip():
            return [], None

        ask_for_more = True
        allowed_rooms = []

        while ask_for_more:
            result = VidyoOperations.searchRooms(query,
                                                 offset=offset,
                                                 limit=limit)

            if isinstance(result, VidyoError):
                # query held no results? there's nothing left.
                return result, offset

            if not result:
                # set offset to None, meaning that the bottom of the "search stream" has been reached
                offset = None
                break

            for room in result:
                av = VidyoTools.getAvatarByAccountName(room.ownerName)

                # go through all bookings that use this room and check if this user has any privileges
                # over them
                for booking in VidyoTools.getIndexByVidyoRoom().getBookingList(
                        room.roomID):
                    if av == user or booking.getConference() in user.getLinkTo("conference", "manager") \
                            or user == booking.getConference().getCreator() \
                            or RCVideoServicesManager.hasRights(user, booking.getConference(), ["Vidyo"]) \
                            or user.isAdmin():

                        # if that's the case, add the booking to our list
                        bookingParams = booking.getBookingParams().copy()
                        bookingParams["videoLinkType"] = "event"
                        bookingParams["videoLinkSession"] = ""
                        bookingParams["videoLinkContribution"] = ""
                        allowed_rooms.append(bookingParams)
                        break

                offset += 1

                if limit is not None and len(allowed_rooms) >= limit:
                    # reached limit? that's enough!
                    ask_for_more = False
                    break

        return (allowed_rooms, offset)
Пример #6
0
    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()
Пример #7
0
    def _search(cls, user, query, offset=0, limit=None):

        if not query.strip():
            return [], None

        ask_for_more = True
        allowed_rooms = []

        while ask_for_more:
            result = VidyoOperations.searchRooms(query, offset=offset, limit=limit)

            if isinstance(result, VidyoError):
                # query held no results? there's nothing left.
                return result, offset

            if not result:
                # set offset to None, meaning that the bottom of the "search stream" has been reached
                offset = None
                break

            for room in result:
                av = VidyoTools.getAvatarByAccountName(room.ownerName)

                # go through all bookings that use this room and check if this user has any privileges
                # over them
                for booking in VidyoTools.getIndexByVidyoRoom().getBookingList(room.roomID):
                    if av == user or booking.getConference() in user.getLinkTo("conference", "manager") \
                            or user == booking.getConference().getCreator() \
                            or RCVideoServicesManager.hasRights(user, booking.getConference(), ["Vidyo"]) \
                            or user.isAdmin():

                        # if that's the case, add the booking to our list
                        bookingParams = booking.getBookingParams().copy()
                        bookingParams["videoLinkType"] = "event"
                        bookingParams["videoLinkSession"] = ""
                        bookingParams["videoLinkContribution"] = ""
                        allowed_rooms.append(bookingParams)
                        break

                offset += 1

                if limit is not None and len(allowed_rooms) >= limit:
                    # reached limit? that's enough!
                    ask_for_more = False
                    break

        return (allowed_rooms, offset)
Пример #8
0
    def _search(cls, user, query, offset=0, limit=None):
        if query == "":
            return[]
        result = VidyoOperations.searchRooms(query)
        if isinstance(result, VidyoError):
            return result

        allowedRooms = []
        for room in result:
            av = VidyoTools.getAvatarByAccountName(room.ownerName)
            for booking in VidyoTools.getIndexByVidyoRoom().getBookingList(room.roomID):
                if av == user or booking.getConference() in user.getLinkTo("conference", "manager") \
                        or user == booking.getConference().getCreator() \
                        or RCVideoServicesManager.hasRights(user, booking.getConference(), ["Vidyo"]):
                    bookingParams = booking.getBookingParams().copy()
                    bookingParams["videoLinkType"] = "event"
                    bookingParams["videoLinkSession"] = ""
                    bookingParams["videoLinkContribution"] = ""
                    allowedRooms.append(bookingParams)
                    break
        limit = limit if limit else (len(allowedRooms) - 1)
        return allowedRooms[offset:offset+limit]
Пример #9
0
 def connectionStatus(self):
     return VidyoOperations.isRoomConnected(self, VidyoTools.getLinkRoomAttribute(self.getLinkObject(),
                                                                                  attName="H323 IP"),
                                            VidyoTools.getLinkRoomAttribute(self.getLinkObject(),
                                                                            attName="VidyoPanorama ID"))
Пример #10
0
 def connectionStatus(self):
     return VidyoOperations.isRoomConnected(self, VidyoTools.getLinkRoomAttribute(self.getLinkObject(),
                                                                                  attName="h323-ip"),
                                            VidyoTools.getLinkRoomAttribute(self.getLinkObject(),
                                                                            attName="vidyopanorama-id"))
Пример #11
0
 def connectionStatus(self):
     return VidyoOperations.isRoomConnected(self, VidyoTools.getLinkRoomIp(self.getLinkObject()))
Пример #12
0
 def connectionStatus(self):
     return VidyoOperations.isRoomConnected(
         self, VidyoTools.getLinkRoomIp(self.getLinkObject()))