Index: /pjproject/trunk/pjmedia/include/pjmedia/transport.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/transport.h	(revision 4344)
+++ /pjproject/trunk/pjmedia/include/pjmedia/transport.h	(revision 4345)
@@ -567,5 +567,5 @@
  *
  * @param tp	    The transport.
- * @param info	    Media socket info to be initialized.
+ * @param info	    Media transport info to be initialized.
  *
  * @return	    PJ_SUCCESS on success.
@@ -578,4 +578,27 @@
     
     return PJ_ENOTSUP;
+}
+
+
+/**
+ * Utility API to get transport type specific info from the specified media
+ * transport info.
+ * 
+ * @param info	    Media transport info.
+ * @param type	    Media transport type.
+ *
+ * @return	    Pointer to media transport specific info, or NULL if
+ * 		    specific info for the transport type is not found.
+ */
+PJ_INLINE(void*) pjmedia_transport_info_get_spc_info(
+						pjmedia_transport_info *info,
+						pjmedia_transport_type type)
+{
+    unsigned i;
+    for (i = 0; i < info->specific_info_cnt; ++i) {
+	if (info->spc_info[i].type == type)
+	    return (void*)info->spc_info[i].buffer;
+    }
+    return NULL;
 }
 
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 4344)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 4345)
@@ -3060,8 +3060,8 @@
 
     /* Check if ICE setup is complete and if it needs reinvite */
