Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::SIPAccount Class Reference

#include <sipaccount.h>

Inheritance diagram for jami::SIPAccount:
Inheritance graph
Collaboration diagram for jami::SIPAccount:
Collaboration graph

Public Member Functions

std::unique_ptr< AccountConfigbuildConfig () const override
 
bool checkNATAddress (pjsip_regc_cbparam *param, pj_pool_t *pool)
 Update NAT address, Via and Contact header from the REGISTER response.
 
const SipAccountConfigconfig () const
 
void connectivityChanged () override
 Inform the account that the network status has changed.
 
dhtnet::IpAddr createBindingAddress ()
 Create the Ip address that the transport uses.
 
void destroyRegistrationInfo ()
 
void doRegister () override
 Initialize the SIP voip link with the account parameters and send registration.
 
void doUnregister (bool forceShutdownConnections=false) override
 Send unregistration.
 
void editConfig (std::function< void(SipAccountConfig &conf)> &&edit)
 
void enablePresence (const bool &enable)
 Activate the module.
 
std::string_view getAccountType () const override
 
dhtnet::IpAddr getContactAddress () const
 Get the contact address.
 
std::string getContactHeader () const
 Get the contact header.
 
unsigned getCredentialCount () const
 Get the number of credentials defined for this account.
 
std::vector< std::map< std::string, std::string > > getCredentials () const
 
const pjsip_cred_infogetCredInfo () const
 
std::string getFromUri () const override
 
pjsip_host_port getHostPortFromSTUN (pj_pool_t *pool)
 
uint16_t getLocalPort () const
 Get the port on which the transport/listener should use, or is actually using.
 
SIPPresencegetPresence () const
 Presence management.
 
const std::string & getReceivedParameter () const
 
unsigned getRegistrationExpire () const
 A client sendings a REGISTER request MAY suggest an expiration interval that indicates how long the client would like the registration to be valid.
 
pjsip_regcgetRegistrationInfo ()
 Get the registration structure that is used for PJSIP in the registration process.
 
int getRPort () const
 
std::string getServerUri () const
 In the current version, "srv" uri is obtained in the preformatted way: hostname:port.
 
std::string getServiceRoute () const
 
virtual bool getSrtpFallback () const override
 
pj_uint16_t getStunPort () const override
 
std::string getStunServer () const
 
pj_str_t getStunServerName () const
 
pj_uint16_t getTlsListenerPort () const
 Get the local port for TLS listener.
 
pjsip_tls_settinggetTlsSetting ()
 
std::map< std::string, std::string > getTlsSettings () const
 Return the TLS settings, mainly used to return security information to a client application.
 
std::string getToUri (const std::string &username) const override
 This method adds the correct scheme, hostname and append the ;transport= parameter at the end of the uri, in accordance with RFC3261.
 
virtual std::shared_ptr< SipTransportgetTransport ()
 
pjsip_tpselector getTransportSelector ()
 Shortcut for SipTransport::getTransportSelector(account.getTransport()).
 
pjsip_transport_type_e getTransportType () const
 
std::string getUserUri () const override
 
pjsip_host_portgetViaAddr ()
 
virtual std::map< std::string, std::string > getVolatileAccountDetails () const override
 Retrieve volatile details such as recent registration errors.
 
bool hasCredentials () const
 
bool hasServiceRoute () const
 
bool isIP2IP () const override
 Returns true if this is the IP2IP account.
 
bool isRegistered () const
 Registration flag.
 
bool isRegistrationRefreshEnabled () const
 
bool isSrtpEnabled () const override
 
bool isStunEnabled () const override
 
virtual bool isTlsEnabled () const override
 Determine if TLS is enabled for this account.
 
void loadConfig () override
 Actually useless, since config loading is done in init()
 
MatchRank matches (std::string_view username, std::string_view hostname) const override
 
std::shared_ptr< SIPCallnewIncomingCall (const std::string &from, const std::vector< libjami::MediaMap > &mediaList, const std::shared_ptr< SipTransport > &sipTr={}) override
 Create incoming SIPCall.
 
std::shared_ptr< CallnewOutgoingCall (std::string_view toUrl, const std::vector< libjami::MediaMap > &mediaList) override
 Create outgoing SIPCall.
 
void onRegister (pjsip_regc_cbparam *param)
 
