Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3263 by [email protected]: B2buaHelper.createRequest does not honor an empty Route list as part of the header-map
http://code.google.com/p/mobicents/issues/detail?id=3263

What steps will reproduce the problem?
1. Create a new request using the B2buahelper.createRequest and pass in a header map where the entry for Route has an empty list, as in, please remove all routes.
2. The new request will still have any Routes from the incoming request.

What is the expected output? What do you see instead?
The new request should have no route headers


What version of the product are you using? On what operating system?
MSS 1.7 final.

Please provide any additional information below.

Imagine that an INVITE request has the following to route headers:
INVITE ...
Route: <sip:[email protected]>
Route: <sip:[email protected]>

and for the b2bua request you do not want those Route headers to survive so therefore you do the following:

final B2buaHelper helper = originalRequest.getB2buaHelper();
final Map<String, java.util.List<String>> headerMap = new HashMap<String, List<String>>();
headerMap.put("Route", new ArrayList<String>());
final SipServletRequest newRequest = helper.createRequest(originalRequest, true, headerMap);

However, the "newRequest" still has the two Route headers from the incoming request present. Note though, if you actually have a value in the route-list in the header-map then it actually works. I.e., the following code does what you expect it too:

final B2buaHelper helper = originalRequest.getB2buaHelper();
final Map<String, java.util.List<String>> headerMap = new HashMap<String, List<String>>();
List<String> newRouteHeaders = new ArrayList();
newRouteHeaders.add("sip:[email protected]");
headerMap.put("Route", newRouteHeaders);
final SipServletRequest newRequest = helper.createRequest(originalRequest, true, headerMap);

and now the newRequest will actually contain our "sip:[email protected]" route header and nothing else.

Reply via email to