Ring Daemon
Loading...
Searching...
No Matches
jami::Account Class Referenceabstract

#include <account.h>

Inheritance diagram for jami::Account:
Inheritance graph
Collaboration diagram for jami::Account:
Collaboration graph

Public Member Functions

 Account (const std::string &accountID)
 
void addDefaultModerator (const std::string &peerURI)
 
void attach (const std::shared_ptr< Call > &call)
 
void attach (const std::shared_ptr< Conference > &conf)
 
virtual std::unique_ptr< AccountConfigbuildConfig () const =0
 
const AccountConfigconfig () const
 
virtual void connectivityChanged ()
 Inform the account that the network status has changed.
 
bool detach (const std::shared_ptr< Call > &call)
 
virtual void doRegister ()=0
 Register the account.
 
virtual void doUnregister (bool forceShutdownConnections=false)=0
 Unregister the account.
 
void editConfig (std::function< void(AccountConfig &config)> &&edit)
 
void enableAutoLoadConversations (bool enable)
 
void enableIceCompIdRfc5245Compliance (bool enable)
 
void enableIceForMedia (bool enable)
 
void enableVideo (bool enable)
 
virtual void flush ()
 This method is called to request removal of possible account traces on the system, like internal account setup files.
 
std::map< std::string, std::string > getAccountDetails () const
 
const std::string & getAccountID () const
 Get the account ID.
 
virtual std::string_view getAccountType () const =0
 
std::vector< std::shared_ptr< SystemCodecInfo > > getActiveAccountCodecInfoList (MediaType mediaType) const
 
std::vector< unsignedgetActiveCodecs (MediaType mediaType=MEDIA_ALL) const
 
const std::string & getAlias () const
 
std::shared_ptr< CallgetCall (const std::string &callId) const
 
std::vector< std::string > getCallList () const
 
std::shared_ptr< ConferencegetConference (const std::string &confId) const
 
std::vector< std::string > getConferenceList () const
 
std::set< std::string > getDefaultModerators () const
 
std::string getDisplayName () const
 
virtual std::string getFromUri () const =0
 
const std::string & getHostname () const
 
virtual std::vector< libjami::MessagegetLastMessages (const uint64_t &)
 
std::string getMailBox () const
 
virtual im::MessageStatus getMessageStatus (uint64_t) const
 Return the status corresponding to the token.
 
virtual std::map< std::string, std::string > getNearbyPeers () const
 
const std::filesystem::path & getPath () const
 
vCard::utils::VCardData getProfileVcard () const
 
RegistrationState getRegistrationState () const
 
bool getRingtoneEnabled () const
 
std::filesystem::path getRingtonePath () const
 
bool getUPnPActive () const
 returns whether or not UPnP is enabled and active ie: if it is able to make port mappings
 
dhtnet::IpAddr getUPnPIpAddress () const
 Get the UPnP IP (external router) address.
 
const std::string & getUserAgentName ()
 Get the user-agent.
 
const std::string & getUsername () const
 
virtual std::map< std::string, std::string > getVolatileAccountDetails () const
 
virtual bool handleMessage (const std::shared_ptr< dht::crypto::Certificate > &, const std::string &, const std::pair< std::string, std::string > &)
 
void hangupCalls ()
 Free all ressources related to this account.
 
bool hasActiveCodec (MediaType mediaType) const
 
bool isActive () const noexcept
 Tell if the account is activated (can currently be used).
 
bool isAllModerators () const
 
bool isAutoAnswerEnabled () const
 
bool isComposingEnabled () const
 
bool isDenySecondCallEnabled () const
 
bool isEmptyOffersEnabled () const
 
bool isEnabled () const
 Tell if the account is enable or not.
 
bool isIceCompIdRfc5245Compliant () const
 
bool isIceForMediaEnabled () const
 
virtual bool isIP2IP () const
 Returns true if this is the IP2IP account.
 
bool isLocalModeratorsEnabled () const
 
bool isReadReceiptEnabled () const
 
bool isRendezVous () const
 
bool isUsable () const
 
bool isVideoEnabled () const
 
virtual void loadConfig ()
 Load the settings in this account.
 
void loadDefaultCodecs ()
 Helper function used to load the default codec order from the codec factory.
 
virtual std::shared_ptr< CallnewOutgoingCall (std::string_view toUrl, const std::vector< libjami::MediaMap > &mediaList)=0
 Create a new outgoing call.
 
bool removeConference (const std::string &confId)
 
void removeDefaultModerator (const std::string &peerURI)
 
virtual void saveConfig () const
 
std::shared_ptr< SystemCodecInfosearchCodecById (unsigned codecId, MediaType mediaType)
 
std::shared_ptr< SystemCodecInfosearchCodecByPayload (unsigned payload, MediaType mediaType)
 
virtual uint64_t sendTextMessage (const std::string &, const std::string &, const std::map< std::string, std::string > &, uint64_t=0, bool=false)
 If supported, send a text message from this account.
 
void setAccountDetails (const std::map< std::string, std::string > &details)
 
void setActive (bool active) noexcept
 
virtual void setActiveCodecs (const std::vector< unsigned > &list)
 Update both the codec order structure and the codec string used for SDP offer and configuration respectively.
 
void setCodecActive (unsigned codecId)
 
void setCodecInactive (unsigned codecId)
 
void setConfig (std::unique_ptr< AccountConfig > &&config)
 
void setEnabled (bool enable)
 
virtual void setIsComposing (const std::string &, bool)
 
virtual bool setMessageDisplayed (const std::string &, const std::string &, int)
 
virtual bool setPushNotificationConfig (const std::map< std::string, std::string > &data)
 
virtual bool setPushNotificationToken (const std::string &pushDeviceToken="")
 
virtual bool setPushNotificationTopic (const std::string &topic="")
 
virtual void setRegistrationState (RegistrationState state, int detail_code=0, const std::string &detail_str={})
 Set the registration state of the specified link.
 
virtual void updateProfile (const std::string &, const std::string &, const std::string &, int32_t)=0
 
virtual ~Account ()
 Virtual destructor.
 

Static Public Member Functions

static std::map< std::string, std::string > getDefaultCodecDetails (const unsigned &codecId)
 
static std::vector< unsignedgetDefaultCodecsId ()
 
static bool meetMinimumRequiredVersion (const std::vector< unsigned > &jamiVersion, const std::vector< unsigned > &minRequiredVersion)
 

Public Attributes

std::mt19937_64 rand
 Random generator engine Logical account state shall never rely on the state of the random generator.
 

Protected Member Functions

std::vector< unsignedgetAccountCodecInfoIdList (MediaType mediaType) const
 
std::shared_ptr< SystemCodecInfosearchCodecByName (const std::string &name, MediaType mediaType)
 private account codec searching functions
 
void setAllCodecsActive (MediaType mediaType, bool active)
 
void sortCodec ()
 
virtual void updateUpnpController ()
 

Static Protected Member Functions

static std::string getDefaultUserAgent ()
 Build the user-agent string.
 
static std::string mapStateNumberToString (RegistrationState state)
 

Protected Attributes

std::vector< std::shared_ptr< SystemCodecInfo > > accountCodecInfoList_
 Vector containing all account codecs (set of system codecs with custom parameters)
 
const std::string accountID_
 Account ID are assign in constructor and shall not changed.
 
bool active_ {true}
 Tells if the account is active now.
 
bool autoLoadConversations_ {true}
 Auto load conversations when creatinf convModule()
 
std::unique_ptr< AccountConfigconfig_ {}
 
std::recursive_mutex configurationMutex_ {}
 
bool iceCompIdRfc5245Compliant_ {false}
 
bool iceForMediaEnabled_ {true}
 
std::filesystem::path idPath_ {}
 path to account
 
RegistrationState registrationState_ {RegistrationState::UNLOADED}
 
std::filesystem::path ringtonePath_
 Ringtone .au file used for this account.
 
std::shared_ptr< SystemCodecContainersystemCodecContainer_
 Vector containing all system codecs (with default parameters)
 
std::mutex upnp_mtx {}
 UPnP IGD controller and the mutex to access it.
 
std::shared_ptr< dhtnet::upnp::Controller > upnpCtrl_
 

Static Protected Attributes

static const std::string DEFAULT_USER_AGENT = Account::getDefaultUserAgent()
 

Friends

class ConfigurationTest
 

Detailed Description

Definition at line 78 of file account.h.

Constructor & Destructor Documentation

◆ Account()

jami::Account::Account ( const std::string &  accountID)

Definition at line 64 of file account.cpp.

References loadDefaultCodecs().

Here is the call graph for this function:

◆ ~Account()

jami::Account::~Account ( )
virtual

Virtual destructor.

Definition at line 74 of file account.cpp.

Member Function Documentation

◆ addDefaultModerator()

void jami::Account::addDefaultModerator ( const std::string &  peerURI)

Definition at line 434 of file account.cpp.

References config_.

◆ attach() [1/2]

void jami::Account::attach ( const std::shared_ptr< Call > &  call)
inline

Definition at line 407 of file account.h.

References jami::CallSet::add().

Here is the call graph for this function:

◆ attach() [2/2]

void jami::Account::attach ( const std::shared_ptr< Conference > &  conf)
inline

Definition at line 409 of file account.h.

References jami::CallSet::add(), and jami::emitSignal().

Here is the call graph for this function:

◆ buildConfig()

virtual std::unique_ptr< AccountConfig > jami::Account::buildConfig ( ) const
pure virtual

Implemented in jami::JamiAccount, and jami::SIPAccount.

Referenced by setAccountDetails().

◆ config()

◆ connectivityChanged()

virtual void jami::Account::connectivityChanged ( )
inlinevirtual

Inform the account that the network status has changed.

Reimplemented in jami::JamiAccount, jami::SIPAccount, and jami::SIPAccountBase.

Definition at line 339 of file account.h.

◆ detach()

bool jami::Account::detach ( const std::shared_ptr< Call > &  call)
inline

Definition at line 408 of file account.h.

References jami::CallSet::remove().

Here is the call graph for this function:

◆ doRegister()

virtual void jami::Account::doRegister ( )
pure virtual

Register the account.

This should update the getRegistrationState() return value.

Implemented in jami::JamiAccount, and jami::SIPAccount.

◆ doUnregister()

virtual void jami::Account::doUnregister ( bool  forceShutdownConnections = false)
pure virtual

Unregister the account.

This should update the getRegistrationState() return value.

Implemented in jami::JamiAccount, and jami::SIPAccount.

◆ editConfig()

void jami::Account::editConfig ( std::function< void(AccountConfig &config)> &&  edit)
inline

Definition at line 116 of file account.h.

References config_, configurationMutex_, jami::emitSignal(), and saveConfig().

Referenced by jami::JamiAccount::editConfig(), jami::SIPAccount::editConfig(), and enableVideo().

Here is the call graph for this function:

◆ enableAutoLoadConversations()

void jami::Account::enableAutoLoadConversations ( bool  enable)
inline

Definition at line 398 of file account.h.

References autoLoadConversations_.

◆ enableIceCompIdRfc5245Compliance()

void jami::Account::enableIceCompIdRfc5245Compliance ( bool  enable)
inline

Definition at line 397 of file account.h.

References iceCompIdRfc5245Compliant_.

◆ enableIceForMedia()

void jami::Account::enableIceForMedia ( bool  enable)
inline

Definition at line 372 of file account.h.

References iceForMediaEnabled_.

◆ enableVideo()

void jami::Account::enableVideo ( bool  enable)
inline

Definition at line 273 of file account.h.

References config(), editConfig(), and jami::AccountConfig::videoEnabled.

Here is the call graph for this function:

◆ flush()

virtual void jami::Account::flush ( )
inlinevirtual

This method is called to request removal of possible account traces on the system, like internal account setup files.

Reimplemented in jami::JamiAccount, and jami::SIPAccountBase.

Definition at line 424 of file account.h.

Referenced by jami::SIPAccountBase::flush().

◆ getAccountCodecInfoIdList()

std::vector< unsigned > jami::Account::getAccountCodecInfoIdList ( MediaType  mediaType) const
protected

Definition at line 363 of file account.cpp.

References accountCodecInfoList_, jami::emitSignal(), and jami::MEDIA_NONE.

Here is the call graph for this function:

◆ getAccountDetails()

std::map< std::string, std::string > jami::Account::getAccountDetails ( ) const
inline

Definition at line 135 of file account.h.

References config(), configurationMutex_, and jami::AccountConfig::toMap().

Here is the call graph for this function:

◆ getAccountID()

◆ getAccountType()

virtual std::string_view jami::Account::getAccountType ( ) const
pure virtual

Implemented in jami::JamiAccount, and jami::SIPAccount.

◆ getActiveAccountCodecInfoList()

std::vector< std::shared_ptr< SystemCodecInfo > > jami::Account::getActiveAccountCodecInfoList ( MediaType  mediaType) const

Definition at line 407 of file account.cpp.

References accountCodecInfoList_, jami::emitSignal(), and jami::MEDIA_NONE.

Here is the call graph for this function:

◆ getActiveCodecs()

std::vector< unsigned > jami::Account::getActiveCodecs ( MediaType  mediaType = MEDIA_ALL) const

Definition at line 349 of file account.cpp.

References accountCodecInfoList_, jami::emitSignal(), and jami::MEDIA_NONE.

Here is the call graph for this function:

◆ getAlias()

const std::string & jami::Account::getAlias ( ) const
inline

Definition at line 287 of file account.h.

References jami::AccountConfig::alias, and config().

Here is the call graph for this function:

◆ getCall()

std::shared_ptr< Call > jami::Account::getCall ( const std::string &  callId) const
inline

Definition at line 400 of file account.h.

References jami::CallSet::getCall().

Here is the call graph for this function:

◆ getCallList()

std::vector< std::string > jami::Account::getCallList ( ) const
inline

Definition at line 401 of file account.h.

References jami::CallSet::getCallIds().

Here is the call graph for this function:

◆ getConference()

std::shared_ptr< Conference > jami::Account::getConference ( const std::string &  confId) const
inline

Definition at line 402 of file account.h.

References jami::emitSignal(), and jami::CallSet::getConference().

Here is the call graph for this function:

◆ getConferenceList()

std::vector< std::string > jami::Account::getConferenceList ( ) const
inline

Definition at line 406 of file account.h.

References jami::CallSet::getConferenceIds().

Here is the call graph for this function:

◆ getDefaultCodecDetails()

std::map< std::string, std::string > jami::Account::getDefaultCodecDetails ( const unsigned codecId)
static

Definition at line 266 of file account.cpp.

References jami::emitSignal(), jami::getSystemCodecContainer, jami::MEDIA_ALL, jami::MEDIA_AUDIO, and jami::MEDIA_VIDEO.

Referenced by libjami::getCodecDetails().

Here is the call graph for this function:

◆ getDefaultCodecsId()

std::vector< unsigned > jami::Account::getDefaultCodecsId ( )
static

Definition at line 260 of file account.cpp.

References jami::getSystemCodecContainer, and jami::MEDIA_ALL.

Referenced by libjami::getActiveCodecList().

◆ getDefaultModerators()

std::set< std::string > jami::Account::getDefaultModerators ( ) const
inline

Definition at line 362 of file account.h.

References config(), and jami::AccountConfig::defaultModerators.

Here is the call graph for this function:

◆ getDefaultUserAgent()

std::string jami::Account::getDefaultUserAgent ( )
staticprotected

Build the user-agent string.

Definition at line 428 of file account.cpp.

References jami::emitSignal(), jami::platform(), and libjami::version().

Here is the call graph for this function:

◆ getDisplayName()

std::string jami::Account::getDisplayName ( ) const
inline

Definition at line 309 of file account.h.

References config(), and jami::AccountConfig::displayName.

Here is the call graph for this function:

◆ getFromUri()

virtual std::string jami::Account::getFromUri ( ) const
pure virtual

Implemented in jami::JamiAccount, and jami::SIPAccount.

◆ getHostname()

const std::string & jami::Account::getHostname ( ) const
inline

Definition at line 286 of file account.h.

References config(), and jami::AccountConfig::hostname.

Here is the call graph for this function:

◆ getLastMessages()

virtual std::vector< libjami::Message > jami::Account::getLastMessages ( const uint64_t )
inlinevirtual

Reimplemented in jami::JamiAccount, and jami::SIPAccountBase.

Definition at line 207 of file account.h.

◆ getMailBox()

std::string jami::Account::getMailBox ( ) const
inline

Definition at line 310 of file account.h.

References config(), and jami::AccountConfig::mailbox.

Here is the call graph for this function:

◆ getMessageStatus()

virtual im::MessageStatus jami::Account::getMessageStatus ( uint64_t  ) const
inlinevirtual

Return the status corresponding to the token.

Reimplemented in jami::SIPAccountBase.

Definition at line 222 of file account.h.

References jami::im::UNKNOWN.

◆ getNearbyPeers()

virtual std::map< std::string, std::string > jami::Account::getNearbyPeers ( ) const
inlinevirtual

Reimplemented in jami::JamiAccount.

Definition at line 209 of file account.h.

◆ getPath()

const std::filesystem::path & jami::Account::getPath ( ) const
inline

Definition at line 153 of file account.h.

References idPath_.

◆ getProfileVcard()

vCard::utils::VCardData jami::Account::getProfileVcard ( ) const

Definition at line 181 of file account.cpp.

References jami::emitSignal(), idPath_, JAMI_ERROR, jami::fileutils::loadTextFile(), and jami::vCard::utils::toMap().

Referenced by jami::SIPAccount::updateProfile().

Here is the call graph for this function:

◆ getRegistrationState()

RegistrationState jami::Account::getRegistrationState ( ) const
inline

Definition at line 172 of file account.h.

References registrationState_.

◆ getRingtoneEnabled()

bool jami::Account::getRingtoneEnabled ( ) const
inline

Definition at line 308 of file account.h.

References config(), and jami::AccountConfig::ringtoneEnabled.

Here is the call graph for this function:

◆ getRingtonePath()

