Class Factory
The factory is a singleton object devoted to the creation of all the objects of Liblinphone that cannot be created by Linphone.Core itself.
It is also used to configure a few behaviors before creating the Linphone.Core, like the logs verbosity or collection.
Inherited Members
Namespace: Linphone
Assembly: cs.temp.dll.dll
Syntax
public class Factory : LinphoneObject
Properties
CacheDir
Set the directory where the application local cache is located.
If the path is empty (default value), the path will be computed when calling Linphone.Factory.DataDir
Declaration
public string CacheDir { set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ConfigDir
Set the directory where the configurations are located.
If the path is empty (default value), the path will be computed when calling Linphone.Factory.ConfigDir
Declaration
public string ConfigDir { set; }
Property Value
| Type | Description |
|---|---|
| System.String |
DataDir
Set the directory where the application local data are located.
If the path is empty (default value), the path will be computed when calling Linphone.Factory.DataDir
Declaration
public string DataDir { set; }
Property Value
| Type | Description |
|---|---|
| System.String |
DataResourcesDir
Get the directory where the data resources are located.
Declaration
public string DataResourcesDir { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The path to the directory where the data resources are located |
DialPlans
Returns a bctbx_list_t of all DialPlans.
Declaration
public IEnumerable<DialPlan> DialPlans { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<DialPlan> | A list of Linphone.DialPlan |
DownloadDir
Set the directory where downloads are located.
If the path is empty (default value), the path will be computed when calling Linphone.Factory.DownloadDir
Declaration
public string DownloadDir { set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ImageResourcesDir
Get the directory where the image resources are located.
Declaration
public string ImageResourcesDir { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The path to the directory where the image resources are located |
Instance
Create the Linphone.Factory if that has not been done and return a pointer on it.
Declaration
public static Factory Instance { get; }
Property Value
| Type | Description |
|---|---|
| Factory | A pointer on the Linphone.Factory |
IsCacheDirSet
Test if cache dir has been set.
Declaration
public bool IsCacheDirSet { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if cache dir has been set. |
IsConfigDirSet
Test if config dir has been set.
Declaration
public bool IsConfigDirSet { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if config dir has been set. |
IsDatabaseStorageAvailable
Indicates if the storage in database is available.
Declaration
public bool IsDatabaseStorageAvailable { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if the database storage is available, false otherwise |
IsDataDirSet
Test if data dir has been set.
Declaration
public bool IsDataDirSet { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if data dir has been set. |
IsDownloadDirSet
Test if download dir has been set.
Declaration
public bool IsDownloadDirSet { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if download dir has been set. |
IsImdnAvailable
Indicates if IMDN are available.
Declaration
public bool IsImdnAvailable { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if IDMN are available |
IsQrcodeAvailable
Indicates if the QRCode feature is available.
Declaration
public bool IsQrcodeAvailable { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if QRCodes can be used |
LiblinphonePluginsDir
Get the directory where the liblinphone plugins are located.
Declaration
public string LiblinphonePluginsDir { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The path to the directory where the liblinphone plugins are located, or null if it has not been set. |
LogCollectionPath
Sets the log collection path.
Declaration
public string LogCollectionPath { set; }
Property Value
| Type | Description |
|---|---|
| System.String |
MspluginsDir
Get the directory where the mediastreamer2 plugins are located.
Declaration
public string MspluginsDir { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The path to the directory where the mediastreamer2 plugins are located, or null if it has not been set. |
RecommendedVideoDefinitions
Get the recommended list of standard video definitions.
This list is suitable for a widest set of hardware for all video codec implementations, and thus excludes some very high definition formats that are unlikely to work unless specific hardware or codecs are used.
Declaration
public IEnumerable<VideoDefinition> RecommendedVideoDefinitions { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<VideoDefinition> | A list of video definitions. |
RingResourcesDir
Get the directory where the ring resources are located.
Declaration
public string RingResourcesDir { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The path to the directory where the ring resources are located |
SoundResourcesDir
Get the directory where the sound resources are located.
Declaration
public string SoundResourcesDir { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The path to the directory where the sound resources are located |
SupportedVideoDefinitions
Get the list of standard video definitions supported by Linphone.
Declaration
public IEnumerable<VideoDefinition> SupportedVideoDefinitions { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<VideoDefinition> | A list of video definitions. |
TopResourcesDir
Get the top directory where the resources are located.
Declaration
public string TopResourcesDir { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The path to the top directory where the resources are located |
Methods
Clean()
Clean the factory.
This function is generally useless as the factory is unique per process,
however calling this function at the end avoid getting reports from belle-sip
leak detector about memory leaked in
Declaration
public static void Clean()
ComputeHa1ForAlgorithm(String, String, String, String)
Computes the hashed version of the password given the user ID and the realm, using given algorithm.
Declaration
public string ComputeHa1ForAlgorithm(string userid, string password, string realm, string algorithm)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userid | the username or user ID to use. |
| System.String | password | the password to hash. |
| System.String | realm | the real to use. |
| System.String | algorithm | the algorithm to use (MD5 or SHA-256). |
Returns
| Type | Description |
|---|---|
| System.String | the generated hash if it succeeded, null otherwise. |
CreateAddress(String)
Parse a string holding a SIP URI and create the according Linphone.Address object.
Declaration
public Address CreateAddress(string addr)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | addr | A string holding the SIP URI to parse. |
Returns
| Type | Description |
|---|---|
| Address | A new Linphone.Address. |
CreateAuthInfo(String, BearerToken, String)
Creates a Linphone.AuthInfo object.
The object can be created empty, that is with all arguments set to null. Username, userid, password, realm and domain can be set later using specific methods. At the end, username and passwd (or ha1) are required.
Declaration
public AuthInfo CreateAuthInfo(string username, BearerToken accessToken, string realm)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | username | The username that needs to be authenticated |
| BearerToken | accessToken | An access token to send to authenticate |
| System.String | realm | The authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter. |
Returns
| Type | Description |
|---|---|
| AuthInfo | A Linphone.AuthInfo object.
linphone_auth_info_unref must be used to destroy it when no longer needed. The
Linphone.Core makes a copy of
Linphone.AuthInfo passed through |
CreateAuthInfo(String, String, String, String, String, String)
Creates a Linphone.AuthInfo object.
The object can be created empty, that is with all arguments set to null. Username, userid, password, realm and domain can be set later using specific methods. At the end, username and passwd (or ha1) are required.
Declaration
public AuthInfo CreateAuthInfo(string username, string userid, string passwd, string ha1, string realm, string domain)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | username | The username that needs to be authenticated |
| System.String | userid | The userid used for authenticating (use null if you don't know what it is) |
| System.String | passwd | The password in clear text |
| System.String | ha1 | The ha1-encrypted password if password is not given in clear text. |
| System.String | realm | The authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter. |
| System.String | domain | The SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain. |
Returns
| Type | Description |
|---|---|
| AuthInfo | A Linphone.AuthInfo object.
linphone_auth_info_destroy must be used to destroy it when no longer needed.
The Linphone.Core makes a copy of
Linphone.AuthInfo passed through |
CreateAuthInfo(String, String, String, String, String, String, String)
Creates a Linphone.AuthInfo object.
The object can be created empty, that is with all arguments set to null. Username, userid, password, realm and domain can be set later using specific methods. At the end, username and passwd (or ha1) are required.
Declaration
public AuthInfo CreateAuthInfo(string username, string userid, string passwd, string ha1, string realm, string domain, string algorithm)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | username | The username that needs to be authenticated |
| System.String | userid | The userid used for authenticating (use null if you don't know what it is) |
| System.String | passwd | The password in clear text |
| System.String | ha1 | The ha1-encrypted password if password is not given in clear text. |
| System.String | realm | The authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter. |
| System.String | domain | The SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain. |
| System.String | algorithm | The algorithm for encrypting password. |
Returns
| Type | Description |
|---|---|
| AuthInfo | A Linphone.AuthInfo object.
linphone_auth_info_destroy must be used to destroy it when no longer needed.
The Linphone.Core makes a copy of
Linphone.AuthInfo passed through |
CreateBearerToken(String, Int64)
Create a new Linphone.BearerToken object.
The expiration time may be set to zero if unknown, in which case the Linphone.Core will anyway use the refresh token if an access token is rejected by a server.
Declaration
public BearerToken CreateBearerToken(string token, long expirationTime)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | token | the token, as an opaque string. |
| System.Int64 | expirationTime | the expiration time as the number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). |
Returns
| Type | Description |
|---|---|
| BearerToken | the newly created Linphone.BearerToken . |
CreateBuffer()
Creates an object Linphone.Buffer.
Declaration
public Buffer CreateBuffer()
Returns
| Type | Description |
|---|---|
| Buffer |
CreateBufferFromData(UInt32, Int64)
Creates an object Linphone.Buffer.
Declaration
public Buffer CreateBufferFromData(uint data, long size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | data | the data to set in the buffer |
| System.Int64 | size | the size of the data |
Returns
| Type | Description |
|---|---|
| Buffer |
CreateBufferFromString(String)
Creates an object Linphone.Buffer.
Declaration
public Buffer CreateBufferFromString(string data)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | data | the data to set in the buffer |
Returns
| Type | Description |
|---|---|
| Buffer |
CreateConferenceInfo()
Creates an object Linphone.ConferenceInfo.
Declaration
public ConferenceInfo CreateConferenceInfo()
Returns
| Type | Description |
|---|---|
| ConferenceInfo |
CreateConferenceInfoFromIcalendarContent(Content)
Creates an object Linphone.ConferenceInfo from an Icalendar Linphone.Content.
Declaration
public ConferenceInfo CreateConferenceInfoFromIcalendarContent(Content content)
Parameters
| Type | Name | Description |
|---|---|---|
| Content | content | the Icalendar Linphone.Content |
Returns
| Type | Description |
|---|---|
| ConferenceInfo | a Linphone.ConferenceInfo created from an Icalendar Linphone.Content |
CreateConfig(String)
Creates an object Linphone.Config.
Declaration
public Config CreateConfig(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | the path of the config |
Returns
| Type | Description |
|---|---|
| Config |
CreateConfigFromString(String)
Creates an object Linphone.Config.
Declaration
public Config CreateConfigFromString(string data)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | data | the config data |
Returns
| Type | Description |
|---|---|
| Config |
CreateConfigWithFactory(String, String)
Creates an object Linphone.Config.
Declaration
public Config CreateConfigWithFactory(string path, string factoryPath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | the path of the config |
| System.String | factoryPath | the path of the factory |
Returns
| Type | Description |
|---|---|
| Config |
CreateContent()
Creates an object Linphone.Content.
Declaration
public Content CreateContent()
Returns
| Type | Description |
|---|---|
| Content |
CreateContentFromFile(String)
Creates a file object of Linphone.Content from a file path.
Declaration
public Content CreateContentFromFile(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | the path of the file |
Returns
| Type | Description |
|---|---|
| Content | a Linphone.Content which can be used as a file |
CreateCore(String, String, IntPtr)
Instantiate a Linphone.Core object.
The Linphone.Core object is the primary handle for doing all phone actions. It should be unique within your application. The Linphone.Core object is not started automatically, you need to call Linphone.Core.Start() to that effect. The returned Linphone.Core will be in Linphone.GlobalState Ready. Core ressources can be released using Linphone.Core.Stop() which is strongly encouraged on garbage collected languages.
Declaration
public Core CreateCore(string configPath, string factoryConfigPath, IntPtr systemContext)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | configPath | A path to a config file. If it does not exists it will be created. The config file is used to store all settings, proxies... so that all these settings become persistent over the life of the Linphone.Core object. It is allowed to set a null config file. In that case Linphone.Core will not store any settings. |
| System.String | factoryConfigPath | A path to a read-only config file that can be used to store hard-coded preferences such as proxy settings or internal preferences. The settings in this factory file always override the ones in the normal config file. It is optional, use null if unneeded. |
| System.IntPtr | systemContext | A pointer to a system object required by the core to operate. Currently it is required to pass an android Context on android, pass null on other platforms. |
Returns
| Type | Description |
|---|---|
| Core | a Linphone.Core object |
Remarks
See : linphone_core_new_with_config_3()
CreateCoreWithConfig(Config, IntPtr)
Instantiate a Linphone.Core object with a given LinphoneConfig.
The Linphone.Core object is the primary handle for doing all phone actions. It should be unique within your application. The Linphone.Core object is not started automatically, you need to call Linphone.Core.Start() to that effect. The returned Linphone.Core will be in Linphone.GlobalState Ready. Core ressources can be released using Linphone.Core.Stop() which is strongly encouraged on garbage collected languages.
Declaration
public Core CreateCoreWithConfig(Config config, IntPtr systemContext)
Parameters
| Type | Name | Description |
|---|---|---|
| Config | config | A Linphone.Config object holding the configuration for the Linphone.Core to be instantiated. |
| System.IntPtr | systemContext | A pointer to a system object required by the core to operate. Currently it is required to pass an android Context on android, pass null on other platforms. |
Returns
| Type | Description |
|---|---|
| Core | a Linphone.Core object |
Remarks
See :
CreateDigestAuthenticationPolicy()
Create a Linphone.DigestAuthenticationPolicy object.
The Linphone.DigestAuthenticationPolicy object which is used to configure a policy for digest authentication, such as allowing MD5 or mode without qop=auth.
Declaration
public DigestAuthenticationPolicy CreateDigestAuthenticationPolicy()
Returns
| Type | Description |
|---|---|
| DigestAuthenticationPolicy |
CreateEktInfo()
Create an empty Linphone.EktInfo object.
Declaration
public EktInfo CreateEktInfo()
Returns
| Type | Description |
|---|---|
| EktInfo | A new Linphone.EktInfo object |
CreateErrorInfo()
Creates an object LinphoneErrorInfo.
Declaration
public ErrorInfo CreateErrorInfo()
Returns
| Type | Description |
|---|---|
| ErrorInfo | a Linphone.ErrorInfo object. |
CreateFriendPhoneNumber(String, String)
Creates a new Linphone.FriendPhoneNumber object.
Declaration
public FriendPhoneNumber CreateFriendPhoneNumber(string phoneNumber, string label)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | phoneNumber | The phone number. |
| System.String | label | the type of phone number, for example "home", "cell", etc. Use null or empty for no label. |
Returns
| Type | Description |
|---|---|
| FriendPhoneNumber | The newly created Linphone.FriendPhoneNumber object. |
CreateParticipantDeviceIdentity(Address, String)
Create a Linphone.ParticipantDeviceIdentity object.
Declaration
public ParticipantDeviceIdentity CreateParticipantDeviceIdentity(Address address, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | address | Linphone.Address object. |
| System.String | name | the name given to the device. |
Returns
| Type | Description |
|---|---|
| ParticipantDeviceIdentity |
CreateParticipantInfo(Address)
Creates an object Linphone.ConferenceInfo from an Icalendar Linphone.Content.
Declaration
public ParticipantInfo CreateParticipantInfo(Address address)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | address | the Linphone.Address of the participant |
Returns
| Type | Description |
|---|---|
| ParticipantInfo |
CreateQrcode(String, UInt32, UInt32, UInt32)
Creates a Bitmap QRCode and return it into an object Linphone.Content.
Declaration
public Content CreateQrcode(string code, uint width, uint height, uint margin)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | code | The code to be generated into an image. It must not be empty. |
| System.UInt32 | width | The requested width of the QRCode image. It will be 100 if 0. |
| System.UInt32 | height | The requested height of the QRCode image. It will be 100 if 0. |
| System.UInt32 | margin | The requested margin of the QRCode image. |
Returns
| Type | Description |
|---|---|
| Content |
CreateRange()
Creates an object LinphoneRange.
Declaration
public Range CreateRange()
Returns
| Type | Description |
|---|---|
| Range | a Linphone.Range object. |
CreateSignalInformation()
Creates an object Linphone.SignalInformation.
Declaration
public SignalInformation CreateSignalInformation()
Returns
| Type | Description |
|---|---|
| SignalInformation |
CreateTransports()
Creates an object LinphoneTransports.
Declaration
public Transports CreateTransports()
Returns
| Type | Description |
|---|---|
| Transports | a Linphone.Transports object. |
CreateTunnelConfig()
Creates an object Linphone.TunnelConfig.
Declaration
public TunnelConfig CreateTunnelConfig()
Returns
| Type | Description |
|---|---|
| TunnelConfig |
CreateVcard()
Create an empty Linphone.Vcard.
Declaration
public Vcard CreateVcard()
Returns
| Type | Description |
|---|---|
| Vcard | a new Linphone.Vcard. |
CreateVideoActivationPolicy()
Creates an object LinphoneVideoActivationPolicy.
Declaration
public VideoActivationPolicy CreateVideoActivationPolicy()
Returns
| Type | Description |
|---|---|
| VideoActivationPolicy | Linphone.VideoActivationPolicy object. |
CreateVideoDefinition(UInt32, UInt32)
Create a Linphone.VideoDefinition from a given width and height.
Declaration
public VideoDefinition CreateVideoDefinition(uint width, uint height)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | width | The width of the created video definition |
| System.UInt32 | height | The height of the created video definition |
Returns
| Type | Description |
|---|---|
| VideoDefinition | A new Linphone.VideoDefinition object |
CreateVideoDefinitionFromName(String)
Create a Linphone.VideoDefinition from a given standard definition name.
Declaration
public VideoDefinition CreateVideoDefinitionFromName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The standard definition name of the video definition to create |
Returns
| Type | Description |
|---|---|
| VideoDefinition | A new Linphone.VideoDefinition object |
CreateVideoSourceDescriptor()
Creates an object Linphone.VideoSourceDescriptor.
Declaration
public VideoSourceDescriptor CreateVideoSourceDescriptor()
Returns
| Type | Description |
|---|---|
| VideoSourceDescriptor |
EnableLogCollection(LogCollectionState)
Enables or disables log collection.
Declaration
public void EnableLogCollection(LogCollectionState state)
Parameters
| Type | Name | Description |
|---|---|---|
| LogCollectionState | state | the Linphone.LogCollectionState for log collection |
GetCacheDir(IntPtr)
Get the cache path.
Declaration
public string GetCacheDir(IntPtr context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | context | used to compute path. Can be null. JavaPlatformHelper on Android and char *appGroupId on iOS with shared core. |
Returns
| Type | Description |
|---|---|
| System.String | The cache path |
GetConfigDir(IntPtr)
Get the config path.
Declaration
public string GetConfigDir(IntPtr context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | context | used to compute path. Can be null. JavaPlatformHelper on Android and char *appGroupId on iOS with shared core. |
Returns
| Type | Description |
|---|---|
| System.String | The config path |
GetDataDir(IntPtr)
Get the data path.
Declaration
public string GetDataDir(IntPtr context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | context | used to compute path. Can be null. JavaPlatformHelper on Android and char *appGroupId on iOS with shared core. |
Returns
| Type | Description |
|---|---|
| System.String | The data path |
GetDownloadDir(IntPtr)
Get the download path.
Declaration
public string GetDownloadDir(IntPtr context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | context | used to compute path. Can be null. JavaPlatformHelper on Android and char *appGroupId on iOS with shared core. |
Returns
| Type | Description |
|---|---|
| System.String | The download path |
IsChatroomBackendAvailable(ChatRoomBackend)
Indicates if the given LinphoneChatRoomBackend is available.
Declaration
public bool IsChatroomBackendAvailable(ChatRoomBackend chatroomBackend)
Parameters
| Type | Name | Description |
|---|---|---|
| ChatRoomBackend | chatroomBackend |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the chatroom backend is available, false otherwise |
SetVfsEncryption(UInt32, UInt32, Int64)
Select encryption module and set secret material to encrypt the files.
Declaration
public bool SetVfsEncryption(uint encryptionModule, uint secret, long secretSize)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | encryptionModule | One of the available encryption module for VFS, pick in the LINPHONE_VFS_ENCRYPTION_* list if set to _UNSET, default bctoolbox VFS is switch to Standard one |
| System.UInt32 | secret | the secret material used to encrypt the files, can be null for the _PLAIN module |
| System.Int64 | secretSize | size of the secret |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if everything went well, false if it appears that the given secret is unable to decrypt existing configuration |
WriteQrcodeFile(String, String, UInt32, UInt32, UInt32)
Creates a QRCode and write it into a JPEG file specified by file_path (only if build with JPEG).
Declaration
public int WriteQrcodeFile(string filePath, string code, uint width, uint height, uint margin)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The file where to write the QRCode JPEG image. |
| System.String | code | The code to be generated into an image. It must not be empty. |
| System.UInt32 | width | The requested width of the QRCode image. It will be 100 if 0. |
| System.UInt32 | height | The requested height of the QRCode image. It will be 100 if 0. |
| System.UInt32 | margin | The requested margin of the QRCode image. |
Returns
| Type | Description |
|---|---|
| System.Int32 | 0 if successful, -2 if JPEG is not supported, -1 otherwise |