Examples of waitForNotify()


Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

   
    SubscribeSession session = new SubscribeSession(getAlicePhone(), "reg");
    Request subscribe = session.newInitialSubscribe(100, getAliceUri()); // 1
    session.sendRequest(subscribe, Response.OK); // 2
   
    ServerTransaction tx = session.waitForNotify();
    Request notify = tx.getRequest(); // 3
    //System.out.println(notify);
    session.sendResponse(Response.OK, tx); // 4
    SubscriptionStateHeader subState = (SubscriptionStateHeader) notify.getHeader(SubscriptionStateHeader.NAME);
    assertEquals(SubscriptionStateHeader.ACTIVE.toLowerCase(), subState.getState().toLowerCase());
View Full Code Here

Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

    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
    regInfo = getRegInfo(notify);
    registration = regInfo.getRegistrationArray(0);
View Full Code Here

Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

    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);
    registration = regInfo.getRegistrationArray(0);
View Full Code Here

Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

    assertEquals(Event.UNREGISTERED, contact.getEvent());
   
    subscribe = session.newSubsequentSubscribe(0); // 13
    session.sendRequest(subscribe, Response.OK); // 14
   
    tx = session.waitForNotify();
    notify = tx.getRequest(); // 15
    //System.out.println(notify);
    session.sendResponse(Response.OK, tx); // 16
    subState = (SubscriptionStateHeader) notify.getHeader(SubscriptionStateHeader.NAME);
    assertEquals(SubscriptionStateHeader.TERMINATED.toLowerCase(),
View Full Code Here

Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

   
    SubscribeSession session = new SubscribeSession(getAlicePhone(), "reg");
    Request subscribe = session.newInitialSubscribe(100, getAliceUri());
    session.sendRequest(subscribe, Response.OK);
   
    ServerTransaction tx = session.waitForNotify();
    Request notify = tx.getRequest();
    //System.out.println(notify);
    session.sendResponse(Response.OK, tx);
    SubscriptionStateHeader subState = (SubscriptionStateHeader) notify.getHeader(SubscriptionStateHeader.NAME);
    assertEquals(SubscriptionStateHeader.ACTIVE.toLowerCase(), subState.getState().toLowerCase());
View Full Code Here

Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

    assertEquals(1, registration.getContactArray().length);
   
   
    getAlicePhone().unregister(null, 2000);
    assertLastOperationSuccess(getAlicePhone());
    tx = session.waitForNotify();
    notify = tx.getRequest();
    session.sendResponse(Response.OK, tx);
    regInfo = getRegInfo(notify);
    registration = regInfo.getRegistrationArray(0);
    assertEquals(1, registration.getContactArray().length);
View Full Code Here

Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

    assertEquals(Event.UNREGISTERED, contact.getEvent());
       
    subscribe = session.newSubsequentSubscribe(0);
    session.sendRequest(subscribe, Response.OK);
   
    tx = session.waitForNotify();
    notify = tx.getRequest();
    //System.out.println(notify);
    session.sendResponse(Response.OK, tx);
    subState = (SubscriptionStateHeader) notify.getHeader(SubscriptionStateHeader.NAME);
    assertEquals(SubscriptionStateHeader.TERMINATED.toLowerCase(),
View Full Code Here

Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

   
    SubscribeSession winfoSession = new SubscribeSession(getBobPhone(), "presence.winfo"); // 7
    subscribe = winfoSession.newInitialSubscribe(60, getBobUri());
    winfoSession.sendRequest(subscribe, Response.OK); // 8
   
    tx = winfoSession.waitForNotify(); // 9
    Request notify = tx.getRequest();
    //System.out.println(notify);
    winfoSession.sendResponse(Response.OK, tx); // 10
    SubscriptionStateHeader subState = (SubscriptionStateHeader) notify.getHeader(SubscriptionStateHeader.NAME);
    assertEquals(SubscriptionStateHeader.ACTIVE.toLowerCase(), subState.getState().toLowerCase());
View Full Code Here

Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

    //System.out.println("11:\n" + tx.getRequest());
    presenceSession.sendResponse(Response.OK, tx); // 14
    presence = getPresence(tx.getRequest());
    assertEquals(Basic.CLOSED, presence.getTupleArray()[0].getStatus().getBasic());
   
    tx = winfoSession.waitForNotify(); // 15
    notify = tx.getRequest();
    winfoSession.sendResponse(Response.OK, tx); // 16
    System.out.println(notify);
    subState = (SubscriptionStateHeader) notify.getHeader(SubscriptionStateHeader.NAME);
    assertEquals(SubscriptionStateHeader.ACTIVE.toLowerCase(), subState.getState().toLowerCase());
View Full Code Here

Examples of org.cafesip.sipunit.SubscribeSession.waitForNotify()

     
   
    subscribe = winfoSession.newSubsequentSubscribe(0); // 17
    winfoSession.sendRequest(subscribe, Response.OK); // 18
       
    tx = winfoSession.waitForNotify(); // 19
    winfoSession.sendResponse(Response.OK, tx); // 20
   
   
    subscribe = presenceSession.newSubsequentSubscribe(0); // 21
    presenceSession.sendRequest(subscribe, Response.OK); // 22
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.