Index: pjproject/branches/1.x/pjmedia/include/pjmedia/transport.h
===================================================================
--- pjproject/branches/1.x/pjmedia/include/pjmedia/transport.h	(revision 4338)
+++ pjproject/branches/1.x/pjmedia/include/pjmedia/transport.h	(revision 4346)
@@ -534,5 +534,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.
@@ -545,4 +545,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/branches/1.x/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_media.c	(revision 4338)
+++ pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_media.c	(revision 4346)
@@ -858,16 +858,10 @@
 	    pjmedia_transport_info tpinfo;
 	    pjmedia_ice_transport_info *ii = NULL;
-	    unsigned i;
 
 	    pjmedia_transport_info_init(&tpinfo);
 	    pjmedia_transport_get_info(tp, &tpinfo);
-	    for (i=0; i<tpinfo.specific_info_cnt; ++i) {
-		if (tpinfo.spc_info[i].type==PJMEDIA_TRANSPORT_TYPE_ICE) {
-		    ii = (pjmedia_ice_transport_info*)
-			 tpinfo.spc_info[i].buffer;
-		    break;
-		}
-	    }
-
+	    ii = (pjmedia_ice_transport_info*)
+		 pjmedia_transport_info_get_spc_info(
+					 &tpinfo, PJMEDIA_TRANSPORT_TYPE_ICE);
 	    if (ii && ii->role==PJ_ICE_SESS_ROLE_CONTROLLING &&
 		pj_sockaddr_cmp(&tpinfo.sock_info.rtp_addr_name,
@@ -1587,4 +1581,18 @@
 
 
+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,
 				  int new_audio_idx,
@@ -1626,7 +1634,13 @@
 	return PJ_TRUE;
 
-    /* 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 */
@@ -1921,4 +1935,5 @@
     } else {
 	pjmedia_transport_info tp_info;
+	pjmedia_srtp_info *srtp_info;
 
 	/* Start/restart media transport */
@@ -1935,16 +1950,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->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->rem_srtp_use = srtp_info->peer_use;
 	}
 
