summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsua-lib
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2013-03-06 05:55:09 +0000
committerLiong Sauw Ming <ming@teluu.com>2013-03-06 05:55:09 +0000
commit5087300ce2189c93021234508a2bb0cd497f1876 (patch)
tree0052ab3df4904f55d19a4d58ddea88c4a61e1b27 /pjsip/src/pjsua-lib
parent22da209226aac2c65f45900e55cf5f162cd311d4 (diff)
Fixed #1629: Add pjsua_call_set_hold2() API to allow update of Contact header
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4421 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index 6db50cd8..f0d75f5b 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -2257,10 +2257,18 @@ PJ_DEF(pj_status_t) pjsua_call_process_redirect( pjsua_call_id call_id,
PJ_DEF(pj_status_t) pjsua_call_set_hold(pjsua_call_id call_id,
const pjsua_msg_data *msg_data)
{
+ return pjsua_call_set_hold2(call_id, 0, msg_data);
+}
+
+PJ_DEF(pj_status_t) pjsua_call_set_hold2(pjsua_call_id call_id,
+ unsigned options,
+ const pjsua_msg_data *msg_data)
+{
pjmedia_sdp_session *sdp;
pjsua_call *call;
pjsip_dialog *dlg = NULL;
pjsip_tx_data *tdata;
+ pj_str_t *new_contact = NULL;
pj_status_t status;
PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls,
@@ -2283,8 +2291,14 @@ PJ_DEF(pj_status_t) pjsua_call_set_hold(pjsua_call_id call_id,
if (status != PJ_SUCCESS)
goto on_return;
+ if ((options & PJSUA_CALL_UPDATE_CONTACT) &&
+ pjsua_acc_is_valid(call->acc_id))
+ {
+ new_contact = &pjsua_var.acc[call->acc_id].contact;
+ }
+
/* Create re-INVITE with new offer */
- status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata);
+ status = pjsip_inv_reinvite( call->inv, new_contact, sdp, &tdata);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Unable to create re-INVITE", status);
goto on_return;