void pushNotificationReceived (const std::string &from, const std::map< std::string, std::string > &data)
 To be called by clients with relevant data when a push notification is received.
 
void resetAutoRegistration ()
 
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) override
 
void sendRegister ()
 Build and send SIP registration request.
 
void sendUnregister ()
 Build and send SIP unregistration request.
 
void setActiveCodecs (const std::vector< unsigned > &list) override
 Update both the codec order structure and the codec string used for SDP offer and configuration respectively.
 
void setLocalPort (uint16_t port)
 
bool setPushNotificationConfig (const std::map< std::string, std::string > &data) override
 
bool setPushNotificationToken (const std::string &pushDeviceToken="") override
 
void setReceivedParameter (const std::string &received)
 
void setRegistrationInfo (pjsip_regc *regc)
 Set the registration structure that is used for PJSIP in the registration process; @pram A pointer to the new registration structure.
 
virtual void setRegistrationState (RegistrationState state, int code=0, const std::string &detail_str={}) override
 Set the registration state of the specified link.
 
void setRPort (int rPort)
 
void setTransport (const std::shared_ptr< SipTransport > &=nullptr)
 
std::shared_ptr< SIPAccountshared ()
 
std::shared_ptr< SIPAccount constshared () const
 
 SIPAccount (const std::string &accountID, bool presenceEnabled)
 Constructor.
 
void supportPresence (int function, bool enable)
 Activate the publish/subscribe.
 
void updateDialogViaSentBy (pjsip_dialog *dlg)
 
void updateProfile (const std::string &displayName, const std::string &avatar, const std::string &fileType, int32_t flag) override
 updates SIP account profile
 
std::weak_ptr< SIPAccountweak ()
 
std::weak_ptr< SIPAccount constweak () const
 
 ~SIPAccount () noexcept
 
- Public Member Functions inherited from jami::SIPAccountBase
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).
 
void loadConfig () override
 Load the settings in this account.
 
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 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 bool cancelMessage (uint64_t)
 
const AccountConfigconfig () const
 
bool detach (const std::shared_ptr< Call > &call)
 
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.
 
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
 
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
 
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.
 
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
 
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 setPushNotificationTopic (const std::string &topic="")
 
virtual ~Account ()
 Virtual destructor.
 

Static Public Member Functions

static const std::vector< std::string > & getSupportedTlsCiphers ()
 
static const std::vector< std::string > & getSupportedTlsProtocols ()
 
- Static Public Member Functions inherited from jami::SIPAccountBase
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 auto ACCOUNT_TYPE = ACCOUNT_TYPE_SIP
 
- Static Public Attributes inherited from jami::SIPAccountBase
static constexpr unsigned HALF_MAX_PORT {MAX_PORT / 2}
 
static constexpr unsigned MAX_PORT {65536}
 

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.
 
- Protected Member Functions inherited from jami::SIPAccountBase
uint16_t acquireRandomEvenPort (const std::pair< uint16_t, uint16_t > &range) const
 
uint16_t getRandomEvenPort (const std::pair< uint16_t, uint16_t > &range) const
 
- 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 inherited from jami::SIPAccountBase
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 inherited from jami::SIPAccountBase
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 inherited from jami::SIPAccountBase
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()
 

Detailed Description

Definition at line 47 of file sipaccount.h.

Constructor & Destructor Documentation

◆ SIPAccount()

jami::SIPAccount::SIPAccount ( const std::string &  accountID,
bool  presenceEnabled 
)

Constructor.

Parameters
accountIDThe account identifier

Definition at line 125 of file sipaccount.cpp.

◆ ~SIPAccount()

jami::SIPAccount::~SIPAccount ( )
noexcept

Definition at line 135 of file sipaccount.cpp.

References destroyRegistrationInfo(), JAMI_ERR, and setTransport().

Here is the call graph for this function:

Member Function Documentation

◆ buildConfig()

std::unique_ptr< AccountConfig > jami::SIPAccount::buildConfig ( ) const
inlineoverridevirtual

Implements jami::Account.

Definition at line 82 of file sipaccount.h.

References jami::Account::getAccountID().

Here is the call graph for this function:

◆ checkNATAddress()

bool jami::SIPAccount::checkNATAddress ( pjsip_regc_cbparam param,
pj_pool_t pool 
)

