- clang format + naming improved

This commit is contained in:
2026-09-03 10:03:42 +03:00
parent 249e614def
commit e166bae1ea
204 changed files with 20621 additions and 21019 deletions
+35 -34
View File
@@ -22,10 +22,11 @@
class UserAgent;
class Session;
class Account: public resip::DnsResultSink
class Account : public resip::DnsResultSink
{
friend class UserAgent;
friend class NATDecorator;
public:
Account(PVariantMap config, UserAgent& agent);
~Account();
@@ -34,7 +35,7 @@ public:
void stop();
void refresh();
bool active();
int id() const;
int id() const;
enum class RegistrationState
{
@@ -47,69 +48,69 @@ public:
RegistrationState registrationState();
/* Publishes new presence information */
void publishPresence(bool online, const std::string& content, int seconds = 600);
void publishPresence(bool online, const std::string& content, int seconds = 600);
/* Stops publishing of presence */
void stopPublish();
void stopPublish();
/* Starts observing on specified target / package */
PClientObserver observe(const std::string& target, const std::string& package, void* tag);
PClientObserver observe(const std::string& target, const std::string& package, void* tag);
/* Queues message to peer with specified mime type. Returns ID of message. */
int sendMsg(const std::string& peer, const void* ptr, unsigned length, const std::string& mime, void* tag);
int sendMsg(const std::string& peer, const void* ptr, unsigned length, const std::string& mime, void* tag);
/* Returns name of account - <sip:user@domain> */
std::string name();
/* Updates account with configuration */
void setup(VariantMap& config);
void setup(VariantMap& config);
/* Returns corresponding resiprocate profile */
std::shared_ptr<resip::UserProfile> getUserProfile() const { return mProfile; }
std::shared_ptr<resip::UserProfile> getUserProfile() const { return mProfile; }
typedef std::map<std::string, std::string> UserInfo;
void setUserInfo(const UserInfo& info);
UserInfo getUserInfo() const;
void setUserInfo(const UserInfo& info);
UserInfo getUserInfo() const;
protected:
PVariantMap mConfig;
PVariantMap mConfig;
// Registration
ResipSession* mRegistration;
resip::ClientRegistrationHandle mRegistrationHandle;
resip::ClientPublicationHandle mPublication;
resip::TransportType mUsedTransport;
ResipSession* mRegistration;
resip::ClientRegistrationHandle mRegistrationHandle;
resip::ClientPublicationHandle mPublication;
resip::TransportType mUsedTransport;
RegistrationState mRegistrationState;
RegistrationState mRegistrationState;
ice::NetworkAddress mExternalAddress;
ice::NetworkAddress mExternalAddress;
std::shared_ptr<resip::UserProfile> mProfile;
UserAgent& mAgent;
bool mPresenceOnline;
std::string mPresenceContent;
UserAgent& mAgent;
bool mPresenceOnline;
std::string mPresenceContent;
// Timer to refresh STUN server IP
ice::ICEScheduleTimer mRefreshStunServerIpTimer;
ice::ICEScheduleTimer mRefreshStunServerIpTimer;
// Cached auth
resip::Auth mCachedAuth;
resip::Auth mCachedAuth;
// Id of account
int mId;
int mId;
// User info about current state
UserInfo mUserInfo;
UserInfo mUserInfo;
// List of client subscriptions sent from this account
typedef std::set<PClientObserver> ClientObserverSet;
ClientObserverSet mClientObserverSet;
typedef std::set<PClientObserver> ClientObserverSet;
ClientObserverSet mClientObserverSet;
void process();
void process();
// Method queries new stun server ip from dns (if stun server is specified as dns name)
void queryStunServerIp();
void queryStunServerIp();
bool isResponsibleFor(const resip::NameAddr& addr);
bool isResponsibleFor(const resip::NameAddr& addr);
enum class SecureScheme
{
SipsAndTls,
@@ -121,10 +122,10 @@ protected:
resip::NameAddr contact(SecureScheme ss = SecureScheme::SipsOnly);
// This method prepares configuration, creates ice stack and sets ownership to session
void prepareIceStack(Session* session, ice::AgentRole role);
void onSuccess(resip::ClientRegistrationHandle h, const resip::SipMessage& response);
void onRemoved(resip::ClientRegistrationHandle h, const resip::SipMessage& response);
void onFailure(resip::ClientRegistrationHandle, const resip::SipMessage& response);
void prepareIceStack(Session* session, ice::AgentRole role);
void onSuccess(resip::ClientRegistrationHandle h, const resip::SipMessage& response);
void onRemoved(resip::ClientRegistrationHandle h, const resip::SipMessage& response);
void onFailure(resip::ClientRegistrationHandle, const resip::SipMessage& response);
#pragma region DnsResultSink implementation
void onDnsResult(const resip::DNSResult<resip::DnsHostRecord>&);
@@ -134,7 +135,7 @@ protected:
void onDnsResult(const resip::DNSResult<resip::DnsCnameRecord>&);
#pragma endregion
static int generateId();
static int generateId();
static std::atomic_int IdGenerator;
};