summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2013-01-17 12:57:46 +0000
committerBenny Prijono <bennylp@teluu.com>2013-01-17 12:57:46 +0000
commit6802bb114cbbfa46dae0e9a57275727882b78b8d (patch)
treed0829a1aa7f70bf835be88d50cd2d83b8ae5ebe3
parent71674cc69ba19cb8a4229b31daa5a7a2153b0ded (diff)
Fixed #1611: Add missing Supported header in UPDATE for Session Timers. Also fixed minor placement error of pjsip_dlg_dec_lock() in pjsip_inv_update(). The dec_lock was called too early before calling pjsip_timer_update_req().
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4323 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsip-ua/sip_inv.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c
index 6a608673..815da53a 100644
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -2572,6 +2572,7 @@ PJ_DEF(pj_status_t) pjsip_inv_update ( pjsip_inv_session *inv,
pjsip_contact_hdr *contact_hdr = NULL;
pjsip_tx_data *tdata = NULL;
pjmedia_sdp_session *sdp_copy;
+ const pjsip_hdr *hdr;
pj_status_t status = PJ_SUCCESS;
/* Verify arguments. */
@@ -2640,13 +2641,24 @@ PJ_DEF(pj_status_t) pjsip_inv_update ( pjsip_inv_session *inv,
pjsip_create_sdp_body(tdata->pool, sdp_copy, &tdata->msg->body);
}
- /* Unlock dialog. */
- pjsip_dlg_dec_lock(inv->dlg);
+ /* Session Timers spec (RFC 4028) says that Supported header MUST be put
+ * in refresh requests. So here we'll just put the Supported header in
+ * all cases regardless of whether session timers is used or not, just
+ * in case this is a common behavior.
+ */
+ hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_SUPPORTED, NULL);
+ if (hdr) {
+ pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)
+ pjsip_hdr_shallow_clone(tdata->pool, hdr));
+ }
status = pjsip_timer_update_req(inv, tdata);
if (status != PJ_SUCCESS)
goto on_error;
+ /* Unlock dialog. */
+ pjsip_dlg_dec_lock(inv->dlg);
+
*p_tdata = tdata;
pj_log_pop_indent();