-    for (i = 0; i < call->med_cnt && ice_complete; ++i) {
+    for (i = 0; i < call->med_cnt; ++i) {
 	pjsua_call_media *call_med = &call->media[i];
 	pjmedia_transport_info tpinfo;
-	unsigned j;
+	pjmedia_ice_transport_info *ice_info;
 	
 	if (call_med->tp_st == PJSUA_MED_TP_NULL ||
@@ -3074,32 +3074,28 @@
 	pjmedia_transport_info_init(&tpinfo);
 	pjmedia_transport_get_info(call_med->tp, &tpinfo);
-	for (j = 0; j < tpinfo.specific_info_cnt; ++j) {
-	    pjmedia_ice_transport_info *ice_info;
-	    
-	    if (tpinfo.spc_info[j].type != PJMEDIA_TRANSPORT_TYPE_ICE)
-		continue;
-	    
-	    ice_info = (pjmedia_ice_transport_info*)tpinfo.spc_info[j].buffer;
-	    
-	    /* Check if ICE setup not completed yet */
-	    if (ice_info->sess_state < PJ_ICE_STRANS_STATE_RUNNING) {
-		ice_complete = PJ_FALSE;
-		break;
+	ice_info = (pjmedia_ice_transport_info*)
+		   pjmedia_transport_info_get_spc_info(
+					&tpinfo, PJMEDIA_TRANSPORT_TYPE_ICE);
+	if (!ice_info)
+	    continue;
+
+	/* Check if ICE setup not completed yet */
+	if (ice_info->sess_state < PJ_ICE_STRANS_STATE_RUNNING) {
+	    ice_complete = PJ_FALSE;
+	    break;
+	}
+	
+	/* Check if ICE needs to send reinvite */
+	if (!ice_need_reinv &&
+	    ice_info->sess_state == PJ_ICE_STRANS_STATE_RUNNING &&
+	    ice_info->role == PJ_ICE_SESS_ROLE_CONTROLLING)
+	{
+	    pjsua_ice_config *cfg=&pjsua_var.acc[call->acc_id].cfg.ice_cfg;
+	    if ((cfg->ice_always_update && !call->reinv_ice_sent) ||
+		pj_sockaddr_cmp(&tpinfo.sock_info.rtp_addr_name,
+				&call_med->rtp_addr))
+	    {
+		ice_need_reinv = PJ_TRUE;
 	    }
-	    
-	    /* Check if ICE needs to send reinvite */
-	    if (!ice_need_reinv &&
-		ice_info->sess_state == PJ_ICE_STRANS_STATE_RUNNING &&
-		ice_info->role == PJ_ICE_SESS_ROLE_CONTROLLING)
-	    {
-		pjsua_ice_config *cfg=&pjsua_var.acc[call->acc_id].cfg.ice_cfg;
-		if ((cfg->ice_always_update && !call->reinv_ice_sent) ||
-		    pj_sockaddr_cmp(&tpinfo.sock_info.rtp_addr_name,
-				    &call_med->rtp_addr))
-		{
-		    ice_need_reinv = PJ_TRUE;
-		}
-	    }
-	    break;
 	}
     }
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 4344)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 4345)
@@ -2249,4 +2249,18 @@
 #if PJSUA_MEDIA_HAS_PJMEDIA || PJSUA_THIRD_PARTY_STREAM_HAS_GET_INFO
 
+static pj_bool_t is_ice_running(pjmedia_transport *tp)
+{
+    pjmedia_transport_info tpinfo;
+    pjmedia_ice_transport_info *ice_info;
+
+    pjmedia_transport_info_init(&tpinfo);
+    pjmedia_transport_get_info(tp, &tpinfo);
+    ice_info = (pjmedia_ice_transport_info*)
+	       pjmedia_transport_info_get_spc_info(&tpinfo,
+						   PJMEDIA_TRANSPORT_TYPE_ICE);
+    return (ice_info && ice_info->sess_state == PJ_ICE_STRANS_STATE_RUNNING);
+}
+
+
 static pj_bool_t is_media_changed(const pjsua_call *call,
 				  unsigned med_idx,
@@ -2288,7 +2302,13 @@
 	}
 
-	/* Compare remote RTP address */
-	if (pj_sockaddr_cmp(&old_si->rem_addr, &new_si->rem_addr))
+	/* Compare remote RTP address. If ICE is running, change in default
+	 * address can happen after negotiation, this can be handled
+	 * internally by ICE and does not need to cause media restart.
+	 */
+	if (!is_ice_running(call_med->tp) &&
+	    pj_sockaddr_cmp(&old_si->rem_addr, &new_si->rem_addr))
+	{
 	    return PJ_TRUE;
+	}
 
 	/* Compare codec info */
@@ -2344,7 +2364,13 @@
 	}
 
-	/* Compare remote RTP address */
-	if (pj_sockaddr_cmp(&old_si->rem_addr, &new_si->rem_addr))
+	/* Compare remote RTP address. If ICE is running, change in default
+	 * address can happen after negotiation, this can be handled
+	 * internally by ICE and does not need to cause media restart.
+	 */
+	if (!is_ice_running(call_med->tp) &&
+	    pj_sockaddr_cmp(&old_si->rem_addr, &new_si->rem_addr))
+	{
 	    return PJ_TRUE;
+	}
 
 	/* Compare codec info */
@@ -2555,4 +2581,5 @@
 	    } else {
 		pjmedia_transport_info tp_info;
+		pjmedia_srtp_info *srtp_info;
 
 		/* Start/restart media transport based on info in SDP */
@@ -2573,17 +2600,9 @@
 		pjmedia_transport_info_init(&tp_info);
 		pjmedia_transport_get_info(call_med->tp, &tp_info);
-		if (tp_info.specific_info_cnt > 0) {
-		    unsigned i;
-		    for (i = 0; i < tp_info.specific_info_cnt; ++i) {
-			if (tp_info.spc_info[i].type == 
-			    PJMEDIA_TRANSPORT_TYPE_SRTP)
-			{
-			    pjmedia_srtp_info *srtp_info =
-				(pjmedia_srtp_info*)tp_info.spc_info[i].buffer;
-
-			    call_med->rem_srtp_use = srtp_info->peer_use;
-			    break;
-			}
-		    }
+		srtp_info = (pjmedia_srtp_info*)
+			    pjmedia_transport_info_get_spc_info(
+				    &tp_info, PJMEDIA_TRANSPORT_TYPE_SRTP);
+		if (srtp_info) {
+		    call_med->rem_srtp_use = srtp_info->peer_use;
 		}
 
@@ -2692,4 +2711,5 @@
 	    } else {
 		pjmedia_transport_info tp_info;
+		pjmedia_srtp_info *srtp_info;
 
 		/* Start/restart media transport */
@@ -2710,16 +2730,9 @@
 		pjmedia_transport_info_init(&tp_info);
 		pjmedia_transport_get_info(call_med->tp, &tp_info);
-		if (tp_info.specific_info_cnt > 0) {
-		    unsigned i;
-		    for (i = 0; i < tp_info.specific_info_cnt; ++i) {
-			if (tp_info.spc_info[i].type ==
-				PJMEDIA_TRANSPORT_TYPE_SRTP)
-			{
-			    pjmedia_srtp_info *sri;
-			    sri=(pjmedia_srtp_info*)tp_info.spc_info[i].buffer;
-			    call_med->rem_srtp_use = sri->peer_use;
-			    break;
-			}
-		    }
+		srtp_info = (pjmedia_srtp_info*)
+			    pjmedia_transport_info_get_spc_info(
+				    &tp_info, PJMEDIA_TRANSPORT_TYPE_SRTP);
+		if (srtp_info) {
+		    call_med->rem_srtp_use = srtp_info->peer_use;
 		}
 
