Commit b3ed132d authored by Simon Morlat's avatar Simon Morlat Committed by Guillaume BIENKOWSKI
Browse files

fix crash in gtk app when updating sip ports

call linphone_call_fix_parameters() when INVITEs and reINVITEs, but not during early-media
parent 79fdfe0f
......@@ -391,7 +391,10 @@ static void call_accepted(SalOp *op){
}
}
}
linphone_core_update_streams (lc,call,md);
linphone_core_update_streams(lc,call,md);
/*also reflect the change if the "wished" params, in order to avoid to propose SAVP or video again
* further in the call, for example during pause,resume, conferencing reINVITEs*/
linphone_call_fix_call_parameters(call);
if (!call->current_params.in_conference)
lc->current_call=call;
linphone_call_set_state(call, LinphoneCallStreamsRunning, "Streams running");
......@@ -440,8 +443,9 @@ static void call_accept_update(LinphoneCore *lc, LinphoneCall *call){
linphone_call_update_remote_session_id_and_ver(call);
sal_call_accept(call->op);
md=sal_call_get_final_media_description(call->op);
if (md && !sal_media_description_empty(md))
if (md && !sal_media_description_empty(md)){
linphone_core_update_streams(lc,call,md);
}
}
static void call_resumed(LinphoneCore *lc, LinphoneCall *call){
......
......@@ -1909,9 +1909,6 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
LinphoneMediaEncryptionSRTP : LinphoneMediaEncryptionNone;
}
/*also reflect the change if the "wished" params, in order to avoid to propose SAVP or video again
* further in the call, for example during pause,resume, conferencing reINVITEs*/
linphone_call_fix_call_parameters(call);
if ((call->ice_session != NULL) && (ice_session_state(call->ice_session) != IS_Completed)) {
ice_session_start_connectivity_checks(call->ice_session);
}
......
......@@ -3088,8 +3088,10 @@ int linphone_core_start_accept_call_update(LinphoneCore *lc, LinphoneCall *call)
sal_call_set_local_media_description(call->op,call->localdesc);
sal_call_accept(call->op);
md=sal_call_get_final_media_description(call->op);
if (md && !sal_media_description_empty(md))
if (md && !sal_media_description_empty(md)){
linphone_core_update_streams (lc,call,md);
linphone_call_fix_call_parameters(call);
}
linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)");
return 0;
}
......
......@@ -345,7 +345,7 @@ void linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessag
void linphone_core_play_tone(LinphoneCore *lc);
void linphone_call_init_stats(LinphoneCallStats *stats, int type);
void linphone_call_fix_call_parameters(LinphoneCall *call);
void linphone_call_init_audio_stream(LinphoneCall *call);
void linphone_call_init_video_stream(LinphoneCall *call);
void linphone_call_init_media_streams(LinphoneCall *call);
......
......@@ -1132,15 +1132,17 @@ static void port_config_free(PortConfigCtx *ctx){
g_free(ctx);
}
static void apply_transports(PortConfigCtx *ctx){
static gboolean apply_transports(PortConfigCtx *ctx){
GtkWidget *mw=linphone_gtk_get_main_window();
LCSipTransports tp;
LinphoneCore *lc=linphone_gtk_get_core();
linphone_core_get_sip_transports(lc,&tp);
tp.udp_port=ctx->tp.udp_port;
tp.tcp_port=ctx->tp.tcp_port;
g_message("new transports: %i, %i, %i",(int)tp.udp_port,(int)tp.tcp_port,(int)tp.tls_port);
linphone_core_set_sip_transports(lc,&tp);
g_object_set_data(G_OBJECT(mw),"port_config",NULL);
return FALSE;
}
static void transport_changed(GtkWidget *parameters){
......
......@@ -885,6 +885,7 @@ static void simple_conference(void) {
marie_call_laure=linphone_core_get_current_call(marie->lc);
CU_ASSERT_PTR_NOT_NULL_FATAL(marie_call_laure);
linphone_core_add_to_conference(marie->lc,marie_call_laure);
CU_ASSERT_TRUE(wait_for(marie->lc,laure->lc,&marie->stat.number_of_LinphoneCallUpdating,initial_marie_stat.number_of_LinphoneCallUpdating+1));
......
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