Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Component-Sip-Servlets MSS-2.1.0.FINAL Roadmap-Fix

New issue 216 by [email protected]: Cannot add multiple reason headers
http://code.google.com/p/sipservlets/issues/detail?id=216

What steps will reproduce the problem?
1.Call addHeader to add a Reason header for SIP
2.Call addHeader to add a Reason header for Q.850
3.Send the message


What is the expected output? What do you see instead?
I expect to see a message being sent with both reason headers (as per RFC 3326). Only the first header is present in the outgoing message.


What version of the product are you using? On what operating system?
2.0.0 Final


Please provide any additional information below.

The problem is in gov.nist.javax.sip.message.ListMap - it does not include ReasonList in the table of headers that may contain more than one item (headerListTable). When addHeader is called in gov.nist.javax.sip.message.SIPMessage, it calls attachHeader which asks ListMap if the Reason header may be a list. ListMap returns no and step 2 above silently drops the second header. As the header is not added to the message, the header is not included when the message is sent.

-- Cut-down JUnit test --
public final void testIt() throws ParseException {
  List<Header> headers = ((SipFactoryImpl)sipFactory)
   .getHeaderFactory()
   .createHeaders("Reason" + ":" + "SIP ;cause=499, Q.850 ;cause=34");
  Message fred =
   (SipFactoryImpl)sipFactory).messageFactory.createRequest(null);
  for (Header header : headers) {
    fred.addHeader(header);
  }
  ListIterator bill = fred.getHeaders("Reason");
  assertTrue(bill.hasNext());
  assertEquals("Reason: SIP;cause=499\r\n", bill.next().toString());

  assertTrue(bill.hasNext());  // <=== THIS FAILS - second header missing

  assertEquals("Reason: Q.850;cause=34\r\n", bill.next().toString());
  assertFalse(bill.hasNext());
}

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

--- You received this message because you are subscribed to the Google Groups "mobicents-all-issues-changes" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to