Use config to declare signal/stun server info

This commit is contained in:
dijunkun
2023-07-18 16:58:53 +08:00
parent ea9ffbd6d8
commit 03cb767f1f
16 changed files with 830 additions and 34 deletions

View File

@@ -6,7 +6,7 @@
#include "log.h"
IceAgent::IceAgent() {}
IceAgent::IceAgent(std::string &ip, uint16_t port) : ip_(ip), port_(port) {}
IceAgent::~IceAgent() {}
@@ -20,8 +20,8 @@ int IceAgent::CreateIceAgent(juice_cb_state_changed_t on_state_changed,
memset(&config, 0, sizeof(config));
// STUN server example
config.stun_server_host = "120.77.216.215";
config.stun_server_port = 3478;
config.stun_server_host = ip_.c_str();
config.stun_server_port = port_;
config.cb_state_changed = on_state_changed;
config.cb_candidate = on_candidate;