Package org.cafesip.sipunit

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


       
        SubscribeSession presenceSession = new SubscribeSession(getBobPhone(), "presence");
    Request subscribe = presenceSession.newInitialSubscribe(0, getAliceUri()); // 3
    presenceSession.sendRequest(subscribe, Response.OK); // 4

    ServerTransaction tx = presenceSession.waitForNotify(); // 5
    System.out.println("5:\n" + tx.getRequest());
    presenceSession.sendResponse(Response.OK, tx); // 6
    Presence presence = getPresence(tx.getRequest());
    assertEquals(Basic.CLOSED, presence.getTupleArray()[0].getStatus().getBasic());
   
View Full Code Here


   
    SubscribeSession winfoSession = new SubscribeSession(getAlicePhone(), "presence.winfo"); // 7
    subscribe = winfoSession.newInitialSubscribe(60, getAliceUri());
    winfoSession.sendRequest(subscribe, Response.OK); // 8
   
    tx = winfoSession.waitForNotify(); // 9
    Request notify = tx.getRequest();
    System.out.println("9:\n" +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

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

    assertEquals(Event.SUBSCRIBE, watcher.getEvent());
    assertEquals(getAliceUri(), watcher.getStringValue());
    assertEquals(Status.ACTIVE, watcher.getStatus());
   
   
    tx = presenceSession.waitForNotify(); // 9
    presenceSession.sendResponse(Response.OK, tx); // 10
   
   
    subscribe = presenceSession.newSubsequentSubscribe(0); // 11
    presenceSession.sendRequest(subscribe, Response.OK); // 12
View Full Code Here

    watcher = watcherList.getWatcherArray(0);
    assertEquals(Event.TIMEOUT, watcher.getEvent());
    assertEquals(getAliceUri(), watcher.getStringValue());
    assertEquals(Status.TERMINATED, watcher.getStatus());
   
    tx = presenceSession.waitForNotify(); // 15
    presenceSession.sendResponse(Response.OK, tx); // 16
   
    subscribe = winfoSession.newSubsequentSubscribe(0); // 17
    winfoSession.sendRequest(subscribe, Response.OK); //18
   
View Full Code Here

  {   
    SubscribeSession presenceSession = new SubscribeSession(getAlicePhone(), "presence");
    Request subscribe = presenceSession.newInitialSubscribe(100, getBobUri()); // 1
    presenceSession.sendRequest(subscribe, Response.OK); // 2

    ServerTransaction tx = presenceSession.waitForNotify(); // 3
    presenceSession.sendResponse(Response.OK, tx); // 4
   
    SubscribeSession winfoSession = new SubscribeSession(getBobPhone(), "presence.winfo"); // 5
    subscribe = winfoSession.newInitialSubscribe(0, getBobUri());
    winfoSession.sendRequest(subscribe, Response.OK); // 6
View Full Code Here

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

   
    SubscribeSession presenceSession = new SubscribeSession(getAlicePhone(), "presence");
    Request subscribe = presenceSession.newInitialSubscribe(100, getBobUri()); // 3
    presenceSession.sendRequest(subscribe, Response.OK); // 4

    ServerTransaction tx = presenceSession.waitForNotify(); // 5
    //System.out.println("3:\n" + tx.getRequest());
    presenceSession.sendResponse(Response.OK, tx); // 6
    Presence presence = getPresence(tx.getRequest());
    assertEquals(Basic.OPEN, presence.getTupleArray()[0].getStatus().getBasic());
   
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.