Index: pjproject/trunk/build/common.mak
===================================================================
--- pjproject/trunk/build/common.mak	(revision 64)
+++ pjproject/trunk/build/common.mak	(revision 65)
Index: pjproject/trunk/pjlib-util/include/pjlib-util/md5.h
===================================================================
--- pjproject/trunk/pjlib-util/include/pjlib-util/md5.h	(revision 64)
+++ pjproject/trunk/pjlib-util/include/pjlib-util/md5.h	(revision 65)
Index: pjproject/trunk/pjlib-util/include/pjlib-util/scanner.h
===================================================================
--- pjproject/trunk/pjlib-util/include/pjlib-util/scanner.h	(revision 64)
+++ pjproject/trunk/pjlib-util/include/pjlib-util/scanner.h	(revision 65)
Index: pjproject/trunk/pjlib-util/include/pjlib-util/string.h
===================================================================
--- pjproject/trunk/pjlib-util/include/pjlib-util/string.h	(revision 64)
+++ pjproject/trunk/pjlib-util/include/pjlib-util/string.h	(revision 65)
@@ -1,3 +1,3 @@
-/* $Id: $ */
+/* $Id$ */
 /* 
  * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
@@ -31,9 +31,14 @@
 
 /**
- * Unescape string.
+ * Unescape string. If source string does not contain any escaped
+ * characters, the function would simply return the original string.
+ * Otherwise a new string will be allocated.
  *
- * @param str	    The string to unescape.
+ * @param pool	    Pool to allocate the string.
+ * @param src	    Source string to unescape.
+ *
+ * @return	    String with no escaped characters.
  */
-PJ_DECL(void) pj_str_unescape(pj_str_t *str);
+PJ_DECL(pj_str_t) pj_str_unescape( pj_pool_t *pool, const pj_str_t *src);
 
 /**
Index: pjproject/trunk/pjlib-util/include/pjlib-util/stun.h
===================================================================
--- pjproject/trunk/pjlib-util/include/pjlib-util/stun.h	(revision 64)
+++ pjproject/trunk/pjlib-util/include/pjlib-util/stun.h	(revision 65)
Index: pjproject/trunk/pjlib-util/include/pjlib-util/xml.h
===================================================================
--- pjproject/trunk/pjlib-util/include/pjlib-util/xml.h	(revision 64)
+++ pjproject/trunk/pjlib-util/include/pjlib-util/xml.h	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util-test/main.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util-test/main.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util-test/main.c	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util-test/test.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util-test/test.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util-test/test.c	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util-test/test.h
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util-test/test.h	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util-test/test.h	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util-test/xml.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util-test/xml.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util-test/xml.c	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util/md5.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/md5.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/md5.c	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util/scanner.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/scanner.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/scanner.c	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util/string.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/string.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/string.c	(revision 65)
@@ -1,3 +1,3 @@
-/* $Id: $ */
+/* $Id$ */
 /* 
  * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
@@ -19,11 +19,19 @@
 #include <pjlib-util/string.h>
 #include <pj/ctype.h>
+#include <pj/string.h>
+#include <pj/pool.h>
 
-PJ_DEF(void) pj_str_unescape(pj_str_t *str)
+PJ_DEF(pj_str_t) pj_str_unescape( pj_pool_t *pool, const pj_str_t *src_str)
 {
-    char *src = str->ptr;
-    char *dst = str->ptr;
-    char *end = src + str->slen;
+    char *src = src_str->ptr;
+    char *end = src + src_str->slen;
+    pj_str_t dst_str;
+    char *dst;
     
+    if (pj_strchr(src_str, '%')==NULL)
+	return *src_str;
+
+    dst = dst_str.ptr = pj_pool_alloc(pool, src_str->slen);
+
     while (src != end) {
 	if (*src == '%' && src < end-2) {
@@ -33,9 +41,9 @@
 	    src += 3;
 	} else {
-	    ++src;
-	    ++dst;
+	    *dst++ = *src++;
 	}
     }
-    str->slen = dst - str->ptr;
+    dst_str.slen = dst - dst_str.ptr;
+    return dst_str;
 }
 
Index: pjproject/trunk/pjlib-util/src/pjlib-util/stun.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/stun.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/stun.c	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util/stun_client.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/stun_client.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/stun_client.c	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util/symbols.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/symbols.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/symbols.c	(revision 65)
Index: pjproject/trunk/pjlib-util/src/pjlib-util/xml.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/xml.c	(revision 64)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/xml.c	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/file.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/file.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/file.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/hash.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/hash.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/hash.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/list.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/list.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/list.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/lock.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/lock.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/lock.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/os.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/os.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/os.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/pool.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/pool.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/pool.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/proactor.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/proactor.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/proactor.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/scanner.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/scanner.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/scanner.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/sock.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/sock.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/sock.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/string.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/string.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/string.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/timer.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/timer.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/timer.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/tree.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/tree.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/tree.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj++/types.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/types.hpp	(revision 64)
+++ pjproject/trunk/pjlib/include/pj++/types.hpp	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/addr_resolv.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/addr_resolv.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/addr_resolv.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/array.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/array.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/array.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/assert.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/assert.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/assert.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/assert.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/assert.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/assert.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/ctype.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/ctype.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/ctype.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/errno.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/errno.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/errno.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/high_precision.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/high_precision.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/high_precision.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/m_alpha.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/m_alpha.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/m_alpha.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/m_i386.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/m_i386.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/m_i386.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/m_m68k.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/m_m68k.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/m_m68k.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/m_sparc.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/m_sparc.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/m_sparc.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/malloc.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/malloc.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/malloc.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/os_linux.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/os_linux.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/os_linux.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/os_linux_kernel.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/os_linux_kernel.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/os_linux_kernel.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/os_palmos.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/os_palmos.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/os_palmos.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/os_sunos.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/os_sunos.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/os_sunos.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/os_win32.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/os_win32.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/os_win32.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/rand.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/rand.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/rand.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/setjmp.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/setjmp.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/setjmp.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/size_t.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/size_t.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/size_t.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/socket.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/socket.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/socket.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/sprintf.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/sprintf.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/sprintf.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/stdarg.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/stdarg.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/stdarg.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/stdfileio.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/stdfileio.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/stdfileio.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/string.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/string.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/string.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/time.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/time.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/time.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/compat/vsprintf.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/vsprintf.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/compat/vsprintf.h	(revision 65)
Index: pjproject/trunk/pjlib/include/pj/os.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/os.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/os.h	(revision 65)
@@ -867,4 +867,42 @@
 
 /**
+ * Add timestamp t2 to t1.
+ * @param t1	    t1.
+ * @param t2	    t2.
+ */
+PJ_INLINE(void) pj_add_timestamp(pj_timestamp *t1, const pj_timestamp *t2)
+{
+#if PJ_HAS_INT64
+    t1->u64 += t2->u64;
+#else
+    pj_uint32_t old = t1->u32.lo;
+    t1->u32.hi += t2->u32.hi;
+    t1->u32.lo += t2->u32.lo;
+    if (t1->u32.lo < old)
+	++t1->u32.hi;
+#endif
+}
+
+/**
+ * Substract timestamp t2 from t1.
+ * @param t1	    t1.
+ * @param t2	    t2.
+ */
+PJ_INLINE(void) pj_sub_timestamp(pj_timestamp *t1, const pj_timestamp *t2)
+{
+#if PJ_HAS_INT64
+    t1->u64 -= t2->u64;
+#else
+    t1->u32.hi -= t2->u32.hi;
+    if (t1->u32.lo >= t2->u32.lo)
+	t1->u32.lo -= t2->u32.lo;
+    else {
+	t1->u32.lo -= t2->u32.lo;
+	--t1->u32.hi;
+    }
+#endif
+}
+
+/**
  * Calculate the elapsed time, and store it in pj_time_val.
  * This function calculates the elapsed time using highest precision
Index: pjproject/trunk/pjlib/include/pj/string.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/string.h	(revision 64)
+++ pjproject/trunk/pjlib/include/pj/string.h	(revision 65)
@@ -399,5 +399,5 @@
  * @return the pointer to first character found, or NULL.
  */