Update NAT address, Via and Contact header from the REGISTER response.

Parameters
parampjsip reg cbparam
pool
Returns
update status

Definition at line 1609 of file sipaccount.cpp.

References JAMI_DBG, JAMI_ERR, JAMI_LOG, and JAMI_WARN.

◆ config()

◆ connectivityChanged()

void jami::SIPAccount::connectivityChanged ( )
overridevirtual

Inform the account that the network status has changed.

Reimplemented from jami::Account.

Definition at line 773 of file sipaccount.cpp.

◆ createBindingAddress()

dhtnet::IpAddr jami::SIPAccount::createBindingAddress ( )

Create the Ip address that the transport uses.

Returns
IpAddr created

Definition at line 2016 of file sipaccount.cpp.

◆ destroyRegistrationInfo()

void jami::SIPAccount::destroyRegistrationInfo ( )

Definition at line 1589 of file sipaccount.cpp.

Referenced by setRegistrationInfo(), and ~SIPAccount().

◆ doRegister()

void jami::SIPAccount::doRegister ( )
overridevirtual

Initialize the SIP voip link with the account parameters and send registration.

Implements jami::Account.

Definition at line 621 of file sipaccount.cpp.

References JAMI_DBG, JAMI_DEBUG, and JAMI_WARN.

◆ doUnregister()

void jami::SIPAccount::doUnregister ( bool  forceShutdownConnections = false)
overridevirtual

Send unregistration.

Implements jami::Account.

Definition at line 753 of file sipaccount.cpp.

References JAMI_ERR.

◆ editConfig()

void jami::SIPAccount::editConfig ( std::function< void(SipAccountConfig &conf)> &&  edit)
inline

Definition at line 86 of file sipaccount.h.

References jami::Account::editConfig(), and jami::emitSignal().

Referenced by setLocalPort().

Here is the call graph for this function:

◆ enablePresence()

void jami::SIPAccount::enablePresence ( const bool enable)

Activate the module.

Enable the presence module.

Parameters
functionPublish or subscribe to enable
enableFlag

Definition at line 1523 of file sipaccount.cpp.

References JAMI_ERR, and JAMI_LOG.

◆ getAccountType()

std::string_view jami::SIPAccount::getAccountType ( ) const
inlineoverridevirtual

Implements jami::Account.

Definition at line 92 of file sipaccount.h.

References ACCOUNT_TYPE.

◆ getContactAddress()

dhtnet::IpAddr jami::SIPAccount::getContactAddress ( ) const

Get the contact address.

Returns
The current contact address

Definition at line 1277 of file sipaccount.cpp.

◆ getContactHeader()

std::string jami::SIPAccount::getContactHeader ( ) const

Get the contact header.

Returns
The current contact header

Definition at line 1284 of file sipaccount.cpp.

Referenced by newIncomingCall(), and newOutgoingCall().

◆ getCredentialCount()

unsigned jami::SIPAccount::getCredentialCount ( ) const
inline

Get the number of credentials defined for this account.

Parameters
none
Returns
int The number of credentials set for this account.

Definition at line 164 of file sipaccount.h.

References config(), and jami::SipAccountConfig::credentials.

Referenced by jami::PresSubClient::subscribe().

Here is the call graph for this function:

◆ getCredentials()

std::vector< std::map< std::string, std::string > > jami::SIPAccount::getCredentials ( ) const
inline

Definition at line 168 of file sipaccount.h.

References config(), and jami::SipAccountConfig::getCredentials().

Here is the call graph for this function:

◆ getCredInfo()

const pjsip_cred_info * jami::SIPAccount::getCredInfo ( ) const
inline

Definition at line 156 of file sipaccount.h.

Referenced by jami::PresSubClient::subscribe().

◆ getFromUri()

std::string jami::SIPAccount::getFromUri ( ) const
overridevirtual
Returns
pj_str_t "From" uri based on account information. From RFC3261: "The To header field first and foremost specifies the desired logical" recipient of the request, or the address-of-record of the user or resource that is the target of this request. [...] As such, it is very important that the From URI not contain IP addresses or the FQDN of the host on which the UA is running, since these are not logical names."

Implements jami::Account.

Definition at line 1190 of file sipaccount.cpp.

