Index: pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h	(revision 3221)
+++ pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h	(revision 3222)
@@ -296,4 +296,14 @@
     PJSIP_INV_SUPPORT_UPDATE	= 4,
 
+    /**
+     * Indicate support for ICE
+     */
+    PJSIP_INV_SUPPORT_ICE	= 8,
+
+    /**
+     * Require ICE support.
+     */
+    PJSIP_INV_REQUIRE_ICE	= 16,
+
     /** 
      * Require reliable provisional response extension. 
@@ -310,5 +320,5 @@
      * support/want session timer.
      */
-    PJSIP_INV_ALWAYS_USE_TIMER	= 128,
+    PJSIP_INV_ALWAYS_USE_TIMER	= 128
 
 };
Index: pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 3221)
+++ pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 3222)
@@ -305,4 +305,16 @@
 
 #endif
+
+/**
+ * Controls whether PJSUA-LIB should add ICE media feature tag
+ * parameter (the ";+sip.ice" parameter) to Contact header if ICE
+ * is enabled in the config.
+ *
+ * Default: 1
+ */
+#ifndef PJSUA_ADD_ICE_TAGS
+#   define PJSUA_ADD_ICE_TAGS		1
+#endif
+
 
 /**
Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c	(revision 3221)
+++ pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c	(revision 3222)
@@ -778,4 +778,6 @@
     if (*options & PJSIP_INV_REQUIRE_TIMER)
 	*options |= PJSIP_INV_SUPPORT_TIMER;
+    if (*options & PJSIP_INV_REQUIRE_ICE)
+	*options |= PJSIP_INV_SUPPORT_ICE;
 
     /* Get the message in rdata */
@@ -949,10 +951,13 @@
 	const pj_str_t STR_100REL = { "100rel", 6};
 	const pj_str_t STR_TIMER = { "timer", 5};
+	const pj_str_t STR_ICE = { "ice", 3 };
 
 	for (i=0; i<sup_hdr->count; ++i) {
 	    if (pj_stricmp(&sup_hdr->values[i], &STR_100REL)==0)
 		rem_option |= PJSIP_INV_SUPPORT_100REL;
-	    if (pj_stricmp(&sup_hdr->values[i], &STR_TIMER)==0)
+	    else if (pj_stricmp(&sup_hdr->values[i], &STR_TIMER)==0)
 		rem_option |= PJSIP_INV_SUPPORT_TIMER;
+	    else if (pj_stricmp(&sup_hdr->values[i], &STR_ICE)==0)
+		rem_option |= PJSIP_INV_SUPPORT_ICE;
 	}
     }
@@ -966,4 +971,5 @@
 	const pj_str_t STR_REPLACES = { "replaces", 8 };
 	const pj_str_t STR_TIMER = { "timer", 5 };
+	const pj_str_t STR_ICE = { "ice", 3 };
 	unsigned unsupp_cnt = 0;
 	pj_str_t unsupp_tags[PJSIP_GENERIC_ARRAY_MAX_COUNT];
@@ -987,4 +993,8 @@
 		if (!supp)
 		    unsupp_tags[unsupp_cnt++] = req_hdr->values[i];
+	    } else if ((*options & PJSIP_INV_SUPPORT_ICE) &&
+		pj_stricmp(&req_hdr->values[i], &STR_ICE)==0)
+	    {
+		rem_option |= PJSIP_INV_REQUIRE_ICE;
 
 	    } else if (!pjsip_endpt_has_capability(endpt, PJSIP_H_SUPPORTED,
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 3221)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 3222)
@@ -237,4 +237,20 @@
 	acc->cred[acc->cred_cnt++] = pjsua_var.ua_cfg.cred_info[i];
     }
+
+    /* If ICE is enabled, add "+sip.ice" media feature tag in account's
+     * contact params.
+     */
+#if PJSUA_ADD_ICE_TAGS
+    if (pjsua_var.media_cfg.enable_ice) {
+	unsigned new_len;
+	pj_str_t new_prm;
+
+	new_len = acc_cfg->contact_params.slen + 10;
+	new_prm.ptr = (char*)pj_pool_alloc(acc->pool, new_len);
+	pj_strcpy(&new_prm, &acc_cfg->contact_params);
+	pj_strcat2(&new_prm, ";+sip.ice");
+	acc_cfg->contact_params = new_prm;
+    }
+#endif
 
     status = pjsua_pres_init_acc(acc_id);
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 3221)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 3222)
@@ -841,4 +841,6 @@
     if (pjsua_var.acc[acc_id].cfg.require_timer)
 	options |= PJSIP_INV_REQUIRE_TIMER;
+    if (pjsua_var.media_cfg.enable_ice)
+	options |= PJSIP_INV_SUPPORT_ICE;
 
     status = pjsip_inv_verify_request2(rdata, &options, offer, answer, NULL,
