Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::SIPAccountBase Class Referenceabstract

#include <sipaccountbase.h>

Inheritance diagram for jami::SIPAccountBase:
Inheritance graph
Collaboration diagram for jami::SIPAccountBase:
Collaboration graph

Public Member Functions

const SipAccountBaseConfigconfig () const
 
void connectivityChanged () override
 Inform the account that the network status has changed.
 
bool CreateClientDialogAndInvite (const pj_str_t *from, const pj_str_t *contact, const pj_str_t *to, const pj_str_t *target, const pjmedia_sdp_session *local_sdp, pjsip_dialog **dlg, pjsip_inv_session **inv)
 Create UAC attached dialog and invite session.
 
std::vector< MediaAttributecreateDefaultMediaList (bool addVideo, bool onHold=false)
 
virtual void flush () override
 This method is called to request removal of possible account traces on the system, like internal account setup files.
 
uint16_t generateAudioPort () const
 Socket port generators for media Note: given ports are application wide, a port is unable to be given again by any account instances until it's released by the static method releasePort().
 
virtual std::string getDtmfType () const
 
virtual dhtnet::IceTransportOptions getIceOptions () const
 
std::vector< libjami::MessagegetLastMessages (const uint64_t &base_timestamp) override
 
const std::string & getLocalInterface () const
 Get the local interface name on which this account is bound.
 
im::MessageStatus getMessageStatus (uint64_t id) const override
 Return the status corresponding to the token.
 
std::string getPublishedAddress () const
 Get the public IP address set by the user for this account.
 
virtual dhtnet::IpAddr getPublishedIpAddress (uint16_t family=PF_UNSPEC) const
 
bool getPublishedSameasLocal () const
 Get a flag which determine the usage in sip headers of either the local IP address and port (localAddress and localPort) or to an address set manually (publishedAddress and publishedPort).
 
virtual bool getSrtpFallback () const =0
 
virtual pj_uint16_t getStunPort () const
 
virtual std::string getToUri (const std::string &username) const =0
 
virtual std::string getUserUri () const =0
 
virtual bool isSrtpEnabled () const =0
 
virtual bool isStunEnabled () const
 
virtual bool isTlsEnabled () const
 Determine if TLS is enabled for this account.
 
void loadConfig () override
 Load the settings in this account.
 
virtual MatchRank matches (std::string_view username, std::string_view hostname) const =0
 
virtual std::shared_ptr< SIPCallnewIncomingCall (const std::string &from, const std::vector< libjami::MediaMap > &mediaList, const std::shared_ptr< SipTransport > &sipTr={})=0
 Create incoming SIPCall.
 
virtual void onTextMessage (const std::string &id, const std::string &from, const std::shared_ptr< dht::crypto::Certificate > &peerCert, const std::map< std::string, std::string > &payloads)
 
virtual void sendMessage (const std::string &to, const std::string &deviceId, const std::map< std::string, std::string > &payloads, uint64_t id, bool retryOnTimeout=true, bool onlyConnected=false)=0
 
virtual uint64_t sendTextMessage (const std::string &to, const std::string &deviceId, const std::map< std::string, std::string > &payloads, uint64_t refreshToken=0, bool onlyConnected=false) override
 If supported, send a text message from this account.
 
void setPublishedAddress (const dhtnet::IpAddr &ip_addr)
 
 SIPAccountBase (const std::string &accountID)
 Constructor.
 
virtual ~SIPAccountBase () noexcept
 
- Public Member Functions inherited from jami::Account
 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
 
virtual bool cancelMessage (uint64_t)
 
const AccountConfigconfig () const
 
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)
 
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
 
std::string getMailBox () const
 
virtual std::map< std::string, std::string > getNearbyPeers () const
 
const std::filesystem::path & getPath () const
 
std::map< std::string, std::string > 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 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
 
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)
 
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 updateProfile (const std::string &, const std::string &, const std::string &, int32_t)=0
 
virtual ~Account ()
 Virtual destructor.
 

Static Public Member Functions

static void releasePort (uint16_t port) noexcept
 
- Static Public Member Functions inherited from jami::Account
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)
 

Static Public Attributes

static constexpr unsigned HALF_MAX_PORT {MAX_PORT / 2}
 