std::filesystem::path jami::Account::getRingtonePath ( ) const
inline

Definition at line 307 of file account.h.

References ringtonePath_.

◆ getUPnPActive()

bool jami::Account::getUPnPActive ( ) const

returns whether or not UPnP is enabled and active ie: if it is able to make port mappings

returns whether or not UPnP is enabled and active_ ie: if it is able to make port mappings

Definition at line 300 of file account.cpp.

References jami::emitSignal(), upnp_mtx, and upnpCtrl_.

Referenced by jami::SIPAccountBase::getIceOptions(), and jami::SIPAccount::newOutgoingCall().

Here is the call graph for this function:

◆ getUPnPIpAddress()

dhtnet::IpAddr jami::Account::getUPnPIpAddress ( ) const

Get the UPnP IP (external router) address.

If use UPnP is set to false, the address will be empty.

Definition at line 287 of file account.cpp.

References jami::emitSignal(), upnp_mtx, and upnpCtrl_.

Referenced by jami::SIPAccount::newOutgoingCall().

Here is the call graph for this function:

◆ getUserAgentName()

const std::string & jami::Account::getUserAgentName ( )

Get the user-agent.

Definition at line 422 of file account.cpp.

References config_, and DEFAULT_USER_AGENT.

Referenced by jami::SIPPresence::fillDoc().

◆ getUsername()

const std::string & jami::Account::getUsername ( ) const
inline

Definition at line 285 of file account.h.

References config(), and jami::AccountConfig::username.

Here is the call graph for this function:

◆ getVolatileAccountDetails()

std::map< std::string, std::string > jami::Account::getVolatileAccountDetails ( ) const
virtual

◆ handleMessage()

virtual bool jami::Account::handleMessage ( const std::shared_ptr< dht::crypto::Certificate > &  ,
const std::string &  ,
const std::pair< std::string, std::string > &   
)
inlinevirtual

Reimplemented in jami::JamiAccount.

Definition at line 341 of file account.h.

Referenced by jami::SIPAccountBase::onTextMessage().

◆ hangupCalls()

void jami::Account::hangupCalls ( )

Free all ressources related to this account.

Current calls using this account are HANG-UP

Definition at line 77 of file account.cpp.

References getAccountID(), jami::CallSet::getCallIds(), jami::Manager::hangupCall(), and jami::Manager::instance().

Here is the call graph for this function:

◆ hasActiveCodec()

bool jami::Account::hasActiveCodec ( MediaType  mediaType) const

Definition at line 195 of file account.cpp.

References accountCodecInfoList_, and jami::emitSignal().

Here is the call graph for this function:

◆ isActive()

bool jami::Account::isActive ( ) const
inlinenoexcept

Tell if the account is activated (can currently be used).

Definition at line 267 of file account.h.

References active_.

◆ isAllModerators()

bool jami::Account::isAllModerators ( ) const
inline

Definition at line 368 of file account.h.

References jami::AccountConfig::allModeratorsEnabled, and config().

Here is the call graph for this function:

◆ isAutoAnswerEnabled()

bool jami::Account::isAutoAnswerEnabled ( ) const
inline

Definition at line 313 of file account.h.

References jami::AccountConfig::autoAnswerEnabled, and config().

Here is the call graph for this function:

◆ isComposingEnabled()

bool jami::Account::isComposingEnabled ( ) const
inline

Definition at line 316 of file account.h.

References config(), and jami::AccountConfig::sendComposing.

Here is the call graph for this function:

◆ isDenySecondCallEnabled()

bool jami::Account::isDenySecondCallEnabled ( ) const
inline

Definition at line 314 of file account.h.

References config(), and jami::AccountConfig::denySecondCallEnabled.

Here is the call graph for this function:

◆ isEmptyOffersEnabled()

bool jami::Account::isEmptyOffersEnabled ( ) const
inline

Definition at line 375 of file account.h.

Referenced by jami::SIPAccount::newOutgoingCall().

◆ isEnabled()

bool jami::Account::isEnabled ( ) const
inline

Tell if the account is enable or not.

Returns
true if enabled, false otherwise

Definition at line 252 of file account.h.

References config(), and jami::AccountConfig::enabled.

Here is the call graph for this function:

◆ isIceCompIdRfc5245Compliant()

bool jami::Account::isIceCompIdRfc5245Compliant ( ) const
inline

Definition at line 396 of file account.h.

References iceCompIdRfc5245Compliant_.

◆ isIceForMediaEnabled()

bool jami::Account::isIceForMediaEnabled ( ) const
inline

Definition at line 371 of file account.h.

References iceForMediaEnabled_.

◆ isIP2IP()

