Commit c55a2c6b authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Delay creation of local media description so that edge network detection works with ICE activated.

parent e3d56d41
...@@ -184,7 +184,6 @@ static void call_received(SalOp *h){ ...@@ -184,7 +184,6 @@ static void call_received(SalOp *h){
} }
call=linphone_call_new_incoming(lc,from_addr,to_addr,h); call=linphone_call_new_incoming(lc,from_addr,to_addr,h);
sal_call_set_local_media_description(h,call->localdesc);
/* the call is acceptable so we can now add it to our list */ /* the call is acceptable so we can now add it to our list */
linphone_core_add_call(lc,call); linphone_core_add_call(lc,call);
......
...@@ -269,11 +269,11 @@ static SalMediaDescription *_create_local_media_description(LinphoneCore *lc, Li ...@@ -269,11 +269,11 @@ static SalMediaDescription *_create_local_media_description(LinphoneCore *lc, Li
md->streams[i].crypto[1].algo = 0; md->streams[i].crypto[1].algo = 0;
md->streams[i].crypto[2].algo = 0; md->streams[i].crypto[2].algo = 0;
} }
if ((linphone_core_get_firewall_policy(call->core) == LinphonePolicyUseIce) && (call->ice_session != NULL) && (ice_session_check_list(call->ice_session, i) == NULL)) {
ice_session_add_check_list(call->ice_session, ice_check_list_new());
}
} }
update_media_description_from_stun(md,&call->ac,&call->vc); update_media_description_from_stun(md,&call->ac,&call->vc);
if (call->ice_session != NULL) {
linphone_core_update_local_media_description_from_ice(md, call->ice_session);
}
linphone_address_destroy(addr); linphone_address_destroy(addr);
return md; return md;
} }
...@@ -378,7 +378,6 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr ...@@ -378,7 +378,6 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr
if (ping_time>=0) { if (ping_time>=0) {
linphone_core_adapt_to_network(lc,ping_time,&call->params); linphone_core_adapt_to_network(lc,ping_time,&call->params);
} }
call->localdesc=create_local_media_description(lc,call);
call->camera_active=params->has_video; call->camera_active=params->has_video;
discover_mtu(lc,linphone_address_get_domain (to)); discover_mtu(lc,linphone_address_get_domain (to));
...@@ -439,7 +438,6 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro ...@@ -439,7 +438,6 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
if (ping_time>=0) { if (ping_time>=0) {
linphone_core_adapt_to_network(lc,ping_time,&call->params); linphone_core_adapt_to_network(lc,ping_time,&call->params);
}; };
call->localdesc=create_local_media_description(lc,call);
call->camera_active=call->params.has_video; call->camera_active=call->params.has_video;
discover_mtu(lc,linphone_address_get_domain(from)); discover_mtu(lc,linphone_address_get_domain(from));
...@@ -1011,6 +1009,9 @@ void linphone_call_init_audio_stream(LinphoneCall *call){ ...@@ -1011,6 +1009,9 @@ void linphone_call_init_audio_stream(LinphoneCall *call){
if ((linphone_core_get_firewall_policy(lc) == LinphonePolicyUseIce) && (call->ice_session != NULL)){ if ((linphone_core_get_firewall_policy(lc) == LinphonePolicyUseIce) && (call->ice_session != NULL)){
rtp_session_set_pktinfo(audiostream->session, TRUE); rtp_session_set_pktinfo(audiostream->session, TRUE);
rtp_session_set_symmetric_rtp(audiostream->session, FALSE); rtp_session_set_symmetric_rtp(audiostream->session, FALSE);
if (ice_session_check_list(call->ice_session, 0) == NULL) {
ice_session_add_check_list(call->ice_session, ice_check_list_new());
}
audiostream->ice_check_list = ice_session_check_list(call->ice_session, 0); audiostream->ice_check_list = ice_session_check_list(call->ice_session, 0);
ice_check_list_set_rtp_session(audiostream->ice_check_list, audiostream->session); ice_check_list_set_rtp_session(audiostream->ice_check_list, audiostream->session);
} }
...@@ -1044,6 +1045,9 @@ void linphone_call_init_video_stream(LinphoneCall *call){ ...@@ -1044,6 +1045,9 @@ void linphone_call_init_video_stream(LinphoneCall *call){
if ((linphone_core_get_firewall_policy(lc) == LinphonePolicyUseIce) && (call->ice_session != NULL) && (ice_session_check_list(call->ice_session, 1))){ if ((linphone_core_get_firewall_policy(lc) == LinphonePolicyUseIce) && (call->ice_session != NULL) && (ice_session_check_list(call->ice_session, 1))){
rtp_session_set_pktinfo(call->videostream->session, TRUE); rtp_session_set_pktinfo(call->videostream->session, TRUE);
rtp_session_set_symmetric_rtp(call->videostream->session, FALSE); rtp_session_set_symmetric_rtp(call->videostream->session, FALSE);
if (ice_session_check_list(call->ice_session, 1) == NULL) {
ice_session_add_check_list(call->ice_session, ice_check_list_new());
}
call->videostream->ice_check_list = ice_session_check_list(call->ice_session, 1); call->videostream->ice_check_list = ice_session_check_list(call->ice_session, 1);
ice_check_list_set_rtp_session(call->videostream->ice_check_list, call->videostream->session); ice_check_list_set_rtp_session(call->videostream->ice_check_list, call->videostream->session);
} }
......
...@@ -2195,10 +2195,9 @@ int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, LinphonePro ...@@ -2195,10 +2195,9 @@ int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, LinphonePro
linphone_call_init_media_streams(call); linphone_call_init_media_streams(call);
if (lc->ringstream==NULL) if (lc->ringstream==NULL)
audio_stream_prepare_sound(call->audiostream,lc->sound_conf.play_sndcard,lc->sound_conf.capt_sndcard); audio_stream_prepare_sound(call->audiostream,lc->sound_conf.play_sndcard,lc->sound_conf.capt_sndcard);
call->localdesc=create_local_media_description(lc,call);
if (!lc->sip_conf.sdp_200_ack){ if (!lc->sip_conf.sdp_200_ack){
call->media_pending=TRUE; call->media_pending=TRUE;
if (call->ice_session != NULL)
linphone_core_update_local_media_description_from_ice(call->localdesc, call->ice_session);
sal_call_set_local_media_description(call->op,call->localdesc); sal_call_set_local_media_description(call->op,call->localdesc);
} }
real_url=linphone_address_as_string(call->log->to); real_url=linphone_address_as_string(call->log->to);
...@@ -2457,8 +2456,8 @@ void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call){ ...@@ -2457,8 +2456,8 @@ void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call){
bool_t propose_early_media=lp_config_get_int(lc->config,"sip","incoming_calls_early_media",FALSE); bool_t propose_early_media=lp_config_get_int(lc->config,"sip","incoming_calls_early_media",FALSE);
const char *ringback_tone=linphone_core_get_remote_ringback_tone (lc); const char *ringback_tone=linphone_core_get_remote_ringback_tone (lc);
if (call->ice_session != NULL) call->localdesc=create_local_media_description(lc,call);
linphone_core_update_local_media_description_from_ice(call->localdesc, call->ice_session); sal_call_set_local_media_description(call->op,call->localdesc);
md=sal_call_get_final_media_description(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)){
sal_call_decline(call->op,SalReasonMedia,NULL); sal_call_decline(call->op,SalReasonMedia,NULL);
......
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