39std::shared_ptr<SIPCall>
42 const std::vector<libjami::MediaMap>&
mediaList)
44 if (
not allowNewCall_) {
45 JAMI_WARN(
"Creation of new calls is not allowed");
49 std::lock_guard
lk(callMapsMutex_);
52 callMaps_[call->getLinkType()].emplace(
id, call);
60 allowNewCall_ =
false;
66 std::lock_guard
lk(callMapsMutex_);
72 JAMI_DBG(
"Remaining %zu call", map.size());
78 std::lock_guard
lk(callMapsMutex_);
89 std::lock_guard
lk(callMapsMutex_);
91 for (
const auto&
item : callMaps_) {
92 const auto& map =
item.second;
93 if (map.find(
id) != map.cend())
103 std::lock_guard
lk(callMapsMutex_);
105 for (
const auto&
item : callMaps_) {
116 std::lock_guard
lk(callMapsMutex_);
123 std::lock_guard
lk(callMapsMutex_);
125 for (
const auto&
item : callMaps_) {
126 const auto& map =
item.second;
127 const auto&
iter = map.find(
id);
128 if (
iter != map.cend())
135std::vector<std::shared_ptr<Call>>
138 std::lock_guard
lk(callMapsMutex_);
139 std::vector<std::shared_ptr<Call>> v;
141 for (
const auto&
itemmap : callMaps_) {
142 const auto& map =
itemmap.second;
143 v.reserve(v.size() + map.size());
144 for (
const auto&
item : map)
145 v.push_back(
item.second);
151std::vector<std::string>
154 std::vector<std::string> v;
156 for (
const auto&
item : callMaps_) {
157 const auto& map =
item.second;
158 for (
const auto&
it : map)
159 v.push_back(
it.first);
169 std::lock_guard
lk(callMapsMutex_);
170 std::size_t count = 0;
172 for (
const auto&
itemmap : callMaps_)
173 count +=
itemmap.second.size();
181 std::lock_guard
lk(callMapsMutex_);
183 auto const map = getMap_(
link);
184 return map
and map->find(
id) != map->cend();
190 std::lock_guard
lk(callMapsMutex_);
192 const auto map = getMap_(
link);
193 return !map
or map->empty();
199 std::lock_guard
lk(callMapsMutex_);
201 const auto map = getMap_(
link);
205 const auto&
it = map->find(
id);
206 if (
it == map->cend())
212std::vector<std::shared_ptr<Call>>
215 std::lock_guard
lk(callMapsMutex_);
216 std::vector<std::shared_ptr<Call>> v;
218 const auto map = getMap_(
link);
220 for (
const auto&
it : *map)
221 v.push_back(
it.second);
228std::vector<std::string>
231 std::lock_guard
lk(callMapsMutex_);
232 std::vector<std::string> v;
234 const auto map = getMap_(
link);
236 for (
const auto&
it : *map)
237 v.push_back(
it.first);
247 std::lock_guard
lk(callMapsMutex_);
249 const auto map = getMap_(
link);
std::size_t callCount() const
Return number of calls.
std::vector< std::shared_ptr< Call > > getAllCalls() const
Return all calls.
std::shared_ptr< SIPCall > newSipCall(const std::shared_ptr< SIPAccountBase > &account, Call::CallType type, const std::vector< libjami::MediaMap > &mediaList)
Create a new call instance.
void forbid()
Forbid creation of new calls.
std::vector< std::string > getCallIDs() const
Return all call's IDs.
bool hasCall(const std::string &id) const
Return if given call exists.
void removeCall(Call &call)
Remove given call instance from call list.
std::shared_ptr< Call > getCall(const std::string &id) const
Return call pointer associated to given ID.Type can optionally be specified.
std::string getNewCallID() const
void clear()
Erase all calls.
bool empty() const
Return if calls exist.
virtual LinkType getLinkType() const
const std::string & getCallId() const
Return a reference on the call id.
CallType
This determines if the call originated from the local user (OUTGOING) or from some remote peer (INCOM...
void emitSignal(Args... args)
static constexpr uint64_t JAMI_ID_MAX_VAL
SIPCall are SIP implementation of a normal Call.