virtual bool jami::Account::isIP2IP ( ) const
inlinevirtual

Returns true if this is the IP2IP account.

Reimplemented in jami::SIPAccount.

Definition at line 158 of file account.h.

Referenced by jami::SIPAccountBase::getVolatileAccountDetails().

◆ isLocalModeratorsEnabled()

bool jami::Account::isLocalModeratorsEnabled ( ) const
inline

Definition at line 367 of file account.h.

References config(), and jami::AccountConfig::localModeratorsEnabled.

Here is the call graph for this function:

◆ isReadReceiptEnabled()

bool jami::Account::isReadReceiptEnabled ( ) const
inline

Definition at line 315 of file account.h.

References config(), and jami::AccountConfig::sendReadReceipt.

Here is the call graph for this function:

◆ isRendezVous()

bool jami::Account::isRendezVous ( ) const
inline

Definition at line 312 of file account.h.

References config(), and jami::AccountConfig::isRendezVous.

Here is the call graph for this function:

◆ isUsable()

bool jami::Account::isUsable ( ) const
inline

Definition at line 271 of file account.h.

References active_, config(), jami::emitSignal(), and jami::AccountConfig::enabled.

Referenced by updateUpnpController().

Here is the call graph for this function:

◆ isVideoEnabled()

bool jami::Account::isVideoEnabled ( ) const
inline

Definition at line 277 of file account.h.

References config(), and jami::AccountConfig::videoEnabled.

Referenced by jami::SIPAccountBase::createDefaultMediaList(), and jami::SIPAccount::newOutgoingCall().

Here is the call graph for this function:

◆ loadConfig()

void jami::Account::loadConfig ( )
virtual

◆ loadDefaultCodecs()

void jami::Account::loadDefaultCodecs ( )

Helper function used to load the default codec order from the codec factory.

Definition at line 124 of file account.cpp.

References accountCodecInfoList_, jami::CODEC_ENCODER_DECODER, jami::emitSignal(), jami::MEDIA_AUDIO, jami::MEDIA_VIDEO, and systemCodecContainer_.

Referenced by Account().

Here is the call graph for this function:

◆ mapStateNumberToString()

◆ meetMinimumRequiredVersion()

bool jami::Account::meetMinimumRequiredVersion ( const std::vector< unsigned > &  jamiVersion,
const std::vector< unsigned > &  minRequiredVersion 
)
static

Definition at line 446 of file account.cpp.

References jami::emitSignal(), and jami::swarm_protocol::version.

Here is the call graph for this function:

◆ newOutgoingCall()

virtual std::shared_ptr< Call > jami::Account::newOutgoingCall ( std::string_view  toUrl,
const std::vector< libjami::MediaMap > &  mediaList 
)
pure virtual

Create a new outgoing call.

Parameters
toUrlThe address to call
mediaListA list of media
Returns
The created call

Implemented in jami::JamiAccount, and jami::SIPAccount.

◆ removeConference()

bool jami::Account::removeConference ( const std::string &  confId)
inline

Definition at line 410 of file account.h.

References jami::emitSignal(), getAccountID(), and jami::CallSet::removeConference().

Here is the call graph for this function:

◆ removeDefaultModerator()

void jami::Account::removeDefaultModerator ( const std::string &  peerURI)

Definition at line 440 of file account.cpp.

References config_.

◆ saveConfig()

void jami::Account::saveConfig ( ) const
virtual

Reimplemented in jami::JamiAccount.

Definition at line 168 of file account.cpp.

References jami::Manager::instance(), and jami::Manager::saveConfig().

Referenced by editConfig(), setAccountDetails(), setPushNotificationConfig(), setPushNotificationToken(), and setPushNotificationTopic().

Here is the call graph for this function:

◆ searchCodecById()

std::shared_ptr< SystemCodecInfo > jami::Account::searchCodecById ( unsigned  codecId,
MediaType  mediaType 
)

Definition at line 313 of file account.cpp.

References accountCodecInfoList_, jami::emitSignal(), and jami::MEDIA_NONE.

Referenced by setActiveCodecs().

Here is the call graph for this function:

◆ searchCodecByName()

std::shared_ptr< SystemCodecInfo > jami::Account::searchCodecByName ( const std::string &  name,
MediaType  mediaType 
)
protected

private account codec searching functions

Definition at line 325 of file account.cpp.

References accountCodecInfoList_, jami::emitSignal(), and jami::MEDIA_NONE.

Here is the call graph for this function:

◆ searchCodecByPayload()

std::shared_ptr< SystemCodecInfo > jami::Account::searchCodecByPayload ( unsigned  payload,
MediaType  mediaType 
)

