Index: pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 2851)
+++ pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 2852)
@@ -181,5 +181,6 @@
     puts  ("  --id=url            Set the URL of local ID (used in From header)");
     puts  ("  --contact=url       Optionally override the Contact information");
-    puts  ("  --contact-params=S  Append the specified parameters S in Contact URI");
+    puts  ("  --contact-params=S  Append the specified parameters S in Contact header");
+    puts  ("  --contact-uri-params=S  Append the specified parameters S in Contact URI");
     puts  ("  --proxy=url         Optional URL of proxy server to visit");
     puts  ("                      May be specified multiple times");
@@ -472,5 +473,5 @@
 	   OPT_LOCAL_PORT, OPT_IP_ADDR, OPT_PROXY, OPT_OUTBOUND_PROXY, 
 	   OPT_REGISTRAR, OPT_REG_TIMEOUT, OPT_PUBLISH, OPT_ID, OPT_CONTACT,
-	   OPT_BOUND_ADDR, OPT_CONTACT_PARAMS,
+	   OPT_BOUND_ADDR, OPT_CONTACT_PARAMS, OPT_CONTACT_URI_PARAMS,
 	   OPT_100REL, OPT_USE_IMS, OPT_REALM, OPT_USERNAME, OPT_PASSWORD,
 	   OPT_NAMESERVER, OPT_STUN_DOMAIN, OPT_STUN_SRV,
@@ -530,4 +531,5 @@
 	{ "contact",	1, 0, OPT_CONTACT},
 	{ "contact-params",1,0, OPT_CONTACT_PARAMS},
+	{ "contact-uri-params",1,0, OPT_CONTACT_URI_PARAMS},
 	{ "auto-update-nat",	1, 0, OPT_AUTO_UPDATE_NAT},
         { "use-compact-form",	0, 0, OPT_USE_COMPACT_FORM},
@@ -852,4 +854,8 @@
 	    break;
 
+	case OPT_CONTACT_URI_PARAMS:
+	    cur_acc->contact_uri_params = pj_str(pj_optarg);
+	    break;
+
 	case OPT_AUTO_UPDATE_NAT:   /* OPT_AUTO_UPDATE_NAT */
             cur_acc->allow_contact_rewrite  = pj_strtoul(pj_cstr(&tmp, pj_optarg));
@@ -1406,9 +1412,17 @@
     }
 
-    /* Contact parameters */
+    /* Contact header parameters */
     if (acc_cfg->contact_params.slen) {
 	pj_ansi_sprintf(line, "--contact-params %.*s\n", 
 			(int)acc_cfg->contact_params.slen, 
 			acc_cfg->contact_params.ptr);
+	pj_strcat2(result, line);
+    }
+
+    /* Contact URI parameters */
+    if (acc_cfg->contact_uri_params.slen) {
+	pj_ansi_sprintf(line, "--contact-uri-params %.*s\n", 
+			(int)acc_cfg->contact_uri_params.slen, 
+			acc_cfg->contact_uri_params.ptr);
 	pj_strcat2(result, line);
     }
Index: pjproject/trunk/pjsip-apps/src/python/_pjsua.h
===================================================================
--- pjproject/trunk/pjsip-apps/src/python/_pjsua.h	(revision 2851)
+++ pjproject/trunk/pjsip-apps/src/python/_pjsua.h	(revision 2852)
@@ -1654,4 +1654,6 @@
     PyObject	    *auth_initial_algorithm;
     PyObject	    *pidf_tuple_id;
+    PyObject	    *contact_params;
+    PyObject	    *contact_uri_params;
     int		     require_100rel;
     int		     allow_contact_rewrite;
@@ -1676,4 +1678,6 @@
     Py_XDECREF(self->auth_initial_algorithm);
     Py_XDECREF(self->pidf_tuple_id);
+    Py_XDECREF(self->contact_params);
+    Py_XDECREF(self->contact_uri_params);
     Py_XDECREF(self->ka_data);
     self->ob_type->tp_free((PyObject*)self);
@@ -1722,4 +1726,8 @@
     Py_XDECREF(obj->pidf_tuple_id);
     obj->pidf_tuple_id = PyString_FromPJ(&cfg->pidf_tuple_id);