-PJ_INLINE(char*) pj_strchr( pj_str_t *str, int chr)
+PJ_INLINE(char*) pj_strchr( const pj_str_t *str, int chr)
 {
     return (char*) memchr(str->ptr, chr, str->slen);
Index: pjproject/trunk/pjlib/src/pj/addr_resolv_linux_kernel.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/addr_resolv_linux_kernel.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pj/addr_resolv_linux_kernel.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pj/addr_resolv_sock.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/addr_resolv_sock.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pj/addr_resolv_sock.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pj/array.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/array.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pj/array.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pj/compat/sigjmp.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/compat/sigjmp.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pj/compat/sigjmp.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pj/compat/string.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/compat/string.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pj/compat/string.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib++-test/main.cpp
===================================================================
--- pjproject/trunk/pjlib/src/pjlib++-test/main.cpp	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib++-test/main.cpp	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-samples/except.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-samples/except.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-samples/except.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-samples/list.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-samples/list.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-samples/list.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-samples/log.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-samples/log.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-samples/log.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/atomic.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/atomic.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/atomic.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/echo_clt.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/echo_clt.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/echo_clt.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/errno.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/errno.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/errno.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/exception.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/exception.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/exception.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/fifobuf.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/fifobuf.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/fifobuf.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/file.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/file.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/file.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/ioq_udp.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/ioq_udp.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/ioq_udp.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/list.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/list.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/list.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/main.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/main.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/main.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/main_mod.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/main_mod.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/main_mod.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/mutex.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/mutex.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/mutex.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/os.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/os.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/os.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/pool.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/pool.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/pool.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/rand.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/rand.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/rand.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/rbtree.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/rbtree.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/rbtree.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/select.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/select.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/select.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/sleep.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/sleep.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/sleep.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/sock.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/sock_perf.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/sock_perf.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/sock_perf.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/string.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/string.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/string.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/test.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/test.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/test.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/test.h
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/test.h	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/test.h	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/thread.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/thread.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/thread.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/timer.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/timer.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/timer.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/timestamp.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/timestamp.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/timestamp.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_sync.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_sync.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_sync.c	(revision 65)
Index: pjproject/trunk/pjlib/src/pjlib-test/util.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/util.c	(revision 64)
+++ pjproject/trunk/pjlib/src/pjlib-test/util.c	(revision 65)
Index: pjproject/trunk/pjmedia/build/Jbtest.dat
===================================================================
--- pjproject/trunk/pjmedia/build/Jbtest.dat	(revision 64)
+++ pjproject/trunk/pjmedia/build/Jbtest.dat	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/codec.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/codec.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/codec.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/codec.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/codec.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/codec.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/config.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/config.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/config.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/dsound.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/dsound.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/dsound.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/g711.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/jbuf.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/jbuf.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/jbuf.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/mediamgr.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/mediamgr.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/mediamgr.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/mediamgr.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/mediamgr.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/mediamgr.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/nullsound.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/nullsound.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/nullsound.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/pasound.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/pasound.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/pasound.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/LICENSE.txt
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/LICENSE.txt	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/LICENSE.txt	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/README.txt
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/README.txt	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/README.txt	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/V19-devel-readme.txt
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/V19-devel-readme.txt	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/V19-devel-readme.txt	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/dsound_wrapper.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/dsound_wrapper.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/dsound_wrapper.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/dsound_wrapper.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/dsound_wrapper.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/dsound_wrapper.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_allocation.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_allocation.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_allocation.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_allocation.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_allocation.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_allocation.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_converters.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_converters.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_converters.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_converters.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_converters.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_converters.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_cpuload.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_cpuload.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_cpuload.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_cpuload.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_cpuload.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_cpuload.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_dither.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_dither.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_dither.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_dither.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_dither.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_dither.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_endianness.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_endianness.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_endianness.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_front.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_front.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_front.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_hostapi.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_hostapi.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_hostapi.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_linux_alsa.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_linux_alsa.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_linux_alsa.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_linux_alsa.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_linux_alsa.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_linux_alsa.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_process.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_process.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_process.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_process.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_process.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_process.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_skeleton.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_skeleton.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_skeleton.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_stream.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_stream.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_stream.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_stream.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_stream.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_stream.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_trace.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_trace.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_trace.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_trace.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_trace.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_trace.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_types.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_types.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_types.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_hostapis.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_hostapis.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_hostapis.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_oss.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_oss.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_oss.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_util.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_util.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_util.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_util.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_util.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_util.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_util.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_util.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_util.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_ds.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_ds.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_ds.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_hostapis.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_hostapis.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_hostapis.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_util.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_util.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_util.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_x86_plain_converters.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_x86_plain_converters.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_x86_plain_converters.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_x86_plain_converters.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_x86_plain_converters.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_x86_plain_converters.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/pjmedia/portaudio/portaudio.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/portaudio/portaudio.h	(revision 64)
+++ pjproject/trunk/pjmedia/src/pjmedia/portaudio/portaudio.h	(revision 65)
Index: pjproject/trunk/pjmedia/src/test/audio_tool.c
===================================================================
--- pjproject/trunk/pjmedia/src/test/audio_tool.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/test/audio_tool.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/test/jbuf_test.c
===================================================================
--- pjproject/trunk/pjmedia/src/test/jbuf_test.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/test/jbuf_test.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/test/main.c
===================================================================
--- pjproject/trunk/pjmedia/src/test/main.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/test/main.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/test/rtp_test.c
===================================================================
--- pjproject/trunk/pjmedia/src/test/rtp_test.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/test/rtp_test.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/test/sdptest.c
===================================================================
--- pjproject/trunk/pjmedia/src/test/sdptest.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/test/sdptest.c	(revision 65)
Index: pjproject/trunk/pjmedia/src/test/session_test.c
===================================================================
--- pjproject/trunk/pjmedia/src/test/session_test.c	(revision 64)
+++ pjproject/trunk/pjmedia/src/test/session_test.c	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip-simple/event_notify.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-simple/event_notify.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip-simple/event_notify.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip-simple/event_notify_msg.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-simple/event_notify_msg.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip-simple/event_notify_msg.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip-simple/messaging.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-simple/messaging.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip-simple/messaging.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip-simple/pidf.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-simple/pidf.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip-simple/pidf.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip-simple/presence.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-simple/presence.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip-simple/presence.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip-simple/xpidf.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-simple/xpidf.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip-simple/xpidf.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip-ua/sip_dialog.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-ua/sip_dialog.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip-ua/sip_dialog.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip-ua/sip_regc.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-ua/sip_regc.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip-ua/sip_regc.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip-ua/sip_ua.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-ua/sip_ua.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip-ua/sip_ua.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/print_util.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/print_util.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/print_util.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_auth.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_auth.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_auth.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_auth_msg.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_auth_msg.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_auth_msg.h	(revision 65)
@@ -37,4 +37,5 @@
 {
     pj_str_t	realm;
+    pjsip_param	other_param;
 };
 
@@ -49,4 +50,5 @@
 {
     pj_str_t	realm;
+    pjsip_param	other_param;
     pj_str_t	username;
     pj_str_t	nonce;
@@ -58,5 +60,4 @@
     pj_str_t	qop;
     pj_str_t	nc;
-    pj_str_t	other_param;
 };
 
@@ -70,4 +71,5 @@
 {
     pj_str_t	realm;
+    pjsip_param	other_param;
     pj_str_t	version;
     pj_str_t	signature;
@@ -130,4 +132,5 @@
 {
     pj_str_t	realm;
+    pjsip_param	other_param;
 };
 
@@ -141,4 +144,5 @@
 {
     pj_str_t	realm;
+    pjsip_param	other_param;
     pj_str_t	domain;
     pj_str_t	nonce;
@@ -147,5 +151,4 @@
     pj_str_t	algorithm;
     pj_str_t	qop;
-    pj_str_t	other_param;
 };
 
@@ -159,4 +162,5 @@
 {
     pj_str_t	realm;
+    pjsip_param	other_param;
     pj_str_t	version;
     pj_str_t	micalgorithm;
Index: pjproject/trunk/pjsip/include/pjsip/sip_auth_parser.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_auth_parser.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_auth_parser.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_config.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_config.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_config.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_endpoint.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_endpoint.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_endpoint.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_errno.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_errno.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_errno.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_event.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_event.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_event.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_module.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_module.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_module.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_msg.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_msg.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_msg.h	(revision 65)
@@ -995,8 +995,8 @@
     PJSIP_DECL_HDR_MEMBER(struct pjsip_contact_hdr);
     int		    star;	    /**< The contact contains only a '*' character */
-    pjsip_uri *uri;	    /**< URI in the contact. */
+    pjsip_uri	   *uri;	    /**< URI in the contact. */
     int		    q1000;	    /**< The "q" value times 1000 (to avoid float) */
     pj_int32_t	    expires;	    /**< Expires parameter, otherwise -1 if not present. */
-    pj_str_t	    other_param;    /**< Other parameters, concatenated in a single string. */
+    pjsip_param	    other_param;    /**< Other parameters, concatenated in a single string. */
 } pjsip_contact_hdr;
 
@@ -1078,7 +1078,7 @@
 {
     PJSIP_DECL_HDR_MEMBER(struct pjsip_fromto_hdr);
-    pjsip_uri  *uri;	    /**< URI in From/To header. */
+    pjsip_uri	    *uri;	    /**< URI in From/To header. */
     pj_str_t	     tag;	    /**< Header "tag" parameter. */
-    pj_str_t	     other_param;   /**< Other params, concatenated as a single string. */
+    pjsip_param	     other_param;   /**< Other params, concatenated as a single string. */
 } pjsip_fromto_hdr;
 
@@ -1188,5 +1188,5 @@
     PJSIP_DECL_HDR_MEMBER(struct pjsip_routing_hdr);  /**< Generic header fields. */
     pjsip_name_addr  name_addr;	  /**< The URL in the Route/Record-Route header. */
-    pj_str_t	     other_param; /** Other parameter. */
+    pjsip_param	     other_param; /** Other parameter. */
 } pjsip_routing_hdr;
 
@@ -1352,5 +1352,5 @@
     pj_str_t	     recvd_param;   /**< "received" parameter. */
     pj_str_t	     branch_param;  /**< "branch" parameter. */
-    pj_str_t	     other_param;   /**< Other parameters, concatenated as single string. */
+    pjsip_param	     other_param;   /**< Other parameters, concatenated as single string. */
     pj_str_t	     comment;	    /**< Comment. */
 } pjsip_via_hdr;
