Package org.linphone.core
Interface Tunnel
public interface Tunnel
Linphone tunnel object.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addServer
(TunnelConfig tunnelConfig) Add a tunnel server configuration.void
Remove all tunnel server addresses previously entered withaddServer(org.linphone.core.TunnelConfig)
boolean
Check whether the tunnel is connected.boolean
Returns whether the tunnel is activated.Get the domain.getMode()
Get the tunnel mode.long
Gets the native pointer used by this class to make native method calls.Get added servers.Gets the object stored in this object user's dataGet the username.boolean
Get the dual tunnel client mode.boolean
Check whether tunnel is set to transport SIP packets.void
Force reconnection to the tunnel server.void
removeServer
(TunnelConfig tunnelConfig) Remove a tunnel server configuration.void
Set the domain.void
setDualModeEnabled
(boolean dualModeEnabled) Sets whether or not to use the dual tunnel client mode.void
setHttpProxy
(String host, int port, String username, String passwd) Set an optional http proxy to go through when connecting to tunnel server.void
setHttpProxyAuthInfo
(String username, String passwd) Set authentication info for the http proxy.void
setMode
(Tunnel.Mode mode) Set the tunnel mode.void
setSipEnabled
(boolean enable) Set whether SIP packets must be directly sent to a UA or pass through the
tunnel.void
setUserData
(Object data) Sets the object to store in this object user's datavoid
setUsername
(String username) Set the username.toString()
-
Method Details
-
getActivated
boolean getActivated()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
Get the domain.
- Returns:
- The domain.
-
setDomain
Set the domain.
Required for tunnel TLS client authentification. Certificate Altname or CName
should be sip:- Parameters:
domain
- The domain.
-
isDualModeEnabled
boolean isDualModeEnabled()Get the dual tunnel client mode.
- Returns:
- true if dual tunnel client mode is enabled, false otherwise
-
setDualModeEnabled
void setDualModeEnabled(boolean 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
-
getMode
Tunnel.Mode getMode()Get the tunnel mode.
- Returns:
- The current
Tunnel.Mode
-
setMode
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:
mode
- The desiredTunnel.Mode
-
getServers
Get added servers.
- Returns:
- The list of servers.
-
isSipEnabled
boolean isSipEnabled()Check whether tunnel is set to transport SIP packets.
- Returns:
- A boolean value telling whether SIP packets shall pass through the
tunnel
-
setSipEnabled
void setSipEnabled(boolean 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
-
getUsername
Get the username.
- Returns:
- The username.
-
setUsername
Set the username.
Required for tunnel TLS client authentification. Certificate Altname or CName
should be sip:- Parameters:
username
- The username.
-
addServer
Add a tunnel server configuration.
- Parameters:
tunnelConfig
-TunnelConfig
object
-
cleanServers
void cleanServers()Remove all tunnel server addresses previously entered withaddServer(org.linphone.core.TunnelConfig)
-
connected
boolean connected()Check whether the tunnel is connected.
- Returns:
- A boolean value telling if the tunnel is connected
-
reconnect
void 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
Remove a tunnel server configuration.
- Parameters:
tunnelConfig
-TunnelConfig
object
-
setHttpProxy
void setHttpProxy(@NonNull String host, int port, @Nullable String username, @Nullable String passwd) Set an optional http proxy to go through when connecting to tunnel server.
- Parameters:
host
- http proxy hostport
- http proxy portusername
- Optional http proxy username if the proxy request
authentication. Currently only basic authentication is supported. Use null if
not needed.passwd
- Optional http proxy password. Use null if not needed.
-
setHttpProxyAuthInfo
Set authentication info for the http proxy.
- Parameters:
username
- User namepasswd
- Password
-
setUserData
Sets the object to store in this object user's data- Parameters:
data
- the object to store
-
getUserData
Object getUserData()Gets the object stored in this object user's data- Returns:
- the object store if any, null otherwise
-
getNativePointer
long getNativePointer()Gets the native pointer used by this class to make native method calls.- Returns:
- the nativer pointer, as long
-
toString
String toString()
-