Index: /pjproject/trunk/pjmedia/include/pjmedia/transport_ice.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/transport_ice.h	(revision 1107)
+++ /pjproject/trunk/pjmedia/include/pjmedia/transport_ice.h	(revision 1108)
@@ -67,5 +67,6 @@
 PJ_DECL(pj_status_t) pjmedia_ice_start_ice(pjmedia_transport *tp,
 					   pj_pool_t *pool,
-					   pjmedia_sdp_session *rem_sdp);
+					   pjmedia_sdp_session *rem_sdp,
+					   unsigned media_index);
 PJ_DECL(pj_status_t) pjmedia_ice_stop_ice(pjmedia_transport *tp);
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 1107)
+++ /pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 1108)
@@ -401,5 +401,6 @@
 PJ_DEF(pj_status_t) pjmedia_ice_start_ice(pjmedia_transport *tp,
 					  pj_pool_t *pool,
-					  pjmedia_sdp_session *rem_sdp)
+					  pjmedia_sdp_session *rem_sdp,
+					  unsigned media_index)
 {
     struct transport_ice *tp_ice = (struct transport_ice*)tp;
@@ -407,22 +408,38 @@
     unsigned i, cand_cnt;
     pj_ice_cand cand[PJ_ICE_MAX_CAND];
+    pjmedia_sdp_media *sdp_med;
     pj_str_t uname, pass;
     pj_status_t status;
 
-    /* Find ice-ufrag attribute */
+    PJ_ASSERT_RETURN(tp && pool && rem_sdp, PJ_EINVAL);
+    PJ_ASSERT_RETURN(media_index < rem_sdp->media_count, PJ_EINVAL);
+
+    sdp_med = rem_sdp->media[media_index];
+
+    /* Find ice-ufrag attribute in session descriptor */
     attr = pjmedia_sdp_attr_find2(rem_sdp->attr_count, rem_sdp->attr,
 				  "ice-ufrag", NULL);
     if (attr == NULL) {
-	set_no_ice(tp_ice);
-	return PJ_SUCCESS;
+	/* Find in media descriptor */
+	attr = pjmedia_sdp_attr_find2(sdp_med->attr_count, sdp_med->attr,
+				      "ice-ufrag", NULL);
+	if (attr == NULL) {
+	    set_no_ice(tp_ice);
+	    return PJ_SUCCESS;
+	}
     }
     uname = attr->value;
 
-    /* Find ice-pwd attribute */
+    /* Find ice-pwd attribute in session descriptor */
     attr = pjmedia_sdp_attr_find2(rem_sdp->attr_count, rem_sdp->attr,
 				  "ice-pwd", NULL);
     if (attr == NULL) {
-	set_no_ice(tp_ice);
-	return PJ_SUCCESS;
+	/* Not found, find in media descriptor */
+	attr = pjmedia_sdp_attr_find2(sdp_med->attr_count, sdp_med->attr,
+				      "ice-pwd", NULL);
+	if (attr == NULL) {
+	    set_no_ice(tp_ice);
+	    return PJ_SUCCESS;
+	}
     }
     pass = attr->value;
@@ -430,8 +447,8 @@
     /* Get all candidates */
     cand_cnt = 0;
-    for (i=0; i<rem_sdp->media[0]->attr_count; ++i) {
+    for (i=0; i<sdp_med->attr_count; ++i) {
 	pjmedia_sdp_attr *attr;
 
-	attr = rem_sdp->media[0]->attr[i];
+	attr = sdp_med->attr[i];
 	if (pj_strcmp2(&attr->name, "candidate")!=0)
 	    continue;
Index: /pjproject/trunk/pjnath/src/pjnath-test/ice_test.c
===================================================================
--- /pjproject/trunk/pjnath/src/pjnath-test/ice_test.c	(revision 1107)
+++ /pjproject/trunk/pjnath/src/pjnath-test/ice_test.c	(revision 1108)
@@ -460,5 +460,9 @@
     pj_stun_config_init(&stun_cfg, mem, 0, ioqueue, timer_heap);
 
-    //pj_log_set_level(4);
+#if 1
+    pj_log_set_level(5);
+#endif
+
+    goto test;
 
     /* Basic create/destroy */
@@ -488,7 +492,10 @@
 
     /* Direct communication with two components */
+test:
     rc = perform_ice_test("With two components (RTP and RTCP)", PJ_TRUE, 2, PJ_TRUE, D1, D2, 0, NULL, 0, NULL);
     if (rc != 0)
 	goto on_return;
+
+    goto on_return;
 
     /* Direct communication with mismatch number of components */
@@ -502,5 +509,5 @@
 
 on_return:
-    //pj_log_set_level(3);
+    pj_log_set_level(3);
     pj_ioqueue_destroy(stun_cfg.ioqueue);
     pj_pool_release(pool);
Index: /pjproject/trunk/pjnath/src/pjnath-test/test.c
===================================================================
--- /pjproject/trunk/pjnath/src/pjnath-test/test.c	(revision 1107)
+++ /pjproject/trunk/pjnath/src/pjnath-test/test.c	(revision 1108)
@@ -50,7 +50,9 @@
     mem = &caching_pool.factory;
 
+#if 0
     pj_log_set_level(3);
     pj_log_set_decor(PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | 
                      PJ_LOG_HAS_MICRO_SEC);
+#endif
 
     rc = pj_init();
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1107)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1108)
@@ -823,5 +823,5 @@
 	if (pjsua_var.media_cfg.enable_ice) {
 	    status = pjmedia_ice_start_ice(call->med_tp, call->inv->pool, 
-					   remote_sdp);
+					   remote_sdp, 0);
 	    if (status != PJ_SUCCESS)
 		return status;
