Commit 48512d1e authored by Ghislain MARY's avatar Ghislain MARY

Delete LinphoneCallUpdated state and add LinphoneCallUpdating state.

parent b72f80fd
...@@ -302,11 +302,7 @@ static void call_accepted(SalOp *op){ ...@@ -302,11 +302,7 @@ static void call_accepted(SalOp *op){
linphone_core_update_streams (lc,call,md); linphone_core_update_streams (lc,call,md);
linphone_call_set_state(call,LinphoneCallPausedByRemote,"Call paused by remote"); linphone_call_set_state(call,LinphoneCallPausedByRemote,"Call paused by remote");
}else{ }else{
if (call->state==LinphoneCallStreamsRunning){ if (call->state!=LinphoneCallUpdating){
/*media was running before, the remote as acceted a call modification (that is
a reinvite made by us. We must notify the application this reinvite was accepted*/
linphone_call_set_state(call, LinphoneCallUpdated, "Call updated");
}else{
if (call->state==LinphoneCallResuming){ if (call->state==LinphoneCallResuming){
if (lc->vtable.display_status){ if (lc->vtable.display_status){
lc->vtable.display_status(lc,_("Call resumed.")); lc->vtable.display_status(lc,_("Call resumed."));
...@@ -343,11 +339,6 @@ static void call_ack(SalOp *op){ ...@@ -343,11 +339,6 @@ static void call_ack(SalOp *op){
if (call->media_pending){ if (call->media_pending){
SalMediaDescription *md=sal_call_get_final_media_description(op); SalMediaDescription *md=sal_call_get_final_media_description(op);
if (md && !sal_media_description_empty(md)){ if (md && !sal_media_description_empty(md)){
if (call->state==LinphoneCallStreamsRunning){
/*media was running before, the remote as acceted a call modification (that is
a reinvite made by us. We must notify the application this reinvite was accepted*/
linphone_call_set_state(call, LinphoneCallUpdated, "Call updated");
}
linphone_core_update_streams (lc,call,md); linphone_core_update_streams (lc,call,md);
linphone_call_set_state (call,LinphoneCallStreamsRunning,"Connected (streams running)"); linphone_call_set_state (call,LinphoneCallStreamsRunning,"Connected (streams running)");
}else{ }else{
......
...@@ -520,8 +520,8 @@ const char *linphone_call_state_to_string(LinphoneCallState cs){ ...@@ -520,8 +520,8 @@ const char *linphone_call_state_to_string(LinphoneCallState cs){
return "LinphoneCallUpdatedByRemote"; return "LinphoneCallUpdatedByRemote";
case LinphoneCallIncomingEarlyMedia: case LinphoneCallIncomingEarlyMedia:
return "LinphoneCallIncomingEarlyMedia"; return "LinphoneCallIncomingEarlyMedia";
case LinphoneCallUpdated: case LinphoneCallUpdating:
return "LinphoneCallUpdated"; return "LinphoneCallUpdating";
case LinphoneCallReleased: case LinphoneCallReleased:
return "LinphoneCallReleased"; return "LinphoneCallReleased";
} }
...@@ -1828,7 +1828,7 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){ ...@@ -1828,7 +1828,7 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
linphone_call_delete_ice_session(call); linphone_call_delete_ice_session(call);
} }
switch (call->state) { switch (call->state) {
case LinphoneCallStreamsRunning: case LinphoneCallUpdating:
linphone_core_start_update_call(call->core, call); linphone_core_start_update_call(call->core, call);
break; break;
case LinphoneCallUpdatedByRemote: case LinphoneCallUpdatedByRemote:
...@@ -1838,10 +1838,12 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){ ...@@ -1838,10 +1838,12 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
linphone_call_stop_media_streams_for_ice_gathering(call); linphone_call_stop_media_streams_for_ice_gathering(call);
linphone_core_proceed_with_invite_if_ready(call->core, call, NULL); linphone_core_proceed_with_invite_if_ready(call->core, call, NULL);
break; break;
default: case LinphoneCallIdle:
linphone_call_stop_media_streams_for_ice_gathering(call); linphone_call_stop_media_streams_for_ice_gathering(call);
linphone_core_notify_incoming_call(call->core, call); linphone_core_notify_incoming_call(call->core, call);
break; break;
default:
break;
} }
} else if (evt == ORTP_EVENT_ICE_LOSING_PAIRS_COMPLETED) { } else if (evt == ORTP_EVENT_ICE_LOSING_PAIRS_COMPLETED) {
linphone_core_start_accept_call_update(call->core, call); linphone_core_start_accept_call_update(call->core, call);
......
...@@ -2564,6 +2564,7 @@ int linphone_core_start_update_call(LinphoneCore *lc, LinphoneCall *call){ ...@@ -2564,6 +2564,7 @@ int linphone_core_start_update_call(LinphoneCore *lc, LinphoneCall *call){
int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){
int err=0; int err=0;
if (params!=NULL){ if (params!=NULL){
linphone_call_set_state(call,LinphoneCallUpdating,"Updating call");
#ifdef VIDEO_ENABLED #ifdef VIDEO_ENABLED
bool_t has_video = call->params.has_video; bool_t has_video = call->params.has_video;
if ((call->ice_session != NULL) && (call->videostream != NULL) && !params->has_video) { if ((call->ice_session != NULL) && (call->videostream != NULL) && !params->has_video) {
...@@ -2571,7 +2572,7 @@ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const Linpho ...@@ -2571,7 +2572,7 @@ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const Linpho
call->videostream->ice_check_list = NULL; call->videostream->ice_check_list = NULL;
} }
call->params = *params; call->params = *params;
if ((call->ice_session != NULL) && (ice_session_state(call->ice_session) != IS_Completed) && !has_video && params->has_video) { if ((call->ice_session != NULL) && !has_video && params->has_video) {
/* Defer call update until the ICE candidates gathering process has finished. */ /* Defer call update until the ICE candidates gathering process has finished. */
ms_message("Defer call update to gather ICE candidates"); ms_message("Defer call update to gather ICE candidates");
update_local_media_description(lc, call); update_local_media_description(lc, call);
...@@ -5030,7 +5031,7 @@ bool_t linphone_core_sound_resources_locked(LinphoneCore *lc){ ...@@ -5030,7 +5031,7 @@ bool_t linphone_core_sound_resources_locked(LinphoneCore *lc){
case LinphoneCallConnected: case LinphoneCallConnected:
case LinphoneCallRefered: case LinphoneCallRefered:
case LinphoneCallIncomingEarlyMedia: case LinphoneCallIncomingEarlyMedia:
case LinphoneCallUpdated: case LinphoneCallUpdating:
return TRUE; return TRUE;
default: default:
break; break;
......
...@@ -343,7 +343,7 @@ typedef enum _LinphoneCallState{ ...@@ -343,7 +343,7 @@ typedef enum _LinphoneCallState{
LinphoneCallPausedByRemote, /**<The call is paused by remote end*/ LinphoneCallPausedByRemote, /**<The call is paused by remote end*/
LinphoneCallUpdatedByRemote, /**<The call's parameters change is requested by remote end, used for example when video is added by remote */ LinphoneCallUpdatedByRemote, /**<The call's parameters change is requested by remote end, used for example when video is added by remote */
LinphoneCallIncomingEarlyMedia, /**<We are proposing early media to an incoming call */ LinphoneCallIncomingEarlyMedia, /**<We are proposing early media to an incoming call */
LinphoneCallUpdated, /**<The remote accepted the call update initiated by us */ LinphoneCallUpdating, /**<A call update has been initiated by us */
LinphoneCallReleased /**< The call object is no more retained by the core */ LinphoneCallReleased /**< The call object is no more retained by the core */
} LinphoneCallState; } LinphoneCallState;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment