Issue Details (XML | Word | Printable)

Key: SIPSERVLET_SPEC-32
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: binod
Reporter: jonbo372
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
sipservlet-spec

It is not 100% clear in the documentation whether an empty list for a particular header in B2BuaHelper.createRequest(..., headerMap) will clear that header out.

Created: 18/Jan/13 12:16 AM   Updated: 26/Mar/14 05:01 AM   Resolved: 05/Mar/14 11:56 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-pr

Time Tracking:
Not Specified

Tags:
Participants: binod, bpulito, echeung, jonbo372, jverbil, nitzann and wchen


 Description  « Hide

By using the B2BuaHelper.createRequest(..., headerMap) the user can create a new "b2bua:ed" request where system headers such as Route-headers can be overridden. However, the documentation is not really clear what the behavior is when you supply an empty value-list for a particular header. Consider the following example:

Incoming INVITE which has two route headers like so:

INVITE sip:alice@example.com SIP/2.0
...
Route: <route 1>
Route: <route 2>

If I wanted to use the b2buahelper to create the second leg but do not want to the Route headers to be present in the new request one could assume that the following would work:

Map<String, List<String>> headerMap = ...
headerMap.put("Route", new ArrayList<String>());
SipServletRequest req = helper.createRequest(origRequest, linked, headerMap);

I would now assume that the previous two routes have been wiped out. It is not clear in the specification that this is what is supposed to happen and at least one container implementation had not implemented it this way.



binod added a comment - 05/Mar/14 11:56 AM

jonbo372 added a comment - 26/Feb/14 06:59 PM

Seems like there is a consensus for Option 1 so let's update the javadoc to make this clear.


bpulito added a comment - 26/Feb/14 01:32 PM

Option 1


nitzann added a comment - 26/Feb/14 08:58 AM

Option 1


wchen added a comment - 26/Feb/14 05:16 AM

I misread the issue at the meeting. After reading it again, yes, option 1.


jverbil added a comment - 25/Feb/14 08:35 PM

Option 1


echeung added a comment - 25/Feb/14 06:39 PM

I vote for option 1.
Eric


jonbo372 added a comment - 25/Feb/14 06:15 PM

Personally, I vote for Option 1...

/Jonas


jonbo372 added a comment - 25/Feb/14 06:13 PM

Per our discussion on the weekly meeting, we do agree that a clarification is needed since there are at least two different opinions of what the current wording in the javadoc actually means.

=== Option 1 ===
If you supply an empty list for a particular header, then that header will be removed. This is what the original entry suggests.

=== Option 2 ===
If you supply an empty list for a particular header then the original headers and their values are preserved.

Also, if you prefer Option 2, please specify what should happen in the following example:

Incoming request with three X-Hello headers like so:

INVITE sip:alice@example.com SIP/2.0
...
X-Hello: hello one
X-Hello: hello two
X-Hello: hello three
...

Map<String, List<String>> headerMap = ...
List<String> helloHeaders = new ArrayList<String>();
helloHeaders.add("hello world");
headerMap.put("X-Hello", helloHeaders);
SipServletRequest req = helper.createRequest(origRequest, linked, headerMap);

How many X-Hello headers exists in the new request and what are their values?

Please vote which option you prefer so that we can clarify the behavior in the javadoc and align the behavior of the containers.