Index: pjproject/trunk/pjsip/include/pjsip/sip_msg_i.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_msg_i.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_msg_i.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_parser.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_parser.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_parser.h	(revision 65)
@@ -337,5 +337,5 @@
 };
 
-void pjsip_parse_param_imp(  pj_scanner *scanner,
+void pjsip_parse_param_imp(  pj_scanner *scanner, pj_pool_t *pool,
 			     pj_str_t *pname, pj_str_t *pvalue,
 			     unsigned opt);
Index: pjproject/trunk/pjsip/include/pjsip/sip_private.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_private.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_private.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_resolve.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_resolve.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_resolve.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_transaction.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_transaction.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_transaction.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_transport.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_transport.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_transport.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_transport_udp.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_transport_udp.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_transport_udp.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_types.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_types.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_types.h	(revision 65)
Index: pjproject/trunk/pjsip/include/pjsip/sip_uri.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_uri.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_uri.h	(revision 65)
@@ -85,4 +85,29 @@
 PJ_DECL(void) pjsip_param_clone(pj_pool_t *pool, pjsip_param *dst_list,
 				const pjsip_param *src_list);
+
+/**
+ * Duplicate the parameters.
+ *
+ * @param pool		Pool to allocate memory from.
+ * @param dst_list	Destination list.
+ * @param src_list	Source list.
+ */
+PJ_DECL(void) pjsip_param_shallow_clone(pj_pool_t *pool, 
+					pjsip_param *dst_list,
+					const pjsip_param *src_list);
+
+/**
+ * Print parameters.
+ *
+ * @param param_list	The parameter list.
+ * @param buf		Buffer.
+ * @param size		Size of buffer.
+ * @param sep		Separator character (either ';' or ',').
+ *
+ * @return		The number of bytes printed, or -1 on errr.
+ */
+PJ_DECL(pj_ssize_t) pjsip_param_print_on(const pjsip_param *param_list,
+					 char *buf, pj_size_t size,
+					 int sep);
 
 /**
Index: pjproject/trunk/pjsip/include/pjsip/sip_util.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_util.h	(revision 64)
+++ pjproject/trunk/pjsip/include/pjsip/sip_util.h	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-simple/event_notify.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-simple/event_notify.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-simple/event_notify.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-simple/event_notify_msg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-simple/event_notify_msg.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-simple/event_notify_msg.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-simple/messaging.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-simple/messaging.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-simple/messaging.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-simple/pidf.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-simple/pidf.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-simple/pidf.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-simple/presence.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-simple/presence.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-simple/presence.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-simple/xpidf.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-simple/xpidf.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-simple/xpidf.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_dialog.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-ua/sip_dialog.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-ua/sip_dialog.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_ua.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-ua/sip_ua.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-ua/sip_ua.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_ua_private.h
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-ua/sip_ua_private.h	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip-ua/sip_ua_private.h	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip/sip_auth.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_auth.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_auth.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c	(revision 65)
@@ -48,4 +48,5 @@
     pjsip_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_AUTHORIZATION, &authorization_hdr_vptr);
+    pj_list_init(&hdr->credential.common.other_param);
     return hdr;
 }
@@ -55,4 +56,5 @@
     pjsip_proxy_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_PROXY_AUTHORIZATION, &authorization_hdr_vptr);
+    pj_list_init(&hdr->credential.common.other_param);
     return hdr;
 }
@@ -77,5 +79,9 @@
     copy_advance_pair(buf, ", qop=", 6, cred->qop);
     copy_advance_pair(buf, ", nc=", 5, cred->nc);
-    copy_advance(buf, cred->other_param);
+    
+    printed = pjsip_param_print_on(&cred->other_param, buf, endbuf-buf, ',');
+    if (printed < 0)
+	return -1;
+    buf += printed;
 
     return (int) (buf-startbuf);
@@ -148,5 +154,5 @@
 	pj_strdup(pool, &hdr->credential.digest.qop, &rhs->credential.digest.qop);
 	pj_strdup(pool, &hdr->credential.digest.nc, &rhs->credential.digest.nc);
-	pj_strdup(pool, &hdr->credential.digest.other_param, &rhs->credential.digest.other_param);
+	pjsip_param_clone(pool, &hdr->credential.digest.other_param, &rhs->credential.digest.other_param);
     } else if (pj_stricmp2(&hdr->scheme, "pgp") == 0) {
 	pj_assert(0);
@@ -166,4 +172,6 @@
     pjsip_authorization_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
+    pjsip_param_shallow_clone(pool, &hdr->credential.common.other_param, 
+			      &rhs->credential.common.other_param);
     return hdr;
 }
@@ -193,4 +201,5 @@
     pjsip_www_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_WWW_AUTHENTICATE, &www_authenticate_hdr_vptr);
+    pj_list_init(&hdr->challenge.common.other_param);
     return hdr;
 }
@@ -201,4 +210,5 @@
     pjsip_proxy_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_PROXY_AUTHENTICATE, &www_authenticate_hdr_vptr);
+    pj_list_init(&hdr->challenge.common.other_param);
     return hdr;
 }
@@ -221,5 +231,9 @@
     copy_advance_pair(buf, ",algorithm=", 11, chal->algorithm);
     copy_advance_pair_quote_cond(buf, ",qop=", 5, chal->qop, '"', '"');
-    copy_advance(buf, chal->other_param);
+    
+    printed = pjsip_param_print_on(&chal->other_param, buf, endbuf-buf, ',');
+    if (printed < 0)
+	return -1;
+    buf += printed;
 
     return (int)(buf-startbuf);
@@ -286,5 +300,6 @@
 	pj_strdup(pool, &hdr->challenge.digest.algorithm, &rhs->challenge.digest.algorithm);
 	pj_strdup(pool, &hdr->challenge.digest.qop, &rhs->challenge.digest.qop);
-	pj_strdup(pool, &hdr->challenge.digest.other_param, &rhs->challenge.digest.other_param);
+	pjsip_param_clone(pool, &hdr->challenge.digest.other_param, 
+			  &rhs->challenge.digest.other_param);
     } else if (pj_stricmp2(&hdr->scheme, "pgp") == 0) {
 	pj_assert(0);
@@ -305,6 +320,8 @@
     pjsip_www_authenticate_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
-    return hdr;
-}
-
-
+    pjsip_param_shallow_clone(pool, &hdr->challenge.common.other_param, 
+			      &rhs->challenge.common.other_param);
+    return hdr;
+}
+
+
Index: pjproject/trunk/pjsip/src/pjsip/sip_auth_parser.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_auth_parser.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_auth_parser.c	(revision 65)
@@ -23,4 +23,5 @@
 #include <pj/string.h>
 #include <pj/except.h>
+#include <pj/pool.h>
 
 static pjsip_hdr* parse_hdr_authorization       ( pjsip_parse_ctx *ctx );
@@ -67,8 +68,11 @@
                                      pjsip_digest_credential *cred)
 {
+    pj_list_init(&cred->other_param);
+
     for (;;) {
 	pj_str_t name, value;
 
-	pjsip_parse_param_imp(scanner, &name, &value,PJSIP_PARSE_REMOVE_QUOTE);
+	pjsip_parse_param_imp(scanner, pool, &name, &value,
+			      PJSIP_PARSE_REMOVE_QUOTE);
 
 	if (!pj_stricmp(&name, &pjsip_USERNAME_STR)) {
@@ -103,5 +107,8 @@
 
 	} else {
-	    pjsip_concat_param_imp(&cred->other_param,pool,&name,&value, ',');
+	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    p->name = name;
+	    p->value = value;
+	    pj_list_insert_before(&cred->other_param, p);
 	}
 
@@ -127,8 +134,11 @@
                                     pjsip_digest_challenge *chal)
 {
+    pj_list_init(&chal->other_param);
+
     for (;;) {
 	pj_str_t name, value;
 
-	pjsip_parse_param_imp(scanner, &name, &value,PJSIP_PARSE_REMOVE_QUOTE);
+	pjsip_parse_param_imp(scanner, pool, &name, &value,
+			      PJSIP_PARSE_REMOVE_QUOTE);
 
 	if (!pj_stricmp(&name, &pjsip_REALM_STR)) {
@@ -159,6 +169,8 @@
 
 	} else {
-	    pjsip_concat_param_imp(&chal->other_param, pool, 
-                                   &name, &value, ',');
+	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    p->name = name;
+	    p->value = value;
+	    pj_list_insert_before(&chal->other_param, p);
 	}
 
Index: pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip/sip_errno.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_errno.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_errno.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip/sip_msg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 65)
@@ -869,4 +869,5 @@
     init_hdr(hdr, PJSIP_H_CONTACT, &contact_hdr_vptr);
     hdr->expires = -1;
+    pj_list_init(&hdr->other_param);
     return hdr;
 }
@@ -884,5 +885,4 @@
 	*p++ = ' ';
 	*p++ = '*';
-	*p = '\0';
 	return p - buf;
 
@@ -928,15 +928,15 @@
 	}
 
-	if (hdr->other_param.slen) {
-	    copy_advance(buf, hdr->other_param);
-	}
-
-	*buf = '\0';
+	printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,';');
+	if (printed < 0)
+	    return printed;
+	buf += printed;
+
 	return buf-startbuf;
     }
 }
 
-static pjsip_contact_hdr* pjsip_contact_hdr_clone( pj_pool_t *pool, 
-					           const pjsip_contact_hdr *rhs)
+static pjsip_contact_hdr* pjsip_contact_hdr_clone(pj_pool_t *pool, 
+					          const pjsip_contact_hdr *rhs)
 {
     pjsip_contact_hdr *hdr = pjsip_contact_hdr_create(pool);
@@ -949,13 +949,15 @@
     hdr->q1000 = rhs->q1000;
     hdr->expires = rhs->expires;
-    pj_strdup(pool, &hdr->other_param, &rhs->other_param);
-    return hdr;
-}
-
-static pjsip_contact_hdr* pjsip_contact_hdr_shallow_clone( pj_pool_t *pool,
-							   const pjsip_contact_hdr *rhs)
+    pjsip_param_clone(pool, &hdr->other_param, &rhs->other_param);
+    return hdr;
+}
+
+static pjsip_contact_hdr* 
+pjsip_contact_hdr_shallow_clone( pj_pool_t *pool,
+				 const pjsip_contact_hdr *rhs)
 {
     pjsip_contact_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
+    pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
     return hdr;
 }
@@ -965,6 +967,8 @@
  * Content-Type header..
  */
-static int pjsip_ctype_hdr_print( pjsip_ctype_hdr *hdr, char *buf, pj_size_t size);
-static pjsip_ctype_hdr* pjsip_ctype_hdr_clone( pj_pool_t *pool, const pjsip_ctype_hdr *hdr);
+static int pjsip_ctype_hdr_print( pjsip_ctype_hdr *hdr, char *buf, 
+				  pj_size_t size);
+static pjsip_ctype_hdr* pjsip_ctype_hdr_clone(pj_pool_t *pool, 
+					      const pjsip_ctype_hdr *hdr);
 #define pjsip_ctype_hdr_shallow_clone pjsip_ctype_hdr_clone
 
@@ -1071,4 +1075,5 @@
     pjsip_from_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_FROM, &fromto_hdr_vptr);
