Commit 9ef35e8f authored by Simon Morlat's avatar Simon Morlat
Browse files

fix crash when receiving no SDP in 200 OK and ICE is enabled

parent b2b1410a
......@@ -465,23 +465,24 @@ static void call_ringing(SalOp *h){
static void call_accepted(SalOp *op){
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
SalMediaDescription *md;
SalMediaDescription *md, *rmd;
bool_t update_state=TRUE;
if (call==NULL){
ms_warning("No call to accept.");
return ;
}
rmd=sal_call_get_remote_media_description(op);
/*set privacy*/
call->current_params->privacy=(LinphonePrivacyMask)sal_op_get_privacy(call->op);
/* Handle remote ICE attributes if any. */
if (call->ice_session != NULL) {
linphone_call_update_ice_from_remote_media_description(call, sal_call_get_remote_media_description(op));
if (call->ice_session != NULL && rmd) {
linphone_call_update_ice_from_remote_media_description(call, rmd);
}
#ifdef BUILD_UPNP
if (call->upnp_session != NULL) {
linphone_core_update_upnp_from_remote_media_description(call, sal_call_get_remote_media_description(op));
if (call->upnp_session != NULL && rmd) {
linphone_core_update_upnp_from_remote_media_description(call, rmd);
}
#endif //BUILD_UPNP
......
mediastreamer2 @ 8e97e29d
Subproject commit 2be165a129a174a6b9a51574aee85f90d4f38084
Subproject commit 8e97e29d6ed8baa66ff95c74181a215e522c292d
oRTP @ 19ed314d
Subproject commit 3b0892f87fecbd7d3e2b34b381527ab1d7e59a59
Subproject commit 19ed314d52d4061a21daa4805aef9459ad31640c
......@@ -3245,7 +3245,7 @@ static void call_with_paused_no_sdp_on_resume() {
}
}
static void early_media_without_sdp_in_200_base( bool_t use_video ){
static void early_media_without_sdp_in_200_base( bool_t use_video, bool_t use_ice ){
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_rc");
MSList* lcs = NULL;
......@@ -3258,6 +3258,10 @@ static void early_media_without_sdp_in_200_base( bool_t use_video ){
lcs = ms_list_append(lcs,marie->lc);
lcs = ms_list_append(lcs,pauline->lc);
if (use_ice){
linphone_core_set_firewall_policy(marie->lc, LinphonePolicyUseIce);
linphone_core_set_stun_server(marie->lc, "stun.linphone.org");
}
/*
Marie calls Pauline, and after the call has rung, transitions to an early_media session
*/
......@@ -3318,11 +3322,15 @@ static void early_media_without_sdp_in_200_base( bool_t use_video ){
}
static void call_with_early_media_and_no_sdp_in_200_with_video(){
early_media_without_sdp_in_200_base(TRUE);
early_media_without_sdp_in_200_base(TRUE, FALSE);
}
static void call_with_early_media_and_no_sdp_in_200(){
early_media_without_sdp_in_200_base(FALSE);
early_media_without_sdp_in_200_base(FALSE, FALSE);
}
static void call_with_early_media_ice_and_no_sdp_in_200(){
early_media_without_sdp_in_200_base(FALSE, TRUE);
}
static void call_with_generic_cn(void) {
......@@ -3551,8 +3559,9 @@ test_t call_tests[] = {
{ "Call with in-dialog codec change", call_with_in_dialog_codec_change },
{ "Call with in-dialog codec change no sdp", call_with_in_dialog_codec_change_no_sdp },
{ "Call with pause no SDP on resume", call_with_paused_no_sdp_on_resume },
{ "Call with early media and no SDP on 200 Ok", call_with_early_media_and_no_sdp_in_200 },
{ "Call with early media and no SDP on 200 Ok with video", call_with_early_media_and_no_sdp_in_200_with_video },
{ "Call with early media and no SDP in 200 Ok", call_with_early_media_and_no_sdp_in_200 },
{ "Call with early media and no SDP in 200 Ok with video", call_with_early_media_and_no_sdp_in_200_with_video },
{ "Call with ICE and no SDP in 200 OK", call_with_early_media_ice_and_no_sdp_in_200},
{ "Call with custom supported tags", call_with_custom_supported_tags },
{ "Call log from taken from asserted id",call_log_from_taken_from_p_asserted_id},
{ "Incoming INVITE with invalid SDP",incoming_invite_with_invalid_sdp},
......
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