def connectionStatus(self): return VidyoOperations.isRoomConnected( self, VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="h323-ip"), VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="vidyopanorama-id"))
def _connect(self, force=False): self._checkStatus() connectionStatus = self.connectionStatus() if isinstance(connectionStatus, VidyoError): return connectionStatus confRoomIp = VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="H323 IP") confRoomPanoramaUser = VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="VidyoPanorama ID") if confRoomIp == "" and confRoomPanoramaUser == "": return VidyoError("noValidConferenceRoom", "connect") if connectionStatus.get("isConnected") == True: if connectionStatus.get("roomName") == self.getBookingParamByName("roomName"): return VidyoError("alreadyConnected", "connect", _("It seems that the room has been already connected to the room, please refresh the page.")) if not force: # if connect is not forced, give up return VidyoError("alreadyConnected", "connect", _("The room is already connected to some other endpoint. Please refresh the page.")) else: # otherwise, replace whatever call is going on ExternalOperationsManager.execute( self, "disconnectRoom", VidyoOperations.disconnectRoom, self, connectionStatus, confRoomIp, confRoomPanoramaUser) retry = 15 connected = True # wait for the current call to be disconnected while retry: connectionStatus = self.connectionStatus() time.sleep(2) retry -= 1 if connectionStatus.get("isConnected") == False: connected = False break if connected: return VidyoError("couldntStop", "connect", _("It seems like we haven't managed to stop " "the current call. Please refresh the page and try again.")) else: # give it some time before trying to connect time.sleep(5) query = (getVidyoOptionValue("prefixConnect") + confRoomIp) if confRoomIp else confRoomPanoramaUser result = ExternalOperationsManager.execute(self, "connectRoom", VidyoOperations.connectRoom, self, self._roomId, query) if isinstance(result, VidyoError): return result return self
def _disconnect(self): self._checkStatus() confRoomIp = VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="H323 IP") confRoomPanoramaUser = VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="VidyoPanorama ID") if confRoomIp == "" and confRoomPanoramaUser == "": return VidyoError("noValidConferenceRoom", "disconnect") connectionStatus = self.connectionStatus() if isinstance(connectionStatus, VidyoError): return connectionStatus if not connectionStatus.get("isConnected"): return VidyoError("alreadyDisconnected", "disconnect", _("It seems that the room has been already disconnected, please refresh the page")) result = ExternalOperationsManager.execute(self, "disconnectRoom", VidyoOperations.disconnectRoom, self, connectionStatus, confRoomIp, confRoomPanoramaUser) if isinstance(result, VidyoError): return result return self
def _checkProtection(self): if self.getAW().getUser( ) and request.remote_addr == VidyoTools.getLinkRoomAttribute( self._booking.getLinkObject(), attName='ip'): return elif not hasattr( self._booking, "getOwnerObject" ) or self._booking.getOwnerObject() != self.getAW().getUser(): CollaborationBookingModifBase._checkProtection(self)
def _disconnect(self): self._checkStatus() confRoomIp = VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="h323-ip") confRoomPanoramaUser = VidyoTools.getLinkRoomAttribute( self.getLinkObject(), attName="vidyopanorama-id") if confRoomIp == "" and confRoomPanoramaUser == "": return VidyoError("noValidConferenceRoom", "disconnect") connectionStatus = self.connectionStatus() if isinstance(connectionStatus, VidyoError): return connectionStatus if not connectionStatus.get("isConnected"): return VidyoError( "alreadyDisconnected", "disconnect", _("It seems that the room has been already disconnected, please refresh the page" )) result = ExternalOperationsManager.execute( self, "disconnectRoom", VidyoOperations.disconnectRoom, self, connectionStatus, confRoomIp, confRoomPanoramaUser) if isinstance(result, VidyoError): return result return self
def connectionStatus(self): return VidyoOperations.isRoomConnected(self, VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="H323 IP"), VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="VidyoPanorama ID"))
def isLinkedToEquippedRoom(self): return self._created and (VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="H323 IP") != "" or VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="VidyoPanorama ID") != "")
def connectionStatus(self): return VidyoOperations.isRoomConnected(self, VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="h323-ip"), VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="vidyopanorama-id"))
def isLinkedToEquippedRoom(self): return self._created and (VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="h323-ip") != "" or VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="vidyopanorama-id") != "")
def _checkProtection(self): if self.getAW().getUser() and request.remote_addr == VidyoTools.getLinkRoomAttribute(self._booking.getLinkObject(), attName='IP'): return elif not hasattr(self._booking, "getOwnerObject") or self._booking.getOwnerObject() != self.getAW().getUser(): CollaborationBookingModifBase._checkProtection(self)
def _connect(self, force=False): self._checkStatus() connectionStatus = self.connectionStatus() if isinstance(connectionStatus, VidyoError): return connectionStatus confRoomIp = VidyoTools.getLinkRoomAttribute(self.getLinkObject(), attName="h323-ip") confRoomPanoramaUser = VidyoTools.getLinkRoomAttribute( self.getLinkObject(), attName="vidyopanorama-id") if confRoomIp == "" and confRoomPanoramaUser == "": return VidyoError("noValidConferenceRoom", "connect") if connectionStatus.get("isConnected") == True: if connectionStatus.get("roomName") == self.getBookingParamByName( "roomName"): return VidyoError( "alreadyConnected", "connect", _("It seems that the room has been already connected to the room, please refresh the page." )) if not force: # if connect is not forced, give up return VidyoError( "alreadyConnected", "connect", _("The room is already connected to some other endpoint. Please refresh the page." )) else: # otherwise, replace whatever call is going on ExternalOperationsManager.execute( self, "disconnectRoom", VidyoOperations.disconnectRoom, self, connectionStatus, confRoomIp, confRoomPanoramaUser) retry = 15 connected = True # wait for the current call to be disconnected while retry: connectionStatus = self.connectionStatus() time.sleep(2) retry -= 1 if connectionStatus.get("isConnected") == False: connected = False break if connected: return VidyoError( "couldntStop", "connect", _("It seems like we haven't managed to stop " "the current call. Please refresh the page and try again." )) else: # give it some time before trying to connect time.sleep(5) query = (getVidyoOptionValue("prefixConnect") + confRoomIp) if confRoomIp else confRoomPanoramaUser result = ExternalOperationsManager.execute(self, "connectRoom", VidyoOperations.connectRoom, self, self._roomId, query) if isinstance(result, VidyoError): return result return self
def isLinkedToEquippedRoom(self): return self._created and (VidyoTools.getLinkRoomAttribute( self.getLinkObject(), attName="h323-ip") != "" or VidyoTools.getLinkRoomAttribute( self.getLinkObject(), attName="vidyopanorama-id") != "")