Index: /pjproject/trunk/pjsip/include/pjsip/sip_parser.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsip/sip_parser.h	(revision 605)
+++ /pjproject/trunk/pjsip/include/pjsip/sip_parser.h	(revision 606)
@@ -315,5 +315,5 @@
     pjsip_HEX_SPEC,	        /**< Hexadecimal digits. */
     pjsip_PARAM_CHAR_SPEC,      /**< For scanning pname (or pvalue when it's 
-				     not quoted.) */
+				     not quoted.) in URI */
     pjsip_PARAM_CHAR_SPEC_ESC,	/**< Variant without the escape ('%') char */
     pjsip_HDR_CHAR_SPEC,	/**< Chars in hname/havalue in URL. */
@@ -357,9 +357,15 @@
 };
 
+/* Parse parameter in header (matching the character as token) */
 void pjsip_parse_param_imp(  pj_scanner *scanner, pj_pool_t *pool,
 			     pj_str_t *pname, pj_str_t *pvalue,
 			     unsigned opt);
+/* Parse parameter in URL (matching the character as paramchar) */
+void pjsip_parse_uri_param_imp(  pj_scanner *scanner, pj_pool_t *pool,
+				 pj_str_t *pname, pj_str_t *pvalue,
+				 unsigned opt);
 void pjsip_concat_param_imp( pj_str_t *param, pj_pool_t *pool, 
-			 const pj_str_t *pname, const pj_str_t *pvalue, int sepchar);
+			     const pj_str_t *pname, const pj_str_t *pvalue, 
+			     int sepchar);
 void pjsip_parse_end_hdr_imp ( pj_scanner *scanner );
 
Index: /pjproject/trunk/pjsip/src/pjsip-simple/evsub_msg.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip-simple/evsub_msg.c	(revision 605)
+++ /pjproject/trunk/pjsip/src/pjsip-simple/evsub_msg.c	(revision 606)
@@ -71,6 +71,6 @@
     
     printed = pjsip_param_print_on(&hdr->other_param, p, endbuf-p,
-				   &pjsip_PARAM_CHAR_SPEC, 
-				   &pjsip_PARAM_CHAR_SPEC, ';');
+				   &pjsip_TOKEN_SPEC, 
+				   &pjsip_TOKEN_SPEC, ';');
     if (printed < 0)
 	return printed;
@@ -181,6 +181,6 @@
     
     printed = pjsip_param_print_on( &hdr->other_param, p, endbuf-p, 
-				    &pjsip_PARAM_CHAR_SPEC,
-				    &pjsip_PARAM_CHAR_SPEC,
+				    &pjsip_TOKEN_SPEC,
+				    &pjsip_TOKEN_SPEC,
 				    ';');
     if (printed < 0)
Index: /pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c	(revision 605)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c	(revision 606)
@@ -82,6 +82,6 @@
     
     printed = pjsip_param_print_on(&cred->other_param, buf, endbuf-buf, 
-				   &pjsip_PARAM_CHAR_SPEC, 
-				   &pjsip_PARAM_CHAR_SPEC, ',');
+				   &pjsip_TOKEN_SPEC, 
+				   &pjsip_TOKEN_SPEC, ',');
     if (printed < 0)
 	return -1;
@@ -236,6 +236,6 @@
     
     printed = pjsip_param_print_on(&chal->other_param, buf, endbuf-buf, 
-				   &pjsip_PARAM_CHAR_SPEC, 
-				   &pjsip_PARAM_CHAR_SPEC, ',');
+				   &pjsip_TOKEN_SPEC, 
+				   &pjsip_TOKEN_SPEC, ',');
     if (printed < 0)
 	return -1;
Index: /pjproject/trunk/pjsip/src/pjsip/sip_msg.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 605)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 606)
@@ -1040,6 +1040,6 @@
 
 	printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,
-				       &pjsip_PARAM_CHAR_SPEC,
-				       &pjsip_PARAM_CHAR_SPEC, ';');
+				       &pjsip_TOKEN_SPEC, &pjsip_TOKEN_SPEC, 
+				       ';');
 	if (printed < 0)
 	    return printed;
@@ -1283,6 +1283,6 @@
 
     printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 
-				   &pjsip_PARAM_CHAR_SPEC,
-				   &pjsip_PARAM_CHAR_SPEC, ';');
+				   &pjsip_TOKEN_SPEC,
+				   &pjsip_TOKEN_SPEC, ';');
     if (printed < 0)
 	return -1;
