ProxyConfig
public class ProxyConfig : LinphoneObject
The ProxyConfig
object represents a proxy configuration to be used by the
Core
object.
Its fields must not be used directly in favour of the accessors methods. Once
created and filled properly the ProxyConfig
can be given to Core
with
Core.addProxyConfig(). This will automatically triggers the registration, if
enabled.
The proxy configuration are persistent to restarts because they are saved in the configuration file. As a consequence, after linphone_core_new there might already be a list of configured proxy that can be examined with Core.getProxyConfigList().
The default proxy (see linphone_core_set_default_proxy ) is the one of the list that is used by default for calls.
-
Indicates whether AVPF/SAVPF is being used for calls using this proxy config.
Declaration
Swift
public var avpfEnabled: Bool { get }
Return Value
True if AVPF/SAVPF is enabled, false otherwise.
-
Get enablement status of RTCP feedback (also known as AVPF profile).
Declaration
Swift
public var avpfMode: AVPFMode { get set }
Return Value
the enablement mode, which can be LinphoneAVPFDefault (use LinphoneCore’s mode), LinphoneAVPFEnabled (avpf is enabled), or LinphoneAVPFDisabled (disabled).
-
Get the interval between regular RTCP reports when using AVPF/SAVPF.
Declaration
Swift
public var avpfRrInterval: UInt8 { get set }
Return Value
The interval in seconds.
-
Get the conference factory uri.
Declaration
Swift
public var conferenceFactoryUri: String { get set }
Return Value
The uri of the conference factory
-
Declaration
Swift
public var contactParameters: String { get set }
Return Value
previously set contact parameters.
-
Declaration
Swift
public var contactUriParameters: String { get set }
Return Value
previously set contact URI parameters.
-
Get the dependency of a
ProxyConfig
.Declaration
Swift
public var dependency: ProxyConfig? { get set }
Return Value
The proxy config this one is dependent upon, or nil if not marked dependent
-
Declaration
Swift
public var dialEscapePlus: Bool { get set }
Return Value
whether liblinphone should replace “+” by “00” in dialed numbers (passed to linphone_core_invite ).
-
Declaration
Swift
public var dialPrefix: String { get set }
Return Value
dialing prefix.
-
Get the domain name of the given proxy config.
Declaration
Swift
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.
Declaration
Swift
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.
Declaration
Swift
public var errorInfo: ErrorInfo? { get }
Return Value
The details why registration failed for this proxy config.
-
Declaration
Swift
public var expires: Int { get set }
Return Value
the duration of registration.
-
Declaration
Swift
public var identityAddress: Address? { get }
Return Value
the SIP identity that belongs to this proxy configuration.
-
Undocumented
Declaration
Swift
public func setIdentityaddress(newValue: Address) throws
-
Get the idkey property of a
ProxyConfig
.Declaration
Swift
public var idkey: String { get set }
Return Value
The idkey string, or nil
-
Indicates whether to add to the contact parameters the push notification information.
Declaration
Swift
public var isPushNotificationAllowed: Bool { get }
Return Value
True if push notification informations should be added, false otherwise.
-
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()
Declaration
Swift
public var natPolicy: NatPolicy? { get set }
Return Value
NatPolicy
object in use. -
Get default privacy policy for all calls routed through this proxy.
Declaration
Swift
public var privacy: UInt { get set }
Return Value
Privacy mode
-
Declaration
Swift
public var publishEnabled: Bool { get set }
Return Value
if PUBLISH request is enabled for this proxy.
-
get the publish expiration time in second. Default value is the registration expiration value.
Declaration
Swift
public var publishExpires: Int { get set }
Return Value
expires in second
-
Indicates whether to add to the contact parameters the push notification information.
Declaration
Swift
public var pushNotificationAllowed: Bool? { get set }
Parameters
allow
True to allow push notification information, false otherwise.
-
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.
Declaration
Swift
public var qualityReportingCollector: String { get set }
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.
Declaration
Swift
public var qualityReportingEnabled: Bool { get set }
Return Value
True if quality repotring is enabled, false otherwise.
-
Get the interval between interval reports when using quality reporting.
Declaration
Swift
public var qualityReportingInterval: Int { get set }
Return Value
The interval in seconds, 0 means interval reports are disabled.
-
Get the realm of the given proxy config.
Declaration
Swift
public var realm: String { get set }
Return Value
The realm of the proxy config.
-
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.
Declaration
Swift
public var refKey: String { get set }
Return Value
The reference key string that has been associated to the proxy config, or nil if none has been associated.
-
Declaration
Swift
public var registerEnabled: Bool { get set }
Return Value
if registration to the proxy is enabled.
-
deprecated: Use getRoutes() instead.
Declaration
Swift
public var route: String { get }
Return Value
the route set for this proxy configuration.
-
Undocumented
Declaration
Swift
public func setRoute(newValue: String) throws
-
Gets the list of the routes set for this proxy config.
Declaration
Swift
public var routes: [String] { get }
Return Value
A list of const char * objects. const char * the list of routes.
-
Undocumented
Declaration
Swift
public func setRoutes(newValue: [String]) throws
-
Declaration
Swift
public var serverAddr: String { get }
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.
Declaration
Swift
public var state: RegistrationState { get }
Return Value
The registration state of the proxy config.
-
Get the transport from either service route, route or addr.
Declaration
Swift
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.
Declaration
Swift
public var unreadChatMessageCount: Int { get }
Return Value
The unread chat message count.
-
Commits modification made to the proxy configuration.
Declaration
Swift
public func done() throws
-
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.
Declaration
Swift
public func edit()
-
Obtain the value of a header sent by the server in last answer to REGISTER.
Declaration
Swift
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.
-
Detect if the given input is a phone number or not.
Declaration
Swift
public func isPhoneNumber(username: String) -> Bool
Parameters
username
string to parse.
Return Value
if input is a phone number, true otherwise.
-
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.Declaration
Swift
public func normalizePhoneNumber(username: String) -> String
Parameters
username
the string to parse
Return Value
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.
Declaration
Swift
public func normalizeSipUri(username: String) -> Address?
Parameters
username
the string to parse
Return Value
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().
Declaration
Swift
public func pauseRegister()
-
Refresh a proxy registration. This is useful if for example you resuming from suspend, thus IP address may have changed.
Declaration
Swift
public func refreshRegister()
-
Set the value of a custom header sent to the server in REGISTERs request.
Declaration
Swift
public func setCustomHeader(headerName: String, headerValue: String)
Parameters
headerName
the header name
headerValue
the header’s value