Пример #1
0
 private void assertTopMostVia(
     final SipMessage msg, final String host, final int port, final String transport)
     throws Exception {
   final ViaHeader via =
       this.headerFactory.createViaHeader(Buffers.wrap(host), port, Buffers.wrap(transport), null);
   msg.addHeaderFirst(via);
   final ViaHeader topMostVia = msg.getViaHeader();
   assertThat(topMostVia.getBranch(), not((Buffer) null));
   assertThat(topMostVia.getHost().toString(), is(host));
   assertThat(topMostVia.getPort(), is(port));
   assertThat(topMostVia.getTransport().toString(), is(transport));
 }
Пример #2
0
 static SipMessage frame(final byte[] buffer) throws SipParseException, IOException {
   assertNotNull(buffer, "Byte-array cannot be null");
   return SipParser.frame(Buffers.wrap(buffer));
 }
Пример #3
0
 /**
  * @param buffer
  * @return
  * @throws IOException
  */
 static SipMessage frame(final String buffer) throws SipParseException, IOException {
   assertNotEmpty(buffer, "Buffer cannot be null or the empty string");
   return SipParser.frame(Buffers.wrap(buffer));
 }
Пример #4
0
 /*
  * (non-Javadoc)
  *
  * @see io.pkts.packet.Packet#write(java.io.OutputStream)
  */
 @Override
 public void write(final OutputStream out, final Buffer payload) throws IOException {
   this.parent.write(out, Buffers.wrap(this.msg.toBuffer(), payload));
 }
Пример #5
0
/** @author [email protected] */
public interface ContactHeader extends HeaderAddress, SipHeader, Parameters {

  Buffer NAME = Buffers.wrap("Contact");

  ContactHeader clone();
}