public static void releaseSession(NgnPublicationSession session) {
   synchronized (sSessions) {
     if (session != null && sSessions.containsKey(session.getId())) {
       long id = session.getId();
       session.decRef();
       sSessions.remove(id);
     }
   }
 }
 public static NgnPublicationSession createOutgoingSession(NgnSipStack sipStack, String toUri) {
   synchronized (sSessions) {
     final NgnPublicationSession pubSession = new NgnPublicationSession(sipStack, toUri);
     sSessions.put(pubSession.getId(), pubSession);
     return pubSession;
   }
 }
 public static void releaseSession(long id) {
   synchronized (sSessions) {
     NgnPublicationSession session = NgnPublicationSession.getSession(id);
     if (session != null) {
       session.decRef();
       sSessions.remove(id);
     }
   }
 }
 public static boolean hasSession(long id) {
   synchronized (sSessions) {
     return sSessions.containsKey(id);
   }
 }
 public static int getSize() {
   synchronized (sSessions) {
     return sSessions.size();
   }
 }
 public static NgnPublicationSession getSession(long id) {
   synchronized (sSessions) {
     if (sSessions.containsKey(id)) return sSessions.get(id);
     else return null;
   }
 }