Definition at line 337 of file account.cpp.

References accountCodecInfoList_, jami::emitSignal(), and jami::MEDIA_NONE.

Here is the call graph for this function:

◆ sendTextMessage()

virtual uint64_t jami::Account::sendTextMessage ( const std::string &  ,
const std::string &  ,
const std::map< std::string, std::string > &  ,
uint64_t  = 0,
bool  = false 
)
inlinevirtual

If supported, send a text message from this account.

Returns
a token to query the message status

Reimplemented in jami::JamiAccount, and jami::SIPAccountBase.

Definition at line 189 of file account.h.

◆ setAccountDetails()

void jami::Account::setAccountDetails ( const std::map< std::string, std::string > &  details)
inline

Definition at line 125 of file account.h.

References buildConfig(), config_, configurationMutex_, jami::emitSignal(), loadConfig(), and saveConfig().

Here is the call graph for this function:

◆ setActive()

void jami::Account::setActive ( bool  active)
inlinenoexcept

Definition at line 269 of file account.h.

References active_.

◆ setActiveCodecs()

void jami::Account::setActiveCodecs ( const std::vector< unsigned > &  list)
virtual

Update both the codec order structure and the codec string used for SDP offer and configuration respectively.

Reimplemented in jami::JamiAccount, and jami::SIPAccount.

Definition at line 204 of file account.cpp.

References jami::emitSignal(), jami::MEDIA_ALL, searchCodecById(), setAllCodecsActive(), and sortCodec().

Referenced by loadConfig().

Here is the call graph for this function:

◆ setAllCodecsActive()

void jami::Account::setAllCodecsActive ( MediaType  mediaType,
bool  active 
)
protected

Definition at line 378 of file account.cpp.

References accountCodecInfoList_, jami::emitSignal(), and jami::MEDIA_NONE.

Referenced by setActiveCodecs().

Here is the call graph for this function:

◆ setCodecActive()

void jami::Account::setCodecActive ( unsigned  codecId)

Definition at line 389 of file account.cpp.

References accountCodecInfoList_, and jami::emitSignal().

Here is the call graph for this function:

◆ setCodecInactive()

void jami::Account::setCodecInactive ( unsigned  codecId)

Definition at line 398 of file account.cpp.

References accountCodecInfoList_, and jami::emitSignal().

Here is the call graph for this function:

◆ setConfig()

void jami::Account::setConfig ( std::unique_ptr< AccountConfig > &&  config)
inline

Definition at line 96 of file account.h.

References config(), config_, configurationMutex_, and loadConfig().

Here is the call graph for this function:

◆ setEnabled()

void jami::Account::setEnabled ( bool  enable)
inline

Definition at line 254 of file account.h.

References config_, and updateUpnpController().

Here is the call graph for this function:

◆ setIsComposing()

virtual void jami::Account::setIsComposing ( const std::string &  ,
bool   
)
inlinevirtual

Reimplemented in jami::JamiAccount.

Definition at line 198 of file account.h.

◆ setMessageDisplayed()

virtual bool jami::Account::setMessageDisplayed ( const std::string &  ,
const std::string &  ,
int   
)
inlinevirtual

Reimplemented in jami::JamiAccount.

Definition at line 200 of file account.h.

◆ setPushNotificationConfig()

bool jami::Account::setPushNotificationConfig ( const std::map< std::string, std::string > &  data)
virtual

Reimplemented in jami::JamiAccount, and jami::SIPAccount.

Definition at line 459 of file account.cpp.

References config_, configurationMutex_, jami::emitSignal(), jami::platform(), and saveConfig().

Here is the call graph for this function:

◆ setPushNotificationToken()

virtual bool jami::Account::setPushNotificationToken ( const std::string &  pushDeviceToken = "")
inlinevirtual

Reimplemented in jami::JamiAccount, and jami::SIPAccount.

Definition at line 224 of file account.h.

References config_, configurationMutex_, jami::emitSignal(), and saveConfig().

Here is the call graph for this function:

◆ setPushNotificationTopic()

virtual bool jami::Account::setPushNotificationTopic ( const std::string &  topic = "")
inlinevirtual

Reimplemented in jami::JamiAccount.

Definition at line 235 of file account.h.

References config_, configurationMutex_, jami::emitSignal(), and saveConfig().

Here is the call graph for this function:

◆ setRegistrationState()

void jami::Account::setRegistrationState ( RegistrationState  state,
int  detail_code = 0,
const std::string &  detail_str = {} 
)
virtual

Set the registration state of the specified link.

Parameters
stateThe registration state of underlying VoIPLink