+    pj_list_init(&hdr->other_param);
     return hdr;
 }
@@ -1078,4 +1083,5 @@
     pjsip_to_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_TO, &fromto_hdr_vptr);
+    pj_list_init(&hdr->other_param);
     return hdr;
 }
@@ -1106,5 +1112,6 @@
     *buf++ = ' ';
 
-    printed = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, hdr->uri, buf, endbuf-buf);
+    printed = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, hdr->uri, 
+			      buf, endbuf-buf);
     if (printed < 1)
 	return -1;
@@ -1113,6 +1120,9 @@
 
     copy_advance_pair(buf, ";tag=", 5, hdr->tag);
-    if (hdr->other_param.slen)
-	copy_advance(buf, hdr->other_param);
+
+    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, ';');
+    if (printed < 0)
+	return -1;
+    buf += printed;
 
     return buf-startbuf;
@@ -1129,14 +1139,16 @@
     hdr->uri = pjsip_uri_clone(pool, rhs->uri);
     pj_strdup( pool, &hdr->tag, &rhs->tag);
-    pj_strdup( pool, &hdr->other_param, &rhs->other_param);
-
-    return hdr;
-}
-
-static pjsip_fromto_hdr* pjsip_fromto_hdr_shallow_clone( pj_pool_t *pool,
-							 const pjsip_fromto_hdr *rhs)
+    pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param);
+
+    return hdr;
+}
+
+static pjsip_fromto_hdr* 
+pjsip_fromto_hdr_shallow_clone( pj_pool_t *pool,
+				const pjsip_fromto_hdr *rhs)
 {
     pjsip_fromto_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
+    pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param);
     return hdr;
 }
@@ -1188,5 +1200,5 @@
     init_hdr(hdr, PJSIP_H_RECORD_ROUTE, &routing_hdr_vptr);
     pjsip_name_addr_init(&hdr->name_addr);
-    pj_memset(&hdr->other_param, 0, sizeof(hdr->other_param));
+    pj_list_init(&hdr->other_param);
     return hdr;
 }
@@ -1197,5 +1209,5 @@
     init_hdr(hdr, PJSIP_H_ROUTE, &routing_hdr_vptr);
     pjsip_name_addr_init(&hdr->name_addr);
-    pj_memset(&hdr->other_param, 0, sizeof(hdr->other_param));
+    pj_list_init(&hdr->other_param);
     return hdr;
 }
@@ -1226,12 +1238,14 @@
     *buf++ = ' ';
 
-    printed = pjsip_uri_print(PJSIP_URI_IN_ROUTING_HDR, &hdr->name_addr, buf, endbuf-buf);
+    printed = pjsip_uri_print(PJSIP_URI_IN_ROUTING_HDR, &hdr->name_addr, buf, 
+			      endbuf-buf);
     if (printed < 1)
 	return -1;
     buf += printed;
 
-    if (hdr->other_param.slen) {
-	copy_advance(buf, hdr->other_param);
-    }
+    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, ';');
+    if (printed < 0)
+	return -1;
+    buf += printed;
 
     return buf-startbuf;
@@ -1246,5 +1260,5 @@
     pjsip_name_addr_init(&hdr->name_addr);
     pjsip_name_addr_assign(pool, &hdr->name_addr, &rhs->name_addr);
-    pj_strdup( pool, &hdr->other_param, &rhs->other_param);
+    pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param);
     return hdr;
 }
@@ -1255,4 +1269,5 @@
     pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
+    pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param);
     return hdr;
 }
@@ -1331,4 +1346,5 @@
     hdr->ttl_param = -1;
     hdr->rport_param = -1;
+    pj_list_init(&hdr->other_param);
     return hdr;
 }
@@ -1390,7 +1406,10 @@
     copy_advance_pair(buf, ";received=", 10, hdr->recvd_param);
     copy_advance_pair(buf, ";branch=", 8, hdr->branch_param);
-    copy_advance(buf, hdr->other_param);
     
-    *buf = '\0';
+    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, ';');
+    if (printed < 0)
+	return -1;
+    buf += printed;
+    
     return buf-startbuf;
 }
@@ -1408,5 +1427,5 @@
     pj_strdup(pool, &hdr->recvd_param, &rhs->recvd_param);
     pj_strdup(pool, &hdr->branch_param, &rhs->branch_param);
-    pj_strdup(pool, &hdr->other_param, &rhs->other_param);
+    pjsip_param_clone(pool, &hdr->other_param, &rhs->other_param);
     return hdr;
 }
@@ -1417,4 +1436,5 @@
     pjsip_via_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
+    pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
     return hdr;
 }
Index: pjproject/trunk/pjsip/src/pjsip/sip_parser.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_parser.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_parser.c	(revision 65)
@@ -114,7 +114,9 @@
 				   pjsip_parser_err_report *err_list);
 static void	    int_parse_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,
 				      pj_str_t *hname,
 				      pj_str_t *hvalue );
