/** * Returns the state of the sharing * * @return State * @throws RemoteException * @see State */ public int getState() throws RemoteException { try { VideoStreamingSession session = mRichcallService.getVideoSharingSession(mSharingId); if (session == null) { return mPersistentStorage.getState().toInt(); } SipDialogPath dialogPath = session.getDialogPath(); if (dialogPath != null && dialogPath.isSessionEstablished()) { return State.STARTED.toInt(); } else if (session.isInitiatedByRemote()) { if (session.isSessionAccepted()) { return State.ACCEPTING.toInt(); } return State.INVITED.toInt(); } return State.INITIATING.toInt(); } catch (ServerApiBaseException e) { if (!e.shouldNotBeLogged()) { sLogger.error(ExceptionUtil.getFullStackTrace(e)); } throw e; } catch (Exception e) { sLogger.error(ExceptionUtil.getFullStackTrace(e)); throw new ServerApiGenericException(e); } }
/** * Returns the direction of the sharing (incoming or outgoing) * * @return Direction * @throws RemoteException * @see Direction */ public int getDirection() throws RemoteException { try { VideoStreamingSession session = mRichcallService.getVideoSharingSession(mSharingId); if (session == null) { return mPersistentStorage.getDirection().toInt(); } if (session.isInitiatedByRemote()) { return Direction.INCOMING.toInt(); } return Direction.OUTGOING.toInt(); } catch (ServerApiBaseException e) { if (!e.shouldNotBeLogged()) { sLogger.error(ExceptionUtil.getFullStackTrace(e)); } throw e; } catch (Exception e) { sLogger.error(ExceptionUtil.getFullStackTrace(e)); throw new ServerApiGenericException(e); } }