Class ProxyConfig
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,
Inherited Members
Namespace: Linphone
Assembly: cs.temp.dll.dll
Syntax
public class ProxyConfig : LinphoneObject
Remarks
See : ServerAddr.
Properties
AvpfEnabled
Indicates whether AVPF/SAVPF is being used for calls using this proxy config.
Declaration
public bool AvpfEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean | True if AVPF/SAVPF is enabled, false otherwise. |
AvpfMode
Get enablement status of RTCP feedback (also known as AVPF profile).
Declaration
public AVPFMode AvpfMode { get; set; }
Property Value
Type | Description |
---|---|
AVPFMode | the enablement mode, which can be Default (use LinphoneCore's mode), Enabled (avpf is enabled), or Disabled (disabled). |
AvpfRrInterval
Get the interval between regular RTCP reports when using AVPF/SAVPF.
Declaration
public uint AvpfRrInterval { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 | The interval in seconds. |
ConferenceFactoryUri
Get the conference factory uri.
Declaration
public string ConferenceFactoryUri { get; set; }
Property Value
Type | Description |
---|---|
System.String | The uri of the conference factory. |
Contact
Return the contact address of the proxy config.
Declaration
public Address Contact { get; }
Property Value
Type | Description |
---|---|
Address | a Address correspong to the contact address of the proxy config. |
ContactParameters
Returns the contact parameters.
Declaration
public string ContactParameters { get; set; }
Property Value
Type | Description |
---|---|
System.String | previously set contact parameters. |
ContactUriParameters
Returns the contact URI parameters.
Declaration
public string ContactUriParameters { get; set; }
Property Value
Type | Description |
---|---|
System.String | previously set contact URI parameters. |
Core
Get the Core object to which is associated the ProxyConfig.
Declaration
public Core Core { get; }
Property Value
Type | Description |
---|---|
Core | The Core object to which is associated the ProxyConfig. |
Dependency
Get the dependency of a ProxyConfig.
Declaration
public ProxyConfig Dependency { get; set; }
Property Value
Type | Description |
---|---|
ProxyConfig | The proxy config this one is dependent upon, or null if not marked dependent. |
DialEscapePlus
Returns whether or not the + should be replaced by 00.
Declaration
public bool DialEscapePlus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | whether liblinphone should replace "+" by "00" in
dialed numbers (passed to |
DialPrefix
Gets the prefix set for this proxy config.
Declaration
public string DialPrefix { get; set; }
Property Value
Type | Description |
---|---|
System.String | dialing prefix. |
Domain
Get the domain name of the given proxy config.
Declaration
public string Domain { get; }
Property Value
Type | Description |
---|---|
System.String | The domain name of the proxy config. |
Error
Get the reason why registration failed when the proxy config state is LinphoneRegistrationFailed.
Declaration
public Reason Error { get; }
Property Value
Type | Description |
---|---|
Reason | The Reason why registration failed for this proxy config. |
ErrorInfo
Get detailed information why registration failed when the proxy config state is LinphoneRegistrationFailed.
Declaration
public ErrorInfo ErrorInfo { get; }
Property Value
Type | Description |
---|---|
ErrorInfo | The ErrorInfo explaining why registration failed for this proxy config. |
Expires
Gets the proxy config expires.
Declaration
public int Expires { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | the duration of registration. |
IdentityAddress
Gets the identity addres of the proxy config.
Declaration
public Address IdentityAddress { get; set; }
Property Value
Type | Description |
---|---|
Address | the SIP identity that belongs to this proxy configuration. |
Idkey
Get the idkey property of a ProxyConfig.
Declaration
public string Idkey { get; set; }
Property Value
Type | Description |
---|---|
System.String | The idkey string, or null. |
IsPushNotificationAllowed
Indicates whether to add to the contact parameters the push notification information.
Declaration
public bool IsPushNotificationAllowed { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if push notification informations should be added, false otherwise. |
NatPolicy
Get The policy that is used to pass through NATs/firewalls when using this proxy config.
If it is set to null, the default NAT policy from the core will be used instead.
Declaration
public NatPolicy NatPolicy { get; set; }
Property Value
Type | Description |
---|---|
NatPolicy | NatPolicy object in use. |
Remarks
See : NatPolicy
Privacy
Get default privacy policy for all calls routed through this proxy.
Declaration
public uint Privacy { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 | Privacy mode as LinphonePrivacyMask |
PublishEnabled
Gets if the PUBLISH is enabled.
Declaration
public bool PublishEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if PUBLISH request is enabled for this proxy. |
PublishExpires
get the publish expiration time in second.
Default value is the registration expiration value.
Declaration
public int PublishExpires { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | expires in second |
PushNotificationAllowed
Indicates whether to add to the contact parameters the push notification information.
Declaration
public bool PushNotificationAllowed { set; }
Property Value
Type | Description |
---|---|
System.Boolean |
QualityReportingCollector
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 null, reports will be send to the proxy domain.
Declaration
public string QualityReportingCollector { get; set; }
Property Value
Type | Description |
---|---|
System.String | The SIP address of the collector end-point. |
QualityReportingEnabled
Indicates whether quality statistics during call should be stored and sent to a collector according to RFC 6035.
Declaration
public bool QualityReportingEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if quality repotring is enabled, false otherwise. |
QualityReportingInterval
Get the interval between interval reports when using quality reporting.
Declaration
public int QualityReportingInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The interval in seconds, 0 means interval reports are disabled. |
Realm
Get the realm of the given proxy config.
Declaration
public string Realm { get; set; }
Property Value
Type | Description |
---|---|
System.String | The realm of the proxy config. |
RefKey
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
public string RefKey { get; set; }
Property Value
Type | Description |
---|---|
System.String | The reference key string that has been associated to the proxy config, or null if none has been associated. |
RegisterEnabled
Returns whether the proxy config is enabled or not.
Declaration
public bool RegisterEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if registration to the proxy is enabled. |
Route
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 DefaultProxyConfig ).
Declaration
public string Route { set; }
Property Value
Type | Description |
---|---|
System.String | -1 if route is invalid, 0 otherwise. |
Routes
Gets the list of the routes set for this proxy config.
Declaration
public IEnumerable<string> Routes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The list of routes as string. |
ServerAddr
Gets the proxy config proxy address.
Declaration
public string ServerAddr { get; set; }
Property Value
Type | Description |
---|---|
System.String | the proxy's SIP address. |
State
Get the registration state of the given proxy config.
Declaration
public RegistrationState State { get; }
Property Value
Type | Description |
---|---|
RegistrationState | The RegistrationState of the proxy config. |
Transport
Get the transport from either service route, route or addr.
Declaration
public string Transport { get; }
Property Value
Type | Description |
---|---|
System.String | The transport as a string (I.E udp, tcp, tls, dtls) |
UnreadChatMessageCount
Return the unread chat message count for a given proxy config.
Declaration
public int UnreadChatMessageCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The unread chat message count. |
Methods
Done()
Commits modification made to the proxy configuration.
Declaration
public void Done()
Edit()
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
public void Edit()
FindAuthInfo()
Find authentication info matching proxy config, if any, similarly to linphone_core_find_auth_info.
Declaration
public AuthInfo FindAuthInfo()
Returns
Type | Description |
---|---|
AuthInfo | a AuthInfo matching proxy config criteria if possible, null if nothing can be found. |
GetCustomHeader(String)
Obtain the value of a header sent by the server in last answer to REGISTER.
Declaration
public string GetCustomHeader(string headerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | the header name for which to fetch corresponding value |
Returns
Type | Description |
---|---|
System.String | the value of the queried header. |
IsPhoneNumber(String)
Detect if the given input is a phone number or not.
Declaration
public bool IsPhoneNumber(string username)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | string to parse. |
Returns
Type | Description |
---|---|
System.Boolean | true if input is a phone number, false otherwise. |
NormalizePhoneNumber(String)
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
public string NormalizePhoneNumber(string username)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | the string to parse |
Returns
Type | Description |
---|---|
System.String | null if input is an invalid phone number, normalized phone number from username input otherwise. |
NormalizeSipUri(String)
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
public Address NormalizeSipUri(string username)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | the string to parse |
Returns
Type | Description |
---|---|
Address | null if invalid input, normalized sip address otherwise. |
PauseRegister()
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
public void PauseRegister()
RefreshRegister()
Refresh a proxy registration.
This is useful if for example you resuming from suspend, thus IP address may have changed.
Declaration
public void RefreshRegister()
SetCustomHeader(String, String)
Set the value of a custom header sent to the server in REGISTERs request.
Declaration
public void SetCustomHeader(string headerName, string headerValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | the header name |
System.String | headerValue | the header's value |