35std::shared_ptr<SIPCall>
38 const std::vector<libjami::MediaMap>&
mediaList)
40 if (
not allowNewCall_) {
41 JAMI_WARN(
"Creation of new calls is not allowed");
45 std::lock_guard
lk(callMapsMutex_);
48 callMaps_[call->getLinkType()].emplace(
id, call);
56 allowNewCall_ =
false;
62 std::lock_guard
lk(callMapsMutex_);
68 JAMI_DBG(
"Remaining %zu call", map.size());
74 std::lock_guard
lk(callMapsMutex_);
85 std::lock_guard
lk(callMapsMutex_);
87 for (
const auto&
item : callMaps_) {
88 const auto& map =
item.second;
89 if (map.find(
id) != map.cend())
99 std::lock_guard
lk(callMapsMutex_);
101 for (
const auto&
item : callMaps_) {
112 std::lock_guard
lk(callMapsMutex_);
119 std::lock_guard
lk(callMapsMutex_);
121 for (
const auto&
item : callMaps_) {
122 const auto& map =
item.second;
123 const auto&
iter = map.find(
id);
124 if (
iter != map.cend())
131std::vector<std::shared_ptr<Call>>
134 std::lock_guard
lk(callMapsMutex_);
135 std::vector<std::shared_ptr<Call>> v;
137 for (
const auto&
itemmap : callMaps_) {
138 const auto& map =
itemmap.second;
139 v.reserve(v.size() + map.size());
140 for (
const auto&
item : map)
141 v.push_back(
item.second);
147std::vector<std::string>
150 std::vector<std::string> v;
152 for (
const auto&
item : callMaps_) {
153 const auto& map =
item.second;
154 for (
const auto&
it : map)
155 v.push_back(
it.first);
165 std::lock_guard
lk(callMapsMutex_);
166 std::size_t count = 0;
168 for (
const auto&
itemmap : callMaps_)
169 count +=
itemmap.second.size();
177 std::lock_guard
lk(callMapsMutex_);
179 const auto*
const map = getMap_(
link);
180 return map
and map->find(
id) != map->cend();
186 std::lock_guard
lk(callMapsMutex_);
188 const auto*
const map = getMap_(
link);
189 return !map
or map->empty();
195 std::lock_guard
lk(callMapsMutex_);
197 const auto*
const map = getMap_(
link);
201 const auto&
it = map->find(
id);
202 if (
it == map->cend())
208std::vector<std::shared_ptr<Call>>
211 std::lock_guard
lk(callMapsMutex_);
212 std::vector<std::shared_ptr<Call>> v;
214 const auto*
const map = getMap_(
link);
216 for (
const auto&
it : *map)
217 v.push_back(
it.second);
224std::vector<std::string>
227 std::lock_guard
lk(callMapsMutex_);
228 std::vector<std::string> v;
230 const auto*
const map = getMap_(
link);
232 for (
const auto&
it : *map)
233 v.push_back(
it.first);
243 std::lock_guard
lk(callMapsMutex_);
245 const auto*
const 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.