@@ -126,4 +128,5 @@
 					   pjsip_status_line *line);
 static void	    int_parse_user_pass( pj_scanner *scanner, 
+					 pj_pool_t *pool,
 					 pj_str_t *user, 
 					 pj_str_t *pass);
@@ -287,9 +290,9 @@
     status = pj_cis_dup(&pjsip_USER_SPEC, &pjsip_ALNUM_SPEC);
     PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
-    pj_cis_add_str( &pjsip_USER_SPEC, ESCAPED USER_UNRESERVED );
+    pj_cis_add_str( &pjsip_USER_SPEC, UNRESERVED ESCAPED USER_UNRESERVED );
 
     status = pj_cis_dup(&pjsip_PASSWD_SPEC, &pjsip_ALNUM_SPEC);
     PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
-    pj_cis_add_str( &pjsip_PASSWD_SPEC, MARK ESCAPED PASS);
+    pj_cis_add_str( &pjsip_PASSWD_SPEC, UNRESERVED ESCAPED PASS);
 
     status = pj_cis_init(&cis_buf, &pjsip_PROBE_USER_HOST_SPEC);
@@ -866,5 +869,5 @@
 
 /* Parse parameter (pname ["=" pvalue]). */
-void pjsip_parse_param_imp(  pj_scanner *scanner,
+void pjsip_parse_param_imp(  pj_scanner *scanner, pj_pool_t *pool,
 			     pj_str_t *pname, pj_str_t *pvalue,
 			     unsigned option)
@@ -872,5 +875,5 @@
     /* pname */
     pj_scan_get(scanner, &pjsip_PARAM_CHAR_SPEC, pname);
-    pj_str_unescape(pname);
+    *pname = pj_str_unescape(pool, pname);
 
     /* pvalue, if any */
@@ -886,5 +889,5 @@
 	} else {
 	    pj_scan_get(scanner, &pjsip_PARAM_CHAR_SPEC, pvalue);
-	    pj_str_unescape(pvalue);
+	    *pvalue = pj_str_unescape(pool, pvalue);
 	}
     } else {
@@ -895,5 +898,5 @@
 
 /* Parse parameter (";" pname ["=" pvalue]). */
-static void int_parse_param( pj_scanner *scanner,
+static void int_parse_param( pj_scanner *scanner, pj_pool_t *pool,
 			     pj_str_t *pname, pj_str_t *pvalue)
 {
@@ -902,9 +905,10 @@
 
     /* Get pname and optionally pvalue */
-    pjsip_parse_param_imp(scanner, pname, pvalue, 0);
+    pjsip_parse_param_imp(scanner, pool, pname, pvalue, 
+			  PJSIP_PARSE_REMOVE_QUOTE);
 }
 
 /* Parse header parameter. */
-static void int_parse_hparam( pj_scanner *scanner,
+static void int_parse_hparam( pj_scanner *scanner, pj_pool_t *pool,
 			      pj_str_t *hname, pj_str_t *hvalue )
 {
@@ -914,5 +918,5 @@
     /* hname */
     pj_scan_get(scanner, &pjsip_HDR_CHAR_SPEC, hname);
-    pj_str_unescape(hname);
+    *hname = pj_str_unescape(pool, hname);
 
     /* pvalue, if any */
@@ -920,5 +924,5 @@
 	pj_scan_get_char(scanner);
 	pj_scan_get(scanner, &pjsip_HDR_CHAR_SPEC, hvalue);
-	pj_str_unescape(hvalue);
+	*hvalue = pj_str_unescape(pool, hvalue);
     } else {
 	hvalue->ptr = NULL;
@@ -937,5 +941,4 @@
 	pj_scan_get_char(scanner);
 	pj_scan_get(scanner, &pjsip_DIGIT_SPEC, &port);
-	pj_str_unescape(&port);
 	*p_port = pj_strtoul(&port);
     } else {
@@ -962,14 +965,14 @@
 
 /* Parse user:pass tokens in an URI. */
-static void int_parse_user_pass( pj_scanner *scanner, 
+static void int_parse_user_pass( pj_scanner *scanner, pj_pool_t *pool,
 				 pj_str_t *user, pj_str_t *pass)
 {
     pj_scan_get( scanner, &pjsip_USER_SPEC, user);
-    pj_str_unescape(user);
+    *user = pj_str_unescape(pool, user);
 
     if ( *scanner->curptr == ':') {
 	pj_scan_get_char( scanner );
 	pj_scan_get( scanner, &pjsip_PASSWD_SPEC, pass);
-	pj_str_unescape(pass);
+	*pass = pj_str_unescape(pool, pass);
     } else {
 	pass->ptr = NULL;
@@ -1105,5 +1108,5 @@
 
     if (int_is_next_user(scanner)) {
-	int_parse_user_pass(scanner, &url->user, &url->passwd);
+	int_parse_user_pass(scanner, pool, &url->user, &url->passwd);
     }
 
@@ -1115,5 +1118,5 @@
 	pj_str_t pname, pvalue;
 
-	int_parse_param( scanner, &pname, &pvalue);
+	int_parse_param( scanner, pool, &pname, &pvalue);
 
 	if (!parser_stricmp(pname, pjsip_USER_STR) && pvalue.slen) {
@@ -1147,5 +1150,5 @@
 	pjsip_param *param;
 	param = pj_pool_alloc(pool, sizeof(pjsip_param));
-	int_parse_hparam(scanner, &param->name, &param->value);
+	int_parse_hparam(scanner, pool, &param->name, &param->value);
 	pj_list_insert_before(&url->header_param, param);
 	hsep = '&';
@@ -1168,4 +1171,7 @@
     if (*scanner->curptr == '"') {
 	pj_scan_get_quote( scanner, '"', '"', &name_addr->display);
+	/* Trim the leading and ending quote */
+	name_addr->display.ptr++;
+	name_addr->display.slen -= 2;
 
     } else if (*scanner->curptr != '<') {
@@ -1324,5 +1330,5 @@
 	pj_str_t pname, pvalue;
 
-	int_parse_param( scanner, &pname, &pvalue);
+	int_parse_param( scanner, pool, &pname, &pvalue);
 	if (!parser_stricmp(pname, pjsip_Q_STR) && pvalue.slen) {
 	    char *dot_pos = memchr(pvalue.ptr, '.', pvalue.slen);
@@ -1338,5 +1344,8 @@
 
 	} else {
-	    concat_param(&hdr->other_param, pool, &pname, &pvalue);
+	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    p->name = pname;
+	    p->value = pvalue;
+	    pj_list_insert_before(&hdr->other_param, p);
 	}
     }
@@ -1413,5 +1422,5 @@
     while (*scanner->curptr == ';') {
 	pj_str_t pname, pvalue;
-	int_parse_param(scanner, &pname, &pvalue);
+	int_parse_param(scanner, ctx->pool, &pname, &pvalue);
 	concat_param(&hdr->media.param, ctx->pool, &pname, &pvalue);
     }
@@ -1466,5 +1475,5 @@
 	pj_str_t pname, pvalue;
 
-	int_parse_param( scanner, &pname, &pvalue);
+	int_parse_param( scanner, pool, &pname, &pvalue);
 
 	if (!parser_stricmp(pname, pjsip_TAG_STR)) {
@@ -1472,5 +1481,8 @@
 	    
 	} else {
-	    concat_param(&hdr->other_param, pool, &pname, &pvalue);
+	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    p->name = pname;
+	    p->value = pvalue;
+	    pj_list_insert_before(&hdr->other_param, p);
 	}
     }
@@ -1547,5 +1559,5 @@
 	pj_str_t pname, pvalue;
 
-	int_parse_param( scanner, &pname, &pvalue);
+	int_parse_param( scanner, pool, &pname, &pvalue);
 
 	if (!parser_stricmp(pname, pjsip_BRANCH_STR) && pvalue.slen) {
@@ -1567,8 +1579,10 @@
 		hdr->rport_param = 0;
 	} else {
-	    concat_param( &hdr->other_param, pool, &pname, &pvalue);
-	}
-    }
-
+	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    p->name = pname;
+	    p->value = pvalue;
+	    pj_list_insert_before(&hdr->other_param, p);
+	}
+    }
 }
 
@@ -1603,7 +1617,9 @@
 
     pj_memcpy(&hdr->name_addr, temp, sizeof(*temp));
-    if (*scanner->curptr == ';') {
-	pj_scan_get_until(scanner, &pjsip_NEWLINE_OR_EOF_SPEC, 
-                          &hdr->other_param);
+
+    while (*scanner->curptr == ';') {
+	pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	int_parse_param(scanner, pool, &p->name, &p->value);
+	pj_list_insert_before(&hdr->other_param, p);
     }
 }
Index: pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_resolve.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_resolve.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transaction.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transaction.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip/sip_transport.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsip/sip_uri.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_uri.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_uri.c	(revision 65)
@@ -69,4 +69,42 @@
 }
 
+
+PJ_DEF(void) pjsip_param_shallow_clone( pj_pool_t *pool, 
+					pjsip_param *dst_list,
+					const pjsip_param *src_list)
+{
+    const pjsip_param *p = src_list->next;
+
+    pj_list_init(dst_list);
+    while (p != src_list) {
+	pjsip_param *new_param = pj_pool_alloc(pool, sizeof(pjsip_param));
+	new_param->name = p->name;
+	new_param->value = p->value;
+	pj_list_insert_before(dst_list, new_param);
+	p = p->next;
+    }
+}
+
+PJ_DEF(pj_ssize_t) pjsip_param_print_on( const pjsip_param *param_list,
+					 char *buf, pj_size_t size,
+					 int sep)
+{
+    const pjsip_param *p = param_list->next;
+    char *startbuf = buf;
+    char *endbuf = buf + size;
+
+    while (p != param_list) {
+	*buf++ = (char)sep;
+	copy_advance_escape(buf, p->name, pjsip_PARAM_CHAR_SPEC);
+	if (p->value.slen) {
+	    *buf++ = '=';
+	    copy_advance_escape(buf, p->value, pjsip_PARAM_CHAR_SPEC);
+	}
+	p = p->next;
+    }
+    return buf-startbuf;
+}
+
+
 /*
  * URI stuffs
@@ -255,14 +293,8 @@
 
     /* Other param. */
-    param = url->other_param.next;
-    while (param != &url->other_param) {
-	*buf++ = ';';
-	copy_advance_escape(buf, param->name, pjsip_PARAM_CHAR_SPEC);
-	if (param->value.slen) {
-	    *buf++ = '=';
-	    copy_advance_escape(buf, param->value, pjsip_PARAM_CHAR_SPEC);
-	}
-	param = param->next;
-    }
+    printed = pjsip_param_print_on(&url->other_param, buf, endbuf-buf, ';');
+    if (printed < 0)
+	return -1;
+    buf += printed;
 
     /* Header param. */
@@ -473,6 +505,9 @@
 
     if (context != PJSIP_URI_IN_REQ_URI) {
-	copy_advance(buf, name->display);
 	if (name->display.slen) {
+	    if (endbuf-buf < 8) return -1;
+	    *buf++ = '"';
+	    copy_advance(buf, name->display);
+	    *buf++ = '"';
 	    *buf++ = ' ';
 	}
Index: pjproject/trunk/pjsip/src/pjsip/sip_util.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_util.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsip/sip_util.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsua/getopt.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua/getopt.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsua/getopt.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsua/getopt.h
===================================================================
--- pjproject/trunk/pjsip/src/pjsua/getopt.h	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsua/getopt.h	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsua/main.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua/main.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsua/main.c	(revision 65)
Index: pjproject/trunk/pjsip/src/pjsua/misc.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua/misc.c	(revision 64)
+++ pjproject/trunk/pjsip/src/pjsua/misc.c	(revision 65)
Index: pjproject/trunk/pjsip/src/test-pjsip/main.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/main.c	(revision 64)
+++ pjproject/trunk/pjsip/src/test-pjsip/main.c	(revision 65)
Index: pjproject/trunk/pjsip/src/test-pjsip/msg.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/msg.c	(revision 64)
+++ pjproject/trunk/pjsip/src/test-pjsip/msg.c	(revision 65)
Index: pjproject/trunk/pjsip/src/test-pjsip/test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/test.c	(revision 64)
+++ pjproject/trunk/pjsip/src/test-pjsip/test.c	(revision 65)
Index: pjproject/trunk/pjsip/src/test-pjsip/test.h
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/test.h	(revision 64)
+++ pjproject/trunk/pjsip/src/test-pjsip/test.h	(revision 65)
Index: pjproject/trunk/pjsip/src/test-pjsip/uri.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/uri.c	(revision 64)
+++ pjproject/trunk/pjsip/src/test-pjsip/uri.c	(revision 65)
@@ -26,14 +26,19 @@
 		    "0123456789"
 #define MARK	    "-_.!~*'()"
-#define USER	    "&=+$,;?/%"
-#define PASS	    "&=+$,%"
-#define PARAM_CHAR  "[]/:&+$" MARK "%"
-
-#define POOL_SIZE	4096
-
-static pj_uint32_t parse_len, parse_time, print_time;
+#define USER_CHAR   ALPHANUM MARK "&=+$,;?/"
+#define PASS_CHAR   ALPHANUM MARK "&=+$,"
+#define PARAM_CHAR  ALPHANUM MARK "[]/:&+$"
+
+#define POOL_SIZE	4000
+#define LOOP_COUNT	1000
+#define AVERAGE_URL_LEN	80
+#define THREAD_COUNT	4
+
+static pj_uint32_t parse_len;
+static pj_timestamp parse_time, print_time;
 
 
 /* URI creator functions. */
+static pjsip_uri *create_uri0( pj_pool_t *pool );
 static pjsip_uri *create_uri1( pj_pool_t *pool );
 static pjsip_uri *create_uri2( pj_pool_t *pool );
@@ -53,6 +58,4 @@
 static pjsip_uri *create_uri16( pj_pool_t *pool );
 static pjsip_uri *create_uri17( pj_pool_t *pool );
-static pjsip_uri *create_uri18( pj_pool_t *pool );
-static pjsip_uri *create_uri19( pj_pool_t *pool );
 static pjsip_uri *create_dummy( pj_pool_t *pool );
 
@@ -71,15 +74,15 @@
 	PJ_SUCCESS,
 	"sip:localhost",
+	&create_uri0
+    },
+    {
+	PJ_SUCCESS,
+	"sip:user@localhost",
 	&create_uri1
     },
     {
 	PJ_SUCCESS,
-	"sip:user@localhost",
-	&create_uri2
-    },
-    {
-	PJ_SUCCESS,
 	"sip:user:password@localhost:5060",
-	&create_uri3,
+	&create_uri2,
     },
     {
@@ -87,11 +90,11 @@
 	ERR_NOT_EQUAL,
 	"sip:localhost:5060",
+	&create_uri3
+    },
+    {
+	/* All recognized parameters. */
+	PJ_SUCCESS,
+	"sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK",
 	&create_uri4
-    },
-    {
-	/* All recognized parameters. */
-	PJ_SUCCESS,
-	"sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK",
-	&create_uri5
     },
     {
@@ -100,5 +103,5 @@
 	"sip:localhost;pickup=hurry;user=phone;message=I%20am%20sorry"
 	"?Subject=Hello%20There&Server=SIP%20Server",
-	&create_uri6
+	&create_uri5
     },
     {
@@ -106,5 +109,5 @@
 	PJ_SUCCESS,
 	"sips:localhost",
-	&create_uri7,
+	&create_uri6,
     },
     {
@@ -112,5 +115,5 @@
 	PJ_SUCCESS,
 	"<sip:localhost>",
-	&create_uri8
+	&create_uri7
     },
     {
@@ -120,35 +123,35 @@
 	PJ_SUCCESS,
 	"  Power Administrator  <sips:localhost>",
+	&create_uri8
+    },
+    {
+	/* Name address. */
+	PJ_SUCCESS,
+	" \"User\" <sip:user@localhost:5071>",
 	&create_uri9
     },
     {
-	/* Name address. */
-	PJ_SUCCESS,
-	" \"User\" <sip:user@localhost:5071>",
-	&create_uri10
-    },
-    {
 	/* Escaped sequence in display name (display=Strange User\"\\\"). */
 	PJ_SUCCESS,
 	" \"Strange User\\\"\\\\\\\"\" <sip:localhost>",
+	&create_uri10,
+    },
+    {
+	/* Errorneous escaping in display name. */
+	ERR_SYNTAX_ERR,
+	" \"Rogue User\\\" <sip:localhost>",
 	&create_uri11,
     },
     {
-	/* Errorneous escaping in display name. */
-	ERR_SYNTAX_ERR,
-	" \"Rogue User\\\" <sip:localhost>",
+	/* Dangling quote in display name, but that should be OK. */
+	PJ_SUCCESS,
+	"Strange User\" <sip:localhost>",
 	&create_uri12,
     },
     {
-	/* Dangling quote in display name, but that should be OK. */
-	PJ_SUCCESS,
-	"Strange User\" <sip:localhost>",
+	/* Special characters in parameter value must be quoted. */
+	PJ_SUCCESS,
+	"sip:localhost;pvalue=\"hello world\"",
 	&create_uri13,
-    },
-    {
-	/* Special characters in parameter value must be quoted. */
-	PJ_SUCCESS,
-	"sip:localhost;pvalue=\"hello world\"",
-	&create_uri14,
     },
     {
@@ -157,13 +160,13 @@
 	 */
 	PJ_SUCCESS,
-	"This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%09a&Zz=+$,@"
+	"This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%40a&Zz=+$,@"
 	"my_proxy09.MY-domain.com:9801>",
+	&create_uri14,
+    },
+    {
+	/* Another excercise to the allowed character sets to the hostname. */
+	PJ_SUCCESS,
+	"sip:" ALPHANUM "-_.com",
 	&create_uri15,
-    },
-    {
-	/* Another excercise to the allowed character sets to the hostname. */
-	PJ_SUCCESS,
-	"sip:" ALPHANUM "-_.com",
-	&create_uri16,
     },
     {
@@ -172,6 +175,6 @@
 	 */
 	PJ_SUCCESS,
-	"sip:" ALPHANUM USER ":" ALPHANUM PASS "@host",
-	&create_uri17,
+	"sip:" USER_CHAR ":" PASS_CHAR "@host",
+	&create_uri16,
     },
     {
@@ -180,10 +183,10 @@
 	 */
 	PJ_SUCCESS,
-	"sip:host;user=ip;" ALPHANUM PARAM_CHAR "=" ALPHANUM PARAM_CHAR 
+	"sip:host;user=ip;" PARAM_CHAR "%21=" PARAM_CHAR "%21"
 	";lr;other=1;transport=sctp;other2",
-	&create_uri18,
-    },
-    {
-	/* This should trigger syntax error. */
+	&create_uri17,
+    },
+    {
+	/* 18: This should trigger syntax error. */
 	ERR_SYNTAX_ERR,
 	"sip:",
@@ -191,5 +194,5 @@
     },
     {
-	/* Syntax error: whitespace after scheme. */
+	/* 19: Syntax error: whitespace after scheme. */
 	ERR_SYNTAX_ERR,
 	"sip :host",
@@ -197,5 +200,5 @@
     },
     {
-	/* Syntax error: whitespace before hostname. */
+	/* 20: Syntax error: whitespace before hostname. */
 	ERR_SYNTAX_ERR,
 	"sip: host",
@@ -203,5 +206,5 @@
     },
     {
-	/* Syntax error: invalid port. */
+	/* 21: Syntax error: invalid port. */
 	ERR_SYNTAX_ERR,
 	"sip:user:password",
@@ -209,5 +212,5 @@
     },
     {
-	/* Syntax error: no host. */
+	/* 22: Syntax error: no host. */
 	ERR_SYNTAX_ERR,
 	"sip:user@",
@@ -215,5 +218,5 @@
     },
     {
-	/* Syntax error: no user/host. */
+	/* 23: Syntax error: no user/host. */
 	ERR_SYNTAX_ERR,
 	"sip:@",
@@ -221,5 +224,5 @@
     },
     {
-	/* Syntax error: empty string. */
+	/* 24: Syntax error: empty string. */
 	ERR_SYNTAX_ERR,
 	"",
@@ -228,5 +231,5 @@
 };
 
-static pjsip_uri *create_uri1(pj_pool_t *pool)
+static pjsip_uri *create_uri0(pj_pool_t *pool)
 {
     /* "sip:localhost" */
@@ -237,5 +240,5 @@
 }
 
-static pjsip_uri *create_uri2(pj_pool_t *pool)
+static pjsip_uri *create_uri1(pj_pool_t *pool)
 {
     /* "sip:user@localhost" */
@@ -248,5 +251,5 @@
 }
 
-static pjsip_uri *create_uri3(pj_pool_t *pool)
+static pjsip_uri *create_uri2(pj_pool_t *pool)
 {
     /* "sip:user:password@localhost:5060" */
@@ -261,5 +264,5 @@
 }
 
-static pjsip_uri *create_uri4(pj_pool_t *pool)
+static pjsip_uri *create_uri3(pj_pool_t *pool)
 {
     /* Like: "sip:localhost:5060", but without the port. */
@@ -270,5 +273,5 @@
 }
 
-static pjsip_uri *create_uri5(pj_pool_t *pool)
+static pjsip_uri *create_uri4(pj_pool_t *pool)
 {
     /* "sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK" */
@@ -286,5 +289,14 @@
 }
 
-static pjsip_uri *create_uri6(pj_pool_t *pool)
+#define param_add(list,pname,pvalue)  \
+	do { \
+	    pjsip_param *param; \
+	    param=pj_pool_alloc(pool, sizeof(pjsip_param)); \
+	    param->name = pj_str(pname); \
+	    param->value = pj_str(pvalue); \
+	    pj_list_insert_before(&list, param); \
+	} while (0)
+
+static pjsip_uri *create_uri5(pj_pool_t *pool)
 {
     /* "sip:localhost;pickup=hurry;user=phone;message=I%20am%20sorry"
@@ -295,11 +307,17 @@
     pj_strdup2(pool, &url->host, "localhost");
     pj_strdup2(pool, &url->user_param, "phone");
-    pj_strdup2(pool, &url->other_param, ";pickup=hurry;message=I%20am%20sorry");
-    pj_strdup2(pool, &url->header_param, "?Subject=Hello%20There&Server=SIP%20Server");
-    return (pjsip_uri*)url;
-
-}
-
-static pjsip_uri *create_uri7(pj_pool_t *pool)
+
+    //pj_strdup2(pool, &url->other_param, ";pickup=hurry;message=I%20am%20sorry");
+    param_add(url->other_param, "pickup", "hurry");
+    param_add(url->other_param, "message", "I am sorry");
+
+    //pj_strdup2(pool, &url->header_param, "?Subject=Hello%20There&Server=SIP%20Server");
+    param_add(url->header_param, "Subject", "Hello There");
+    param_add(url->header_param, "Server", "SIP Server");
+    return (pjsip_uri*)url;
+
+}
+
+static pjsip_uri *create_uri6(pj_pool_t *pool)
 {
     /* "sips:localhost" */
@@ -310,5 +328,5 @@
 }
 
-static pjsip_uri *create_uri8(pj_pool_t *pool)
+static pjsip_uri *create_uri7(pj_pool_t *pool)
 {
     /* "<sip:localhost>" */
@@ -323,5 +341,5 @@
 }
 
-static pjsip_uri *create_uri9(pj_pool_t *pool)
+static pjsip_uri *create_uri8(pj_pool_t *pool)
 {
     /* "  Power Administrator <sips:localhost>" */
@@ -337,5 +355,5 @@
 }
 
-static pjsip_uri *create_uri10(pj_pool_t *pool)
+static pjsip_uri *create_uri9(pj_pool_t *pool)
 {
     /* " \"User\" <sip:user@localhost:5071>" */
@@ -346,5 +364,5 @@
     name_addr->uri = (pjsip_uri*) url;
 
-    pj_strdup2(pool, &name_addr->display, "\"User\"");
+    pj_strdup2(pool, &name_addr->display, "User");
     pj_strdup2(pool, &url->user, "user");
     pj_strdup2(pool, &url->host, "localhost");
@@ -353,5 +371,5 @@
 }
 
-static pjsip_uri *create_uri11(pj_pool_t *pool)
+static pjsip_uri *create_uri10(pj_pool_t *pool)
 {
     /* " \"Strange User\\\"\\\\\\\"\" <sip:localhost>" */
@@ -362,10 +380,10 @@
     name_addr->uri = (pjsip_uri*) url;
 
-    pj_strdup2(pool, &name_addr->display, "\"Strange User\\\"\\\\\\\"\"");
+    pj_strdup2(pool, &name_addr->display, "Strange User\\\"\\\\\\\"");
     pj_strdup2(pool, &url->host, "localhost");
     return (pjsip_uri*)name_addr;
 }
 
-static pjsip_uri *create_uri12(pj_pool_t *pool)
+static pjsip_uri *create_uri11(pj_pool_t *pool)
 {
     /* " \"Rogue User\\\" <sip:localhost>" */
@@ -376,10 +394,10 @@
     name_addr->uri = (pjsip_uri*) url;
 
-    pj_strdup2(pool, &name_addr->display, "\"Rogue User\\\"");
+    pj_strdup2(pool, &name_addr->display, "Rogue User\\");
     pj_strdup2(pool, &url->host, "localhost");
     return (pjsip_uri*)name_addr;
 }
 
-static pjsip_uri *create_uri13(pj_pool_t *pool)
+static pjsip_uri *create_uri12(pj_pool_t *pool)
 {
     /* "Strange User\" <sip:localhost>" */
@@ -395,17 +413,18 @@
 }
 
+static pjsip_uri *create_uri13(pj_pool_t *pool)
+{
+    /* "sip:localhost;pvalue=\"hello world\"" */
+    pjsip_url *url;
+    url = pjsip_url_create(pool, 0);
+    pj_strdup2(pool, &url->host, "localhost");
+    //pj_strdup2(pool, &url->other_param, ";pvalue=\"hello world\"");
+    param_add(url->other_param, "pvalue", "hello world");
+    return (pjsip_uri*)url;
+}
+
 static pjsip_uri *create_uri14(pj_pool_t *pool)
 {
-    /* "sip:localhost;pvalue=\"hello world\"" */
-    pjsip_url *url;
-    url = pjsip_url_create(pool, 0);
-    pj_strdup2(pool, &url->host, "localhost");
-    pj_strdup2(pool, &url->other_param, ";pvalue=\"hello world\"");
-    return (pjsip_uri*)url;
-}
-
-static pjsip_uri *create_uri15(pj_pool_t *pool)
-{
-    /* "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%09a&Zz=+$,@my_proxy09.my-domain.com:9801>" */
+    /* "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%40a&Zz=+$,@my_proxy09.my-domain.com:9801>" */
     pjsip_name_addr *name_addr = pjsip_name_addr_create(pool);
     pjsip_url *url;
@@ -415,6 +434,6 @@
 
     pj_strdup2(pool, &name_addr->display, "This is -. !% *_+`'~ me");
-    pj_strdup2(pool, &url->user, "a19A&=+$,;?/%2c");
-    pj_strdup2(pool, &url->passwd, "%09a&Zz=+$,");
+    pj_strdup2(pool, &url->user, "a19A&=+$,;?/,");
+    pj_strdup2(pool, &url->passwd, "@a&Zz=+$,");
     pj_strdup2(pool, &url->host, "my_proxy09.MY-domain.com");
     url->port = 9801;
@@ -422,10 +441,21 @@
 }
 
+static pjsip_uri *create_uri15(pj_pool_t *pool)
+{
+    /* "sip:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.com" */
+    pjsip_url *url;
+    url = pjsip_url_create(pool, 0);
+    pj_strdup2(pool, &url->host, ALPHANUM "-_.com");
+    return (pjsip_uri*)url;
+}
+
 static pjsip_uri *create_uri16(pj_pool_t *pool)
 {
-    /* "sip:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.com" */
-    pjsip_url *url;
-    url = pjsip_url_create(pool, 0);
-    pj_strdup2(pool, &url->host, ALPHANUM "-_.com");
+    /* "sip:" USER_CHAR ":" PASS_CHAR "@host" */
+    pjsip_url *url;
+    url = pjsip_url_create(pool, 0);
+    pj_strdup2(pool, &url->user, USER_CHAR);
+    pj_strdup2(pool, &url->passwd, PASS_CHAR);
+    pj_strdup2(pool, &url->host, "host");
     return (pjsip_uri*)url;
 }
@@ -433,16 +463,5 @@
 static pjsip_uri *create_uri17(pj_pool_t *pool)
 {
-    /* "sip:" ALPHANUM USER ":" ALPHANUM PASS "@host" */
-    pjsip_url *url;
-    url = pjsip_url_create(pool, 0);
-    pj_strdup2(pool, &url->user, ALPHANUM USER);
-    pj_strdup2(pool, &url->passwd, ALPHANUM PASS);
-    pj_strdup2(pool, &url->host, "host");
-    return (pjsip_uri*)url;
-}
-
-static pjsip_uri *create_uri18(pj_pool_t *pool)
-{
-    /* "sip:host;user=ip;" ALPHANUM PARAM_CHAR "=" ALPHANUM PARAM_CHAR ";lr;other=1;transport=sctp;other2" */
+    /* "sip:host;user=ip;" PARAM_CHAR "%21=" PARAM_CHAR "%21;lr;other=1;transport=sctp;other2" */
     pjsip_url *url;
     url = pjsip_url_create(pool, 0);
@@ -450,5 +469,7 @@
     pj_strdup2(pool, &url->user_param, "ip");
     pj_strdup2(pool, &url->transport_param, "sctp");
-    pj_strdup2(pool, &url->other_param, ";" ALPHANUM PARAM_CHAR "=" ALPHANUM PARAM_CHAR ";other=1;other2");    
+    param_add(url->other_param, PARAM_CHAR "!", PARAM_CHAR "!");
+    param_add(url->other_param, "other", "1");
+    param_add(url->other_param, "other2", "");
     url->lr_param = 1;
     return (pjsip_uri*)url;
@@ -485,8 +506,14 @@
 	 */
 	status = entry->status==ERR_SYNTAX_ERR ? PJ_SUCCESS : -10;
+	if (status != 0) {
+	    PJ_LOG(3,("", "   uri parse error!\n"
+			  "   uri='%s'\n",
+			  entry->str));
+	}
 	goto on_return;
     }
     pj_get_timestamp(&t2);
-    parse_time += t2.u32.lo - t1.u32.lo;
+    pj_sub_timestamp(&t2, &t1);
+    pj_add_timestamp(&parse_time, &t2);
 
     /* Create the reference URI. */
@@ -503,5 +530,10 @@
 	goto on_return;
     }
+    s1.ptr[len] = '\0';
     s1.slen = len;
+
+    pj_get_timestamp(&t2);
+    pj_sub_timestamp(&t2, &t1);
+    pj_add_timestamp(&print_time, &t2);
 
     len = pjsip_uri_print( PJSIP_URI_IN_OTHER, ref_uri, s2.ptr, PJSIP_MAX_URL_SIZE);
@@ -510,12 +542,18 @@
 	goto on_return;
     }
