Package org.cipango.server.session

Examples of org.cipango.server.session.Session$UA$ClientInvite


          if (Log.isDebugEnabled())
            Log.debug("Got response {}", response, null);
         
          SipRequest request = _tx.getRequest();
         
          Session session = request.session();
         
          if (request.isInitial() && status < 300)
          {
            if (!session.isSameDialog(response))
            {
              AppSession appSession = session.appSession();
              Session derived = appSession.getSession(response);
              if (derived == null)
                derived = appSession.createDerivedSession(session);
              session = derived;
           
          }
View Full Code Here


  public SipServletRequest createCancel(SipSession sipSession)
  {
    if (sipSession == null)
      throw new NullPointerException("SipSession is null");
   
    Session session = ((SessionIf) sipSession).getSession();
    for (ClientTransaction tx : session.getCallSession().getClientTransactions(session))
    {
      if (tx.getRequest().isInitial())
        return tx.getRequest().createCancel();
    }
    return null;
View Full Code Here

     
      String callId = ID.newCallId(srcRequest.getCallId());
   
    AppSession appSession = srcRequest.appSession();
       
        Session session = appSession.createUacSession(callId, local, remote);
        session.setHandler(appSession.getContext().getSipServletHandler().getDefaultServlet());

        SipRequest request = session.getUA().createRequest(srcRequest);
        request.setRoutingDirective(SipApplicationRoutingDirective.CONTINUE, srcRequest);
        request.setInitial(true);
       
        return request;
  }
View Full Code Here

      throw new IllegalArgumentException("Original request is already linked to another sipSession");
 
    if (getLinkedSipServletRequest(origRequest) != null)
      throw new IllegalArgumentException("Original request is already linked to another request");
   
    Session session = ((SessionIf) sipSession).getSession();
    SipRequest srcRequest = (SipRequest) origRequest;
   
    SipRequest request = (SipRequest) session.getUA().createRequest(srcRequest);
    request.setInitial(false);
    addHeaders(request, headerMap);
   
    linkRequest(srcRequest, request);
   
View Full Code Here

      throw new NullPointerException("SipSession is null");
   
    if (!sipSession.isValid())
      throw new IllegalArgumentException("SipSession " + sipSession + " is not valid");
   
    Session session = ((SessionIf) sipSession).getSession();
    Iterator<Session> it = findCloneSessions(session).iterator();
    while (it.hasNext())
    {
      Session session2 = (Session) it.next();
     
      for (ServerTransaction tx : session.getCallSession().getServerTransactions(session2))
      {
        SipRequest request = tx.getRequest();
        if (request.isInitial())
        {
          if (!session2.equals(session))
          {
            if (status >= 300)
              throw new IllegalStateException("Cannot send response with status" + status
                  + " since final response has already been sent");
            SipResponse response = new SipResponse(request, status, reason);
View Full Code Here

  {
    Iterator<?> it = session.appSession().getSessions("sip");
    List<Session> l = new ArrayList<Session>();
    while (it.hasNext())
    {
      Session sipSession = (Session) it.next();
      if (sipSession.getRemoteParty().equals(session.getRemoteParty())
          && sipSession.getCallId().equals(session.getCallId()))
        l.add(sipSession);
     
    }
    return l;
  }
View Full Code Here

    if (session == null)
      throw new NullPointerException("SipSession is null");
   
    if (!session.isValid())
      throw new IllegalArgumentException("SipSession " + session + " is not valid");
    Session linked = ((SessionIf) session).getSession().getLinkedSession();
    return linked == null null : new ScopedSession(linked);
  }
View Full Code Here

      throw new NullPointerException("SipSession is null");
   
    if (!sipSession.isValid())
      throw new IllegalArgumentException("SipSession " + sipSession + " is not valid");
   
    Session session = ((SessionIf) sipSession).getSession();
   
    if (session.isProxy())
      throw new IllegalArgumentException("SipSession " + session + " is proxy");
    if (session.getUA() == null)
      session.createUA(mode);
   
    List<SipServletMessage> messages = new ArrayList<SipServletMessage>();
    if (mode == UAMode.UAS)
    {
      for (ServerTransaction tx : session.getCallSession().getServerTransactions(session))
      {
        if (!tx.getRequest().isCommitted())
          messages.add(tx.getRequest());
      }
    }
    else
    {
      for (ClientTransaction tx : session.getCallSession().getClientTransactions(session))
      {
        if (!tx.isCompleted())
          messages.add(tx.getRequest());
      }
    }
   
    messages.addAll(session.getUA().getUncommitted2xx(mode));
    messages.addAll(session.getUA().getUncommitted1xx(mode));
   
    Collections.sort(messages, new Comparator() {
      public int compare(Object message1, Object message2)
      {
        long cseq1 = ((SipMessage) message1).getCSeq().getNumber();
View Full Code Here

  /**
   * @see B2buaHelper#linkSipSessions(SipSession, SipSession)
   */
  public void linkSipSessions(SipSession sipSession1, SipSession sipSession2)
  {
    Session session1 = ((SessionIf) sipSession1).getSession();
    Session session2 = ((SessionIf) sipSession2).getSession();
   
    checkNotTerminated(session1);
    checkNotTerminated(session2)
   
    Session linked1 = session1.getLinkedSession();
   
    if (linked1 != null && !linked1.equals(session2))
      throw new IllegalArgumentException("SipSession " + sipSession1 + " is already linked to " + linked1);
   
    Session linked2 = session2.getLinkedSession();
   
    if (linked2 != null && !linked2.equals(session1))
      throw new IllegalArgumentException("SipSession " + sipSession2 + " is already linked to " + linked2);
   
    session1.setLinkedSession(session2);
    session2.setLinkedSession(session1);
  }
View Full Code Here

  public void unlinkSipSessions(SipSession sipSession)
  {
    if (sipSession == null)
      throw new NullPointerException("SipSession is null");
   
    Session session = ((SessionIf) sipSession).getSession();
    checkNotTerminated(session);
   
    Session linked = session.getLinkedSession();
    if (linked == null)
      throw new IllegalArgumentException("SipSession " + session + " has no linked SipSession");
    linked.setLinkedSession(null);
    session.setLinkedSession(null);
  }
View Full Code Here

TOP

Related Classes of org.cipango.server.session.Session$UA$ClientInvite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.