summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2013-04-03 08:21:47 +0000
committerBenny Prijono <bennylp@teluu.com>2013-04-03 08:21:47 +0000
commit1a400a5fa5a8e76a5fbefee88bd21864cca38090 (patch)
treec780958d930756e21a8b852c15d916e0cf3427f6
parent9e851bfd3ac81d8a9a48e25b2ede7f7455ef4d53 (diff)
Fixed #1653: [incompatible] pjsua_call_update() API should not release hold
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4457 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip-apps/src/pjsua/pjsua_cli_cmd.c3
-rw-r--r--pjsip-apps/src/pjsua/pjsua_cmd.c2
-rw-r--r--pjsip-apps/src/pjsua/pjsua_ui_cmd.c6
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c14
4 files changed, 17 insertions, 8 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_cli_cmd.c b/pjsip-apps/src/pjsua/pjsua_cli_cmd.c
index ed20da6d..f0d3fc58 100644
--- a/pjsip-apps/src/pjsua/pjsua_cli_cmd.c
+++ b/pjsip-apps/src/pjsua/pjsua_cli_cmd.c
@@ -1523,6 +1523,7 @@ static pj_status_t cmd_call_reinvite()
static pj_status_t cmd_call_update()
{
if (current_call != PJSUA_INVALID_ID) {
+ call_opt.flag |= PJSUA_CALL_UNHOLD;
pjsua_call_update2(current_call, &call_opt, NULL);
} else {
PJ_LOG(3,(THIS_FILE, "No current call"));
@@ -2949,4 +2950,4 @@ void destroy_cli()
pj_log_set_log_func(&pj_log_write);
pj_cli_destroy(cli);
cli = NULL;
-} \ No newline at end of file
+}
diff --git a/pjsip-apps/src/pjsua/pjsua_cmd.c b/pjsip-apps/src/pjsua/pjsua_cmd.c
index 2f7167f4..ea829b54 100644
--- a/pjsip-apps/src/pjsua/pjsua_cmd.c
+++ b/pjsip-apps/src/pjsua/pjsua_cmd.c
@@ -1024,4 +1024,4 @@ PJ_DEF(void) app_config_show_video(int acc_id, const pjsua_acc_config *acc_cfg)
}
-#endif \ No newline at end of file
+#endif
diff --git a/pjsip-apps/src/pjsua/pjsua_ui_cmd.c b/pjsip-apps/src/pjsua/pjsua_ui_cmd.c
index 044db37a..76da2c14 100644
--- a/pjsip-apps/src/pjsua/pjsua_ui_cmd.c
+++ b/pjsip-apps/src/pjsua/pjsua_ui_cmd.c
@@ -970,7 +970,8 @@ static void ui_call_reinvite()
static void ui_send_update()
{
- if (current_call != -1) {
+ if (current_call != -1) {
+ call_opt.flag |= PJSUA_CALL_UNHOLD;
pjsua_call_update2(current_call, &call_opt, NULL);
} else {
PJ_LOG(3,(THIS_FILE, "No current call"));
@@ -1935,4 +1936,5 @@ void console_app_main(const pj_str_t *uri_to_call, pj_bool_t *app_restart)
on_exit:
;
-} \ No newline at end of file
+}
+
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index b7504e72..73225763 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -2495,11 +2495,17 @@ PJ_DEF(pj_status_t) pjsua_call_update2(pjsua_call_id call_id,
}
/* Create SDP */
- status = pjsua_media_channel_create_sdp(call->index,
- call->inv->pool_prov,
- NULL, &sdp, NULL);
+ if (call->local_hold && (call->opt.flag & PJSUA_CALL_UNHOLD)==0) {
+ status = create_sdp_of_call_hold(call, &sdp);
+ } else {
+ status = pjsua_media_channel_create_sdp(call->index,
+ call->inv->pool_prov,
+ NULL, &sdp, NULL);
+ call->local_hold = PJ_FALSE;
+ }
+
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to get SDP from media endpoint",
+ pjsua_perror(THIS_FILE, "Unable to get SDP from media endpoint",
status);
goto on_return;
}