Reimplemented in jami::SIPAccount, jami::SIPAccountBase, and jami::JamiAccount.

Definition at line 103 of file account.cpp.

References accountID_, jami::emitSignal(), getVolatileAccountDetails(), mapStateNumberToString(), registrationState_, and jami::runOnMainThread().

Referenced by jami::SIPAccountBase::setRegistrationState().

Here is the call graph for this function:

◆ sortCodec()

void jami::Account::sortCodec ( )
protected

Definition at line 224 of file account.cpp.

References accountCodecInfoList_, and jami::emitSignal().

Referenced by setActiveCodecs().

Here is the call graph for this function:

◆ updateProfile()

virtual void jami::Account::updateProfile ( const std::string &  ,
const std::string &  ,
const std::string &  ,
int32_t   
)
pure virtual

Implemented in jami::JamiAccount, and jami::SIPAccount.

◆ updateUpnpController()

void jami::Account::updateUpnpController ( )
protectedvirtual

Definition at line 84 of file account.cpp.

References config(), jami::Manager::instance(), isUsable(), upnp_mtx, and upnpCtrl_.

Referenced by loadConfig(), and setEnabled().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ ConfigurationTest

friend class ConfigurationTest
friend

Definition at line 439 of file account.h.

Member Data Documentation

◆ accountCodecInfoList_

std::vector<std::shared_ptr<SystemCodecInfo> > jami::Account::accountCodecInfoList_
protected

◆ accountID_

const std::string jami::Account::accountID_
protected

Account ID are assign in constructor and shall not changed.

Definition at line 453 of file account.h.

Referenced by getAccountID(), jami::SIPAccountBase::onTextMessage(), and setRegistrationState().

◆ active_

bool jami::Account::active_ {true}
protected

Tells if the account is active now.

This allows doRegister to be called. When an account is unactivated, doUnregister must be called.

Definition at line 462 of file account.h.

Referenced by getVolatileAccountDetails(), isActive(), isUsable(), and setActive().

◆ autoLoadConversations_

bool jami::Account::autoLoadConversations_ {true}
protected

Auto load conversations when creatinf convModule()

Definition at line 500 of file account.h.

Referenced by enableAutoLoadConversations().

◆ config_

◆ configurationMutex_

std::recursive_mutex jami::Account::configurationMutex_ {}
mutableprotected

◆ DEFAULT_USER_AGENT

const std::string jami::Account::DEFAULT_USER_AGENT = Account::getDefaultUserAgent()
staticprotected

Definition at line 441 of file account.h.

Referenced by getUserAgentName().

◆ iceCompIdRfc5245Compliant_

bool jami::Account::iceCompIdRfc5245Compliant_ {false}
protected

Definition at line 496 of file account.h.

Referenced by enableIceCompIdRfc5245Compliance(), and isIceCompIdRfc5245Compliant().

◆ iceForMediaEnabled_

bool jami::Account::iceForMediaEnabled_ {true}
protected

Definition at line 495 of file account.h.

Referenced by enableIceForMedia(), and isIceForMediaEnabled().

◆ idPath_

std::filesystem::path jami::Account::idPath_ {}
protected

path to account

Definition at line 482 of file account.h.

Referenced by jami::JamiAccount::buildConfig(), getPath(), getProfileVcard(), and jami::SIPAccount::updateProfile().

◆ rand

std::mt19937_64 jami::Account::rand
mutable

Random generator engine Logical account state shall never rely on the state of the random generator.

Definition at line 334 of file account.h.

Referenced by jami::SIPAccountBase::acquireRandomEvenPort(), jami::SIPAccountBase::getRandomEvenPort(), jami::im::MessageEngine::sendMessage(), and jami::SIPAccountBase::sendTextMessage().

◆ registrationState_

◆ ringtonePath_

std::filesystem::path jami::Account::ringtonePath_
protected

Ringtone .au file used for this account.

Definition at line 487 of file account.h.

Referenced by getRingtonePath(), and loadConfig().

◆ systemCodecContainer_

std::shared_ptr<SystemCodecContainer> jami::Account::systemCodecContainer_
protected

Vector containing all system codecs (with default parameters)

Definition at line 473 of file account.h.

Referenced by loadDefaultCodecs().

◆ upnp_mtx

std::mutex jami::Account::upnp_mtx {}
mutableprotected

UPnP IGD controller and the mutex to access it.

Definition at line 492 of file account.h.

Referenced by getUPnPActive(), getUPnPIpAddress(), and updateUpnpController().

◆ upnpCtrl_

std::shared_ptr<dhtnet::upnp::Controller> jami::Account::upnpCtrl_
protected

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