Liblinphone  5.3.0
Public Member Functions | Static Public Member Functions | List of all members
linphone::Factory Class Reference

The factory is a singleton object devoted to the creation of all the objects of Liblinphone that cannot be created by Core itself. More...

#include <factory.hh>

Inheritance diagram for linphone::Factory:

Public Member Functions

LINPHONECXX_PUBLIC Factory (void *ptr, bool takeRef=true)
 
LINPHONECXX_PUBLIC _LinphoneFactory * cPtr ()
 
LINPHONECXX_PUBLIC void setCacheDir (const std::string &path)
 Set the directory where the application local cache is located. More...
 
LINPHONECXX_PUBLIC void setConfigDir (const std::string &path)
 Set the directory where the configurations are located. More...
 
LINPHONECXX_PUBLIC void setDataDir (const std::string &path)
 Set the directory where the application local data are located. More...
 
LINPHONECXX_PUBLIC std::string getDataResourcesDir ()
 Get the directory where the data resources are located. More...
 
LINPHONECXX_PUBLIC void setDataResourcesDir (const std::string &path)
 Set the directory where the data resources are located. More...
 
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::DialPlan > > getDialPlans () const
 Returns a bctbx_list_t of all DialPlans. More...
 
LINPHONECXX_PUBLIC void setDownloadDir (const std::string &path)
 Set the directory where downloads are located. More...
 
LINPHONECXX_PUBLIC std::string getImageResourcesDir ()
 Get the directory where the image resources are located. More...
 
LINPHONECXX_PUBLIC void setImageResourcesDir (const std::string &path)
 Set the directory where the image resources are located. More...
 
LINPHONECXX_PUBLIC bool isCacheDirSet () const
 Test if cache dir has been set. More...
 
LINPHONECXX_PUBLIC bool isConfigDirSet () const
 Test if config dir has been set. More...
 
LINPHONECXX_PUBLIC bool isDataDirSet () const
 Test if data dir has been set. More...
 
LINPHONECXX_PUBLIC bool isDatabaseStorageAvailable ()
 Indicates if the storage in database is available. More...
 
LINPHONECXX_PUBLIC bool isDownloadDirSet () const
 Test if download dir has been set. More...
 
LINPHONECXX_PUBLIC bool isImdnAvailable ()
 Indicates if IMDN are available. More...
 
LINPHONECXX_PUBLIC bool isQrcodeAvailable ()
 Indicates if the QRCode feature is available. More...
 
LINPHONECXX_PUBLIC std::string getLiblinphonePluginsDir ()
 Get the directory where the liblinphone plugins are located. More...
 
LINPHONECXX_PUBLIC void setLiblinphonePluginsDir (const std::string &path)
 Set the directory where the liblinphone plugins are located. More...
 
LINPHONECXX_PUBLIC void setLogCollectionPath (const std::string &path)
 Sets the log collection path. More...
 
LINPHONECXX_PUBLIC std::string getMspluginsDir ()
 Get the directory where the mediastreamer2 plugins are located. More...
 
LINPHONECXX_PUBLIC void setMspluginsDir (const std::string &path)
 Set the directory where the mediastreamer2 plugins are located. More...
 
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::VideoDefinition > > getRecommendedVideoDefinitions () const
 Get the recommended list of standard video definitions. More...
 
LINPHONECXX_PUBLIC std::string getRingResourcesDir ()
 Get the directory where the ring resources are located. More...
 
LINPHONECXX_PUBLIC void setRingResourcesDir (const std::string &path)
 Set the directory where the ring resources are located. More...
 
LINPHONECXX_PUBLIC std::string getSoundResourcesDir ()
 Get the directory where the sound resources are located. More...
 
LINPHONECXX_PUBLIC void setSoundResourcesDir (const std::string &path)
 Set the directory where the sound resources are located. More...
 
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::VideoDefinition > > getSupportedVideoDefinitions () const
 Get the list of standard video definitions supported by Linphone. More...
 
LINPHONECXX_PUBLIC std::string getTopResourcesDir () const
 Get the top directory where the resources are located. More...
 