+    s2.ptr[len] = '\0';
     s2.slen = len;
-    pj_get_timestamp(&t2);
-    print_time += t2.u32.lo - t1.u32.lo;
 
     /* Full comparison of parsed URI with reference URI. */
-    if (pjsip_uri_cmp(PJSIP_URI_IN_OTHER, parsed_uri, ref_uri) != 0) {
+    status = pjsip_uri_cmp(PJSIP_URI_IN_OTHER, parsed_uri, ref_uri);
+    if (status != 0) {
 	/* Not equal. See if this is the expected status. */
 	status = entry->status==ERR_NOT_EQUAL ? PJ_SUCCESS : -40;
+	if (status != 0) {
+	    PJ_LOG(3,("", "   uri comparison mismatch, status=%d:\n"
+			  "    uri1='%s'\n"
+			  "    uri2='%s'",
+			  status, s1.ptr, s2.ptr));
+	}
 	goto on_return;
 
@@ -540,10 +578,14 @@
 pj_status_t uri_test()
 {
-    unsigned i;
+    unsigned i, loop;
     pj_pool_t *pool;
     pj_status_t status;
-
-    pool = pjsip_endpt_create_pool(endpt, "", 4000, 4000);
-
+    pj_timestamp zero;
+    pj_highprec_t avg_parse, avg_print;
+
+    zero.u32.hi = zero.u32.lo = 0;
+
+    PJ_LOG(3,("", "  simple test"));
+    pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE);
     for (i=0; i<PJ_ARRAY_SIZE(uri_test_array); ++i) {
 	status = do_uri_test(pool, &uri_test_array[i]);
@@ -551,8 +593,42 @@
 	    PJ_LOG(3,("uri_test", "  error %d when testing entry %d",
 		      status, i));
-	    break;
+	    goto on_return;
 	}
     }
-
+    pjsip_endpt_destroy_pool(endpt, pool);
+
+    PJ_LOG(3,("", "  benchmarking..."));
+    parse_len = 0;
+    parse_time.u32.hi = parse_time.u32.lo = 0;
+    print_time.u32.hi = print_time.u32.lo = 0;
+    pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE);
+    for (loop=0; loop<LOOP_COUNT; ++loop) {
+	for (i=0; i<PJ_ARRAY_SIZE(uri_test_array); ++i) {
+	    status = do_uri_test(pool, &uri_test_array[i]);
+	    if (status != PJ_SUCCESS) {
+		PJ_LOG(3,("uri_test", "  error %d when testing entry %d",
+			  status, i));
+		goto on_return;
+	    }
+	}
+    }
+
+    avg_parse = pj_elapsed_usec(&zero, &parse_time);
+    pj_highprec_mul(avg_parse, AVERAGE_URL_LEN);
+    pj_highprec_div(avg_parse, parse_len);
+    avg_parse = 1000000 / avg_parse;
+
+    avg_print = pj_elapsed_usec(&zero, &print_time);
+    pj_highprec_mul(avg_print, AVERAGE_URL_LEN);
+    pj_highprec_div(avg_print, parse_len);
+    avg_print = 1000000 / avg_print;
+
+    PJ_LOG(3,("", "   done. Average parse=%d url/sec, print=%d url/sec",
+		  (unsigned)avg_parse, (unsigned)avg_print));
+
+    PJ_LOG(3,("", "  multithreaded test"));
+
+
+on_return:
     pjsip_endpt_destroy_pool(endpt, pool);
     return status;
