NatPolicy

public class NatPolicy : LinphoneObject

Policy to use to pass through NATs/firewalls.

  • Declaration

    Swift

    public static func getSwiftObject(cObject: OpaquePointer) -> NatPolicy
  • Declaration

    Swift

    public var getCobject: OpaquePointer? { get }
  • Returns the Core object managing this nat policy, if any.

    Declaration

    Swift

    public var core: Core? { get }

    Return Value

    the Core object associated.

  • Enable ICE. ICE can be enabled without STUN/TURN, in which case only the local candidates will be used.

    Declaration

    Swift

    public var iceEnabled: Bool { get set }

    Return Value

    Boolean value telling whether ICE is enabled.

  • Set the mandatory v4 IP address to use with this NAT policy as server-reflexive candidate for ICE. The IP address is used only if no stun server is set for server-reflexive candidate gathering. Using this method is useful when Liblinphone is used in a server product, when the server does not own the public IP address. Used when STUN or TURN are enabled.

    Declaration

    Swift

    public var natV4Address: String { get set }

    Return Value

    the nat v4 address.

  • Set the mandatory v6 IP address to use with this NAT policy as server-reflexive candidate for ICE. The IP address is used only if no stun server is set for server-reflexive candidate gathering. Using this method is useful when Liblinphone is used in a server product, when the server does not own the public IP address. Used when STUN or TURN are enabled.

    Declaration

    Swift

    public var natV6Address: String { get set }

    Return Value

    the nat v4 address.

  • Enable STUN. If TURN is also enabled, TURN will be used instead of STUN.

    Declaration

    Swift

    public var stunEnabled: Bool { get set }

    Return Value

    Boolean value telling whether STUN is enabled.

  • Set the STUN/TURN server to use with this NAT policy. Used when STUN or TURN are enabled.

    Declaration

    Swift

    public var stunServer: String { get set }

    Return Value

    The STUN server used by this NAT policy.

  • Set the username used to authenticate with the STUN/TURN server. The authentication will search for a AuthInfo with this username. If it is not set the username of the currently used ProxyConfig is used to search for a LinphoneAuthInfo.

    Declaration

    Swift

    public var stunServerUsername: String { get set }

    Return Value

    The username used to authenticate with the STUN/TURN server.

  • Enable TCP TURN transport. Used when TURN is enabled.

    Declaration

    Swift

    public var tcpTurnTransportEnabled: Bool { get set }

    Return Value

    Boolean value telling whether TCP TURN transport is enabled.

  • Enable TLS TURN transport. Used when TURN is enabled.

    Declaration

    Swift

    public var tlsTurnTransportEnabled: Bool { get set }

    Return Value

    Boolean value telling whether TLS TURN transport is enabled.

  • Enable TURN. If STUN is also enabled, it is ignored and TURN is used.

    Declaration

    Swift

    public var turnEnabled: Bool { get set }

    Return Value

    Boolean value telling whether TURN is enabled.

  • Enable UDP TURN transport. Used when TURN is enabled.

    Declaration

    Swift

    public var udpTurnTransportEnabled: Bool { get set }

    Return Value

    Boolean value telling whether UDP TURN transport is enabled.

  • Enable uPnP. This has the effect to disable every other policies (ICE, STUN and TURN).

    Declaration

    Swift

    public var upnpEnabled: Bool { get set }

    Return Value

    Boolean value telling whether uPnP is enabled.

  • Assign a user pointer to the NatPolicy object.

    Declaration

    Swift

    public var userData: UnsafeMutableRawPointer? { get set }

    Return Value

    The user pointer associated with the NatPolicy object.

  • Clear a NAT policy (deactivate all protocols and unset the STUN server).

    Declaration

    Swift

    public func clear()
  • Clone an existing NatPolicy object. Clone a NatPolicy object.

    Declaration

    Swift

    public func clone() -> NatPolicy?

    Return Value

    a new NatPolicy object.

  • Start a STUN server DNS resolution.

    Declaration

    Swift

    public func resolveStunServer()