Referenced by jami::PresSubClient::PresSubClient(), jami::SIPPresence::reportPresSubClientNotification(), and jami::PresSubClient::subscribe().

◆ getHostPortFromSTUN()

pjsip_host_port jami::SIPAccount::getHostPortFromSTUN ( pj_pool_t pool)

Definition at line 1424 of file sipaccount.cpp.

◆ getLocalPort()

uint16_t jami::SIPAccount::getLocalPort ( ) const
inline

Get the port on which the transport/listener should use, or is actually using.

Returns
pj_uint16 The port used for that account

Definition at line 223 of file sipaccount.h.

References config(), and jami::SipAccountConfig::localPort.

Here is the call graph for this function:

◆ getPresence()

SIPPresence * jami::SIPAccount::getPresence ( ) const

Presence management.

Definition at line 1514 of file sipaccount.cpp.

◆ getReceivedParameter()

const std::string & jami::SIPAccount::getReceivedParameter ( ) const
inline

Definition at line 324 of file sipaccount.h.

◆ getRegistrationExpire()

unsigned jami::SIPAccount::getRegistrationExpire ( ) const
inline

A client sendings a REGISTER request MAY suggest an expiration interval that indicates how long the client would like the registration to be valid.

Returns
the expiration value.

Definition at line 184 of file sipaccount.h.

References config(), jami::emitSignal(), and jami::SipAccountConfig::registrationExpire.

Here is the call graph for this function:

◆ getRegistrationInfo()

pjsip_regc * jami::SIPAccount::getRegistrationInfo ( )
inline

Get the registration structure that is used for PJSIP in the registration process.

Settings are loaded from configuration file.

Returns
pjsip_regc* A pointer to the registration structure

Definition at line 201 of file sipaccount.h.

Referenced by jami::PresSubClient::subscribe().

◆ getRPort()

int jami::SIPAccount::getRPort ( ) const
inline

Definition at line 328 of file sipaccount.h.

References config(), and jami::SipAccountConfig::localPort.

Here is the call graph for this function:

◆ getServerUri()

std::string jami::SIPAccount::getServerUri ( ) const

In the current version, "srv" uri is obtained in the preformatted way: hostname:port.

This method adds the correct scheme and append the ;transport= parameter at the end of the uri, in accordance with RFC3261.

Returns
pj_str_t "server" uri based on
Parameters
hostPort
hostPortA string formatted as : "hostname:port"

Definition at line 1254 of file sipaccount.cpp.

◆ getServiceRoute()

std::string jami::SIPAccount::getServiceRoute ( ) const
inline

Definition at line 310 of file sipaccount.h.

References config(), and jami::SipAccountConfig::serviceRoute.

Referenced by jami::PresSubClient::subscribe().

Here is the call graph for this function:

◆ getSrtpFallback()

virtual bool jami::SIPAccount::getSrtpFallback ( ) const
inlineoverridevirtual

Implements jami::SIPAccountBase.

Definition at line 316 of file sipaccount.h.

References config(), and jami::SipAccountConfig::srtpFallback.

Here is the call graph for this function:

◆ getStunPort()

pj_uint16_t jami::SIPAccount::getStunPort ( ) const
inlineoverridevirtual
Returns
pj_uint8_t structure, filled from the configuration file, that can be used directly by PJSIP to initialize an alternate UDP transport.

Reimplemented from jami::SIPAccountBase.

Definition at line 253 of file sipaccount.h.

◆ getStunServer()

std::string jami::SIPAccount::getStunServer ( ) const
inline
Returns
pj_str_t , filled from the configuration file, that can be used directly by PJSIP to initialize an alternate UDP transport.

Definition at line 266 of file sipaccount.h.

References config(), and jami::SipAccountConfig::stunServer.

Here is the call graph for this function:

◆ getStunServerName()

pj_str_t jami::SIPAccount::getStunServerName ( ) const
inline

Definition at line 243 of file sipaccount.h.

◆ getSupportedTlsCiphers()

const std::vector< std::string > & jami::SIPAccount::getSupportedTlsCiphers ( )
static

Definition at line 1442 of file sipaccount.cpp.

References JAMI_ERR.

Referenced by libjami::getSupportedCiphers().

◆ getSupportedTlsProtocols()

const std::vector< std::string > & jami::SIPAccount::getSupportedTlsProtocols ( )
static

Definition at line 1466 of file sipaccount.cpp.

References jami::VALID_TLS_PROTOS.

Referenced by libjami::getSupportedTlsMethod().

◆ getTlsListenerPort()

pj_uint16_t jami::SIPAccount::getTlsListenerPort ( ) const
inline

Get the local port for TLS listener.

Returns
pj_uint16 The port used for that account

Definition at line 241 of file sipaccount.h.

References config(), and jami::SipAccountConfig::tlsListenerPort.

Here is the call graph for this function:

◆ getTlsSetting()

pjsip_tls_setting * jami::SIPAccount::getTlsSetting ( )
inline
Returns
pjsip_tls_setting structure, filled from the configuration file, that can be used directly by PJSIP to initialize TLS transport.

Definition at line 235 of file sipaccount.h.

◆ getTlsSettings()

std::map< std::string, std::string > jami::SIPAccount::getTlsSettings ( ) const

Return the TLS settings, mainly used to return security information to a client application.

◆ getToUri()

std::string jami::SIPAccount::getToUri ( const std::string &  username) const
overridevirtual

This method adds the correct scheme, hostname and append the ;transport= parameter at the end of the uri, in accordance with RFC3261.

It is expected that "port" is present in the internal hostname_.

Returns
pj_str_t "To" uri based on
Parameters
username
usernameA string formatted as : "username"

Implements jami::SIPAccountBase.

Definition at line 1222 of file sipaccount.cpp.

Referenced by newOutgoingCall().

◆ getTransport()

virtual std::shared_ptr< SipTransport > jami::SIPAccount::getTransport ( )
inlinevirtual

Definition at line 346 of file sipaccount.h.

◆ getTransportSelector()

pjsip_tpselector jami::SIPAccount::getTransportSelector ( )

Shortcut for SipTransport::getTransportSelector(account.getTransport()).

Definition at line 388 of file sipaccount.cpp.

◆ getTransportType()

pjsip_transport_type_e jami::SIPAccount::getTransportType ( ) const
inline

Definition at line 348 of file sipaccount.h.

Referenced by newOutgoingCall().

◆ getUserUri()

std::string jami::SIPAccount::getUserUri ( ) const
overridevirtual

Implements jami::SIPAccountBase.

Definition at line 2010 of file sipaccount.cpp.

◆ getViaAddr()

pjsip_host_port * jami::SIPAccount::getViaAddr ( )
inline

Definition at line 326 of file sipaccount.h.

◆ getVolatileAccountDetails()

std::map< std::string, std::string > jami::SIPAccount::getVolatileAccountDetails ( ) const
overridevirtual

Retrieve volatile details such as recent registration errors.

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

Reimplemented from jami::SIPAccountBase.

Definition at line 499 of file sipaccount.cpp.

References JAMI_WARN, libjami::Account::VolatileProperties::InstantMessaging::OFF_CALL, libjami::TlsTransport::TLS_CIPHER, libjami::TlsTransport::TLS_PEER_CA_, libjami::TlsTransport::TLS_PEER_CA_NUM, and libjami::TlsTransport::TLS_PEER_CERT.

◆ hasCredentials()

bool jami::SIPAccount::hasCredentials ( ) const
inline

Definition at line 166 of file sipaccount.h.

References config(), jami::SipAccountConfig::credentials, and jami::emitSignal().

Referenced by jami::PresSubClient::subscribe().

Here is the call graph for this function:

◆ hasServiceRoute()

bool jami::SIPAccount::hasServiceRoute ( ) const
inline

Definition at line 312 of file sipaccount.h.

References config(), jami::emitSignal(), and jami::SipAccountConfig::serviceRoute.

Referenced by jami::PresSubClient::subscribe().

Here is the call graph for this function:

◆ isIP2IP()

bool jami::SIPAccount::isIP2IP ( ) const
overridevirtual

Returns true if this is the IP2IP account.

Reimplemented from jami::Account.

Definition at line 1508 of file sipaccount.cpp.

Referenced by newOutgoingCall(), and jami::SIPPresence::sendPresence().

◆ isRegistered()

bool jami::SIPAccount::isRegistered ( ) const
inline

Registration flag.

Definition at line 193 of file sipaccount.h.

◆ isRegistrationRefreshEnabled()

