Revision: e149098947ec
Author:   josemrecio <[email protected]>
Date:     Wed Apr 17 06:38:36 2013
Log:      Update Issue 207

Backport to master

Current code in SessionManagerUtil.parseSipSessionKey() assumes that the only ')' character in a key is the one enclosing the session key.

This is incorrect in general as the key includes the Call-ID and Call-ID can include ')' character (see below ABNF extracted from RFC3261). If this happens, parsing fails and sip sessions are no longer accessible.
(cherry picked from commit 9265dda4c20f130c18bb030308e6efbf63305a7b)

http://code.google.com/p/sipservlets/source/detail?r=e149098947ec

Modified:
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java

=======================================
--- /sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java Mon Aug 13 12:29:49 2012 +++ /sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java Wed Apr 17 06:38:36 2013
@@ -163,7 +163,9 @@
                        String sipSessionKey) throws ParseException {

                int indexOfLeftParenthesis = sipSessionKey.indexOf("(");
-               int indexOfRightParenthesis = sipSessionKey.indexOf(")");
+               // see http://code.google.com/p/sipservlets/issues/detail?id=207
+               // support for Call-ID with ')' character
+               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-commits" 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