Package org.cipango.server.AbstractSipConnector

Examples of org.cipango.server.AbstractSipConnector.EventHandler


    assertEquals("Not same number of address", expected.size(), it.nextIndex());
  }
 
  public static SipMessage getMessage(String msg) throws Exception
  {
    EventHandler handler = new EventHandler();
    SipParser parser = new SipParser(new ByteArrayBuffer(msg.getBytes()), handler);
    parser.parse();
    return handler.getMessage();
  }
View Full Code Here


  }

  @Test
  public void testMultipleLineHeaders() throws Exception
  {
    EventHandler handler = new EventHandler();
    InputStream is = getClass().getResourceAsStream("/org/cipango/MultipleLineRequest.txt");
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    byte[] buffer = new byte[1024];
    int read;
    while ((read = is.read(buffer)) != -1)
    {
      os.write(buffer, 0, read);
    }
    SipParser parser = new SipParser(new ByteArrayBuffer(os.toByteArray()), handler);
    parser.parse();
   
    SipMessage message = handler.getMessage();
    String toString = message.toString();
    System.out.println(message);
   
    assertEquals(1, count(toString, "Accept:"));
    assertEquals(3, count(toString, "Via:"));
View Full Code Here

    int read;
    while ((read = is.read(buffer)) != -1)
    {
      os.write(buffer, 0, read);
    }
    EventHandler handler = new EventHandler();
    SipParser parser = new SipParser(new ByteArrayBuffer(os.toByteArray()), handler);
    parser.parse();
    return handler.getMessage();
  }
View Full Code Here

TOP

Related Classes of org.cipango.server.AbstractSipConnector.EventHandler

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.