예제 #1
0
	def req_session_status(self, session_id):
		if self.role_instance.sessions.has_key(session_id):
			session = self.role_instance.sessions[session_id]
		else:
			session = Session(session_id, None, None, None, None)
			session.status = "unknown"
		
		return self.req_answer(self.session2xmlstatus(session))
예제 #2
0
	def req_session_disconnect(self, session_id):
		if self.role_instance.sessions.has_key(session_id):
			session = self.role_instance.sessions[session_id]
			if session.status == Session.SESSION_STATUS_ACTIVE:
				self.role_instance.spool_action("disconnect", session.id)
		else:
			session = Session(session_id, None, None, None, None)
			session.status = Session.SESSION_STATUS_UNKNOWN
		
		return self.req_answer(self.session2xmlstatus(session))
예제 #3
0
	def req_session_destroy(self, session_id):
		if self.role_instance.sessions.has_key(session_id):
			session = self.role_instance.sessions[session_id]
			if session.status not in [Session.SESSION_STATUS_WAIT_DESTROY, Session.SESSION_STATUS_DESTROYED, Session.SESSION_STATUS_ERROR]:
				# Switch the session status without warn the session manager
				session.switch_status(Session.SESSION_STATUS_WAIT_DESTROY)
				self.role_instance.spool_action("destroy", session.id)
		else:
			session = Session(session_id, None, None, None, None)
			session.status = Session.SESSION_STATUS_UNKNOWN
		
		return self.req_answer(self.session2xmlstatus(session))