diff --git a/pjsip/src/pjsip/sip_dialog.c b/pjsip/src/pjsip/sip_dialog.c index 2b6bb8988..57f0c14af 100644 --- a/pjsip/src/pjsip/sip_dialog.c +++ b/pjsip/src/pjsip/sip_dialog.c @@ -1885,6 +1885,15 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata ) } 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. */