OpenTera WebRTC API (C++) 1.2.5
Public Member Functions | Static Public Member Functions | List of all members
opentera::IceServer Class Reference

Represents an ice server configuration. More...

#include <IceServer.h>

Public Member Functions

 IceServer (std::string url)
 Creates an ice server configuration with the specified value. More...
 
 IceServer (std::string url, std::string username, std::string credential)
 Creates an ice server configuration with the specified values. More...
 
 IceServer (std::vector< std::string > urls)
 Creates an ice server configuration with the specified value. More...
 
 IceServer (std::vector< std::string > urls, std::string username, std::string credential)
 Creates an ice server configuration with the specified values. More...
 
const std::vector< std::string > & urls () const
 Returns the ice server urls. More...
 
const std::string & username () const
 Returns the ice server username. More...
 
const std::string & credential () const
 Returns the ice server credential. More...
 
 operator webrtc::PeerConnectionInterface::IceServer () const
 

Static Public Member Functions

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. More...
 
static bool fromJson (const std::string &json, std::vector< IceServer > &iceServers)
 Gets ice servers from a JSON. More...
 

Detailed Description

Represents an ice server configuration.

Constructor & Destructor Documentation

◆ IceServer() [1/4]

IceServer::IceServer ( std::string  url)
explicit

Creates an ice server configuration with the specified value.

Parameters
urlThe ice server url

◆ IceServer() [2/4]

IceServer::IceServer ( std::string  url,
std::string  username,
std::string  credential 
)

Creates an ice server configuration with the specified values.

Parameters
urlThe ice server url
usernameThe ice server username
credentialThe ice server credential

◆ IceServer() [3/4]

IceServer::IceServer ( std::vector< std::string >  urls)
explicit

Creates an ice server configuration with the specified value.

Parameters
urlsThe ice server urls

◆ IceServer() [4/4]

IceServer::IceServer ( std::vector< std::string >  urls,
std::string  username,
std::string  credential 
)

Creates an ice server configuration with the specified values.

Parameters
urlsThe ice server urls
usernameThe ice server username
credentialThe ice server credential

Member Function Documentation

◆ credential()

const std::string & opentera::IceServer::credential ( ) const
inline

Returns the ice server credential.

Returns
The ice server credential

◆ fetchFromServer()

bool IceServer::fetchFromServer ( const std::string &  url,
const std::string &  password,
std::vector< IceServer > &  iceServers,
bool  verifyCertificate = true 
)
static

Fetches the ice servers from the signaling server.

Parameters
urlThe signaling server url
passwordThe signaling server username
iceServersThe fetched ice servers
verifyCertificateIndicates to verify the certificate or not
Returns
true if success

◆ fromJson()

bool IceServer::fromJson ( const std::string &  json,
std::vector< IceServer > &  iceServers 
)
static

Gets ice servers from a JSON.

Parameters
jsonThe JSON to parse
iceServersThe parsed ice servers
Returns
true if success

◆ urls()

const std::vector< std::string > & opentera::IceServer::urls ( ) const
inline

Returns the ice server urls.

Returns
The ice server urls

◆ username()

const std::string & opentera::IceServer::username ( ) const
inline

Returns the ice server username.

Returns
The ice server username

The documentation for this class was generated from the following files: