diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index a890e1f00..c6e14ac15 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -44,7 +44,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia if (call->audiostream && call->audiostream->ticker){ /* we already started media: check if we really need to restart it*/ if (oldmd){ - if (sal_media_description_equals(oldmd,new_md)){ + if (sal_media_description_equals(oldmd,new_md) && !call->playing_ringbacktone){ sal_media_description_unref(oldmd); if (call->all_muted){ ms_message("Early media finished, unmuting inputs..."); @@ -79,7 +79,8 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia } if (call->state==LinphoneCallIncomingEarlyMedia && linphone_core_get_remote_ringback_tone (lc)!=NULL){ send_ringbacktone=TRUE; - }else if (call->state==LinphoneCallIncomingEarlyMedia || + } + if (call->state==LinphoneCallIncomingEarlyMedia || (call->state==LinphoneCallOutgoingEarlyMedia && !call->params.real_early_media)){ all_muted=TRUE; } @@ -296,6 +297,11 @@ static void call_accepted(SalOp *op){ if (lc->vtable.display_status){ lc->vtable.display_status(lc,_("Call answered - connected.")); } + 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_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)"); } linphone_core_update_streams (lc,call,md); @@ -316,6 +322,11 @@ static void call_ack(SalOp *op){ if (call->media_pending){ SalMediaDescription *md=sal_call_get_final_media_description(op); 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_call_set_state (call,LinphoneCallStreamsRunning,"Connected (streams running)"); }else{ diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 53a07a007..6fce61605 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -281,6 +281,8 @@ const char *linphone_call_state_to_string(LinphoneCallState cs){ return "LinphoneCallUpdatedByRemote"; case LinphoneCallIncomingEarlyMedia: return "LinphoneCallIncomingEarlyMedia"; + case LinphoneCallUpdated: + return "LinphoneCallUpdated"; } return "undefined state"; } @@ -829,7 +831,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut captcard, captcard==NULL ? FALSE : linphone_core_echo_cancellation_enabled(lc)); post_configure_audio_streams(call); - if (all_inputs_muted){ + if (all_inputs_muted && !send_ringbacktone){ audio_stream_set_mic_gain(call->audiostream,0); } if (send_ringbacktone){ @@ -902,6 +904,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut } #endif call->all_muted=all_inputs_muted; + call->playing_ringbacktone=send_ringbacktone; goto end; end: diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index fb19c0af9..a6ab6a12f 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -219,7 +219,8 @@ typedef enum _LinphoneCallState{ LinphoneCallEnd, /**