Commit 8c2e4d9e authored by Simon Morlat's avatar Simon Morlat
Browse files

increment sdp session id when making a response to pause/resume request

don't accept linphone_core_update_call() outside of StreamsRunning state.
parent 00fa127a
......@@ -460,6 +460,8 @@ static void call_accept_update(LinphoneCore *lc, LinphoneCall *call){
}
static void call_resumed(LinphoneCore *lc, LinphoneCall *call){
/*when we are resumed, increment session id, because sdp is changed (a=recvonly disapears)*/
linphone_call_increment_local_media_description(call);
call_accept_update(lc,call);
if(lc->vtable.display_status)
lc->vtable.display_status(lc,_("We have been resumed."));
......@@ -467,6 +469,8 @@ static void call_resumed(LinphoneCore *lc, LinphoneCall *call){
}
static void call_paused_by_remote(LinphoneCore *lc, LinphoneCall *call){
/*when we are resumed, increment session id, because sdp is changed (a=recvonly appears)*/
linphone_call_increment_local_media_description(call);
call_accept_update(lc,call);
/* we are being paused */
if(lc->vtable.display_status)
......
......@@ -306,6 +306,11 @@ static void setup_rtcp_xr(LinphoneCall *call, SalMediaDescription *md) {
}
}
void linphone_call_increment_local_media_description(LinphoneCall *call){
SalMediaDescription *md=call->localdesc;
md->session_ver++;
}
void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *call){
MSList *l;
PayloadType *pt;
......
......@@ -3153,23 +3153,28 @@ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const Linpho
#ifdef VIDEO_ENABLED
bool_t has_video = FALSE;
#endif
if (call->state!=LinphoneCallStreamsRunning){
ms_error("linphone_core_update_call() is not allowed in [%s] state",linphone_call_state_to_string(call->state));
return -1;
}
if (params!=NULL){
linphone_call_set_state(call,LinphoneCallUpdating,"Updating call");
#ifdef VIDEO_ENABLED
#if defined(VIDEO_ENABLED) && defined(BUILD_UPNP)
has_video = call->params.has_video;
// Video removing
if((call->videostream != NULL) && !params->has_video) {
#ifdef BUILD_UPNP
if(call->upnp_session != NULL) {
if (linphone_core_update_upnp(lc, call)<0) {
/* uPnP port mappings failed, proceed with the call anyway. */
linphone_call_delete_upnp_session(call);
}
}
#endif //BUILD_UPNP
}
#endif /* VIDEO_ENABLED */
#endif /* defined(VIDEO_ENABLED) && defined(BUILD_UPNP) */
_linphone_call_params_copy(&call->params,params);
err=linphone_call_prepare_ice(call,FALSE);
......@@ -3178,10 +3183,9 @@ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const Linpho
return 0;
}
#ifdef VIDEO_ENABLED
#if defined(VIDEO_ENABLED) && defined(BUILD_UPNP)
// Video adding
if (!has_video && call->params.has_video) {
#ifdef BUILD_UPNP
if(call->upnp_session != NULL) {
ms_message("Defer call update to add uPnP port mappings");
video_stream_prepare_video(call->videostream);
......@@ -3192,9 +3196,8 @@ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const Linpho
return err;
}
}
#endif //BUILD_UPNP
}
#endif //VIDEO_ENABLED
#endif //defined(VIDEO_ENABLED) && defined(BUILD_UPNP)
err = linphone_core_start_update_call(lc, call);
}else{
#ifdef VIDEO_ENABLED
......
......@@ -742,6 +742,7 @@ int linphone_core_get_calls_nb(const LinphoneCore *lc);
void linphone_core_set_state(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message);
void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *call);
void linphone_call_increment_local_media_description(LinphoneCall *call);
void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMediaDescription *new_md);
bool_t linphone_core_is_payload_type_usable_for_bandwidth(LinphoneCore *lc, const PayloadType *pt, int bandwidth_limit);
......
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