bool jami::SIPAccount::isRegistrationRefreshEnabled ( ) const
inline

Definition at line 342 of file sipaccount.h.

References config(), and jami::SipAccountConfig::registrationRefreshEnabled.

Here is the call graph for this function:

◆ isSrtpEnabled()

bool jami::SIPAccount::isSrtpEnabled ( ) const
inlineoverridevirtual

Implements jami::SIPAccountBase.

Definition at line 416 of file sipaccount.h.

References config(), jami::NONE, and jami::SipAccountConfig::srtpKeyExchange.

Referenced by newOutgoingCall().

Here is the call graph for this function:

◆ isStunEnabled()

bool jami::SIPAccount::isStunEnabled ( ) const
inlineoverridevirtual
Returns
bool Tells if current transport for that account is set to OTHER.

Reimplemented from jami::SIPAccountBase.

Definition at line 259 of file sipaccount.h.

References config(), and jami::SipAccountConfig::stunEnabled.

Referenced by newOutgoingCall().

Here is the call graph for this function:

◆ isTlsEnabled()

virtual bool jami::SIPAccount::isTlsEnabled ( ) const
inlineoverridevirtual

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 from jami::SIPAccountBase.

Definition at line 314 of file sipaccount.h.

References config(), and jami::SipAccountConfig::tlsEnable.

Referenced by newOutgoingCall().

Here is the call graph for this function:

◆ loadConfig()

void jami::SIPAccount::loadConfig ( )
overridevirtual

Actually useless, since config loading is done in init()

Reimplemented from jami::Account.

Definition at line 1125 of file sipaccount.cpp.

◆ matches()

MatchRank jami::SIPAccount::matches ( std::string_view  username,
std::string_view  hostname 
) const
overridevirtual

Implements jami::SIPAccountBase.

Definition at line 1567 of file sipaccount.cpp.

References JAMI_LOG.

◆ newIncomingCall()

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

Create incoming SIPCall.

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

Implements jami::SIPAccountBase.

Definition at line 204 of file sipaccount.cpp.

References jami::Manager::callFactory, jami::emitSignal(), getContactHeader(), jami::Call::INCOMING, jami::Manager::instance(), jami::CallFactory::newSipCall(), and shared().

Here is the call graph for this function:

◆ newOutgoingCall()

◆ onRegister()

void jami::SIPAccount::onRegister ( pjsip_regc_cbparam param)

Definition at line 897 of file sipaccount.cpp.

References JAMI_DBG, JAMI_ERROR, and JAMI_WARN.

◆ pushNotificationReceived()

void jami::SIPAccount::pushNotificationReceived ( const std::string &  from,
const std::map< std::string, std::string > &  data 
)

To be called by clients with relevant data when a push notification is received.

Definition at line 609 of file sipaccount.cpp.

References JAMI_WARNING.

◆ resetAutoRegistration()

void jami::SIPAccount::resetAutoRegistration ( )

Definition at line 1598 of file sipaccount.cpp.

◆ sendMessage()

void jami::SIPAccount::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 
)
overridevirtual

Implements jami::SIPAccountBase.

Definition at line 1851 of file sipaccount.cpp.

References jami::ctx::acc, JAMI_ERROR, and JAMI_WARN.

◆ sendRegister()

void jami::SIPAccount::sendRegister ( )

Build and send SIP registration request.

Definition at line 786 of file sipaccount.cpp.

References JAMI_ERR, JAMI_ERROR, JAMI_LOG, JAMI_WARNING, and jami::registration_cb().

Here is the call graph for this function:

◆ sendUnregister()

void jami::SIPAccount::sendUnregister ( )

Build and send SIP unregistration request.

Parameters
destroy_transportIf true, attempt to destroy the transport.

Definition at line 985 of file sipaccount.cpp.

References JAMI_ERR.

◆ setActiveCodecs()

void jami::SIPAccount::setActiveCodecs ( const std::vector< unsigned > &  list)
overridevirtual

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

Reimplemented from jami::Account.

Definition at line 2036 of file sipaccount.cpp.

References JAMI_WARNING, jami::MEDIA_ALL, jami::MEDIA_AUDIO, and jami::MEDIA_VIDEO.

◆ setLocalPort()

void jami::SIPAccount::setLocalPort ( uint16_t  port)
inline

