Ring Daemon 16.0.0
Loading...
Searching...
No Matches
sipaccount_config.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
19
20namespace jami {
21constexpr static std::string_view ACCOUNT_TYPE_SIP = "SIP";
22
24 SipAccountConfig(const std::string& id = {}, const std::filesystem::path& path = {}): SipAccountBaseConfig(std::string(ACCOUNT_TYPE_SIP), id, path) {}
25 void serialize(YAML::Emitter& out) const override;
26 void unserialize(const YAML::Node& node) override;
27 std::map<std::string, std::string> toMap() const override;
28 void fromMap(const std::map<std::string, std::string>&) override;
29
34
38 std::string bindAddress {};
39
44
48 std::string interface {dhtnet::ip_utils::DEFAULT_INTERFACE};
49
54 bool stunEnabled {false};
55
60 std::string stunServer {};
61
65 unsigned registrationExpire {3600};
67
68 // If true, the contact addreass and header will be rewritten
69 // using the information received from the registrar.
70 bool allowIPAutoRewrite {true};
71
75 std::string serviceRoute;
76
81 bool tlsEnable {false};
82 std::string tlsMethod;
83 std::string tlsCiphers;
84 std::string tlsServerName;
85 bool tlsVerifyServer {true};
86 bool tlsVerifyClient {true};
90
96 bool srtpFallback {false};
102
103 bool presenceEnabled {false};
104 bool publishSupported {false};
105 bool subscribeSupported {false};
106
111 {
112 std::string realm {};
113 std::string username {};
114 std::string password {};
115 std::string password_h {};
116 Credentials(const std::string& r, const std::string& u, const std::string& p)
117 : realm(r)
118 , username(u)
119 , password(p)
120 {}
121 Credentials(const std::map<std::string, std::string>& r);
122 std::map<std::string, std::string> toMap() const;
123 void computePasswordHash();
124 };
125 std::vector<Credentials> credentials;
126 std::vector<std::map<std::string, std::string>> getCredentials() const;
127 void setCredentials(const std::vector<std::map<std::string, std::string>>& creds);
128};
129
130}
static constexpr int DEFAULT_SIP_TLS_PORT
Definition sip_utils.h:54
static constexpr int DEFAULT_SIP_PORT
Definition sip_utils.h:53
void emitSignal(Args... args)
Definition ring_signal.h:64
KeyExchangeProtocol
Definition media_codec.h:36
static constexpr std::string_view ACCOUNT_TYPE_SIP
const std::filesystem::path path
Path where the configuration file is stored.
const std::string id
Account id.
Map of credential for this account.
Credentials(const std::string &r, const std::string &u, const std::string &p)
std::map< std::string, std::string > toMap() const
uint16_t publishedPort
Published port, used only if defined by the user.
std::string stunServer
The STUN server hostname (optional), used to provide the public IP address in case the softphone stay...
SipAccountConfig(const std::string &id={}, const std::filesystem::path &path={})
void unserialize(const YAML::Node &node) override
bool srtpFallback
Determine if the softphone should fallback on non secured media channel if SRTP negotiation fails.
std::vector< std::map< std::string, std::string > > getCredentials() const
bool stunEnabled
Determine if STUN public address resolution is required to register this account.
uint16_t localPort
Local port to whih this account is bound.
unsigned registrationExpire
Network settings.
std::map< std::string, std::string > toMap() const override
uint16_t tlsListenerPort
The TLS listener port.
void setCredentials(const std::vector< std::map< std::string, std::string > > &creds)
void serialize(YAML::Emitter &out) const override
std::string serviceRoute
Input Outbound Proxy Server Address.
std::vector< Credentials > credentials
KeyExchangeProtocol srtpKeyExchange
Specifies the type of key exchange used for SRTP, if any.
std::string bindAddress
Potential ip addresss on which this account is bound.
void fromMap(const std::map< std::string, std::string > &) override