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

@@ -27,8 +27,8 @@ IceTransport::IceTransport(
IceTransport::~IceTransport() {}
int IceTransport::InitIceTransport() {
ice_agent_ = new IceAgent();
int IceTransport::InitIceTransport(std::string &ip, int port) {
ice_agent_ = new IceAgent(ip, port);
ice_agent_->CreateIceAgent(
[](juice_agent_t *agent, juice_state_t state, void *user_ptr) {
@@ -60,10 +60,11 @@ int IceTransport::InitIceTransport() {
return 0;
}
int IceTransport::InitIceTransport(std::string const &id) {
int IceTransport::InitIceTransport(std::string &ip, int port,
std::string const &id) {
transport_id_ = id;
ice_agent_ = new IceAgent();
ice_agent_ = new IceAgent(ip, port);
ice_agent_->CreateIceAgent(
[](juice_agent_t *agent, juice_state_t state, void *user_ptr) {