Fix #1539: Applied non-strict update of remote capability info after receiving the first 2xx response.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4171 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip/src/pjsip/sip_dialog.c b/pjsip/src/pjsip/sip_dialog.c
index 2b6bb89..57f0c14 100644
--- a/pjsip/src/pjsip/sip_dialog.c
+++ b/pjsip/src/pjsip/sip_dialog.c
@@ -1885,6 +1885,15 @@
 	}
 
 	dlg_update_routeset(dlg, rdata);
+
+	/* Update remote capability info after the first 2xx response
+	 * (ticket #1539). Note that the remote capability retrieved here
+	 * will be assumed to remain unchanged for the duration of the dialog.
+	 */
+	if (dlg->role==PJSIP_ROLE_UAC && !dlg->uac_has_2xx) {
+	    pjsip_dlg_update_remote_cap(dlg, rdata->msg_info.msg, PJ_FALSE);
+	    dlg->uac_has_2xx = PJ_TRUE;
+	}
     }
 
     /* Pass to dialog usages. */