Class Factory
The factory is a singleton object devoted to the creation of all the objects of Liblinphone that cannot be created by Core itself.
It is also used to configure a few behaviors before creating the Core, like the logs verbosity or collection.
Inherited Members
Namespace: Linphone
Assembly: cs.temp.dll.dll
Syntax
public class Factory : LinphoneObject
Properties
ConfigDir
Set the directory where the configurations are located.
If the path is empty (default value), the path will be computed when calling 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 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 DialPlan |
DownloadDir
Set the directory where downloads are located.
If the path is empty (default value), the path will be computed when calling 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 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 Factory |
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 |
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. |
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()
CreateAddress(String)
Parse a string holding a SIP URI and create the according 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 Address. |
CreateAuthInfo(String, String, String, String, String, String)
Creates a 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 AuthInfo object.
linphone_auth_info_destroy must be used to destroy it when no longer needed.
The Core makes a copy of AuthInfo passed through |
CreateAuthInfo(String, String, String, String, String, String, String)
Creates a 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 AuthInfo object.
linphone_auth_info_destroy must be used to destroy it when no longer needed.
The Core makes a copy of AuthInfo passed through |
CreateBuffer()
Creates an object Buffer.
Declaration
public Buffer CreateBuffer()
Returns
| Type | Description |
|---|---|
| Buffer | a Buffer |
CreateBufferFromData(UInt32, Int64)
Creates an object 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 | a Buffer |
CreateBufferFromString(String)
Creates an object 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 | a Buffer |
CreateConferenceInfo()
Creates an object ConferenceInfo.
Declaration
public ConferenceInfo CreateConferenceInfo()
Returns
| Type | Description |
|---|---|
| ConferenceInfo |
CreateConferenceInfoFromIcalendarContent(Content)
Creates an object ConferenceInfo from an Icalendar Content.
Declaration
public ConferenceInfo CreateConferenceInfoFromIcalendarContent(Content content)
Parameters
| Type | Name | Description |
|---|---|---|
| Content | content | the Icalendar Content |
Returns
| Type | Description |
|---|---|
| ConferenceInfo | a ConferenceInfo created from an Icalendar Content |
CreateConfig(String)
Creates an object Config.
Declaration
public Config CreateConfig(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | the path of the config |
Returns
| Type | Description |
|---|---|
| Config | a Config |
CreateConfigFromString(String)
Creates an object Config.
Declaration
public Config CreateConfigFromString(string data)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | data | the config data |
Returns
| Type | Description |
|---|---|
| Config | a Config |
CreateConfigWithFactory(String, String)
Creates an object 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 | a Config |
CreateContent()
Creates an object Content.
Declaration
public Content CreateContent()
Returns
| Type | Description |
|---|---|
| Content | a Content |
CreateCore(String, String, IntPtr)
Instantiate a Core object.
The Core object is the primary handle for doing all phone actions. It should be unique within your application. The Core object is not started automatically, you need to call Start() to that effect. The returned Core will be in GlobalState Ready. Core ressources can be released using 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 Core object. It is allowed to set a null config file. In that case 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 Core object |
Remarks
See : linphone_core_new_with_config_3()
CreateCoreWithConfig(Config, IntPtr)
Instantiate a Core object with a given LinphoneConfig.
The Core object is the primary handle for doing all phone actions. It should be unique within your application. The Core object is not started automatically, you need to call Start() to that effect. The returned Core will be in GlobalState Ready. Core ressources can be released using Stop() which is strongly encouraged on garbage collected languages.
Declaration
public Core CreateCoreWithConfig(Config config, IntPtr systemContext)
Parameters
| Type | Name | Description |
|---|---|---|
| Config | config | A Config object holding the configuration for the 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 Core object |
Remarks
See :
CreateDigestAuthenticationPolicy()
Create a DigestAuthenticationPolicy object.
The 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 | a new DigestAuthenticationPolicy . |
CreateErrorInfo()
Creates an object LinphoneErrorInfo.
Declaration
public ErrorInfo CreateErrorInfo()
Returns
| Type | Description |
|---|---|
| ErrorInfo | a ErrorInfo object. |
CreateParticipantDeviceIdentity(Address, String)
Create a ParticipantDeviceIdentity object.
Declaration
public ParticipantDeviceIdentity CreateParticipantDeviceIdentity(Address address, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | address | Address object. |
| System.String | name | the name given to the device. |
Returns
| Type | Description |
|---|---|
| ParticipantDeviceIdentity | A new ParticipantDeviceIdentity. |
CreateRange()
Creates an object LinphoneRange.
Declaration
public Range CreateRange()
Returns
| Type | Description |
|---|---|
| Range | a Range object. |
CreateTransports()
Creates an object LinphoneTransports.
Declaration
public Transports CreateTransports()
Returns
| Type | Description |
|---|---|
| Transports | a Transports object. |
CreateTunnelConfig()
Creates an object TunnelConfig.
Declaration
public TunnelConfig CreateTunnelConfig()
Returns
| Type | Description |
|---|---|
| TunnelConfig |
CreateVcard()
Create an empty Vcard.
Declaration
public Vcard CreateVcard()
Returns
| Type | Description |
|---|---|
| Vcard | a new Vcard. |
CreateVideoActivationPolicy()
Creates an object LinphoneVideoActivationPolicy.
Declaration
public VideoActivationPolicy CreateVideoActivationPolicy()
Returns
| Type | Description |
|---|---|
| VideoActivationPolicy | VideoActivationPolicy object. |
CreateVideoDefinition(UInt32, UInt32)
Create a 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 VideoDefinition object |
CreateVideoDefinitionFromName(String)
Create a 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 VideoDefinition object |
EnableLogCollection(LogCollectionState)
Enables or disables log collection.
Declaration
public void EnableLogCollection(LogCollectionState state)
Parameters
| Type | Name | Description |
|---|---|---|
| LogCollectionState | state | the LogCollectionState for log collection |
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 | the 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 void 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 |