1 #ifndef OPENTERA_WEBRTC_NATIVE_CLIENT_UTILS_ICE_SERVER_H
2 #define OPENTERA_WEBRTC_NATIVE_CLIENT_UTILS_ICE_SERVER_H
4 #include <api/peer_connection_interface.h>
16 std::vector<std::string> m_urls;
17 std::string m_username;
18 std::string m_credential;
27 const std::vector<std::string>&
urls()
const;
31 explicit operator webrtc::PeerConnectionInterface::IceServer()
const;
34 const std::string& url,
35 const std::string& password,
36 std::vector<IceServer>& iceServers,
37 bool verifyCertificate =
true);
38 static bool fromJson(
const std::string& json, std::vector<IceServer>& iceServers);
59 inline IceServer::operator webrtc::PeerConnectionInterface::IceServer()
const
61 webrtc::PeerConnectionInterface::IceServer iceServer;
62 iceServer.urls = m_urls;
63 iceServer.username = m_username;
64 iceServer.password = m_credential;
Represents an ice server configuration.
Definition: IceServer.h:15
const std::string & username() const
Returns the ice server username.
Definition: IceServer.h:51
static bool fetchFromServer(const std::string &url, const std::string &password, std::vector< IceServer > &iceServers, bool verifyCertificate=true)
Fetches the ice servers from the signaling server.
Definition: IceServer.cpp:61
static bool fromJson(const std::string &json, std::vector< IceServer > &iceServers)
Gets ice servers from a JSON.
Definition: IceServer.cpp:133
const std::vector< std::string > & urls() const
Returns the ice server urls.
Definition: IceServer.h:45
const std::string & credential() const
Returns the ice server credential.
Definition: IceServer.h:57
IceServer(std::string url)
Creates an ice server configuration with the specified value.
Definition: IceServer.cpp:15