LINPHONECXX_PUBLIC void setTopResourcesDir (const std::string &path)
 Set the top directory where the resources are located. More...
 
LINPHONECXX_PUBLIC std::string computeHa1ForAlgorithm (const std::string &userid, const std::string &password, const std::string &realm, const std::string &algorithm) const
 Computes the hashed version of the password given the user ID and the realm, using given algorithm. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::AddresscreateAddress (const std::string &addr) const
 Parse a string holding a SIP URI and create the according Address object. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::AuthInfocreateAuthInfo (const std::string &username, const std::string &userid, const std::string &passwd, const std::string &ha1, const std::string &realm, const std::string &domain) const
 Creates a AuthInfo object. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::AuthInfocreateAuthInfo (const std::string &username, const std::string &userid, const std::string &passwd, const std::string &ha1, const std::string &realm, const std::string &domain, const std::string &algorithm) const
 Creates a AuthInfo object. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::BuffercreateBuffer ()
 Creates an object Buffer. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::BuffercreateBufferFromData (const uint8_t *data, size_t size)
 Creates an object Buffer. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::BuffercreateBufferFromString (const std::string &data)
 Creates an object Buffer. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ConferenceInfocreateConferenceInfo ()
 Creates an object ConferenceInfo. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ConferenceInfocreateConferenceInfoFromIcalendarContent (const std::shared_ptr< linphone::Content > &content)
 Creates an object ConferenceInfo from an Icalendar Content. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ConfigcreateConfig (const std::string &path)
 Creates an object Config. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ConfigcreateConfigFromString (const std::string &data)
 Creates an object Config. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ConfigcreateConfigWithFactory (const std::string &path, const std::string &factoryPath)
 Creates an object Config. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ContentcreateContent ()
 Creates an object Content. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ContentcreateContentFromFile (const std::string &filePath)
 Creates a file object of Content from a file path. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::CorecreateCore (const std::string &configPath, const std::string &factoryConfigPath, void *systemContext) const
 Instantiate a Core object. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::CorecreateCoreWithConfig (const std::shared_ptr< linphone::Config > &config, void *systemContext) const
 Instantiate a Core object with a given LinphoneConfig. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::DigestAuthenticationPolicycreateDigestAuthenticationPolicy () const
 Create a DigestAuthenticationPolicy object. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ErrorInfocreateErrorInfo ()
 Creates an object LinphoneErrorInfo. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::FriendPhoneNumbercreateFriendPhoneNumber (const std::string &phoneNumber, const std::string &label) const
 Creates a new FriendPhoneNumber objects. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ParticipantDeviceIdentitycreateParticipantDeviceIdentity (const std::shared_ptr< const linphone::Address > &address, const std::string &name) const
 Create a ParticipantDeviceIdentity object. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ParticipantInfocreateParticipantInfo (const std::shared_ptr< linphone::Address > &address)
 Creates an object ConferenceInfo from an Icalendar Content. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ContentcreateQrcode (const std::string &code, unsigned int width, unsigned int height, unsigned int margin)
 Creates a Bitmap QRCode and return it into an object Content. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::RangecreateRange ()
 Creates an object LinphoneRange. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::SignalInformationcreateSignalInformation ()
 Creates an object SignalInformation. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::TransportscreateTransports ()
 Creates an object LinphoneTransports. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::TunnelConfigcreateTunnelConfig ()
 Creates an object TunnelConfig. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::VcardcreateVcard ()
 Create an empty Vcard. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::VideoActivationPolicycreateVideoActivationPolicy ()
 Creates an object LinphoneVideoActivationPolicy. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::VideoDefinitioncreateVideoDefinition (unsigned int width, unsigned int height) const
 Create a VideoDefinition from a given width and height. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::VideoDefinitioncreateVideoDefinitionFromName (const std::string &name) const
 Create a VideoDefinition from a given standard definition name. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::VideoSourceDescriptorcreateVideoSourceDescriptor ()
 Creates an object VideoSourceDescriptor. More...
 
LINPHONECXX_PUBLIC void enableLogCollection (linphone::LogCollectionState state)
 Enables or disables log collection. More...
 
