Liblinphone
5.3.0
|
Linphone tunnel object. More...
#include <tunnel.hh>
Public Types | |
enum | Mode { Mode::Disable = 0, Mode::Enable = 1, Mode::Auto = 2 } |
Enum describing the tunnel modes. More... | |
Public Member Functions | |
LINPHONECXX_PUBLIC | Tunnel (void *ptr, bool takeRef=true) |
LINPHONECXX_PUBLIC _LinphoneTunnel * | cPtr () |
LINPHONECXX_PUBLIC bool | getActivated () const |
Returns whether the tunnel is activated. More... | |
LINPHONECXX_PUBLIC std::string | getDomain () |
Get the domain. More... | |
LINPHONECXX_PUBLIC void | setDomain (const std::string &domain) |
Set the domain. More... | |
LINPHONECXX_PUBLIC bool | dualModeEnabled () const |
Get the dual tunnel client mode. More... | |
LINPHONECXX_PUBLIC void | enableDualMode (bool dualModeEnabled) |
Sets whether or not to use the dual tunnel client mode. More... | |
LINPHONECXX_PUBLIC Mode | getMode () const |
Get the tunnel mode. More... | |
LINPHONECXX_PUBLIC void | setMode (Mode mode) |
Set the tunnel mode. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::TunnelConfig > > | getServers () const |
Get added servers. More... | |
LINPHONECXX_PUBLIC bool | sipEnabled () const |
Check whether tunnel is set to transport SIP packets. More... | |
LINPHONECXX_PUBLIC void | enableSip (bool enable) |
Set whether SIP packets must be directly sent to a UA or pass through the tunnel. More... | |
LINPHONECXX_PUBLIC std::string | getUsername () |
Get the username. More... | |
LINPHONECXX_PUBLIC void | setUsername (const std::string &username) |
Set the username. More... | |
LINPHONECXX_PUBLIC void | addServer (const std::shared_ptr< linphone::TunnelConfig > &tunnelConfig) |
Add a tunnel server configuration. More... | |
LINPHONECXX_PUBLIC void | cleanServers () |
Remove all tunnel server addresses previously entered with addServer() More... | |
LINPHONECXX_PUBLIC bool | connected () const |
Check whether the tunnel is connected. More... | |
LINPHONECXX_PUBLIC void | reconnect () |
Force reconnection to the tunnel server. More... | |
LINPHONECXX_PUBLIC void | removeServer (const std::shared_ptr< linphone::TunnelConfig > &tunnelConfig) |
Remove a tunnel server configuration. More... | |
LINPHONECXX_PUBLIC void | setHttpProxy (const std::string &host, int port, const std::string &username, const std::string &passwd) |
Set an optional http proxy to go through when connecting to tunnel server. More... | |
LINPHONECXX_PUBLIC void | setHttpProxyAuthInfo (const std::string &username, const std::string &passwd) |
Set authentication info for the http proxy. More... | |
Linphone tunnel object.
|
strong |
LINPHONECXX_PUBLIC void linphone::Tunnel::addServer | ( | const std::shared_ptr< linphone::TunnelConfig > & | tunnelConfig | ) |
Add a tunnel server configuration.
tunnelConfig | TunnelConfig object |
LINPHONECXX_PUBLIC void linphone::Tunnel::cleanServers | ( | ) |
Remove all tunnel server addresses previously entered with addServer()
LINPHONECXX_PUBLIC bool linphone::Tunnel::connected | ( | ) | const |
Check whether the tunnel is connected.
LINPHONECXX_PUBLIC bool linphone::Tunnel::dualModeEnabled | ( | ) | const |
Get the dual tunnel client mode.
LINPHONECXX_PUBLIC void linphone::Tunnel::enableDualMode | ( | bool | dualModeEnabled | ) |
Sets whether or not to use the dual tunnel client mode.
By default this feature is disabled. After enabling it, add a server with 2 hosts and 2 ports for the feature to work.
dualModeEnabled | true to enable it, false to disable it |
LINPHONECXX_PUBLIC void linphone::Tunnel::enableSip | ( | bool | enable | ) |
Set whether SIP packets must be directly sent to a UA or pass through the tunnel.
enable | If true, SIP packets shall pass through the tunnel |
LINPHONECXX_PUBLIC bool linphone::Tunnel::getActivated | ( | ) | const |
Returns whether the tunnel is activated.
If mode is set to auto, this gives indication whether the automatic detection determined that tunnel was necessary or not.
LINPHONECXX_PUBLIC std::string linphone::Tunnel::getDomain | ( | ) |
Get the domain.
LINPHONECXX_PUBLIC Mode linphone::Tunnel::getMode | ( | ) | const |
Get the tunnel mode.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::TunnelConfig> > linphone::Tunnel::getServers | ( | ) | const |
Get added servers.
LINPHONECXX_PUBLIC std::string linphone::Tunnel::getUsername | ( | ) |
Get the username.
LINPHONECXX_PUBLIC void linphone::Tunnel::reconnect | ( | ) |
Force reconnection to the tunnel server.
This method is useful when the device switches from wifi to Edge/3G or vice versa. In most cases the tunnel client socket won't be notified promptly that its connection is now zombie, so it is recommended to call this method that will cause the lost connection to be closed and new connection to be issued.
LINPHONECXX_PUBLIC void linphone::Tunnel::removeServer | ( | const std::shared_ptr< linphone::TunnelConfig > & | tunnelConfig | ) |
Remove a tunnel server configuration.
tunnelConfig | TunnelConfig object |
LINPHONECXX_PUBLIC void linphone::Tunnel::setDomain | ( | const std::string & | domain | ) |
Set the domain.
Required for tunnel TLS client authentification. Certificate Altname or CName should be sip:<tunnel_username><tunnel_domain>
domain | The domain. |
LINPHONECXX_PUBLIC void linphone::Tunnel::setHttpProxy | ( | const std::string & | host, |
int | port, | ||
const std::string & | username, | ||
const std::string & | passwd | ||
) |
Set an optional http proxy to go through when connecting to tunnel server.
host | http proxy host |
port | http proxy port |
username | Optional http proxy username if the proxy request authentication. Currently only basic authentication is supported. Use nullptr if not needed. |
passwd | Optional http proxy password. Use nullptr if not needed. |
LINPHONECXX_PUBLIC void linphone::Tunnel::setHttpProxyAuthInfo | ( | const std::string & | username, |
const std::string & | passwd | ||
) |
Set authentication info for the http proxy.
username | User name |
passwd | Password |
LINPHONECXX_PUBLIC void linphone::Tunnel::setMode | ( | Mode | mode | ) |
Set the tunnel mode.
The tunnel mode can be 'enable', 'disable' or 'auto' If the mode is set to 'auto', the tunnel manager will try to established an RTP session with the tunnel server on the UdpMirrorPort. If the connection fail, the tunnel is automatically activated whereas the tunnel is automatically disabled if the connection succeed.
mode | The desired Mode |
LINPHONECXX_PUBLIC void linphone::Tunnel::setUsername | ( | const std::string & | username | ) |
Set the username.
Required for tunnel TLS client authentification. Certificate Altname or CName should be sip:<tunnel_username><tunnel_domain>
username | The username. |
LINPHONECXX_PUBLIC bool linphone::Tunnel::sipEnabled | ( | ) | const |
Check whether tunnel is set to transport SIP packets.