assert "TCP".equals(value.getParam(new SipHeaderParamName("Transport")));
}
@Test
public void testCompactHeaders() throws SipParserException, IOException {
SipMessage sipMessage = parse("OPTIONS sip:h@google.com SIP/2.0\r\n" +
"i: mldkjf43532@host.domain\r\n" +
"m: <192.168.5.6:43673>\r\n" +
"e:gzip\r\n" +
"l: \r\n" +
" 15\r\n" +
"c: text/html\r\n" +
"f:\"Jessy James\" <sip:jenny@jones.com>;tag=kpo34fz\r\n" +
"s:what about the wheather today\r\n" +
"k: INVITE,BYE, CANCEL\r\n" +
"t: john the ripper <sip:john@ripper.com;killer>;tag=kpsd4fz\r\n" +
"v: SIP/2.0/UDP 192.168.20.2;branch=mdsif12f\r\n" +
"v: SIP/2.0/UDP 172.20.2.168;branch=msdf343f\r\n" +
"v: SIP/2.0/UDP 10.1.5.7;branch=mfdf343f\r\n" +
"v: SIP/2.0/UDP 64.32.165.46;branch=m134343f\r\n" +
"\r\n" +
"kd\r\n" +
"pe0_\n" +
";_{\r" +
" p");
SipHeaders sipHeaders = sipMessage.getSipHeaders();
SipHeaderFieldValue callId =
sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_CALLID));
assert callId != null;
assert callId.getValue().indexOf("ldkjf43532@host.domain") > -1;
SipHeaderFieldValue contact =
sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_CONTACT));
assert contact != null;
assert contact.getValue().indexOf("<192.168.5.6:43673>") > -1;
SipHeaderFieldValue contentEncoding =
sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_CONTENT_ENCODING));
assert contentEncoding != null;
assert contentEncoding.getValue().indexOf("gzip") > -1;
SipHeaderFieldValue contentlLength =
sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_CONTENT_LENGTH));
assert contentlLength != null;
assert contentlLength.getValue().indexOf("15") > -1;
assert sipMessage.getBody().length == 15;
SipHeaderFieldValue contentType =
sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_CONTENT_TYPE));
assert contentType != null;
assert contentType.getValue().indexOf("text/html") > -1;
SipHeaderFieldValue from =