Status: Accepted
Owner: [email protected]
Labels: Type-Defect Priority-Medium Component-Sip-Servlets MSS-2.1.0.FINAL Roadmap-Fix

New issue 196 by [email protected]: Parentheses in CallID break SessionManagerUtil tokenizer
http://code.google.com/p/sipservlets/issues/detail?id=196

If a Call-ID header contains right parentheses (legal according to RFC3261), then the sessionId derived from it will also contains right parentheses *inside*.

SessionManagerUtil.parseSipSessionKey() will break as the tokenizer expects a format "(" + text+ ")" where text is assumed to contain zero right parentheses.

Attached patch fixes the issue (just changes an indexOf() for a lastIndexOf()).

diff --git a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/
index 09e5c5d..9c7dd5a 100644
--- a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java +++ b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java
@@ -163,7 +163,7 @@ public class SessionManagerUtil {
                        String sipSessionKey) throws ParseException {

                int indexOfLeftParenthesis = sipSessionKey.indexOf("(");
-               int indexOfRightParenthesis = sipSessionKey.indexOf(")");
+ int indexOfRightParenthesis = sipSessionKey.lastIndexOf(")");
                if(indexOfLeftParenthesis == -1) {
throw new ParseException("The left parenthesis could not be found in the following key " + sipSessionKey, 0);
                }



--

--- 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