Index: talk/app/webrtc/webrtcsessiondescriptionfactory.cc |
diff --git a/talk/app/webrtc/webrtcsessiondescriptionfactory.cc b/talk/app/webrtc/webrtcsessiondescriptionfactory.cc |
index 25965af79d30f92cddd20b999436d67d4a95f601..3a76aca02efaa4fd2e654489e03c9f5d2e935b68 100644 |
--- a/talk/app/webrtc/webrtcsessiondescriptionfactory.cc |
+++ b/talk/app/webrtc/webrtcsessiondescriptionfactory.cc |
@@ -390,7 +390,9 @@ void WebRtcSessionDescriptionFactory::InternalCreateOffer( |
return; |
} |
if (session_->local_description() && |
- !request.options.transport_options.ice_restart) { |
+ !request.options.audio_transport_options.ice_restart && |
+ !request.options.video_transport_options.ice_restart && |
+ !request.options.data_transport_options.ice_restart) { |
// Include all local ice candidates in the SessionDescription unless |
// the an ice restart has been requested. |
CopyCandidatesFromSessionDescription(session_->local_description(), offer); |
@@ -403,12 +405,31 @@ void WebRtcSessionDescriptionFactory::InternalCreateAnswer( |
// According to http://tools.ietf.org/html/rfc5245#section-9.2.1.1 |
// an answer should also contain new ice ufrag and password if an offer has |
// been received with new ufrag and password. |
- request.options.transport_options.ice_restart = session_->IceRestartPending(); |
+ request.options.audio_transport_options.ice_restart = |
+ session_->IceRestartPending(); |
+ request.options.video_transport_options.ice_restart = |
+ session_->IceRestartPending(); |
+ request.options.data_transport_options.ice_restart = |
+ session_->IceRestartPending(); |
// We should pass current ssl role to the transport description factory, if |
// there is already an existing ongoing session. |
rtc::SSLRole ssl_role; |
- if (session_->GetSslRole(&ssl_role)) { |
- request.options.transport_options.prefer_passive_role = |
+ if (session_->voice_channel() && |
+ session_->GetSslRole(session_->voice_channel()->transport_name(), |
+ &ssl_role)) { |
pthatcher1
2015/12/11 03:16:09
Again, a helper method for GetSslRole(base_channel
Taylor Brandstetter
2016/01/07 22:25:55
Done.
|
+ request.options.audio_transport_options.prefer_passive_role = |
+ (rtc::SSL_SERVER == ssl_role); |
+ } |
+ if (session_->video_channel() && |
+ session_->GetSslRole(session_->video_channel()->transport_name(), |
+ &ssl_role)) { |
+ request.options.video_transport_options.prefer_passive_role = |
+ (rtc::SSL_SERVER == ssl_role); |
+ } |
+ if (session_->data_channel() && |
+ session_->GetSslRole(session_->data_channel()->transport_name(), |
+ &ssl_role)) { |
+ request.options.data_transport_options.prefer_passive_role = |
(rtc::SSL_SERVER == ssl_role); |
} |
@@ -437,7 +458,9 @@ void WebRtcSessionDescriptionFactory::InternalCreateAnswer( |
return; |
} |
if (session_->local_description() && |
- !request.options.transport_options.ice_restart) { |
+ !request.options.audio_transport_options.ice_restart && |
+ !request.options.video_transport_options.ice_restart && |
+ !request.options.data_transport_options.ice_restart) { |
// Include all local ice candidates in the SessionDescription unless |
// the remote peer has requested an ice restart. |
CopyCandidatesFromSessionDescription(session_->local_description(), answer); |