Ring Daemon 16.0.0
|
Ring Account is build on top of SIPAccountBase and uses DHT to handle call connectivity. More...
#include <jamiaccount.h>
Classes | |
struct | BuddyInfo |
struct | DiscoveredPeer |
struct | PendingCall |
struct | PendingMessage |
Public Member Functions | |
bool | acceptTrustRequest (const std::string &from, bool includeConversation=true) |
const std::shared_ptr< AccountManager > & | accountManager () |
void | addContact (const std::string &uri, bool confirmed=false) |
Add contact to the account contact list. | |
int32_t | addDevice (const std::string &uriProvided) |
Initiates the process of adding a new device to this account. | |
void | askForFileChannel (const std::string &conversationId, const std::string &deviceId, const std::string &interactionId, const std::string &fileId, size_t start=0, size_t end=0) |
void | askForProfile (const std::string &conversationId, const std::string &deviceId, const std::string &memberUri) |
std::unique_ptr< AccountConfig > | buildConfig () const override |
bool | cancelAddDevice (uint32_t op_token) |
dhtnet::tls::CertificateStore & | certStore () const |
bool | changeArchivePassword (const std::string &password_old, const std::string &password_new) |
void | clearProfileCache (const std::string &peerUri) |
Clear sent profiles (because of a removed contact or new trust request) | |
const JamiAccountConfig & | config () const |
bool | confirmAddDevice (uint32_t op_token) |
void | connectivityChanged () override |
Inform the account that the network status has changed. | |
JamiAccountConfig::Credentials | consumeConfigCredentials () |
ConversationModule * | convModule (bool noCreation=false) |
Used to get the instance of the ConversationModule class which is responsible for managing conversations and messages between users. | |
std::string_view | currentDeviceId () const |
std::shared_ptr< TransferManager > | dataTransfer (const std::string &id="") |
Retrieve linked transfer manager. | |
void | declineConversationRequest (const std::string &conversationId) |
std::shared_ptr< dht::DhtRunner > | dht () |
bool | discardTrustRequest (const std::string &from) |
void | doRegister () override |
Connect to the DHT. | |
void | doUnregister (bool forceShutdownConnections=false) override |
Disconnect from the DHT. | |
void | editConfig (std::function< void(JamiAccountConfig &conf)> &&edit) |
bool | exportArchive (const std::string &destinationPath, std::string_view scheme={}, const std::string &password={}) |
Export the archive to a file. | |
bool | findCertificate (const dht::InfoHash &h, std::function< void(const std::shared_ptr< dht::crypto::Certificate > &)> &&cb={}) |
bool | findCertificate (const dht::PkId &h, std::function< void(const std::shared_ptr< dht::crypto::Certificate > &)> &&cb={}) |
bool | findCertificate (const std::string &id) |
void | flush () override |
This method is called to request removal of possible account traces on the system, like internal account setup files. | |
void | forceReloadAccount () |
Try to reload the account to force the identity to be updated. | |
void | forEachDevice (const dht::InfoHash &to, std::function< void(const std::shared_ptr< dht::crypto::PublicKey > &)> &&op, std::function< void(bool)> &&end={}) |
std::string_view | getAccountType () const override |
std::vector< std::string > | getCertificatesByStatus (dhtnet::tls::TrustStore::PermissionStatus status) |
std::vector< std::map< std::string, std::string > > | getChannelList (const std::string &connectionId) |
std::vector< std::map< std::string, std::string > > | getConnectionList (const std::string &conversationId="") |
std::map< std::string, std::string > | getContactDetails (const std::string &uri) const |
Obtain details about one account contact in serializable form. | |
std::string | getContactHeader (const std::shared_ptr< SipTransport > &sipTransport) |
Get the contact header for. | |
std::optional< Contact > | getContactInfo (const std::string &uri) const |
std::vector< std::map< std::string, std::string > > | getContacts (bool includeRemoved=false) const |
std::string | getFromUri () const override |
dhtnet::IceTransportOptions | getIceOptions () const override |
Create and return ICE options. | |
void | getIceOptions (std::function< void(dhtnet::IceTransportOptions &&)> cb) const |
std::map< std::string, std::string > | getKnownDevices () const |
std::vector< libjami::Message > | getLastMessages (const uint64_t &base_timestamp) override |
Get last messages (should be used to retrieve messages when launching the client) | |
std::map< std::string, std::string > | getNearbyPeers () const override |
Get current discovered peers account id and display name. | |
std::vector< uint8_t > | getPasswordKey (const std::string &password) |
dhtnet::IpAddr | getPublishedIpAddress (uint16_t family=PF_UNSPEC) const override |
std::string | getServerUri () const |
In the current version, "srv" uri is obtained in the preformated way: hostname:port. | |
virtual bool | getSrtpFallback () const override |
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. | |
std::map< std::string, bool > | getTrackedBuddyPresence () const |
Tells for each tracked account id if it has been seen online so far in the last DeviceAnnouncement::TYPE.expiration minutes. | |
std::vector< std::map< std::string, std::string > > | getTrustRequests () const |
std::string | getUserUri () const override |
virtual std::map< std::string, std::string > | getVolatileAccountDetails () const override |
Retrieve volatile details such as recent registration errors. | |
void | handleIncomingConversationCall (const std::string &callId, const std::string &destination) |
Join incoming call to hosted conference. | |
bool | handleMessage (const std::shared_ptr< dht::crypto::Certificate > &cert, const std::string &from, const std::pair< std::string, std::string > &message) override |
const dht::crypto::Identity & | identity () const |
bool | isConnectedWith (const DeviceId &deviceId) const |
Check if a Device is connected. | |
bool | isMessageTreated (dht::Value::Id id) |
bool | isMobile () const |
The DRT component is composed on some special nodes, that are usually present but not connected. | |
bool | isPasswordValid (const std::string &password) |
bool | isSrtpEnabled () const override |
virtual bool | isTlsEnabled () const override |
Determine if TLS is enabled for this account. | |
bool | isValidAccountDevice (const dht::crypto::Certificate &cert) const |
JamiAccount (const std::string &accountId) | |
Constructor. | |
void | loadConfig () override |
Load the settings in this account. | |
void | loadConversation (const std::string &convId) |
MatchRank | matches (std::string_view username, std::string_view hostname) const override |
void | monitor () |
bool | needToSendProfile (const std::string &peerUri, const std::string &deviceId, const std::string &sha3Sum) |
Check (via the cache) if we need to send our profile to a specific device. | |
std::shared_ptr< SIPCall > | newIncomingCall (const std::string &from, const std::vector< libjami::MediaMap > &mediaList, const std::shared_ptr< SipTransport > &sipTr={}) override |
Create incoming SIPCall. | |
std::shared_ptr< Call > | newOutgoingCall (std::string_view toUrl, const std::vector< libjami::MediaMap > &mediaList) override |
Create outgoing SIPCall. | |
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) override |
std::filesystem::path | profilePath () const |
bool | provideAccountAuthentication (const std::string &credentialsFromUser, const std::string &scheme) |
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 | reloadContacts () |
void | removeContact (const std::string &uri, bool banned=true) |
bool | revokeDevice (const std::string &device, std::string_view scheme={}, const std::string &password={}) |
void | saveConfig () const override |
bool | searchUser (const std::string &nameQuery) |
void | sendFile (const std::string &conversationId, const std::filesystem::path &path, const std::string &name, const std::string &replyTo) |
void | sendInstantMessage (const std::string &convId, const std::map< std::string, std::string > &msg) |
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 | sendPresenceNote (const std::string ¬e) |
Send a presence note. | |
void | sendProfile (const std::string &convId, const std::string &peerUri, const std::string &deviceId) |
Send Profile via cached SIP connection. | |
void | sendProfile (const std::string &peerUri, const std::string &deviceId) |
Send profile via cached SIP connection. | |
void | sendProfileToPeers () |
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 | sendTrustRequest (const std::string &to, const std::vector< uint8_t > &payload) |
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. | |
bool | setCertificateStatus (const std::shared_ptr< crypto::Certificate > &cert, dhtnet::tls::TrustStore::PermissionStatus status, bool local=true) |
bool | setCertificateStatus (const std::string &cert_id, dhtnet::tls::TrustStore::PermissionStatus status) |
void | setIsComposing (const std::string &conversationUri, bool isWriting) override |
bool | setMessageDisplayed (const std::string &conversationUri, const std::string &messageId, int status) override |
bool | setPushNotificationConfig (const std::map< std::string, std::string > &data) override |
bool | setPushNotificationToken (const std::string &pushDeviceToken="") override |
bool | setPushNotificationTopic (const std::string &topic) override |
void | setRegistrationState (RegistrationState state, int detail_code=0, const std::string &detail_str={}) override |
Set the registration state of the specified link. | |
bool | setValidity (std::string_view scheme, const std::string &pwd, const dht::InfoHash &id, int64_t validity) |
Change certificate's validity period. | |
bool | sha3SumVerify () const |
std::shared_ptr< JamiAccount > | shared () |
std::shared_ptr< JamiAccount const > | shared () const |
void | shutdownConnections () |
This should be called before flushing the account. | |
void | startAccountDiscovery () |
Start Discovery the Jami Account from the Network. | |
void | startAccountPublish () |
Start Publish the Jami Account onto the Network. | |
SyncModule * | syncModule () |
void | trackBuddyPresence (const std::string &buddy_id, bool track) |
Adds an account id to the list of accounts to track on the DHT for buddy presence. | |
void | transferFile (const std::string &conversationId, const std::string &path, const std::string &deviceId, const std::string &fileId, const std::string &interactionId, size_t start=0, size_t end=0, const std::string &sha3Sum="", uint64_t lastWriteTime=0, std::function< void()> onFinished={}) |
void | unlinkConversations (const std::set< std::string > &removedConv) |
Make sure appdata/contacts.yml contains correct information. | |
void | updateProfile (const std::string &displayName, const std::string &avatar, const std::string &fileType, int32_t flag) override |
Update the profile vcard and send it to peers. | |
std::weak_ptr< JamiAccount > | weak () |
std::weak_ptr< JamiAccount const > | weak () const |
~JamiAccount () noexcept | |
![]() | |
const SipAccountBaseConfig & | config () 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< MediaAttribute > | createDefaultMediaList (bool addVideo, bool onHold=false) |
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 |
std::vector< libjami::Message > | getLastMessages (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. | |
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 pj_uint16_t | getStunPort () const |
virtual bool | isStunEnabled () const |
void | loadConfig () override |
Load the settings in this account. | |
void | setPublishedAddress (const dhtnet::IpAddr &ip_addr) |
SIPAccountBase (const std::string &accountID) | |
Constructor. | |
virtual | ~SIPAccountBase () noexcept |
![]() | |
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 AccountConfig & | config () 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< unsigned > | getActiveCodecs (MediaType mediaType=MEDIA_ALL) const |
const std::string & | getAlias () const |
std::shared_ptr< Call > | getCall (const std::string &callId) const |
std::vector< std::string > | getCallList () const |
std::shared_ptr< Conference > | getConference (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 |
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 |
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. | |
bool | removeConference (const std::string &confId) |
void | removeDefaultModerator (const std::string &peerURI) |
std::shared_ptr< SystemCodecInfo > | searchCodecById (unsigned codecId, MediaType mediaType) |
std::shared_ptr< SystemCodecInfo > | searchCodecByPayload (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 | ~Account () |
Virtual destructor. | |
Static Public Attributes | |
static constexpr auto | ACCOUNT_TYPE = ACCOUNT_TYPE_JAMI |
static constexpr const std::pair< uint16_t, uint16_t > | DHT_PORT_RANGE {4000, 8888} |
static constexpr int | ICE_COMP_COUNT_PER_STREAM {1} |
static constexpr int | ICE_STREAMS_COUNT {1} |
![]() | |
static constexpr unsigned | HALF_MAX_PORT {MAX_PORT / 2} |
static constexpr unsigned | MAX_PORT {65536} |
Additional Inherited Members | |
![]() | |
static void | releasePort (uint16_t port) noexcept |
![]() | |
static std::map< std::string, std::string > | getDefaultCodecDetails (const unsigned &codecId) |
static std::vector< unsigned > | getDefaultCodecsId () |
static bool | meetMinimumRequiredVersion (const std::vector< unsigned > &jamiVersion, const std::vector< unsigned > &minRequiredVersion) |
![]() | |
std::mt19937_64 | rand |
Random generator engine Logical account state shall never rely on the state of the random generator. | |
![]() | |
uint16_t | acquireRandomEvenPort (const std::pair< uint16_t, uint16_t > &range) const |
uint16_t | getRandomEvenPort (const std::pair< uint16_t, uint16_t > &range) const |
![]() | |
std::vector< unsigned > | getAccountCodecInfoIdList (MediaType mediaType) const |
std::shared_ptr< SystemCodecInfo > | searchCodecByName (const std::string &name, MediaType mediaType) |
private account codec searching functions | |
void | setAllCodecsActive (MediaType mediaType, bool active) |
void | sortCodec () |
![]() | |
static uint16_t | acquirePort (uint16_t port) |
static std::array< bool, HALF_MAX_PORT > & | getPortsReservation () noexcept |
![]() | |
static std::string | getDefaultUserAgent () |
Build the user-agent string. | |
static std::string | mapStateNumberToString (RegistrationState state) |
![]() | |
std::deque< libjami::Message > | lastMessages_ |
SIPVoIPLink & | link_ |
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_ |
![]() | |
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< AccountConfig > | config_ {} |
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< SystemCodecContainer > | systemCodecContainer_ |
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 constexpr size_t | MAX_WAITING_MESSAGES_SIZE = 1000 |
![]() | |
static const std::string | DEFAULT_USER_AGENT = Account::getDefaultUserAgent() |
Ring Account is build on top of SIPAccountBase and uses DHT to handle call connectivity.
Definition at line 95 of file jamiaccount.h.
jami::JamiAccount::JamiAccount | ( | const std::string & | accountId | ) |
Constructor.
accountID | The account identifier |
Definition at line 251 of file jamiaccount.cpp.
|
noexcept |
Definition at line 262 of file jamiaccount.cpp.
bool jami::JamiAccount::acceptTrustRequest | ( | const std::string & | from, |
bool | includeConversation = true |
||
) |
Definition at line 2964 of file jamiaccount.cpp.
References JAMI_ERROR, and JAMI_WARNING.
|
inline |
Definition at line 558 of file jamiaccount.h.
Add contact to the account contact list.
Set confirmed if we know the contact also added us.
Definition at line 2902 of file jamiaccount.cpp.
References JAMI_ERROR, and JAMI_WARNING.
Initiates the process of adding a new device to this account.
uriProvided | The URI provided by the new device to be added |
Definition at line 1019 of file jamiaccount.cpp.
void jami::JamiAccount::askForFileChannel | ( | const std::string & | conversationId, |
const std::string & | deviceId, | ||
const std::string & | interactionId, | ||
const std::string & | fileId, | ||
size_t | start = 0 , |
||
size_t | end = 0 |
||
) |
Definition at line 4443 of file jamiaccount.cpp.
void jami::JamiAccount::askForProfile | ( | const std::string & | conversationId, |
const std::string & | deviceId, | ||
const std::string & | memberUri | ||
) |
Definition at line 4508 of file jamiaccount.cpp.
|
inlineoverridevirtual |
Implements jami::Account.
Definition at line 149 of file jamiaccount.h.
References jami::Account::getAccountID(), and jami::Account::idPath_.
Definition at line 1037 of file jamiaccount.cpp.
|
inline |
Definition at line 609 of file jamiaccount.h.
bool jami::JamiAccount::changeArchivePassword | ( | const std::string & | password_old, |
const std::string & | password_new | ||
) |
Definition at line 969 of file jamiaccount.cpp.
References jami::JamiAccountConfig::archiveHasPassword, and JAMI_ERROR.
Clear sent profiles (because of a removed contact or new trust request)
peerUri | Uri used to clear cache |
Definition at line 4131 of file jamiaccount.cpp.
|
inline |
Definition at line 122 of file jamiaccount.h.
References jami::Account::config().
Referenced by isMobile().
Definition at line 1045 of file jamiaccount.cpp.
|
overridevirtual |
Inform the account that the network status has changed.
Reimplemented from jami::Account.
Definition at line 2515 of file jamiaccount.cpp.
References JAMI_WARN.
|
inline |
Definition at line 127 of file jamiaccount.h.
References jami::Account::config_, and jami::emitSignal().
ConversationModule * jami::JamiAccount::convModule | ( | bool | noCreation = false | ) |
Used to get the instance of the ConversationModule class which is responsible for managing conversations and messages between users.
noCreate | whether or not to create a new instance |
Definition at line 2244 of file jamiaccount.cpp.
References JAMI_ERROR.
std::string_view jami::JamiAccount::currentDeviceId | ( | ) | const |
Definition at line 4235 of file jamiaccount.cpp.
std::shared_ptr< TransferManager > jami::JamiAccount::dataTransfer | ( | const std::string & | id = "" | ) |
Retrieve linked transfer manager.
id | conversationId or empty for fallback |
Definition at line 4243 of file jamiaccount.cpp.
Definition at line 3005 of file jamiaccount.cpp.
References libjami::Account::TrustRequest::CONVERSATIONID, and JAMI_DEBUG.
|
inline |
Definition at line 387 of file jamiaccount.h.
Definition at line 2985 of file jamiaccount.cpp.
References libjami::Account::TrustRequest::CONVERSATIONID, libjami::Account::TrustRequest::FROM, and JAMI_WARNING.
|
overridevirtual |
Connect to the DHT.
Implements jami::Account.
Definition at line 1683 of file jamiaccount.cpp.
References JAMI_LOG, and JAMI_WARNING.
Disconnect from the DHT.
Implements jami::Account.
Definition at line 2429 of file jamiaccount.cpp.
References jami::Manager::instance(), JAMI_WARN, and jami::PEER_DISCOVERY_JAMI_SERVICE.
|
inline |
Definition at line 425 of file jamiaccount.h.
References jami::Account::editConfig(), and jami::emitSignal().
bool jami::JamiAccount::exportArchive | ( | const std::string & | destinationPath, |
std::string_view | scheme = {} , |
||
const std::string & | password = {} |
||
) |
Export the archive to a file.
destinationPath | |
(optional) | password, if not provided, will update the contacts only if the archive doesn't have a password |
Definition at line 1053 of file jamiaccount.cpp.
bool jami::JamiAccount::findCertificate | ( | const dht::InfoHash & | h, |
std::function< void(const std::shared_ptr< dht::crypto::Certificate > &)> && | cb = {} |
||
) |
Definition at line 2537 of file jamiaccount.cpp.
bool jami::JamiAccount::findCertificate | ( | const dht::PkId & | h, |
std::function< void(const std::shared_ptr< dht::crypto::Certificate > &)> && | cb = {} |
||
) |
Definition at line 2547 of file jamiaccount.cpp.
Definition at line 2556 of file jamiaccount.cpp.
|
overridevirtual |
This method is called to request removal of possible account traces on the system, like internal account setup files.
Reimplemented from jami::SIPAccountBase.
Definition at line 297 of file jamiaccount.cpp.
References jami::SIPAccountBase::flush(), and jami::Account::idPath_.
void jami::JamiAccount::forceReloadAccount | ( | ) |
Try to reload the account to force the identity to be updated.
Definition at line 1079 of file jamiaccount.cpp.
References jami::JamiAccountConfig::receipt, and jami::JamiAccountConfig::receiptSignature.
void jami::JamiAccount::forEachDevice | ( | const dht::InfoHash & | to, |
std::function< void(const std::shared_ptr< dht::crypto::PublicKey > &)> && | op, | ||
std::function< void(bool)> && | end = {} |
||
) |
Definition at line 3068 of file jamiaccount.cpp.
|
inlineoverridevirtual |
std::vector< std::string > jami::JamiAccount::getCertificatesByStatus | ( | dhtnet::tls::TrustStore::PermissionStatus | status | ) |
Definition at line 2592 of file jamiaccount.cpp.
std::vector< std::map< std::string, std::string > > jami::JamiAccount::getChannelList | ( | const std::string & | connectionId | ) |
Definition at line 4287 of file jamiaccount.cpp.
std::vector< std::map< std::string, std::string > > jami::JamiAccount::getConnectionList | ( | const std::string & | conversationId = "" | ) |
Definition at line 4264 of file jamiaccount.cpp.
std::map< std::string, std::string > jami::JamiAccount::getContactDetails | ( | const std::string & | uri | ) | const |
Obtain details about one account contact in serializable form.
Definition at line 2930 of file jamiaccount.cpp.
std::string jami::JamiAccount::getContactHeader | ( | const std::shared_ptr< SipTransport > & | sipTransport | ) |
Get the contact header for.
Definition at line 2880 of file jamiaccount.cpp.
References jami::tls::AbstractSIPTransport::getLocalAddress(), JAMI_ERR, and jami::tls::AbstractSIPTransport::TransportData::self.
Referenced by newIncomingCall().
Definition at line 2938 of file jamiaccount.cpp.
std::vector< std::map< std::string, std::string > > jami::JamiAccount::getContacts | ( | bool | includeRemoved = false | ) | const |
Definition at line 2945 of file jamiaccount.cpp.
|
overridevirtual |
Implements jami::Account.
Definition at line 2794 of file jamiaccount.cpp.
|
overridevirtual |
Create and return ICE options.
Reimplemented from jami::SIPAccountBase.
Definition at line 3392 of file jamiaccount.cpp.
void jami::JamiAccount::getIceOptions | ( | std::function< void(dhtnet::IceTransportOptions &&)> | cb | ) | const |
Definition at line 3398 of file jamiaccount.cpp.
std::map< std::string, std::string > jami::JamiAccount::getKnownDevices | ( | ) | const |
Definition at line 2621 of file jamiaccount.cpp.
|
overridevirtual |
Get last messages (should be used to retrieve messages when launching the client)
base_timestamp |
Reimplemented from jami::Account.
Definition at line 3470 of file jamiaccount.cpp.
|
overridevirtual |
Get current discovered peers account id and display name.
Reimplemented from jami::Account.
Definition at line 3529 of file jamiaccount.cpp.
Definition at line 1001 of file jamiaccount.cpp.
|
overridevirtual |
Reimplemented from jami::SIPAccountBase.
Definition at line 3404 of file jamiaccount.cpp.
|
inline |
In the current version, "srv" uri is obtained in the preformated way: hostname:port.
This method adds the correct scheme and append the ;transport= parameter at the end of the uri, in accordance with RFC3261.
hostPort | |
hostPort | A string formatted as : "hostname:port" |
Definition at line 219 of file jamiaccount.h.
Implements jami::SIPAccountBase.
Definition at line 270 of file jamiaccount.h.
|
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_.
username | |
username | A string formatted as : "username" |
Implements jami::SIPAccountBase.
Definition at line 2803 of file jamiaccount.cpp.
References jami::string_replace().
std::map< std::string, bool > jami::JamiAccount::getTrackedBuddyPresence | ( | ) | const |
Tells for each tracked account id if it has been seen online so far in the last DeviceAnnouncement::TYPE.expiration minutes.
Definition at line 1810 of file jamiaccount.cpp.
std::vector< std::map< std::string, std::string > > jami::JamiAccount::getTrustRequests | ( | ) | const |
Definition at line 2956 of file jamiaccount.cpp.
|
overridevirtual |
Implements jami::SIPAccountBase.
Definition at line 3460 of file jamiaccount.cpp.
References jami::JAMI_URI_PREFIX.
|
overridevirtual |
Retrieve volatile details such as recent registration errors.
Reimplemented from jami::SIPAccountBase.
Definition at line 1465 of file jamiaccount.cpp.
References libjami::Account::VolatileProperties::DEVICE_ANNOUNCED, libjami::Account::ConfProperties::DEVICE_ID, libjami::Account::VolatileProperties::DHT_BOUND_PORT, libjami::Account::VolatileProperties::InstantMessaging::OFF_CALL, libjami::Account::ConfProperties::PROXY_SERVER, and libjami::Account::VolatileProperties::REGISTERED_NAME.
void jami::JamiAccount::handleIncomingConversationCall | ( | const std::string & | callId, |
const std::string & | destination | ||
) |
Join incoming call to hosted conference.
callId | The call to join |
destination | conversation/uri/device/confId to join |
Definition at line 478 of file jamiaccount.cpp.
References libjami::Media::MediaAttributeValue::AUDIO, libjami::Media::MediaAttributeKey::ENABLED, JAMI_DEBUG, JAMI_ERROR, libjami::Media::MediaAttributeKey::LABEL, libjami::Media::MediaAttributeKey::MEDIA_TYPE, libjami::Media::MediaAttributeKey::MUTED, libjami::Media::MediaAttributeKey::SOURCE, jami::split_string(), and libjami::Media::MediaAttributeValue::VIDEO.
|
overridevirtual |
Reimplemented from jami::Account.
Definition at line 3664 of file jamiaccount.cpp.
References libjami::Account::DISPLAYED, JAMI_DEBUG, JAMI_ERROR, JAMI_WARNING, jami::MIME_TYPE_IMDN, jami::MIME_TYPE_INVITE_JSON, jami::MIME_TYPE_PIDF, and std::regex_search().
|
inline |
Definition at line 389 of file jamiaccount.h.
Check if a Device is connected.
deviceId |
Definition at line 3938 of file jamiaccount.cpp.
bool jami::JamiAccount::isMessageTreated | ( | dht::Value::Id | id | ) |
Definition at line 2600 of file jamiaccount.cpp.
|
inline |
The DRT component is composed on some special nodes, that are usually present but not connected.
This kind of node corresponds to devices with push notifications & proxy and are stored in the mobile nodes
Definition at line 600 of file jamiaccount.h.
References config(), jami::AccountConfig::deviceKey, jami::emitSignal(), and jami::JamiAccountConfig::proxyEnabled.
Definition at line 995 of file jamiaccount.cpp.
|
inlineoverridevirtual |
Implements jami::SIPAccountBase.
Definition at line 268 of file jamiaccount.h.
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 267 of file jamiaccount.h.
Definition at line 1108 of file jamiaccount.cpp.
|
overridevirtual |
Load the settings in this account.
Reimplemented from jami::Account.
Definition at line 925 of file jamiaccount.cpp.
References JAMI_LOG.
Definition at line 2422 of file jamiaccount.cpp.
|
overridevirtual |
Implements jami::SIPAccountBase.
Definition at line 2778 of file jamiaccount.cpp.
References JAMI_LOG.
void jami::JamiAccount::monitor | ( | ) |
Definition at line 4251 of file jamiaccount.cpp.
References JAMI_DEBUG.
bool jami::JamiAccount::needToSendProfile | ( | const std::string & | peerUri, |
const std::string & | deviceId, | ||
const std::string & | sha3Sum | ||
) |
Check (via the cache) if we need to send our profile to a specific device.
peerUri | Uri that will receive the profile |
deviceId | Device that will receive the profile |
sha3Sum | SHA3 hash of the profile |
Definition at line 4014 of file jamiaccount.cpp.
|
overridevirtual |
Create incoming SIPCall.
[in] | from | The origin of the call |
mediaList | A list of media | |
sipTr | SIP Transport |
Implements jami::SIPAccountBase.
Definition at line 308 of file jamiaccount.cpp.
References jami::Manager::callFactory, jami::emitSignal(), getContactHeader(), jami::Call::INCOMING, jami::Manager::instance(), JAMI_DEBUG, JAMI_ERR, jami::JAMI_URI_PREFIX, jami::CallFactory::newSipCall(), and shared().
|
overridevirtual |
Create outgoing SIPCall.
[in] | toUrl | The address to call |
[in] | mediaList | list of medias |
Implements jami::Account.
Definition at line 331 of file jamiaccount.cpp.
References jami::SIPAccountBase::createDefaultMediaList(), jami::emitSignal(), jami::Manager::instance(), jami::Account::isVideoEnabled(), JAMI_DBG, JAMI_WARN, jami::MediaAttribute::mediaAttributesToMediaMaps(), jami::Call::OUTGOING, jami::Uri::RENDEZVOUS, shared(), jami::Uri::SWARM, and weak().
|
overridevirtual |
Reimplemented from jami::SIPAccountBase.
Definition at line 2409 of file jamiaccount.cpp.
References jami::parseJamiUri().
std::filesystem::path jami::JamiAccount::profilePath | ( | ) | const |
Definition at line 4138 of file jamiaccount.cpp.
bool jami::JamiAccount::provideAccountAuthentication | ( | const std::string & | credentialsFromUser, |
const std::string & | scheme | ||
) |
Definition at line 1007 of file jamiaccount.cpp.
References JAMI_ERR.
void jami::JamiAccount::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 3450 of file jamiaccount.cpp.
void jami::JamiAccount::reloadContacts | ( | ) |
Definition at line 2509 of file jamiaccount.cpp.
Definition at line 2920 of file jamiaccount.cpp.
References JAMI_WARNING.
bool jami::JamiAccount::revokeDevice | ( | const std::string & | device, |
std::string_view | scheme = {} , |
||
const std::string & | password = {} |
||
) |
Definition at line 1120 of file jamiaccount.cpp.
|
overridevirtual |
Reimplemented from jami::Account.
Definition at line 909 of file jamiaccount.cpp.
References JAMI_ERROR, and JAMI_LOG.
Definition at line 1552 of file jamiaccount.cpp.
References jami::emitSignal().
void jami::JamiAccount::sendFile | ( | const std::string & | conversationId, |
const std::filesystem::path & | path, | ||
const std::string & | name, | ||
const std::string & | replyTo | ||
) |
Definition at line 4296 of file jamiaccount.cpp.
References JAMI_ERROR.
void jami::JamiAccount::sendInstantMessage | ( | const std::string & | convId, |
const std::map< std::string, std::string > & | msg | ||
) |
Definition at line 3646 of file jamiaccount.cpp.
|
overridevirtual |
Track sending state for a single message to one or more devices.
Track new pending message for device
Call after all messages are sent
Complete pending message for device
Implements jami::SIPAccountBase.
Definition at line 3103 of file jamiaccount.cpp.
References jami::ctx::acc, JAMI_ERROR, and jami::parseJamiUri().
Send a presence note.
note |
Definition at line 3947 of file jamiaccount.cpp.
References jami::MessageChannelHandler::getChannels(), jami::getPIDF(), and jami::MIME_TYPE_PIDF.
void jami::JamiAccount::sendProfile | ( | const std::string & | convId, |
const std::string & | peerUri, | ||
const std::string & | deviceId | ||
) |
Send Profile via cached SIP connection.
convId | Conversation's identifier (can be empty for self profile on sync) |
peerUri | Uri that will receive the profile |
deviceId | Device that will receive the profile |
Definition at line 3978 of file jamiaccount.cpp.
References JAMI_DEBUG.
Send profile via cached SIP connection.
peerUri | Uri that will receive the profile |
deviceId | Device that will receive the profile |
void jami::JamiAccount::sendProfileToPeers | ( | ) |
Definition at line 3535 of file jamiaccount.cpp.
References jami::AccountPeerInfo::accountId.
|
overridevirtual |
If supported, send a text message from this account.
Reimplemented from jami::SIPAccountBase.
Definition at line 3076 of file jamiaccount.cpp.
References jami::Uri::authority(), JAMI_ERROR, jami::parseJamiUri(), and jami::Uri::scheme().
void jami::JamiAccount::sendTrustRequest | ( | const std::string & | to, |
const std::vector< uint8_t > & | payload | ||
) |
Definition at line 3026 of file jamiaccount.cpp.
References JAMI_ERROR, JAMI_WARN, and JAMI_WARNING.
Update both the codec order structure and the codec string used for SDP offer and configuration respectively.
Reimplemented from jami::Account.
Definition at line 3632 of file jamiaccount.cpp.
References jami::MEDIA_ALL, jami::MEDIA_AUDIO, and jami::MEDIA_VIDEO.
bool jami::JamiAccount::setCertificateStatus | ( | const std::shared_ptr< crypto::Certificate > & | cert, |
dhtnet::tls::TrustStore::PermissionStatus | status, | ||
bool | local = true |
||
) |
Definition at line 2577 of file jamiaccount.cpp.
bool jami::JamiAccount::setCertificateStatus | ( | const std::string & | cert_id, |
dhtnet::tls::TrustStore::PermissionStatus | status | ||
) |
Definition at line 2564 of file jamiaccount.cpp.
|
overridevirtual |
Reimplemented from jami::Account.
Definition at line 2840 of file jamiaccount.cpp.
References jami::Uri::authority(), and jami::Uri::scheme().
|
overridevirtual |
Reimplemented from jami::Account.
Definition at line 2861 of file jamiaccount.cpp.
References jami::Uri::authority(), libjami::Account::DISPLAYED, and jami::Uri::scheme().
|
overridevirtual |
Reimplemented from jami::Account.
Definition at line 3433 of file jamiaccount.cpp.
|
overridevirtual |
Reimplemented from jami::Account.
Definition at line 3410 of file jamiaccount.cpp.
References JAMI_WARNING.
Reimplemented from jami::Account.
Definition at line 3422 of file jamiaccount.cpp.
|
overridevirtual |
Set the registration state of the specified link.
state | The registration state of underlying VoIPLink |
Reimplemented from jami::SIPAccountBase.
Definition at line 2487 of file jamiaccount.cpp.
References JAMI_WARNING.
bool jami::JamiAccount::setValidity | ( | std::string_view | scheme, |
const std::string & | pwd, | ||
const dht::InfoHash & | id, | ||
int64_t | validity | ||
) |
Change certificate's validity period.
pwd | Password for the archive |
id | Certificate to update ({} for updating the whole chain) |
validity | New validity |
Definition at line 1064 of file jamiaccount.cpp.
References jami::DEVICE_ID_PATH.
bool jami::JamiAccount::sha3SumVerify | ( | ) | const |
Definition at line 2607 of file jamiaccount.cpp.
|
inline |
Definition at line 105 of file jamiaccount.h.
References jami::emitSignal().
Referenced by newIncomingCall(), and newOutgoingCall().
|
inline |
Definition at line 109 of file jamiaccount.h.
References jami::emitSignal().
void jami::JamiAccount::shutdownConnections | ( | ) |
This should be called before flushing the account.
ConnectionManager needs the account to exists
Definition at line 269 of file jamiaccount.cpp.
References jami::emitSignal(), jami::Account::getAccountID(), and JAMI_DBG.
void jami::JamiAccount::startAccountDiscovery | ( | ) |
Start Discovery the Jami Account from the Network.
Definition at line 3485 of file jamiaccount.cpp.
References JAMI_INFO, JAMI_LOG, jami::PEER_DISCOVERY_EXPIRATION, and jami::PEER_DISCOVERY_JAMI_SERVICE.
void jami::JamiAccount::startAccountPublish | ( | ) |
Start Publish the Jami Account onto the Network.
Definition at line 3476 of file jamiaccount.cpp.
References jami::AccountPeerInfo::accountId, jami::AccountPeerInfo::displayName, and jami::PEER_DISCOVERY_JAMI_SERVICE.
SyncModule * jami::JamiAccount::syncModule | ( | ) |
Definition at line 2396 of file jamiaccount.cpp.
References JAMI_ERR.
Adds an account id to the list of accounts to track on the DHT for buddy presence.
buddy_id | The buddy id. |
Definition at line 1724 of file jamiaccount.cpp.
References JAMI_ERROR, JAMI_LOG, and jami::parseJamiUri().
void jami::JamiAccount::transferFile | ( | const std::string & | conversationId, |
const std::string & | path, | ||
const std::string & | deviceId, | ||
const std::string & | fileId, | ||
const std::string & | interactionId, | ||
size_t | start = 0 , |
||
size_t | end = 0 , |
||
const std::string & | sha3Sum = "" , |
||
uint64_t | lastWriteTime = 0 , |
||
std::function< void()> | onFinished = {} |
||
) |
Definition at line 4376 of file jamiaccount.cpp.
Make sure appdata/contacts.yml contains correct information.
removedConv | The current removed conversations |
Definition at line 1089 of file jamiaccount.cpp.
References JAMI_WARNING.
|
overridevirtual |
Update the profile vcard and send it to peers.
displayName | Current or new display name |
avatar | Current or new avatar |
flag | 0 for path to avatar, 1 for base64 avatar |
Implements jami::Account.
Definition at line 3559 of file jamiaccount.cpp.
References jami::AccountConfig::displayName, vCard::utils::initVcard(), JAMI_ERROR, vCard::utils::removeByKey(), and vCard::utils::toString().
|
inline |
Definition at line 113 of file jamiaccount.h.
References jami::emitSignal().
Referenced by newOutgoingCall().
|
inline |
Definition at line 117 of file jamiaccount.h.
References jami::emitSignal().
|
staticconstexpr |
Definition at line 98 of file jamiaccount.h.
Referenced by jami::AccountFactory::AccountFactory(), getAccountType(), jami::Manager::loadAccountAndConversation(), and jami::Manager::loadAccountMap().
|
staticconstexpr |
Definition at line 99 of file jamiaccount.h.
Definition at line 101 of file jamiaccount.h.
Definition at line 100 of file jamiaccount.h.