Browse Source

Changed default data mid to a number

Paul-Louis Ageneau 4 years ago
parent
commit
62da885028
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/peerconnection.cpp

+ 4 - 1
src/peerconnection.cpp

@@ -1014,7 +1014,10 @@ void PeerConnection::processLocalDescription(Description description) {
 		if (!description.hasApplication()) {
 			std::shared_lock lock(mDataChannelsMutex);
 			if (!mDataChannels.empty()) {
-				Description::Application app("data");
+				unsigned int m = 0;
+				while (description.hasMid(std::to_string(m)))
+					++m;
+				Description::Application app(std::to_string(m));
 				app.setSctpPort(DEFAULT_SCTP_PORT);
 				app.setMaxMessageSize(LOCAL_MAX_MESSAGE_SIZE);