LINPHONECXX_PUBLIC std::string getCacheDir (void *context)
 Get the cache path. More...
 
LINPHONECXX_PUBLIC std::string getConfigDir (void *context)
 Get the config path. More...
 
LINPHONECXX_PUBLIC std::string getDataDir (void *context)
 Get the data path. More...
 
LINPHONECXX_PUBLIC std::string getDownloadDir (void *context)
 Get the download path. More...
 
LINPHONECXX_PUBLIC bool isChatroomBackendAvailable (linphone::ChatRoom::Backend chatroomBackend)
 Indicates if the given LinphoneChatRoomBackend is available. More...
 
LINPHONECXX_PUBLIC void setVfsEncryption (const uint16_t encryptionModule, const uint8_t *secret, const size_t secretSize)
 Select encryption module and set secret material to encrypt the files. More...
 
LINPHONECXX_PUBLIC int writeQrcodeFile (const std::string &filePath, const std::string &code, unsigned int width, unsigned int height, unsigned int margin)
 Creates a QRCode and write it into a JPEG file specified by file_path (only if build with JPEG). More...
 

Static Public Member Functions

static LINPHONECXX_PUBLIC void clean ()
 Clean the factory. More...
 
static LINPHONECXX_PUBLIC std::shared_ptr< linphone::Factoryget ()
 Create the Factory if that has not been done and return a pointer on it. More...
 

Detailed Description

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.

Member Function Documentation

◆ clean()

static LINPHONECXX_PUBLIC void linphone::Factory::clean ( )
static

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 get().

◆ computeHa1ForAlgorithm()

LINPHONECXX_PUBLIC std::string linphone::Factory::computeHa1ForAlgorithm ( const std::string &  userid,
const std::string &  password,
const std::string &  realm,
const std::string &  algorithm 
) const

Computes the hashed version of the password given the user ID and the realm, using given algorithm.

Parameters
useridthe username or user ID to use.
passwordthe password to hash.
realmthe real to use.
algorithmthe algorithm to use (MD5 or SHA-256).
Returns
the generated hash if it succeeded, nullptr otherwise.

◆ createAddress()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Address> linphone::Factory::createAddress ( const std::string &  addr) const

Parse a string holding a SIP URI and create the according Address object.

Parameters
addrA string holding the SIP URI to parse.
Returns
A new Address.

◆ createAuthInfo() [1/2]

LINPHONECXX_PUBLIC std::shared_ptr<linphone::AuthInfo> linphone::Factory::createAuthInfo ( const std::string &  username,
const std::string &  userid,
const std::string &  passwd,
const std::string &  ha1,
const std::string &  realm,
const std::string &  domain 
) const

Creates a AuthInfo object.

The object can be created empty, that is with all arguments set to nullptr. Username, userid, password, realm and domain can be set later using specific methods. At the end, username and passwd (or ha1) are required.

