提交 999a6dd0 authored 作者: Ethan Atkins's avatar Ethan Atkins

FS-10485: Re-activate ICE on all attribute changes

I ran into some ice failures when testing reinvites using
bypass_media_after_bridge. Every ice session has ice-ufrag and ice-pwd
attributes. When leg A sends those attributes to leg B, leg B is
supposed to send stun packets to leg A using the credentials provided in
those attributes. Freeswitch was not updating the session credentials
when the phone sent a new invite containing new ufrag and pwd
attributes. This caused ICE to fail on the client side (PJSIP in this
case).

The new_ice flag is set to true when freeswitch detects a change in
those attributes. For whatever reason, the reinvite flows that I was
testing did not set the CF_REINVITE flag on the channel, but new_ice was
true. It seems to me that freeswitch should always reactivate ice when
the ufrag and pwd credentials change.
上级 aba1068e
...@@ -4026,8 +4026,8 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t ...@@ -4026,8 +4026,8 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
engine->rtcp_mux = -1; engine->rtcp_mux = -1;
} }
if (switch_channel_test_flag(smh->session->channel, CF_REINVITE)) { if (engine->new_ice) {
if (switch_rtp_ready(engine->rtp_session) && engine->ice_in.cands[engine->ice_in.chosen[0]][0].ready && engine->new_ice) { if (switch_rtp_ready(engine->rtp_session) && engine->ice_in.cands[engine->ice_in.chosen[0]][0].ready) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_INFO, "RE-Activating %s ICE\n", type2str(type)); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_INFO, "RE-Activating %s ICE\n", type2str(type));
switch_rtp_activate_ice(engine->rtp_session, switch_rtp_activate_ice(engine->rtp_session,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论