+    Py_XDECREF(obj->contact_params);
+    obj->contact_params = PyString_FromPJ(&cfg->contact_params);
+    Py_XDECREF(obj->contact_uri_params);
+    obj->contact_uri_params = PyString_FromPJ(&cfg->contact_uri_params);
     obj->require_100rel = cfg->require_100rel;
     obj->allow_contact_rewrite = cfg->allow_contact_rewrite;
@@ -1766,4 +1774,6 @@
     cfg->auth_pref.algorithm = PyString_ToPJ(obj->auth_initial_algorithm);
     cfg->pidf_tuple_id = PyString_ToPJ(obj->pidf_tuple_id);
+    cfg->contact_params = PyString_ToPJ(obj->contact_params);
+    cfg->contact_uri_params = PyString_ToPJ(obj->contact_uri_params);
     cfg->require_100rel = obj->require_100rel;
     cfg->allow_contact_rewrite = obj->allow_contact_rewrite;
@@ -1797,4 +1807,6 @@
 	self->auth_initial_algorithm = PyString_FromString("");
 	self->pidf_tuple_id = PyString_FromString("");
+	self->contact_params = PyString_FromString("");
+	self->contact_uri_params = PyString_FromString("");
 	self->ka_data = PyString_FromString("");
     }
@@ -1893,4 +1905,14 @@
 	offsetof(PyObj_pjsua_acc_config, pidf_tuple_id), 0,
 	"PIDF tuple id."
+    },
+    {
+	"contact_params", T_OBJECT_EX,
+	offsetof(PyObj_pjsua_acc_config, contact_params), 0,
+	"Additional parameters for Contact header."
+    },
+    {
+	"contact_uri_params", T_OBJECT_EX,
+	offsetof(PyObj_pjsua_acc_config, contact_uri_params), 0,
+	"Additional parameters for Contact URI."
     },
     {
Index: pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 2851)
+++ pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 2852)
@@ -1667,5 +1667,5 @@
 
     /**
-     * Additional URI parameters that will be appended in the Contact header
+     * Additional parameters that will be appended in the Contact header
      * for this account. This will affect the Contact header in all SIP 
      * messages sent on behalf of this account, including but not limited to
@@ -1677,4 +1677,16 @@
      */
     pj_str_t	    contact_params;
+
+    /**
+     * Additional URI parameters that will be appended in the Contact URI
+     * for this account. This will affect the Contact URI in all SIP
+     * messages sent on behalf of this account, including but not limited to
+     * REGISTER, INVITE, and SUBCRIBE requests or responses.
+     *
+     * The parameters should be preceeded by semicolon, and all strings must
+     * be properly escaped. Example:
+     *	 ";my-param=X;another-param=Hi%20there"
+     */
+    pj_str_t	    contact_uri_params;
 
     /**
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 2851)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 2852)
@@ -713,5 +713,5 @@
 	tmp = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
 	len = pj_ansi_snprintf(tmp, PJSIP_MAX_URL_SIZE,
-			       "<sip:%.*s%s%s%.*s%s:%d;transport=%s%.*s>",
+			       "<sip:%.*s%s%s%.*s%s:%d;transport=%s%.*s>%.*s",
 			       (int)acc->user_part.slen,
 			       acc->user_part.ptr,
@@ -723,4 +723,6 @@
 			       rport,
 			       tp->type_name,
+			       (int)acc->cfg.contact_uri_params.slen,
+			       acc->cfg.contact_uri_params.ptr,
 			       (int)acc->cfg.contact_params.slen,
 			       acc->cfg.contact_params.ptr);
@@ -1699,5 +1701,5 @@
     contact->ptr = (char*)pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
     contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
-				     "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>",
+				     "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s",
 				     (int)acc->display.slen,
 				     acc->display.ptr,
@@ -1713,4 +1715,6 @@
 				     local_port,
 				     transport_param,
+				     (int)acc->cfg.contact_uri_params.slen,
+				     acc->cfg.contact_uri_params.ptr,
 				     (int)acc->cfg.contact_params.slen,
 				     acc->cfg.contact_params.ptr);
@@ -1851,5 +1855,5 @@
     contact->ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
     contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
-				     "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>",
+				     "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s",
 				     (int)acc->display.slen,
 				     acc->display.ptr,
@@ -1865,4 +1869,6 @@
 				     local_port,
 				     transport_param,
+				     (int)acc->cfg.contact_uri_params.slen,
+				     acc->cfg.contact_uri_params.ptr,
 				     (int)acc->cfg.contact_params.slen,
 				     acc->cfg.contact_params.ptr);
