ProxyConfig

public class ProxyConfig : LinphoneObject

Represents an account configuration to be used by Core. In addition to the AuthInfo that stores the credentials, you need to configure a ProxyConfig as well to be able to connect to a proxy server. A minimal proxy config consists of an identity address (sip:username@domain.tld) and the proxy server address, - See also: setServerAddr(). If any, it will be stored inside the default configuration file, so it will survive the destruction of the Core and be available at the next start. The account set with Core.setDefaultProxyConfig() will be used as default for outgoing calls & chat messages unless specified otherwise.

  • deprecated: 06/04/2020 Use Account object instead
  • Undocumented

    Declaration

    Swift

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

    Declaration

    Swift

    public var getCobject: OpaquePointer? { get }
  • Indicates whether AVPF/SAVPF is being used for calls using this proxy config.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var avpfEnabled: Bool { get }

    Return Value

    True if AVPF/SAVPF is enabled, false otherwise.

  • Enable the use of RTCP feedback (also known as AVPF profile).

    • deprecated: 06/04/2020 Use Account object instead Get enablement status of RTCP feedback (also known as AVPF profile).
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var avpfMode: AVPFMode { get set }

    Parameters

    mode

    the enablement mode, which can be Default (use LinphoneCore’s mode), Enabled (avpf is enabled), or Disabled (disabled).

    Return Value

    the enablement mode, which can be Default (use LinphoneCore’s mode), Enabled (avpf is enabled), or Disabled (disabled).

  • Set the interval between regular RTCP reports when using AVPF/SAVPF.

    • deprecated: 06/04/2020 Use Account object instead Get the interval between regular RTCP reports when using AVPF/SAVPF.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var avpfRrInterval: UInt8 { get set }

    Parameters

    interval

    The interval in seconds (between 0 and 5 seconds).

    Return Value

    The interval in seconds.

  • Set the conference factory uri.

    • deprecated: 06/04/2020 Use Account object instead Get the conference factory uri.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var conferenceFactoryUri: String { get set }

    Parameters

    uri

    The uri of the conference factory.

    Return Value

    The uri of the conference factory.

  • Return the contact address of the proxy config.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var contact: Address? { get }

    Return Value

    a Address correspong to the contact address of the proxy config.

  • Set optional contact parameters that will be added to the contact information sent in the registration.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var contactParameters: String { get set }

    Parameters

    contactParams

    a string contaning the additional parameters in text form, like “myparam=something;myparam2=something_else”
    The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or apple push id. As an example, the contact address in the SIP register sent will look like sip:joe@15.128.128.93:50421;apple-push-id=43143-DFE23F-2323-FA2232. - deprecated: 06/04/2020 Use Account object instead Returns the contact parameters.

    Return Value

    previously set contact parameters.

  • Set optional contact parameters that will be added to the contact information sent in the registration, inside the URI.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var contactUriParameters: String { get set }

    Parameters

    contactUriParams

    a string containing the additional parameters in text form, like “myparam=something;myparam2=something_else”
    The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or apple push id. As an example, the contact address in the SIP register sent will look like sip:joe@15.128.128.93:50421;apple-push-id=43143-DFE23F-2323-FA2232. - deprecated: 06/04/2020 Use Account object instead Returns the contact URI parameters.

    Return Value

    previously set contact URI parameters.

  • Get the Core object to which is associated the ProxyConfig.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var core: Core? { get }

    Return Value

    The Core object to which is associated the ProxyConfig.

  • Mark this proxy configuration as being dependent on the given one. The dependency must refer to a proxy config previously added to the core and which idkey property is defined.

    See

    See also: setIdkey() The proxy configuration marked as dependent will wait for successful registration on its dependency before triggering its own. Once registered, both proxy configurations will share the same contact address (the ‘dependency’ one). This mecanism must be enabled before the proxy configuration is added to the core
    • deprecated: 06/04/2020 Use Account object instead Get the dependency of a ProxyConfig.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var dependency: ProxyConfig? { get set }

    Parameters

    dependsOn

    The ProxyConfig this one shall be depend on.

    Return Value

    The proxy config this one is dependent upon, or nil if not marked dependent.

  • Sets whether liblinphone should replace “+” by international calling prefix in dialed numbers (passed to Core.invite() ).

    • deprecated: 06/04/2020 Use Account object instead Returns whether or not the + should be replaced by 00.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var dialEscapePlus: Bool { get set }

    Parameters

    enable

    true to replace + by the international prefix, false otherwise.

    Return Value

    whether liblinphone should replace “+” by “00” in dialed numbers (passed to Core.invite()).

  • Sets a dialing prefix to be automatically prepended when inviting a number with Core.invite(); This dialing prefix shall usually be the country code of the country where the user is living, without “+”.

    • deprecated: 06/04/2020 Use Account object instead Gets the prefix set for this proxy config.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var dialPrefix: String { get set }

    Parameters

    prefix

    the prefix to set (withouth the +)

    Return Value

    dialing prefix.

  • Get the domain name of the given proxy config.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var domain: String { get }

    Return Value

    The domain name of the proxy config.

  • Get the reason why registration failed when the proxy config state is LinphoneRegistrationFailed.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var error: Reason { get }

    Return Value

    The Reason why registration failed for this proxy config.

  • Get detailed information why registration failed when the proxy config state is LinphoneRegistrationFailed.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var errorInfo: ErrorInfo? { get }

    Return Value

    The ErrorInfo explaining why registration failed for this proxy config.

  • Sets the registration expiration time in seconds.

    • deprecated: 06/04/2020 Use Account object instead Gets the proxy config expires.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var expires: Int { get set }

    Parameters

    expires

    the expiration time to set

    Return Value

    the duration of registration.

  • Sets the user identity as a SIP address. This identity is normally formed with display name, username and domain, such as: Alice sip:alice@example.net The REGISTER messages will have from and to set to this identity.

    • deprecated: 06/04/2020 Use Account object instead Gets the identity addres of the proxy config.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var identityAddress: Address? { get }

    Parameters

    identity

    the Address of the identity to set

    Return Value

    the SIP identity that belongs to this proxy configuration.

  • Undocumented

    Declaration

    Swift

    public func setIdentityaddress(newValue: Address) throws
  • Set the idkey property on the given proxy configuration. This property can the be referenced by another proxy config ‘depends_on’ to create a dependency relation between them. - See also: linphone_proxy_config_set_depends_on()

    • deprecated: 06/04/2020 Use Account object instead Get the idkey property of a ProxyConfig.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var idkey: String { get set }

    Parameters

    idkey

    The idkey string to associate to the given ProxyConfig.

    Return Value

    The idkey string, or nil.

  • Indicates whether to add to the contact parameters the push notification information. For IOS, it indicates to VOIP push notification.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var isPushNotificationAllowed: Bool { get }

    Return Value

    true if push notification informations should be added, false otherwise.

  • Gets whether push notifications are available or not (Android & iOS only).

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var isPushNotificationAvailable: Bool { get }

    Return Value

    true if push notifications are available, false otherwise

  • Indicates whether to add to the contact parameters the remote push notification information (IOS only). Default value is false.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var isRemotePushNotificationAllowed: Bool { get }

    Return Value

    true if remote push notification informations should be added, false otherwise.

  • Set the policy to use to pass through NATs/firewalls when using this proxy config. If it is set to nil, the default NAT policy from the core will be used instead.

    See

    See also: Core.setNatPolicy()
    • deprecated: 06/04/2020 Use Account object instead Get The policy that is used to pass through NATs/firewalls when using this proxy config. If it is set to nil, the default NAT policy from the core will be used instead.

    See

    See also: Core.getNatPolicy()
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var natPolicy: NatPolicy? { get set }

    Parameters

    policy

    NatPolicy object.

    Return Value

    NatPolicy object in use.

  • Set default privacy policy for all calls routed through this proxy.

    • deprecated: 06/04/2020 Use Account object instead Get default privacy policy for all calls routed through this proxy.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var privacy: UInt { get set }

    Parameters

    privacy

    Privacy to configure privacy

    Return Value

    Privacy mode as LinphonePrivacyMask

  • Indicates either or not, PUBLISH must be issued for this ProxyConfig. In case this ProxyConfig has been added to Core, follows the edit() rule.

    • deprecated: 06/04/2020 Use Account object instead Gets if the PUBLISH is enabled.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var publishEnabled: Bool { get set }

    Parameters

    enable

    if true, publish will be engaged

    Return Value

    true if PUBLISH request is enabled for this proxy.

  • Set the publish expiration time in second.

    • deprecated: 06/04/2020 Use Account object instead get the publish expiration time in second. Default value is the registration expiration value.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var publishExpires: Int { get set }

    Parameters

    expires

    in second

    Return Value

    expires in second

  • Indicates whether to add to the contact parameters the push notification information. For IOS, it indicates to VOIP push notification.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var pushNotificationAllowed: Bool? { get set }

    Parameters

    allow

    true to allow push notification information, false otherwise.

  • Sets the push notification configuration.

    • deprecated: 06/04/2020 Use Account object instead Retrieves the push notification configuration.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var pushNotificationConfig: PushNotificationConfig? { get set }

    Parameters

    pushCfg

    Return Value

    The PushNotificationConfig.

  • Set the route of the collector end-point when using quality reporting. This SIP address should be used on server-side to process packets directly before discarding packets. Collector address should be a non existing account and will not receive any messages. If nil, reports will be send to the proxy domain.

    • deprecated: 06/04/2020 Use Account object instead Get the route of the collector end-point when using quality reporting. This SIP address should be used on server-side to process packets directly before discarding packets. Collector address should be a non existing account and will not receive any messages. If nil, reports will be send to the proxy domain.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var qualityReportingCollector: String { get set }

    Parameters

    collector

    route of the collector end-point, if nil PUBLISH will be sent to the proxy domain.

    Return Value

    The SIP address of the collector end-point.

  • Indicates whether quality statistics during call should be stored and sent to a collector according to RFC 6035.

    • deprecated: 06/04/2020 Use Account object instead Indicates whether quality statistics during call should be stored and sent to a collector according to RFC 6035.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var qualityReportingEnabled: Bool { get set }

    Parameters

    enable

    True to store quality statistics and send them to the collector, false to disable it.

    Return Value

    True if quality repotring is enabled, false otherwise.

  • Set the interval between 2 interval reports sending when using quality reporting. If call exceed interval size, an interval report will be sent to the collector. On call termination, a session report will be sent for the remaining period. Value must be 0 (disabled) or positive.

    • deprecated: 06/04/2020 Use Account object instead Get the interval between interval reports when using quality reporting.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var qualityReportingInterval: Int { get set }

    Parameters

    interval

    The interval in seconds, 0 means interval reports are disabled.

    Return Value

    The interval in seconds, 0 means interval reports are disabled.

  • Set the realm of the given proxy config.

    • deprecated: 06/04/2020 Use Account object instead Get the realm of the given proxy config.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var realm: String { get set }

    Parameters

    realm

    New realm value.

    Return Value

    The realm of the proxy config.

  • Associate a persistent reference key to the proxy config. The reference key can be for example an id to an external database. It is stored in the config file, thus can survive to process exits/restarts.

    • deprecated: 06/04/2020 Use Account object instead Get the persistent reference key associated to the proxy config. The reference key can be for example an id to an external database. It is stored in the config file, thus can survive to process exits/restarts.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var refKey: String { get set }

    Parameters

    refkey

    The reference key string to associate to the proxy config.

    Return Value

    The reference key string that has been associated to the proxy config, or nil if none has been associated.

  • Indicates either or not, REGISTRATION must be issued for this ProxyConfig. In case this ProxyConfig has been added to Core, follows the edit() rule.

    • deprecated: 06/04/2020 Use Account object instead Returns whether the proxy config is enabled or not.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var registerEnabled: Bool { get set }

    Parameters

    enable

    if true, registration will be engaged

    Return Value

    true if registration to the proxy is enabled.

  • Indicates whether to add to the contact parameters the remote push notification information (IOS only).

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    public var remotePushNotificationAllowed: Bool? { get set }

    Parameters

    allow

    true to allow remote push notification information, false otherwise.

  • Sets a SIP route. When a route is set, all outgoing calls will go to the route’s destination if this proxy is the default one (see Core.setDefaultProxyConfig() ).

    • deprecated: 08/07/2020 use setRoutes() instead

    Declaration

    Swift

    @available(*, deprecated)
    public func setRoute(newValue: String) throws

    Parameters

    route

    the SIP route to set

    Return Value

    -1 if route is invalid, 0 otherwise.

  • Sets a list of SIP route. When a route is set, all outgoing calls will go to the route’s destination if this proxy is the default one (see Core.setDefaultProxyConfig() ).

    • deprecated: 06/04/2020 Use Account object instead Gets the list of the routes set for this proxy config.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var routes: [String] { get }

    Parameters

    routes

    A of routes

    Return Value

    The list of routes as string.

  • Undocumented

    Declaration

    Swift

    public func setRoutes(newValue: [String]) throws
  • Sets the proxy address. Examples of valid sip proxy address are:

    • deprecated: 06/04/2020 Use Account object instead Gets the proxy config proxy address.
    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var serverAddr: String { get }

    Parameters

    serverAddress

    the proxy address to set.

    Return Value

    the proxy’s SIP address.

  • Undocumented

    Declaration

    Swift

    public func setServeraddr(newValue: String) throws
  • Get the registration state of the given proxy config.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var state: RegistrationState { get }

    Return Value

    The RegistrationState of the proxy config.

  • Get the transport from either service route, route or addr.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var transport: String { get }

    Return Value

    The transport as a string (I.E udp, tcp, tls, dtls)

  • Return the unread chat message count for a given proxy config.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public var unreadChatMessageCount: Int { get }

    Return Value

    The unread chat message count.

  • Assign a user pointer to the proxy config.

    Declaration

    Swift

    public var userData: UnsafeMutableRawPointer? { get set }

    Parameters

    userData

    The user pointer to associate with the proxy config.
    Retrieve the user pointer associated with the proxy config.

    Return Value

    The user pointer associated with the proxy config.

  • Commits modification made to the proxy configuration.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public func done() throws

    Return Value

    0 if successful, -1 otherwise

  • Starts editing a proxy configuration. Because proxy configuration must be consistent, applications MUST call edit() before doing any attempts to modify proxy configuration (such as identity, proxy address and so on). Once the modifications are done, then the application must call done() to commit the changes.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public func edit()
  • Find authentication info matching proxy config, if any, similarly to linphone_core_find_auth_info.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public func findAuthInfo() -> AuthInfo?

    Return Value

    a AuthInfo matching proxy config criteria if possible, nil if nothing can be found.

  • Obtain the value of a header sent by the server in last answer to REGISTER.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public func getCustomHeader(headerName: String) -> String

    Parameters

    headerName

    the header name for which to fetch corresponding value

    Return Value

    the value of the queried header.

  • Normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222 or +33888444222 depending on the ProxyConfig object. This function will always generate a normalized username if input is a phone number.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public func normalizePhoneNumber(username: String) -> String

    Parameters

    username

    the string to parse

    Return Value

    nil if input is an invalid phone number, normalized phone number from username input otherwise.

  • Normalize a human readable sip uri into a fully qualified LinphoneAddress. A sip address should look like DisplayName sip:username@domain:port . Basically this function performs the following tasks The result is a syntactically correct SIP address.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public func normalizeSipUri(username: String) -> Address?

    Parameters

    username

    the string to parse

    Return Value

    nil if invalid input, normalized sip address otherwise.

  • Prevent a proxy config from refreshing its registration. This is useful to let registrations to expire naturally (or) when the application wants to keep control on when refreshes are sent. However, linphone_core_set_network_reachable(lc,true) will always request the proxy configs to refresh their registrations. The refreshing operations can be resumed with refreshRegister().

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public func pauseRegister()
  • Refresh a proxy registration. This is useful if for example you resuming from suspend, thus IP address may have changed.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public func refreshRegister()
  • Set the value of a custom header sent to the server in REGISTERs request.

    • deprecated: 06/04/2020 Use Account object instead

    Declaration

    Swift

    @available(*, deprecated)
    public func setCustomHeader(headerName: String, headerValue: String?)

    Parameters

    headerName

    the header name

    headerValue

    the header’s value