@@ -1454,6 +1454,6 @@
 
     printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 
-				   &pjsip_PARAM_CHAR_SPEC, 
-				   &pjsip_PARAM_CHAR_SPEC, ';');
+				   &pjsip_TOKEN_SPEC, 
+				   &pjsip_TOKEN_SPEC, ';');
     if (printed < 0)
 	return -1;
@@ -1673,6 +1673,6 @@
     
     printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 
-				   &pjsip_PARAM_CHAR_SPEC,
-				   &pjsip_PARAM_CHAR_SPEC, ';');
+				   &pjsip_TOKEN_SPEC,
+				   &pjsip_TOKEN_SPEC, ';');
     if (printed < 0)
 	return -1;
Index: /pjproject/trunk/pjsip/src/pjsip/sip_parser.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_parser.c	(revision 605)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_parser.c	(revision 606)
@@ -41,6 +41,6 @@
 #define USER_UNRESERVED	    "&=+$,;?/"
 #define PASS		    "&=+$,"
-#define TOKEN		    "-.!%*_=`'~+"   /* '+' is because of app/pidf+xml
-					     * in Content-Type! */
+#define TOKEN		    "-.!%*_`'~+"   /* '=' was removed for parsing 
+					    * param */
 #define HOST		    "_-."
 #define HEX_DIGIT	    "abcdefABCDEF"
@@ -139,4 +139,8 @@
 				     pj_str_t *pname, 
 				     pj_str_t *pvalue);
+static void	    int_parse_uri_param( pj_scanner *scanner, 
+					 pj_pool_t *pool,
+					 pj_str_t *pname, 
+					 pj_str_t *pvalue);
 static void	    int_parse_hparam( pj_scanner *scanner,
 				      pj_pool_t *pool,
@@ -325,4 +329,7 @@
     pj_cis_add_str( &pjsip_TOKEN_SPEC, TOKEN);
 
+    /* TOKEN must not have '%' */
+    pj_assert(pj_cis_match(&pjsip_TOKEN_SPEC, '%')==0);
+
     status = pj_cis_dup(&pjsip_HOST_SPEC, &pjsip_ALNUM_SPEC);
     PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
@@ -1039,12 +1046,13 @@
 }
 
+
 /* Parse parameter (pname ["=" pvalue]). */
-void pjsip_parse_param_imp(  pj_scanner *scanner, pj_pool_t *pool,
+static void parse_param_imp( pj_scanner *scanner, pj_pool_t *pool,
 			     pj_str_t *pname, pj_str_t *pvalue,
+			     const pj_cis_t *spec, const pj_cis_t *esc_spec,
 			     unsigned option)
 {
     /* pname */
-    parser_get_and_unescape(scanner, pool, &pjsip_PARAM_CHAR_SPEC,
-			    &pjsip_PARAM_CHAR_SPEC_ESC, pname);
+    parser_get_and_unescape(scanner, pool, spec, esc_spec, pname);
 
     /* init pvalue */
@@ -1063,7 +1071,6 @@
 		    pvalue->slen -= 2;
 		}
-	    } else if(pj_cis_match(&pjsip_PARAM_CHAR_SPEC, *scanner->curptr)) {
-		parser_get_and_unescape(scanner, pool, &pjsip_PARAM_CHAR_SPEC, 
-					&pjsip_PARAM_CHAR_SPEC_ESC, pvalue);
+	    } else if(pj_cis_match(spec, *scanner->curptr)) {
+		parser_get_and_unescape(scanner, pool, spec, esc_spec, pvalue);
 	    }
 	}
@@ -1071,5 +1078,25 @@
 }
 
-/* Parse parameter (";" pname ["=" pvalue]). */
+/* Parse parameter (pname ["=" pvalue]) using token. */
+void pjsip_parse_param_imp(  pj_scanner *scanner, pj_pool_t *pool,
+			     pj_str_t *pname, pj_str_t *pvalue,
+			     unsigned option)
+{
+    parse_param_imp(scanner, pool, pname, pvalue, &pjsip_TOKEN_SPEC,
+		    &pjsip_TOKEN_SPEC, option);
+}
+
+
+/* Parse parameter (pname ["=" pvalue]) using paramchar. */
+void pjsip_parse_uri_param_imp(pj_scanner *scanner, pj_pool_t *pool,
+			       pj_str_t *pname, pj_str_t *pvalue,
+			       unsigned option)
+{
+    parse_param_imp(scanner, pool, pname, pvalue, &pjsip_PARAM_CHAR_SPEC,
+		    &pjsip_PARAM_CHAR_SPEC_ESC, option);
+}
+
+
+/* Parse parameter (";" pname ["=" pvalue]) in header. */
 static void int_parse_param( pj_scanner *scanner, pj_pool_t *pool,
 			     pj_str_t *pname, pj_str_t *pvalue)
