Tunnel

public class Tunnel : LinphoneObject

Linphone tunnel object.

  • Undocumented

    Declaration

    Swift

    public static func getSwiftObject(cObject: OpaquePointer) -> Tunnel
  • Undocumented

    Declaration

    Swift

    public var getCobject: OpaquePointer? { get }
  • Enum describing the tunnel modes.

    See more

    Declaration

    Swift

    public enum Mode : Int
  • 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.

    Declaration

    Swift

    public var activated: Bool { get }

    Return Value

    true if tunnel is in use, false otherwise.

  • Set the domain. Required for tunnel TLS client authentification. Certificate Altname or CName should be sip:

    Declaration

    Swift

    public var domain: String { get set }

    Parameters

    domain

    The domain.
    Get the domain.

    Return Value

    The domain.

  • 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.

    Declaration

    Swift

    public var dualModeEnabled: Bool { get set }

    Parameters

    dualModeEnabled

    true to enable it, false to disable it Get the dual tunnel client mode.

    Return Value

    true if dual tunnel client mode is enabled, false otherwise

  • 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.

    Declaration

    Swift

    public var mode: Tunnel.Mode { get set }

    Parameters

    mode

    The desired Mode Get the tunnel mode.

    Return Value

    The current Mode

  • Get added servers.

    Declaration

    Swift

    public var servers: [TunnelConfig] { get }

    Return Value

    The list of servers.

  • Set whether SIP packets must be directly sent to a UA or pass through the tunnel.

    Declaration

    Swift

    public var sipEnabled: Bool { get set }

    Parameters

    enable

    If true, SIP packets shall pass through the tunnel Check whether tunnel is set to transport SIP packets.

    Return Value

    A boolean value telling whether SIP packets shall pass through the tunnel

  • Set the username. Required for tunnel TLS client authentification. Certificate Altname or CName should be sip:

    Declaration

    Swift

    public var username: String { get set }

    Parameters

    username

    The username.
    Get the username.

    Return Value

    The username.

  • Add a tunnel server configuration.

    Declaration

    Swift

    public func addServer(tunnelConfig: TunnelConfig)

    Parameters

    tunnelConfig

    TunnelConfig object

  • Remove all tunnel server addresses previously entered with addServer()

    Declaration

    Swift

    public func cleanServers()
  • Check whether the tunnel is connected.

    Declaration

    Swift

    public func connected() -> Bool

    Return Value

    A boolean value telling if the tunnel is connected

  • 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.

    Declaration

    Swift

    public func reconnect()
  • Remove a tunnel server configuration.

    Declaration

    Swift

    public func removeServer(tunnelConfig: TunnelConfig)

    Parameters

    tunnelConfig

    TunnelConfig object

  • Set an optional http proxy to go through when connecting to tunnel server.

    Declaration

    Swift

    public func setHttpProxy(host: String, port: Int, username: String?, passwd: String?)

    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 nil if not needed.

    passwd

    Optional http proxy password. Use nil if not needed.

  • Set authentication info for the http proxy.

    Declaration

    Swift

    public func setHttpProxyAuthInfo(username: String?, passwd: String?)

    Parameters

    username

    User name

    passwd

    Password