static constexpr unsigned MAX_PORT {65536}
 

Protected Member Functions

uint16_t acquireRandomEvenPort (const std::pair< uint16_t, uint16_t > &range) const
 
uint16_t getRandomEvenPort (const std::pair< uint16_t, uint16_t > &range) const
 
virtual std::map< std::string, std::string > getVolatileAccountDetails () const override
 Retrieve volatile details such as recent registration errors.
 
virtual void setRegistrationState (RegistrationState state, int code=0, const std::string &detail_str={}) override
 Set the registration state of the specified link.
 
- Protected Member Functions inherited from jami::Account
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 uint16_t acquirePort (uint16_t port)
 
static std::array< bool, HALF_MAX_PORT > & getPortsReservation () noexcept
 
- Static Protected Member Functions inherited from jami::Account
static std::string getDefaultUserAgent ()
 Build the user-agent string.
 
static std::string mapStateNumberToString (RegistrationState state)
 

Protected Attributes

std::deque< libjami::MessagelastMessages_
 
SIPVoIPLinklink_
 Voice over IP Link contains a listener thread and calls.
 
im::MessageEngine messageEngine_
 
std::mutex mutexLastMessages_
 The deamon can be launched without any client (or with a non ready client) Like call and file transfer, a client should be able to retrieve current messages.
 
dhtnet::IpAddr publishedIp_ [2] {}
 Published IPv4/IPv6 addresses, used only if defined by the user in account configuration.
 
std::string transportError_ {}
 
pj_status_t transportStatus_ {PJSIP_SC_TRYING}
 
std::shared_ptr< dhtnet::TurnCache > turnCache_
 
- Protected Attributes inherited from jami::Account
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 constexpr size_t MAX_WAITING_MESSAGES_SIZE = 1000
 
- Static Protected Attributes inherited from jami::Account
static const std::string DEFAULT_USER_AGENT = Account::getDefaultUserAgent()
 

Additional Inherited Members

- Public Attributes inherited from jami::Account
std::mt19937_64 rand
 Random generator engine Logical account state shall never rely on the state of the random generator.
 

Detailed Description

Definition at line 73 of file sipaccountbase.h.

Constructor & Destructor Documentation

◆ SIPAccountBase()

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

Constructor.

Parameters
accountIDThe account identifier

Definition at line 59 of file sipaccountbase.cpp.

◆ ~SIPAccountBase()

jami::SIPAccountBase::~SIPAccountBase ( )
virtualnoexcept

Definition at line 65 of file sipaccountbase.cpp.

Member Function Documentation

◆ acquirePort()

uint16_t jami::SIPAccountBase::acquirePort ( uint16_t  port)
staticprotected

Definition at line 218 of file sipaccountbase.cpp.

References jami::emitSignal(), and getPortsReservation().

Here is the call graph for this function:

◆ acquireRandomEvenPort()

uint16_t jami::SIPAccountBase::acquireRandomEvenPort ( const std::pair< uint16_t, uint16_t > &  range) const
protected

Definition at line 204 of file sipaccountbase.cpp.

References jami::emitSignal(), getPortsReservation(), and jami::Account::rand.

Referenced by generateAudioPort().

Here is the call graph for this function:

◆ config()

const SipAccountBaseConfig & jami::SIPAccountBase::config ( ) const
inline

Definition at line 87 of file sipaccountbase.h.

References jami::Account::config().

Referenced by generateAudioPort(), getDtmfType(), getIceOptions(), getLocalInterface(), getPublishedAddress(), getPublishedSameasLocal(), and loadConfig().

Here is the call graph for this function:

◆ connectivityChanged()

void jami::SIPAccountBase::connectivityChanged ( )
inlineoverridevirtual

Inform the account that the network status has changed.

Reimplemented from jami::Account.

Definition at line 210 of file sipaccountbase.h.

◆ CreateClientDialogAndInvite()

bool jami::SIPAccountBase::CreateClientDialogAndInvite ( const pj_str_t from,
const pj_str_t contact,
const pj_str_t to,
const pj_str_t target,
const pjmedia_sdp_session local_sdp,
pjsip_dialog **  dlg,
pjsip_inv_session **  inv 
)

Create UAC attached dialog and invite session.

Returns
true if success. false if failure and dlg and inv pointers should not be considered as valid.

Definition at line 68 of file sipaccountbase.cpp.

References jami::sip_utils::CONST_PJ_STR(), jami::emitSignal(), JAMI_DBG, and JAMI_ERR.

Here is the call graph for this function:

◆ createDefaultMediaList()

std::vector< MediaAttribute > jami::SIPAccountBase::createDefaultMediaList ( bool  addVideo,
bool  onHold = false 
)

◆ flush()

void jami::SIPAccountBase::flush ( )
overridevirtual

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

Reimplemented from jami::Account.

Reimplemented in jami::JamiAccount.

Definition at line 124 of file sipaccountbase.cpp.

References jami::Account::flush(), jami::fileutils::get_cache_dir(), and jami::Account::getAccountID().

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

Here is the call graph for this function:

◆ generateAudioPort()

uint16_t jami::SIPAccountBase::generateAudioPort ( ) const

Socket port generators for media Note: given ports are application wide, a port is unable to be given again by any account instances until it's released by the static method releasePort().

Definition at line 231 of file sipaccountbase.cpp.

References acquireRandomEvenPort(), and config().

Here is the call graph for this function:

◆ getDtmfType()

virtual std::string jami::SIPAccountBase::getDtmfType ( ) const
inlinevirtual

Definition at line 110 of file sipaccountbase.h.

References config(), and jami::SipAccountBaseConfig::dtmfType.

Here is the call graph for this function:

◆ getIceOptions()

dhtnet::IceTransportOptions jami::SIPAccountBase::getIceOptions ( ) const
virtual

◆ getLastMessages()

std::vector< libjami::Message > jami::SIPAccountBase::getLastMessages ( const uint64_t base_timestamp)
overridevirtual

Reimplemented from jami::Account.

Definition at line 342 of file sipaccountbase.cpp.

References jami::emitSignal(), lastMessages_, and mutexLastMessages_.

Here is the call graph for this function:

◆ getLocalInterface()

const std::string & jami::SIPAccountBase::getLocalInterface ( ) const
inline

Get the local interface name on which this account is bound.

Definition at line 134 of file sipaccountbase.h.

References config(), and jami::SipAccountBaseConfig::interface.

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

Here is the call graph for this function:

◆ getMessageStatus()

im::MessageStatus jami::SIPAccountBase::getMessageStatus ( uint64_t  ) const
inlineoverridevirtual

Return the status corresponding to the token.

Reimplemented from jami::Account.

Definition at line 197 of file sipaccountbase.h.

References jami::im::MessageEngine::getStatus(), and messageEngine_.

Here is the call graph for this function:

◆ getPortsReservation()

auto jami::SIPAccountBase::getPortsReservation ( )
staticprotectednoexcept

Definition at line 185 of file sipaccountbase.cpp.

References jami::emitSignal(), and getPortsReservation().

Referenced by acquirePort(), acquireRandomEvenPort(), getPortsReservation(), and getRandomEvenPort().

Here is the call graph for this function:

◆ getPublishedAddress()

std::string jami::SIPAccountBase::getPublishedAddress ( ) const
inline

Get the public IP address set by the user for this account.

If this setting is not provided, the local bound adddress will be used.

Returns
std::string The public IPv4 or IPv6 address formatted in standard notation.

Definition at line 142 of file sipaccountbase.h.

References config(), and jami::SipAccountBaseConfig::publishedIp.

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

Here is the call graph for this function:

◆ getPublishedIpAddress()

dhtnet::IpAddr jami::SIPAccountBase::getPublishedIpAddress ( uint16_t  family = PF_UNSPEC) const
virtual

Reimplemented in jami::JamiAccount.

Definition at line 313 of file sipaccountbase.cpp.

References jami::emitSignal(), and publishedIp_.

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

Here is the call graph for this function:

◆ getPublishedSameasLocal()

bool jami::SIPAccountBase::getPublishedSameasLocal ( ) const
inline

Get a flag which determine the usage in sip headers of either the local IP address and port (localAddress and localPort) or to an address set manually (publishedAddress and publishedPort).

Definition at line 153 of file sipaccountbase.h.

References config(), and jami::SipAccountBaseConfig::publishedSameasLocal.

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

Here is the call graph for this function:

◆ getRandomEvenPort()

uint16_t jami::SIPAccountBase::getRandomEvenPort ( const std::pair< uint16_t, uint16_t > &  range) const
protected

Definition at line 193 of file sipaccountbase.cpp.

References jami::emitSignal(), getPortsReservation(), and jami::Account::rand.

Here is the call graph for this function:

◆ getSrtpFallback()

virtual bool jami::SIPAccountBase::getSrtpFallback ( ) const
pure virtual

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

◆ getStunPort()

virtual pj_uint16_t jami::SIPAccountBase::getStunPort ( ) const
inlinevirtual

Reimplemented in jami::SIPAccount.

Definition at line 108 of file sipaccountbase.h.

◆ getToUri()

virtual std::string jami::SIPAccountBase::getToUri ( const std::string &  username) const
pure virtual

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

◆ getUserUri()

virtual std::string jami::SIPAccountBase::getUserUri ( ) const
pure virtual

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

◆ getVolatileAccountDetails()

std::map< std::string, std::string > jami::SIPAccountBase::getVolatileAccountDetails ( ) const
overrideprotectedvirtual

Retrieve volatile details such as recent registration errors.

Returns
std::map< std::string, std::string > The account volatile details

Reimplemented from jami::Account.

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

Definition at line 157 of file sipaccountbase.cpp.

References jami::Conf::CONFIG_ACCOUNT_REGISTRATION_STATUS, jami::Conf::CONFIG_TRANSPORT_STATE_CODE, jami::Conf::CONFIG_TRANSPORT_STATE_DESC, jami::emitSignal(), jami::Account::getVolatileAccountDetails(), jami::Account::isIP2IP(), transportError_, and transportStatus_.

Here is the call graph for this function:

◆ isSrtpEnabled()

virtual bool jami::SIPAccountBase::isSrtpEnabled ( ) const
pure virtual

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

Referenced by createDefaultMediaList().

◆ isStunEnabled()

virtual bool jami::SIPAccountBase::isStunEnabled ( ) const
inlinevirtual

Reimplemented in jami::SIPAccount.

Definition at line 106 of file sipaccountbase.h.

◆ isTlsEnabled()

virtual bool jami::SIPAccountBase::isTlsEnabled ( ) const
inlinevirtual

Determine if TLS is enabled for this account.

TLS provides a secured channel for SIP signalization. It is independent of the media encryption (as provided by SRTP).

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

Definition at line 116 of file sipaccountbase.h.

◆ loadConfig()

void jami::SIPAccountBase::loadConfig ( )
overridevirtual

Load the settings in this account.

Reimplemented from jami::Account.

Definition at line 132 of file sipaccountbase.cpp.

References config(), jami::emitSignal(), jami::fileutils::get_cache_dir(), jami::Account::getAccountID(), jami::Manager::instance(), jami::Manager::ioContext(), jami::Account::loadConfig(), setPublishedAddress(), and turnCache_.

Here is the call graph for this function:

◆ matches()

virtual MatchRank jami::SIPAccountBase::matches ( std::string_view  username,
std::string_view  hostname 
) const
pure virtual

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

◆ newIncomingCall()

virtual std::shared_ptr< SIPCall > jami::SIPAccountBase::newIncomingCall ( const std::string &  from,
const std::vector< libjami::MediaMap > &  mediaList,
const std::shared_ptr< SipTransport > &  sipTr = {} 
)
pure virtual

Create incoming SIPCall.

Parameters
[in]fromThe origin of the call
mediaListA list of media
sipTrSIP Transport
Returns
A shared pointer on the created call.

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

◆ onTextMessage()

void jami::SIPAccountBase::onTextMessage ( const std::string &  id,
const std::string &  from,
const std::shared_ptr< dht::crypto::Certificate > &  peerCert,
const std::map< std::string, std::string > &  payloads 
)
virtual

◆ releasePort()

void jami::SIPAccountBase::releasePort ( uint16_t  port)
staticnoexcept

Definition at line 225 of file sipaccountbase.cpp.

References jami::emitSignal().

Referenced by jami::Sdp::~Sdp().

Here is the call graph for this function:

◆ sendMessage()