@@ -1082,4 +1109,17 @@
 			  PJSIP_PARSE_REMOVE_QUOTE);
 }
+
+/* Parse parameter (";" pname ["=" pvalue]) in URI. */
+static void int_parse_uri_param( pj_scanner *scanner, pj_pool_t *pool,
+				 pj_str_t *pname, pj_str_t *pvalue)
+{
+    /* Get ';' character */
+    pj_scan_get_char(scanner);
+
+    /* Get pname and optionally pvalue */
+    pjsip_parse_uri_param_imp(scanner, pool, pname, pvalue, 
+			      PJSIP_PARSE_REMOVE_QUOTE);
+}
+
 
 /* Parse header parameter. */
@@ -1298,5 +1338,5 @@
 	pj_str_t pname, pvalue;
 
-	int_parse_param( scanner, pool, &pname, &pvalue);
+	int_parse_uri_param( scanner, pool, &pname, &pvalue);
 
 	if (!parser_stricmp(pname, pjsip_USER_STR) && pvalue.slen) {
Index: /pjproject/trunk/pjsip/src/pjsip/sip_tel_uri.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_tel_uri.c	(revision 605)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_tel_uri.c	(revision 606)
@@ -56,5 +56,7 @@
 static pj_cis_t pjsip_TEL_PNAME_SPEC;
 static pj_cis_t pjsip_TEL_PVALUE_SPEC;
+static pj_cis_t pjsip_TEL_PVALUE_SPEC_ESC;
 static pj_cis_t pjsip_TEL_PARSING_PVALUE_SPEC;
+static pj_cis_t pjsip_TEL_PARSING_PVALUE_SPEC_ESC;
 
 static pj_str_t pjsip_ISUB_STR = { "isub", 4 };
@@ -153,8 +155,15 @@
     pj_cis_add_str(&pjsip_TEL_PVALUE_SPEC, PARAM_CHAR);
 
+    status = pj_cis_dup(&pjsip_TEL_PVALUE_SPEC_ESC, &pjsip_TEL_PVALUE_SPEC);
+    pj_cis_del_str(&pjsip_TEL_PVALUE_SPEC_ESC, "%");
+
     status = pj_cis_dup(&pjsip_TEL_PARSING_PVALUE_SPEC, &pjsip_TEL_URIC_SPEC);
     PJ_ASSERT_RETURN(status==PJ_SUCCESS, status);
     pj_cis_add_cis(&pjsip_TEL_PARSING_PVALUE_SPEC, &pjsip_TEL_PVALUE_SPEC);
     pj_cis_add_str(&pjsip_TEL_PARSING_PVALUE_SPEC, "=");
+
+    status = pj_cis_dup(&pjsip_TEL_PARSING_PVALUE_SPEC_ESC, 
+			&pjsip_TEL_PARSING_PVALUE_SPEC);
+    pj_cis_del_str(&pjsip_TEL_PVALUE_SPEC_ESC, "%");
 
     status = pjsip_register_uri_parser("tel", &tel_uri_parse);
@@ -394,5 +403,15 @@
 	    if (*scanner->curptr == '=') {
 		pj_scan_get_char(scanner);
-		pj_scan_get(scanner, &pjsip_TEL_PARSING_PVALUE_SPEC, &pvalue);
+
+#		if defined(PJSIP_UNESCAPE_IN_PLACE) && PJSIP_UNESCAPE_IN_PLACE!=0
+		    pj_scan_get_unescape( scanner, 
+					  &pjsip_TEL_PARSING_PVALUE_SPEC_ESC,
+					  &pvalue);
+#		else
+		    pj_scan_get(scanner, &pjsip_TEL_PARSING_PVALUE_SPEC, 
+				&pvalue);
+		    *token = pj_str_unescape(pool, &pvalue);
+#		endif
+
 	    } else {
 		pvalue.slen = 0;
