From db750df79d865bff61c969344ec9c61b34db6879 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Tue, 29 Aug 2023 11:08:00 +0800 Subject: [PATCH] =?UTF-8?q?webrtc=20application=20sdp=E6=B7=BB=E5=8A=A0can?= =?UTF-8?q?didate=E7=9B=B8=E5=85=B3=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/Sdp.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index bbb8d980..7051e42f 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1556,7 +1556,7 @@ shared_ptr RtcConfigure::createAnswer(const RtcSession &offer) const if (!offer.group.mids.empty()) { for (auto &m : ret->media) { //The remote end has rejected (port 0) the m-section, so it should not be putting its mid in the group attribute. - if(m.port) { + if (m.port) { ret->group.mids.emplace_back(m.mid); } } @@ -1620,9 +1620,11 @@ RETRY: answer_media.ice_pwd = configure.ice_pwd; answer_media.fingerprint = configure.fingerprint; answer_media.ice_lite = configure.ice_lite; -#ifndef ENABLE_SCTP +#ifdef ENABLE_SCTP + answer_media.candidate = configure.candidate; +#else answer_media.port = 0; - WarnL << "answer sdp忽略application, 请安装usrsctp后再测试datachannel功能"; + WarnL << "answer sdp忽略application mline, 请安装usrsctp后再测试datachannel功能"; #endif ret->media.emplace_back(answer_media); return;