virtual void jami::SIPAccountBase::sendMessage ( const std::string &  to,
const std::string &  deviceId,
const std::map< std::string, std::string > &  payloads,
uint64_t  id,
bool  retryOnTimeout = true,
bool  onlyConnected = false 
)
pure virtual

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

Referenced by sendTextMessage().

◆ sendTextMessage()

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

If supported, send a text message from this account.

Returns
a token to query the message status

Reimplemented from jami::Account.

Reimplemented in jami::JamiAccount.

Definition at line 183 of file sipaccountbase.h.

References jami::emitSignal(), jami::JAMI_ID_MAX_VAL, messageEngine_, jami::Account::rand, sendMessage(), and jami::im::MessageEngine::sendMessage().

Here is the call graph for this function:

◆ setPublishedAddress()

void jami::SIPAccountBase::setPublishedAddress ( const dhtnet::IpAddr &  ip_addr)

Definition at line 332 of file sipaccountbase.cpp.

References jami::emitSignal(), and publishedIp_.

Referenced by loadConfig().

Here is the call graph for this function:

◆ setRegistrationState()

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

Set the registration state of the specified link.

Parameters
stateThe registration state of underlying VoIPLink

Reimplemented from jami::Account.

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

Definition at line 171 of file sipaccountbase.cpp.

References jami::emitSignal(), jami::im::MessageEngine::load(), messageEngine_, jami::REGISTERED, jami::Account::registrationState_, jami::im::MessageEngine::save(), and jami::Account::setRegistrationState().

Here is the call graph for this function:

Member Data Documentation

◆ HALF_MAX_PORT

constexpr unsigned jami::SIPAccountBase::HALF_MAX_PORT {MAX_PORT / 2}
staticconstexpr

Definition at line 77 of file sipaccountbase.h.

◆ lastMessages_

std::deque<libjami::Message> jami::SIPAccountBase::lastMessages_
protected

Definition at line 263 of file sipaccountbase.h.

Referenced by getLastMessages(), and onTextMessage().

◆ link_

SIPVoIPLink& jami::SIPAccountBase::link_
protected

Voice over IP Link contains a listener thread and calls.

Definition at line 238 of file sipaccountbase.h.

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

◆ MAX_PORT

constexpr unsigned jami::SIPAccountBase::MAX_PORT {65536}
staticconstexpr

Definition at line 76 of file sipaccountbase.h.

◆ MAX_WAITING_MESSAGES_SIZE

constexpr size_t jami::SIPAccountBase::MAX_WAITING_MESSAGES_SIZE = 1000
staticconstexprprotected

Definition at line 262 of file sipaccountbase.h.

Referenced by onTextMessage().

◆ messageEngine_

im::MessageEngine jami::SIPAccountBase::messageEngine_
protected

Definition at line 233 of file sipaccountbase.h.

Referenced by getMessageStatus(), sendTextMessage(), and setRegistrationState().

◆ mutexLastMessages_

std::mutex jami::SIPAccountBase::mutexLastMessages_
protected

The deamon can be launched without any client (or with a non ready client) Like call and file transfer, a client should be able to retrieve current messages.

To avoid to explode the size in memory, this container should be limited. We don't want to see monsters in memory.

Definition at line 261 of file sipaccountbase.h.

Referenced by getLastMessages(), and onTextMessage().

◆ publishedIp_

dhtnet::IpAddr jami::SIPAccountBase::publishedIp_[2] {}
protected

Published IPv4/IPv6 addresses, used only if defined by the user in account configuration.

Definition at line 245 of file sipaccountbase.h.

Referenced by getPublishedIpAddress(), and setPublishedAddress().

◆ transportError_

std::string jami::SIPAccountBase::transportError_ {}
protected

Definition at line 248 of file sipaccountbase.h.

Referenced by getVolatileAccountDetails().

◆ transportStatus_

pj_status_t jami::SIPAccountBase::transportStatus_ {PJSIP_SC_TRYING}
protected

Definition at line 247 of file sipaccountbase.h.

Referenced by getVolatileAccountDetails().

◆ turnCache_

std::shared_ptr<dhtnet::TurnCache> jami::SIPAccountBase::turnCache_
protected

Definition at line 265 of file sipaccountbase.h.

Referenced by getIceOptions(), and loadConfig().


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