Definition at line 225 of file sipaccount.h.

References config(), editConfig(), jami::emitSignal(), and jami::SipAccountConfig::localPort.

Here is the call graph for this function:

◆ setPushNotificationConfig()

bool jami::SIPAccount::setPushNotificationConfig ( const std::map< std::string, std::string > &  data)
overridevirtual

Reimplemented from jami::Account.

Definition at line 596 of file sipaccount.cpp.

◆ setPushNotificationToken()

bool jami::SIPAccount::setPushNotificationToken ( const std::string &  pushDeviceToken = "")
overridevirtual

Reimplemented from jami::Account.

Definition at line 582 of file sipaccount.cpp.

References JAMI_WARNING.

◆ setReceivedParameter()

void jami::SIPAccount::setReceivedParameter ( const std::string &  received)
inline

Definition at line 318 of file sipaccount.h.

References jami::sip_utils::CONST_PJ_STR().

Here is the call graph for this function:

◆ setRegistrationInfo()

void jami::SIPAccount::setRegistrationInfo ( pjsip_regc regc)
inline

Set the registration structure that is used for PJSIP in the registration process; @pram A pointer to the new registration structure.

Returns
void

Definition at line 209 of file sipaccount.h.

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

Here is the call graph for this function:

◆ setRegistrationState()

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

Set the registration state of the specified link.

Parameters
stateThe registration state of underlying VoIPLink

Reimplemented from jami::SIPAccountBase.

Definition at line 1495 of file sipaccount.cpp.

◆ setRPort()

void jami::SIPAccount::setRPort ( int  rPort)
inline

Definition at line 336 of file sipaccount.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ setTransport()

void jami::SIPAccount::setTransport ( const std::shared_ptr< SipTransport > &  t = nullptr)

Definition at line 356 of file sipaccount.cpp.

References JAMI_DEBUG.

Referenced by newOutgoingCall(), and ~SIPAccount().

◆ shared() [1/2]

std::shared_ptr< SIPAccount > jami::SIPAccount::shared ( )
inline

Definition at line 52 of file sipaccount.h.

References jami::emitSignal().

Referenced by newIncomingCall(), and newOutgoingCall().

Here is the call graph for this function:

◆ shared() [2/2]

std::shared_ptr< SIPAccount const > jami::SIPAccount::shared ( ) const
inline

Definition at line 56 of file sipaccount.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ supportPresence()

void jami::SIPAccount::supportPresence ( int  function,
bool  enable 
)

Activate the publish/subscribe.

Set the presence (PUBLISH/SUBSCRIBE) support flags and process the change.

Parameters
enableFlag

Definition at line 1540 of file sipaccount.cpp.

References JAMI_ERR, JAMI_LOG, PRESENCE_FUNCTION_PUBLISH, and PRESENCE_FUNCTION_SUBSCRIBE.

◆ updateDialogViaSentBy()

void jami::SIPAccount::updateDialogViaSentBy ( pjsip_dialog dlg)

Definition at line 1826 of file sipaccount.cpp.

◆ updateProfile()

void jami::SIPAccount::updateProfile ( const std::string &  displayName,
const std::string &  avatar,
const std::string &  fileType,
int32_t  flag 
)
overridevirtual

◆ weak() [1/2]

std::weak_ptr< SIPAccount > jami::SIPAccount::weak ( )
inline

Definition at line 60 of file sipaccount.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ weak() [2/2]

std::weak_ptr< SIPAccount const > jami::SIPAccount::weak ( ) const
inline

Definition at line 64 of file sipaccount.h.

References jami::emitSignal().

Here is the call graph for this function:

Member Data Documentation

◆ ACCOUNT_TYPE

constexpr auto jami::SIPAccount::ACCOUNT_TYPE = ACCOUNT_TYPE_SIP
staticconstexpr

◆ active

pj_bool_t jami::SIPAccount::active {false}

Flag of reregister status.

Definition at line 470 of file sipaccount.h.

◆ attempt_cnt

unsigned jami::SIPAccount::attempt_cnt {0}

Attempt counter.


Definition at line 472 of file sipaccount.h.

◆ timer

pj_timer_entry jami::SIPAccount::timer {}

Timer for reregistration.


Definition at line 471 of file sipaccount.h.


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