Ring Daemon 16.0.0
Loading...
Searching...
No Matches
callmanager_interface.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
18#ifndef LIBJAMI_CALLMANAGERI_H
19#define LIBJAMI_CALLMANAGERI_H
20
21#include "def.h"
22
23#include <stdexcept>
24#include <map>
25#include <memory>
26#include <vector>
27#include <string>
28#include <cstdint>
29
30#include "jami.h"
31
32namespace libjami {
33
34[[deprecated("Replaced by registerSignalHandlers")]] LIBJAMI_PUBLIC void registerCallHandlers(
35 const std::map<std::string, std::shared_ptr<CallbackWrapperBase>>&);
36
37/* Call related methods */
38LIBJAMI_PUBLIC std::string placeCall(const std::string& accountId, const std::string& to);
39
41 const std::string& accountId,
42 const std::string& to,
43 const std::vector<std::map<std::string, std::string>>& mediaList);
44LIBJAMI_PUBLIC bool refuse(const std::string& accountId, const std::string& callId);
45LIBJAMI_PUBLIC bool accept(const std::string& accountId, const std::string& callId);
46LIBJAMI_PUBLIC bool hangUp(const std::string& accountId, const std::string& callId);
47LIBJAMI_PUBLIC bool hold(const std::string& accountId, const std::string& callId);
48LIBJAMI_PUBLIC bool unhold(const std::string& accountId, const std::string& callId);
49LIBJAMI_PUBLIC bool muteLocalMedia(const std::string& accountId,
50 const std::string& callId,
51 const std::string& mediaType,
52 bool mute);
53LIBJAMI_PUBLIC bool transfer(const std::string& accountId,
54 const std::string& callId,
55 const std::string& to);
56LIBJAMI_PUBLIC bool attendedTransfer(const std::string& accountId,
57 const std::string& callId,
58 const std::string& targetID);
59LIBJAMI_PUBLIC std::map<std::string, std::string> getCallDetails(const std::string& accountId,
60 const std::string& callId);
61LIBJAMI_PUBLIC std::vector<std::string> getCallList(const std::string& accountId);
62
63/* APIs that supports an arbitrary number of media */
64LIBJAMI_PUBLIC bool acceptWithMedia(const std::string& accountId,
65 const std::string& callId,
66 const std::vector<libjami::MediaMap>& mediaList);
67LIBJAMI_PUBLIC bool requestMediaChange(const std::string& accountId,
68 const std::string& callId,
69 const std::vector<libjami::MediaMap>& mediaList);
70
81LIBJAMI_PUBLIC bool answerMediaChangeRequest(const std::string& accountId,
82 const std::string& callId,
83 const std::vector<libjami::MediaMap>& mediaList);
84
85/* Conference related methods */
86LIBJAMI_PUBLIC bool joinParticipant(const std::string& accountId,
87 const std::string& sel_callId,
88 const std::string& account2Id,
89 const std::string& drag_callId);
90LIBJAMI_PUBLIC void createConfFromParticipantList(const std::string& accountId,
91 const std::vector<std::string>& participants);
92LIBJAMI_PUBLIC void setConferenceLayout(const std::string& accountId,
93 const std::string& confId,
94 uint32_t layout);
95LIBJAMI_PUBLIC bool isConferenceParticipant(const std::string& accountId, const std::string& callId);
96LIBJAMI_PUBLIC bool addParticipant(const std::string& accountId,
97 const std::string& callId,
98 const std::string& account2Id,
99 const std::string& confId);
100LIBJAMI_PUBLIC bool addMainParticipant(const std::string& accountId, const std::string& confId);
102LIBJAMI_PUBLIC bool detachParticipant(const std::string& accountId, const std::string& callId);
103LIBJAMI_PUBLIC bool joinConference(const std::string& accountId,
104 const std::string& sel_confId,
105 const std::string& account2Id,
106 const std::string& drag_confId);
107LIBJAMI_PUBLIC bool hangUpConference(const std::string& accountId, const std::string& confId);
108LIBJAMI_PUBLIC bool holdConference(const std::string& accountId, const std::string& confId);
109LIBJAMI_PUBLIC bool unholdConference(const std::string& accountId, const std::string& confId);
110LIBJAMI_PUBLIC std::vector<std::string> getConferenceList(const std::string& accountId);
111LIBJAMI_PUBLIC std::vector<std::string> getParticipantList(const std::string& accountId,
112 const std::string& confId);
113LIBJAMI_PUBLIC std::string getConferenceId(const std::string& accountId, const std::string& callId);
114LIBJAMI_PUBLIC std::map<std::string, std::string> getConferenceDetails(const std::string& accountId,
115 const std::string& callId);
116LIBJAMI_PUBLIC std::vector<libjami::MediaMap> currentMediaList(const std::string& accountId,
117 const std::string& callId);
118LIBJAMI_PUBLIC std::vector<std::map<std::string, std::string>> getConferenceInfos(
119 const std::string& accountId, const std::string& confId);
120LIBJAMI_PUBLIC void setModerator(const std::string& accountId,
121 const std::string& confId,
122 const std::string& accountUri,
123 const bool& state);
125LIBJAMI_PUBLIC void muteParticipant(const std::string& accountId,
126 const std::string& confId,
127 const std::string& accountUri,
128 const bool& state);
129// Note: muting Audio not supported yet
130LIBJAMI_PUBLIC void muteStream(const std::string& accountId,
131 const std::string& confId,
132 const std::string& accountUri,
133 const std::string& deviceId,
134 const std::string& streamId,
135 const bool& state);
137LIBJAMI_PUBLIC void setActiveParticipant(const std::string& accountId,
138 const std::string& confId,
139 const std::string& callId);
140LIBJAMI_PUBLIC void setActiveStream(const std::string& accountId,
141 const std::string& confId,
142 const std::string& accountUri,
143 const std::string& deviceId,
144 const std::string& streamId,
145 const bool& state);
146LIBJAMI_PUBLIC void hangupParticipant(const std::string& accountId,
147 const std::string& confId,
148 const std::string& accountUri,
149 const std::string& deviceId);
151LIBJAMI_PUBLIC void raiseParticipantHand(const std::string& accountId,
152 const std::string& confId,
153 const std::string& peerId,
154 const bool& state);
155LIBJAMI_PUBLIC void raiseHand(const std::string& accountId,
156 const std::string& confId,
157 const std::string& accountUri,
158 const std::string& deviceId,
159 const bool& state);
160
161/* Statistic related methods */
162LIBJAMI_PUBLIC void startSmartInfo(uint32_t refreshTimeMs);
164
165/* File Playback methods */
166LIBJAMI_PUBLIC bool startRecordedFilePlayback(const std::string& filepath);
168
169/* General audio methods */
170LIBJAMI_PUBLIC bool toggleRecording(const std::string& accountId, const std::string& callId);
171/* DEPRECATED */
172LIBJAMI_PUBLIC void setRecording(const std::string& accountId, const std::string& callId);
173
174LIBJAMI_PUBLIC void recordPlaybackSeek(double value);
175LIBJAMI_PUBLIC bool getIsRecording(const std::string& accountId, const std::string& callId);
176LIBJAMI_PUBLIC void playDTMF(const std::string& key);
177LIBJAMI_PUBLIC void startTone(int32_t start, int32_t type);
178
179LIBJAMI_PUBLIC bool switchInput(const std::string& accountId,
180 const std::string& callId,
181 const std::string& resource);
182LIBJAMI_PUBLIC bool switchSecondaryInput(const std::string& accountId,
183 const std::string& confId,
184 const std::string& resource);
185
186/* Instant messaging */
187LIBJAMI_PUBLIC void sendTextMessage(const std::string& accountId,
188 const std::string& callId,
189 const std::map<std::string, std::string>& messages,
190 const std::string& from,
191 bool isMixed);
192
193// Call signal type definitions
195{
197 {
198 constexpr static const char* name = "StateChange";
199 using cb_type = void(const std::string&, const std::string&, const std::string&, int);
200 };
202 {
203 constexpr static const char* name = "TransferFailed";
204 using cb_type = void(void);
205 };
207 {
208 constexpr static const char* name = "TransferSucceeded";
209 using cb_type = void(void);
210 };
212 {
213 constexpr static const char* name = "RecordPlaybackStopped";
214 using cb_type = void(const std::string&);
215 };
217 {
218 constexpr static const char* name = "VoiceMailNotify";
219 using cb_type = void(const std::string&, int32_t, int32_t, int32_t);
220 };
222 {
223 constexpr static const char* name = "IncomingMessage";
224 using cb_type = void(const std::string&,
225 const std::string&,
226 const std::string&,
227 const std::map<std::string, std::string>&);
228 };
230 {
231 constexpr static const char* name = "IncomingCall";
232 using cb_type = void(const std::string&, const std::string&, const std::string&);
233 };
235 {
236 constexpr static const char* name = "IncomingCallWithMedia";
237 using cb_type = void(const std::string&,
238 const std::string&,
239 const std::string&,
240 const std::vector<std::map<std::string, std::string>>&);
241 };
243 {
244 constexpr static const char* name = "MediaChangeRequested";
245 using cb_type = void(const std::string&,
246 const std::string&,
247 const std::vector<std::map<std::string, std::string>>&);
248 };
250 {
251 constexpr static const char* name = "RecordPlaybackFilepath";
252 using cb_type = void(const std::string&, const std::string&);
253 };
255 {
256 constexpr static const char* name = "ConferenceCreated";
257 using cb_type = void(const std::string&, const std::string&, const std::string&);
258 };
260 {
261 constexpr static const char* name = "ConferenceChanged";
262 using cb_type = void(const std::string&, const std::string&, const std::string&);
263 };
265 {
266 constexpr static const char* name = "UpdatePlaybackScale";
267 using cb_type = void(const std::string&, unsigned, unsigned);
268 };
270 {
271 constexpr static const char* name = "ConferenceRemoved";
272 using cb_type = void(const std::string&, const std::string&);
273 };
275 {
276 constexpr static const char* name = "RecordingStateChanged";
277 using cb_type = void(const std::string&, int);
278 };
280 {
281 constexpr static const char* name = "RtcpReportReceived";
282 using cb_type = void(const std::string&, const std::map<std::string, int>&);
283 };
285 {
286 constexpr static const char* name = "PeerHold";
287 using cb_type = void(const std::string&, bool);
288 };
290 {
291 constexpr static const char* name = "VideoMuted";
292 using cb_type = void(const std::string&, bool);
293 };
295 {
296 constexpr static const char* name = "AudioMuted";
297 using cb_type = void(const std::string&, bool);
298 };
300 {
301 constexpr static const char* name = "SmartInfo";
302 using cb_type = void(const std::map<std::string, std::string>&);
303 };
305 {
306 constexpr static const char* name = "ConnectionUpdate";
307 using cb_type = void(const std::string&, int);
308 };
310 {
311 constexpr static const char* name = "OnConferenceInfosUpdated";
312 using cb_type = void(const std::string&,
313 const std::vector<std::map<std::string, std::string>>&);
314 };
316 {
317 constexpr static const char* name = "RemoteRecordingChanged";
318 using cb_type = void(const std::string&, const std::string&, bool);
319 };
320 // Report media negotiation status
322 {
323 constexpr static const char* name = "MediaNegotiationStatus";
324 using cb_type = void(const std::string&,
325 const std::string&,
326 const std::vector<std::map<std::string, std::string>>&);
327 };
328};
329
330} // namespace libjami
331
332#endif // LIBJAMI_CALLMANAGERI_H
#define LIBJAMI_PUBLIC
Definition def.h:42
void muteParticipant(const std::string &accountId, const std::string &confId, const std::string &peerId, const bool &state)
DEPRECATED USE muteStream.
LIBJAMI_PUBLIC bool start(const std::filesystem::path &config_file={}) noexcept
Start asynchronously daemon created by init().
Definition ring_api.cpp:81
bool unholdConference(const std::string &accountId, const std::string &confId)
void playDTMF(const std::string &key)
bool accept(const std::string &accountId, const std::string &callId)
bool transfer(const std::string &accountId, const std::string &callId, const std::string &to)
std::map< std::string, std::string > getCallDetails(const std::string &accountId, const std::string &callId)
bool switchInput(const std::string &accountId, const std::string &callId, const std::string &resource)
bool startRecordedFilePlayback(const std::string &filepath)
bool holdConference(const std::string &accountId, const std::string &confId)
std::string placeCallWithMedia(const std::string &accountId, const std::string &to, const std::vector< libjami::MediaMap > &mediaList)
bool addParticipant(const std::string &accountId, const std::string &callId, const std::string &account2Id, const std::string &confId)
void setActiveParticipant(const std::string &accountId, const std::string &confId, const std::string &participant)
DEPRECATED, USE setActiveStream.
bool hangUpConference(const std::string &accountId, const std::string &confId)
void raiseHand(const std::string &accountId, const std::string &confId, const std::string &accountUri, const std::string &deviceId, const bool &state)
bool detachLocalParticipant()
void setModerator(const std::string &accountId, const std::string &confId, const std::string &peerId, const bool &state)
void stopRecordedFilePlayback()
void muteStream(const std::string &accountId, const std::string &confId, const std::string &accountUri, const std::string &deviceId, const std::string &streamId, const bool &state)
bool acceptWithMedia(const std::string &accountId, const std::string &callId, const std::vector< libjami::MediaMap > &mediaList)
bool getIsRecording(const std::string &accountId, const std::string &callId)
bool hangUp(const std::string &accountId, const std::string &callId)
bool requestMediaChange(const std::string &accountId, const std::string &callId, const std::vector< libjami::MediaMap > &mediaList)
bool isConferenceParticipant(const std::string &accountId, const std::string &callId)
void startSmartInfo(uint32_t refreshTimeMs)
std::string getConferenceId(const std::string &accountId, const std::string &callId)
bool hold(const std::string &accountId, const std::string &callId)
void stopSmartInfo()
std::string placeCall(const std::string &accountId, const std::string &to)
bool switchSecondaryInput(const std::string &accountId, const std::string &confId, const std::string &resource)
std::map< std::string, std::string > getConferenceDetails(const std::string &accountId, const std::string &confId)
void raiseParticipantHand(const std::string &accountId, const std::string &confId, const std::string &peerId, const bool &state)
DEPRECATED, use raiseHand.
void setConferenceLayout(const std::string &accountId, const std::string &confId, uint32_t layout)
bool unhold(const std::string &accountId, const std::string &callId)
void registerCallHandlers(const std::map< std::string, std::shared_ptr< CallbackWrapperBase > > &handlers)
std::vector< std::string > getConferenceList(const std::string &accountId)
bool addMainParticipant(const std::string &accountId, const std::string &confId)
bool toggleRecording(const std::string &accountId, const std::string &callId)
std::vector< std::string > getParticipantList(const std::string &accountId, const std::string &confId)
std::vector< std::map< std::string, std::string > > currentMediaList(const std::string &accountId, const std::string &callId)
void hangupParticipant(const std::string &accountId, const std::string &confId, const std::string &accountUri, const std::string &deviceId)
void recordPlaybackSeek(double value)
void createConfFromParticipantList(const std::string &accountId, const std::vector< std::string > &participants)
bool detachParticipant(const std::string &, const std::string &callId)
bool answerMediaChangeRequest(const std::string &accountId, const std::string &callId, const std::vector< libjami::MediaMap > &mediaList)
Answer a media change request.
bool attendedTransfer(const std::string &accountId, const std::string &transferID, const std::string &targetID)
bool muteLocalMedia(const std::string &accountId, const std::string &callId, const std::string &mediaType, bool mute)
void startTone(int32_t start, int32_t type)
bool joinConference(const std::string &accountId, const std::string &sel_confId, const std::string &account2Id, const std::string &drag_confId)
void setRecording(const std::string &accountId, const std::string &callId)
std::vector< std::string > getCallList()
bool refuse(const std::string &accountId, const std::string &callId)
void sendTextMessage(const std::string &accountId, const std::string &callId, const std::map< std::string, std::string > &messages, const std::string &from, bool isMixed)
bool joinParticipant(const std::string &accountId, const std::string &sel_callId, const std::string &account2Id, const std::string &drag_callId)
void setActiveStream(const std::string &accountId, const std::string &confId, const std::string &accountUri, const std::string &deviceId, const std::string &streamId, const bool &state)
std::vector< std::map< std::string, std::string > > getConferenceInfos(const std::string &accountId, const std::string &confId)
void(const std::string &, bool) cb_type
void(const std::string &, const std::string &, const std::string &) cb_type
void(const std::string &, const std::string &, const std::string &) cb_type
void(const std::string &, const std::string &) cb_type
void(const std::string &, int) cb_type
void(const std::string &, const std::string &, const std::string &, const std::vector< std::map< std::string, std::string > > &) cb_type
void(const std::string &, const std::string &, const std::string &) cb_type
void(const std::string &, const std::string &, const std::string &, const std::map< std::string, std::string > &) cb_type
void(const std::string &, const std::string &, const std::vector< std::map< std::string, std::string > > &) cb_type
void(const std::string &, const std::string &, const std::vector< std::map< std::string, std::string > > &) cb_type
void(const std::string &, const std::vector< std::map< std::string, std::string > > &) cb_type
void(const std::string &, bool) cb_type
void(const std::string &, const std::string &) cb_type
void(const std::string &, const std::string &, bool) cb_type
void(const std::string &, const std::map< std::string, int > &) cb_type
void(const std::map< std::string, std::string > &) cb_type
void(const std::string &, const std::string &, const std::string &, int) cb_type
void(const std::string &, unsigned, unsigned) cb_type
void(const std::string &, bool) cb_type
void(const std::string &, int32_t, int32_t, int32_t) cb_type