noushadali / sipservlets

Automatically exported from code.google.com/p/sipservlets
0 stars 0 forks source link

Cannot add multiple reason headers #216

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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());
}

Original issue reported on code.google.com by Maurice....@gmail.com on 13 Jun 2013 at 12:44

GoogleCodeExporter commented 9 years ago
Seen on 2.0.0 Final, not 2.1.0 final on Centos 5.8

Original comment by Maurice....@gmail.com on 13 Jun 2013 at 1:03

GoogleCodeExporter commented 9 years ago
For your second comment you mean that latest snapshot from here is OK 
https://mobicents.ci.cloudbees.com/job/Mobicents-SipServlets-Release/lastSuccess
fulBuild/artifact/ ?

Original comment by jean.deruelle on 3 Jul 2013 at 8:45

GoogleCodeExporter commented 9 years ago

Original comment by jean.deruelle on 5 Jul 2013 at 7:44

GoogleCodeExporter commented 9 years ago
Reproduced in https://code.google.com/p/jain-sip/issues/detail?id=133

Original comment by jean.deruelle on 2 May 2014 at 3:59

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 86962ad1ff47.

Add non regression test reproducing the issue.

Original comment by jean.deruelle on 2 May 2014 at 4:11

GoogleCodeExporter commented 9 years ago
Fixed in JAIN SIP

Original comment by jean.deruelle on 2 May 2014 at 4:11

GoogleCodeExporter commented 9 years ago

Original comment by jean.der...@telestax.com on 25 Aug 2014 at 10:52