From ced44d17eb7a3ec9e1f70fb1ded728c4ceab42d0 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 21 Apr 2015 12:18:38 +0200 Subject: [PATCH] Add lpconfig option to set the default value for defer_update. --- coreapi/callbacks.c | 4 ++-- coreapi/linphonecore.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index d1d7ce160..5b8d6450f 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -663,7 +663,7 @@ static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call, bool_t if ( call->state == LinphoneCallStreamsRunning) { /*reINVITE and in-dialogs UPDATE go here*/ linphone_core_notify_display_status(lc,_("Call is updated by remote.")); - call->defer_update=FALSE; + call->defer_update = lp_config_get_int(lc->config, "sip", "defer_update_default", FALSE); linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote"); if (call->defer_update==FALSE){ linphone_core_accept_call_update(lc,call,NULL); @@ -676,7 +676,7 @@ static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call, bool_t /* Case where no SDP is present and we were paused by remote. * We send back an ACK with our SDP and expect the remote to send its own. * No state change here until an answer is received. */ - call->defer_update=FALSE; + call->defer_update = lp_config_get_int(lc->config, "sip", "defer_update_default", FALSE); if (call->defer_update==FALSE){ _linphone_core_accept_call_update(lc,call,NULL,call->state,linphone_call_state_to_string(call->state)); } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index ed8cae539..ad77696f6 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3563,10 +3563,11 @@ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const Linpho * When receiving a #LinphoneCallUpdatedByRemote state notification, prevent LinphoneCore from performing an automatic answer. * * When receiving a #LinphoneCallUpdatedByRemote state notification (ie an incoming reINVITE), the default behaviour of - * LinphoneCore is to automatically answer the reINIVTE with call parameters unchanged. + * LinphoneCore is defined by the "defer_update_default" option of the "sip" section of the config. If this option is 0 (the default) + * then the LinphoneCore automatically answers the reINIVTE with call parameters unchanged. * However when for example when the remote party updated the call to propose a video stream, it can be useful * to prompt the user before answering. This can be achieved by calling linphone_core_defer_call_update() during - * the call state notifiacation, to deactivate the automatic answer that would just confirm the audio but reject the video. + * the call state notification, to deactivate the automatic answer that would just confirm the audio but reject the video. * Then, when the user responds to dialog prompt, it becomes possible to call linphone_core_accept_call_update() to answer * the reINVITE, with eventually video enabled in the LinphoneCallParams argument. *