#include <tunnel.hh>
◆ Mode
Enum describing the tunnel modes.
| Enumerator |
|---|
| Disable | The tunnel is disabled.
|
| Enable | The tunnel is enabled.
|
| Auto | The tunnel is enabled automatically if it is required.
|
◆ addServer()
| LINPHONECXX_PUBLIC void linphone::Tunnel::addServer |
( |
const std::shared_ptr< linphone::TunnelConfig > & |
tunnelConfig | ) |
|
Add a tunnel server configuration.
- Parameters
-
◆ connected()
| LINPHONECXX_PUBLIC bool linphone::Tunnel::connected |
( |
| ) |
const |
Check whether the tunnel is connected.
- Returns
- A boolean value telling if the tunnel is connected
◆ dualModeEnabled()
| LINPHONECXX_PUBLIC bool linphone::Tunnel::dualModeEnabled |
( |
| ) |
const |
Get the dual tunnel client mode.
- Returns
- true if dual tunnel client mode is enabled, false otherwise
◆ enableDualMode()
| 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.
- Parameters
-
| dualModeEnabled | true to enable it, false to disable it |
◆ enableSip()
| LINPHONECXX_PUBLIC void linphone::Tunnel::enableSip |
( |
bool |
enable | ) |
|
Set whether SIP packets must be directly sent to a UA or pass through the tunnel.
- Parameters
-
| enable | If true, SIP packets shall pass through the tunnel |
◆ getActivated()
| 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.
- Returns
- true if tunnel is in use, false otherwise.
◆ getDomain()
| LINPHONECXX_PUBLIC std::string linphone::Tunnel::getDomain |
( |
| ) |
|
Get the domain.
- Returns
- The domain.
◆ getMode()
| LINPHONECXX_PUBLIC Mode linphone::Tunnel::getMode |
( |
| ) |
const |
Get the tunnel mode.
- Returns
- The current Mode
◆ getServers()
| LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::TunnelConfig > > linphone::Tunnel::getServers |
( |
| ) |
const |
Get added servers.
- Returns
- The list of servers.
◆ getUsername()
| LINPHONECXX_PUBLIC std::string linphone::Tunnel::getUsername |
( |
| ) |
|
Get the username.
- Returns
- The username.
◆ reconnect()
| 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.
◆ removeServer()
| LINPHONECXX_PUBLIC void linphone::Tunnel::removeServer |
( |
const std::shared_ptr< linphone::TunnelConfig > & |
tunnelConfig | ) |
|
Remove a tunnel server configuration.
- Parameters
-
◆ setDomain()
| 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>
- Parameters
-
◆ setHttpProxy()
| 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.
- Parameters
-
| 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. |
◆ setHttpProxyAuthInfo()
| LINPHONECXX_PUBLIC void linphone::Tunnel::setHttpProxyAuthInfo |
( |
const std::string & |
username, |
|
|
const std::string & |
passwd |
|
) |
| |
Set authentication info for the http proxy.
- Parameters
-
| username | User name
|
| passwd | Password
|
◆ setMode()
| 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.
- Parameters
-
◆ setUsername()
| 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>
- Parameters
-
◆ sipEnabled()
| LINPHONECXX_PUBLIC bool linphone::Tunnel::sipEnabled |
( |
| ) |
const |
Check whether tunnel is set to transport SIP packets.
- Returns
- A boolean value telling whether SIP packets shall pass through the tunnel
The documentation for this class was generated from the following file: