Package org.cafesip.sipunit

Examples of org.cafesip.sipunit.RegisterSession.register()


   */
  public void testSubscription()
  {
    // Ensure Alice is not registered
    RegisterSession registerSession = new RegisterSession(getAlicePhone());
    registerSession.register(null, 0);
   
    SubscribeSession session = new SubscribeSession(getAlicePhone(), "reg");
    Request subscribe = session.newInitialSubscribe(100, getAliceUri()); // 1
    session.sendRequest(subscribe, Response.OK); // 2
   
View Full Code Here


    Registration registration = regInfo.getRegistrationArray(0);
    assertEquals(State.INIT, registration.getState());
    assertEquals(getAliceUri(), registration.getAor());
    assertEquals(0, registration.getContactArray().length);
   
    registerSession.register(null, 1800); // 5 and 6
   
    tx = session.waitForNotify();
    notify = tx.getRequest(); // 7
    //System.out.println(notify);
    session.sendResponse(Response.OK, tx); // 8
View Full Code Here

    assertEquals(State.ACTIVE, registration.getState());
    Contact contact = registration.getContactArray(0);
    assertBetween(1795, 1800, contact.getExpires().intValue());
    assertEquals(Event.REGISTERED, contact.getEvent());
   
    registerSession.register(null, 0); // 9 and  10
    tx = session.waitForNotify();
    notify = tx.getRequest(); // 11
    //System.out.println(notify);
    session.sendResponse(Response.OK, tx); // 12
    regInfo = getRegInfo(notify);
View Full Code Here

    assertFalse(response.getHeaders(ContactHeader.NAME).hasNext());
  }
   
  public void testLowerCSeq() throws Exception {
    RegisterSession session =  new RegisterSession(getAlicePhone());
    session.register(1800);
   
    Request request = session.createRegister(null, 0);
    CSeqHeader cseq = (CSeqHeader) request.getHeader(CSeqHeader.NAME);
    cseq.setSeqNumber(cseq.getSeqNumber() - 2);
    Response response = session.sendRegistrationMessage(request, Response.SERVER_INTERNAL_ERROR);
View Full Code Here

  }
 
  public void testNoContact() throws Exception
    RegisterSession session =  new RegisterSession(getAlicePhone());
    session.register(1800);
    List<String> expectedContacts = new ArrayList<String>();
    expectedContacts.add(getAlicePhone().getContactInfo().getURI());
    sendRegisterNoContact(session, expectedContacts);
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.