Parameters
usernameThe username that needs to be authenticated
useridThe userid used for authenticating (use nullptr if you don't know what it is)
passwdThe password in clear text
ha1The ha1-encrypted password if password is not given in clear text.
realmThe authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter.
domainThe SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain.
Returns
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 Core::addAuthInfo().

◆ createAuthInfo() [2/2]

LINPHONECXX_PUBLIC std::shared_ptr<linphone::AuthInfo> linphone::Factory::createAuthInfo ( const std::string &  username,
const std::string &  userid,
const std::string &  passwd,
const std::string &  ha1,
const std::string &  realm,
const std::string &  domain,
const std::string &  algorithm 
) const

Creates a AuthInfo object.

The object can be created empty, that is with all arguments set to nullptr. Username, userid, password, realm and domain can be set later using specific methods. At the end, username and passwd (or ha1) are required.

Parameters
usernameThe username that needs to be authenticated
useridThe userid used for authenticating (use nullptr if you don't know what it is)
passwdThe password in clear text
ha1The ha1-encrypted password if password is not given in clear text.
realmThe authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter.
domainThe SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain.
algorithmThe algorithm for encrypting password.
Returns
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 Core::addAuthInfo().

◆ createBuffer()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Buffer> linphone::Factory::createBuffer ( )

Creates an object Buffer.

Returns
a Buffer

◆ createBufferFromData()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Buffer> linphone::Factory::createBufferFromData ( const uint8_t *  data,
size_t  size 
)

Creates an object Buffer.

Parameters
datathe data to set in the buffer
sizethe size of the data
Returns
a Buffer

◆ createBufferFromString()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Buffer> linphone::Factory::createBufferFromString ( const std::string &  data)

Creates an object Buffer.

Parameters
datathe data to set in the buffer
Returns
a Buffer

◆ createConferenceInfo()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::ConferenceInfo> linphone::Factory::createConferenceInfo ( )

Creates an object ConferenceInfo.

Returns
a ConferenceInfo

◆ createConferenceInfoFromIcalendarContent()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::ConferenceInfo> linphone::Factory::createConferenceInfoFromIcalendarContent ( const std::shared_ptr< linphone::Content > &  content)

Creates an object ConferenceInfo from an Icalendar Content.

Parameters
contentthe Icalendar Content
Returns
a ConferenceInfo created from an Icalendar Content

◆ createConfig()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Config> linphone::Factory::createConfig ( const std::string &  path)

Creates an object Config.

Parameters
paththe path of the config
Returns
a Config

◆ createConfigFromString()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Config> linphone::Factory::createConfigFromString ( const std::string &  data)

Creates an object Config.

Parameters
datathe config data
Returns
a Config

◆ createConfigWithFactory()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Config> linphone::Factory::createConfigWithFactory ( const std::string &  path,
const std::string &  factoryPath 
)

Creates an object Config.

Parameters
paththe path of the config
factoryPaththe path of the factory
Returns
a Config

◆ createContent()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Content> linphone::Factory::createContent ( )

Creates an object Content.

Returns
a Content

◆ createContentFromFile()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Content> linphone::Factory::createContentFromFile ( const std::string &  filePath)

Creates a file object of Content from a file path.

Parameters
filePaththe path of the file
Returns
a Content which can be used as a file

◆ createCore()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::Factory::createCore ( const std::string &  configPath,
const std::string &  factoryConfigPath,
void *  systemContext 
) const

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 Core::start() to that effect. The returned Core will be in GlobalState Ready. Core ressources can be released using Core::stop() which is strongly encouraged on garbage collected languages.

Parameters
configPathA 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 nullptr config file. In that case Core will not store any settings.
factoryConfigPathA 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 nullptr if unneeded.
systemContextA pointer to a system object required by the core to operate. Currently it is required to pass an android Context on android, pass nullptr on other platforms.
Returns
a Core object
See also
linphone_core_new_with_config_3()

◆ createCoreWithConfig()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::Factory::createCoreWithConfig ( const std::shared_ptr< linphone::Config > &  config,
void *  systemContext 
) const

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 Core::start() to that effect. The returned Core will be in GlobalState Ready. Core ressources can be released using Core::stop() which is strongly encouraged on garbage collected languages.

Parameters
configA Config object holding the configuration for the Core to be instantiated.
systemContextA pointer to a system object required by the core to operate. Currently it is required to pass an android Context on android, pass nullptr on other platforms.
Returns
a Core object
See also
createCore()

◆ createDigestAuthenticationPolicy()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::DigestAuthenticationPolicy> linphone::Factory::createDigestAuthenticationPolicy ( ) const

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.

Returns
a new DigestAuthenticationPolicy .

◆ createErrorInfo()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::ErrorInfo> linphone::Factory::createErrorInfo ( )

Creates an object LinphoneErrorInfo.

Returns
a ErrorInfo object.

◆ createFriendPhoneNumber()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::FriendPhoneNumber> linphone::Factory::createFriendPhoneNumber ( const std::string &  phoneNumber,
const std::string &  label 
) const

Creates a new FriendPhoneNumber objects.

Parameters
phoneNumberThe phone number.
labelthe type of phone number, for example "home", "cell", etc. Use nullptr or empty for no label.
Returns
The newly created FriendPhoneNumber object.

◆ createParticipantDeviceIdentity()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::ParticipantDeviceIdentity> linphone::Factory::createParticipantDeviceIdentity ( const std::shared_ptr< const linphone::Address > &  address,
const std::string &  name 
) const

Create a ParticipantDeviceIdentity object.

Parameters
addressAddress object.
namethe name given to the device.
Returns
A new ParticipantDeviceIdentity.

◆ createParticipantInfo()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::ParticipantInfo> linphone::Factory::createParticipantInfo ( const std::shared_ptr< linphone::Address > &  address)

Creates an object ConferenceInfo from an Icalendar Content.

Parameters
addressthe Address of the participant
Returns
a ParticipantInfo

◆ createQrcode()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Content> linphone::Factory::createQrcode ( const std::string &  code,
unsigned int  width,
unsigned int  height,
unsigned int  margin 
)

Creates a Bitmap QRCode and return it into an object Content.

Parameters
codeThe code to be generated into an image. It must not be empty.
widthThe requested width of the QRCode image. It will be 100 if 0.
heightThe requested height of the QRCode image. It will be 100 if 0.
marginThe requested margin of the QRCode image.
Returns
a Content

◆ createRange()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Range> linphone::Factory::createRange ( )

Creates an object LinphoneRange.

Returns
a Range object.

◆ createSignalInformation()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::SignalInformation> linphone::Factory::createSignalInformation ( )

Creates an object SignalInformation.

Returns
a SignalInformation

◆ createTransports()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Transports> linphone::Factory::createTransports ( )

Creates an object LinphoneTransports.

Returns
a Transports object.

◆ createTunnelConfig()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::TunnelConfig> linphone::Factory::createTunnelConfig ( )

Creates an object TunnelConfig.

Returns
a TunnelConfig

◆ createVcard()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Vcard> linphone::Factory::createVcard ( )

Create an empty Vcard.

Returns
a new Vcard.

◆ createVideoActivationPolicy()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::VideoActivationPolicy> linphone::Factory::createVideoActivationPolicy ( )

Creates an object LinphoneVideoActivationPolicy.

Returns
VideoActivationPolicy object.

◆ createVideoDefinition()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::VideoDefinition> linphone::Factory::createVideoDefinition ( unsigned int  width,
unsigned int  height 
) const

Create a VideoDefinition from a given width and height.

Parameters
widthThe width of the created video definition
heightThe height of the created video definition
Returns
A new VideoDefinition object

◆ createVideoDefinitionFromName()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::VideoDefinition> linphone::Factory::createVideoDefinitionFromName ( const std::string &  name) const

Create a VideoDefinition from a given standard definition name.

Parameters
nameThe standard definition name of the video definition to create
Returns
A new VideoDefinition object

◆ createVideoSourceDescriptor()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::VideoSourceDescriptor> linphone::Factory::createVideoSourceDescriptor ( )

Creates an object VideoSourceDescriptor.

Returns
a VideoSourceDescriptor

◆ enableLogCollection()

LINPHONECXX_PUBLIC void linphone::Factory::enableLogCollection ( linphone::LogCollectionState  state)

Enables or disables log collection.

Parameters
statethe LogCollectionState for log collection

◆ get()

static LINPHONECXX_PUBLIC std::shared_ptr<linphone::Factory> linphone::Factory::get ( )
static

Create the Factory if that has not been done and return a pointer on it.

Returns
A pointer on the Factory

◆ getCacheDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getCacheDir ( void *  context)

Get the cache path.

Parameters
contextused to compute path. Can be nullptr. JavaPlatformHelper on Android and char *appGroupId on iOS with shared core.
Returns
The cache path

◆ getConfigDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getConfigDir ( void *  context)

Get the config path.

Parameters
contextused to compute path. Can be nullptr. JavaPlatformHelper on Android and char *appGroupId on iOS with shared core.
Returns
The config path

◆ getDataDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getDataDir ( void *  context)

Get the data path.

Parameters
contextused to compute path. Can be nullptr. JavaPlatformHelper on Android and char *appGroupId on iOS with shared core.
Returns
The data path

◆ getDataResourcesDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getDataResourcesDir ( )

Get the directory where the data resources are located.

Returns
The path to the directory where the data resources are located

◆ getDialPlans()

LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::DialPlan> > linphone::Factory::getDialPlans ( ) const

Returns a bctbx_list_t of all DialPlans.

Returns
A list of DialPlan

◆ getDownloadDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getDownloadDir ( void *  context)

Get the download path.

Parameters
contextused to compute path. Can be nullptr. JavaPlatformHelper on Android and char *appGroupId on iOS with shared core.
Returns
The download path

◆ getImageResourcesDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getImageResourcesDir ( )

Get the directory where the image resources are located.

Returns
The path to the directory where the image resources are located

◆ getLiblinphonePluginsDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getLiblinphonePluginsDir ( )

Get the directory where the liblinphone plugins are located.

Returns
The path to the directory where the liblinphone plugins are located, or nullptr if it has not been set.

◆ getMspluginsDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getMspluginsDir ( )

Get the directory where the mediastreamer2 plugins are located.

Returns
The path to the directory where the mediastreamer2 plugins are located, or nullptr if it has not been set.

◆ getRecommendedVideoDefinitions()

LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::VideoDefinition> > linphone::Factory::getRecommendedVideoDefinitions ( ) const

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.

Returns
A list of video definitions.

◆ getRingResourcesDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getRingResourcesDir ( )

Get the directory where the ring resources are located.

Returns
The path to the directory where the ring resources are located

◆ getSoundResourcesDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getSoundResourcesDir ( )

Get the directory where the sound resources are located.

Returns
The path to the directory where the sound resources are located

◆ getSupportedVideoDefinitions()

LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::VideoDefinition> > linphone::Factory::getSupportedVideoDefinitions ( ) const

Get the list of standard video definitions supported by Linphone.

Returns
A list of video definitions.

◆ getTopResourcesDir()

LINPHONECXX_PUBLIC std::string linphone::Factory::getTopResourcesDir ( ) const

Get the top directory where the resources are located.

Returns
The path to the top directory where the resources are located

◆ isCacheDirSet()

LINPHONECXX_PUBLIC bool linphone::Factory::isCacheDirSet ( ) const

Test if cache dir has been set.

Returns
true if cache dir has been set.

◆ isChatroomBackendAvailable()

LINPHONECXX_PUBLIC bool linphone::Factory::isChatroomBackendAvailable ( linphone::ChatRoom::Backend  chatroomBackend)

Indicates if the given LinphoneChatRoomBackend is available.

Parameters
chatroomBackendthe ChatRoom::Backend
Returns
true if the chatroom backend is available, false otherwise

◆ isConfigDirSet()

LINPHONECXX_PUBLIC bool linphone::Factory::isConfigDirSet ( ) const

Test if config dir has been set.

Returns
true if config dir has been set.

◆ isDatabaseStorageAvailable()

LINPHONECXX_PUBLIC bool linphone::Factory::isDatabaseStorageAvailable ( )

Indicates if the storage in database is available.

Returns
true if the database storage is available, false otherwise

◆ isDataDirSet()

LINPHONECXX_PUBLIC bool linphone::Factory::isDataDirSet ( ) const

Test if data dir has been set.

Returns
true if data dir has been set.

◆ isDownloadDirSet()

LINPHONECXX_PUBLIC bool linphone::Factory::isDownloadDirSet ( ) const

Test if download dir has been set.

Returns
true if download dir has been set.

◆ isImdnAvailable()

LINPHONECXX_PUBLIC bool linphone::Factory::isImdnAvailable ( )

Indicates if IMDN are available.

Returns
true if IDMN are available

◆ isQrcodeAvailable()

LINPHONECXX_PUBLIC bool linphone::Factory::isQrcodeAvailable ( )

Indicates if the QRCode feature is available.

Returns
true if QRCodes can be used

◆ setCacheDir()

LINPHONECXX_PUBLIC void linphone::Factory::setCacheDir ( const std::string &  path)

Set the directory where the application local cache is located.

If the path is empty (default value), the path will be computed when calling getDataDir()

Parameters
pathThe path to the directory where the application local cache is located

◆ setConfigDir()

LINPHONECXX_PUBLIC void linphone::Factory::setConfigDir ( const std::string &  path)

Set the directory where the configurations are located.

If the path is empty (default value), the path will be computed when calling getConfigDir()

Parameters
pathThe path to the directory where the configurations are located

◆ setDataDir()

LINPHONECXX_PUBLIC void linphone::Factory::setDataDir ( const std::string &  path)

Set the directory where the application local data are located.

If the path is empty (default value), the path will be computed when calling getDataDir()

Parameters
pathThe path to the directory where the application local data are located

◆ setDataResourcesDir()

LINPHONECXX_PUBLIC void linphone::Factory::setDataResourcesDir ( const std::string &  path)

Set the directory where the data resources are located.

Parameters
pathThe path where the data resources are located

◆ setDownloadDir()

LINPHONECXX_PUBLIC void linphone::Factory::setDownloadDir ( const std::string &  path)

Set the directory where downloads are located.

If the path is empty (default value), the path will be computed when calling getDownloadDir()

Parameters
pathThe path to the directory where downloads are located

◆ setImageResourcesDir()

LINPHONECXX_PUBLIC void linphone::Factory::setImageResourcesDir ( const std::string &  path)

Set the directory where the image resources are located.

Parameters
pathThe path where the image resources are located

◆ setLiblinphonePluginsDir()

LINPHONECXX_PUBLIC void linphone::Factory::setLiblinphonePluginsDir ( const std::string &  path)

Set the directory where the liblinphone plugins are located.

Parameters
pathThe path to the directory where the liblinphone plugins are located

◆ setLogCollectionPath()

LINPHONECXX_PUBLIC void linphone::Factory::setLogCollectionPath ( const std::string &  path)

Sets the log collection path.

Parameters
paththe path of the logs

◆ setMspluginsDir()

LINPHONECXX_PUBLIC void linphone::Factory::setMspluginsDir ( const std::string &  path)

Set the directory where the mediastreamer2 plugins are located.

Parameters
pathThe path to the directory where the mediastreamer2 plugins are located

◆ setRingResourcesDir()

LINPHONECXX_PUBLIC void linphone::Factory::setRingResourcesDir ( const std::string &  path)

Set the directory where the ring resources are located.

Parameters
pathThe path where the ring resources are located

◆ setSoundResourcesDir()

LINPHONECXX_PUBLIC void linphone::Factory::setSoundResourcesDir ( const std::string &  path)

Set the directory where the sound resources are located.

Parameters
pathThe path where the sound resources are located

◆ setTopResourcesDir()

LINPHONECXX_PUBLIC void linphone::Factory::setTopResourcesDir ( const std::string &  path)

Set the top directory where the resources are located.

If you only define this top directory, the other resources directory will automatically be derived form this one.

Parameters
pathThe path to the top directory where the resources are located

◆ setVfsEncryption()

LINPHONECXX_PUBLIC void linphone::Factory::setVfsEncryption ( const uint16_t  encryptionModule,
const uint8_t *  secret,
const size_t  secretSize 
)

Select encryption module and set secret material to encrypt the files.

Parameters
encryptionModuleOne 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
secretthe secret material used to encrypt the files, can be nullptr for the _PLAIN module
secretSizesize of the secret

◆ writeQrcodeFile()

LINPHONECXX_PUBLIC int linphone::Factory::writeQrcodeFile ( const std::string &  filePath,
const std::string &  code,
unsigned int  width,
unsigned int  height,
unsigned int  margin 
)

Creates a QRCode and write it into a JPEG file specified by file_path (only if build with JPEG).

Parameters
filePathThe file where to write the QRCode JPEG image.
codeThe code to be generated into an image. It must not be empty.
widthThe requested width of the QRCode image. It will be 100 if 0.
heightThe requested height of the QRCode image. It will be 100 if 0.
marginThe requested margin of the QRCode image.
Returns
0 if successful, -2 if JPEG is not supported, -1 otherwise

The documentation for this class was generated from the following file: