Browse Source

Fixed STUN server for libjuice

Paul-Louis Ageneau 5 years ago
parent
commit
6c4e8f0d46
2 changed files with 6 additions and 2 deletions
  1. 4 2
      src/icetransport.cpp
  2. 2 0
      src/icetransport.hpp

+ 4 - 2
src/icetransport.cpp

@@ -72,8 +72,10 @@ IceTransport::IceTransport(const Configuration &config, Description::Role role,
 				server.service = "3478"; // STUN UDP port
 			PLOG_DEBUG << "Using STUN server \"" << server.hostname << ":" << server.service
 			           << "\"";
-			jconfig.stun_server_host = server.hostname.c_str();
-			jconfig.stun_server_port = std::stoul(server.service);
+			mStunHostname = server.hostname;
+			mStunService = server.service;
+			jconfig.stun_server_host = mStunHostname.c_str();
+			jconfig.stun_server_port = std::stoul(mStunService);
 		}
 	}
 

+ 2 - 0
src/icetransport.hpp

@@ -107,6 +107,8 @@ private:
 
 #if USE_JUICE
 	std::unique_ptr<juice_agent_t, void (*)(juice_agent_t *)> mAgent;
+	string mStunHostname;
+	string mStunService;
 
 	static void StateChangeCallback(juice_agent_t *agent, juice_state_t state, void *user_ptr);
 	static void CandidateCallback(juice_agent_t *agent, const char *sdp, void *user_ptr);