Ring Daemon
Loading...
Searching...
No Matches
callmanager_interface.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2026 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 <map>
24#include <memory>
25#include <vector>
26#include <string>
27#include <cstdint>
28
29#include "jami.h"
30
31namespace libjami {
32
33[[deprecated("Replaced by registerSignalHandlers")]] LIBJAMI_PUBLIC void registerCallHandlers(
34 const std::map<std::string, std::shared_ptr<CallbackWrapperBase>>&);
35
36/* Call related methods */
37LIBJAMI_PUBLIC std::string placeCall(const std::string& accountId, const std::string& to);
38
39LIBJAMI_PUBLIC std::string placeCallWithMedia(const std::string& accountId,
40 const std::string& to,
41 const std::vector<std::map<std::string, std::string>>& mediaList);
42LIBJAMI_PUBLIC bool refuse(const std::string& accountId, const std::string& callId);
43LIBJAMI_PUBLIC bool accept(const std::string& accountId, const std::string& callId);
44LIBJAMI_PUBLIC bool hangUp(const std::string& accountId, const std::string& callId);
45LIBJAMI_PUBLIC bool hold(const std::string& accountId, const std::string& callId);
46LIBJAMI_PUBLIC bool resume(const std::string& accountId, const std::string& callId);
47LIBJAMI_PUBLIC bool muteLocalMedia(const std::string& accountId,
48 const std::string& callId,
49 const std::string& mediaType,
50 bool mute);
51LIBJAMI_PUBLIC bool transfer(const std::string& accountId, const std::string& callId, const std::string& to);
52LIBJAMI_PUBLIC bool attendedTransfer(const std::string& accountId,
53 const std::string& callId,
54 const std::string& targetID);
55LIBJAMI_PUBLIC std::map<std::string, std::string> getCallDetails(const std::string& accountId,
56 const std::string& callId);
57LIBJAMI_PUBLIC std::vector<std::string> getCallList(const std::string& accountId);
58
59/* APIs that supports an arbitrary number of media */
60LIBJAMI_PUBLIC bool acceptWithMedia(const std::string& accountId,
61 const std::string& callId,
62 const std::vector<libjami::MediaMap>& mediaList);
63LIBJAMI_PUBLIC bool requestMediaChange(const std::string& accountId,
64 const std::string& callId,
65 const std::vector<libjami::MediaMap>& mediaList);
66
77LIBJAMI_PUBLIC bool answerMediaChangeRequest(const std::string& accountId,
78 const std::string& callId,
79 const std::vector<libjami::MediaMap>& mediaList);
80
81/* Conference related methods */
82LIBJAMI_PUBLIC bool joinParticipant(const std::string& accountId,
83 const std::string& sel_callId,
84 const std::string& account2Id,
85 const std::string& drag_callId);
86LIBJAMI_PUBLIC void createConfFromParticipantList(const std::string& accountId,
87 const std::vector<std::string>& participants);
88LIBJAMI_PUBLIC void setConferenceLayout(const std::string& accountId, const std::string& confId, uint32_t layout);
89LIBJAMI_PUBLIC bool isConferenceParticipant(const std::string& accountId, const std::string& callId);
90LIBJAMI_PUBLIC bool addParticipant(const std::string& accountId,
91 const std::string& callId,
92 const std::string& account2Id,
93 const std::string& confId);
94LIBJAMI_PUBLIC bool addMainParticipant(const std::string& accountId, const std::string& confId);
96LIBJAMI_PUBLIC bool detachParticipant(const std::string& accountId, const std::string& callId);
97LIBJAMI_PUBLIC bool joinConference(const std::string& accountId,
98 const std::string& sel_confId,
99 const std::string& account2Id,
100 const std::string& drag_confId);
101LIBJAMI_PUBLIC bool hangUpConference(const std::string& accountId, const std::string& confId);
102LIBJAMI_PUBLIC bool holdConference(const std::string& accountId, const std::string& confId);
103LIBJAMI_PUBLIC bool resumeConference(const std::string& accountId, const std::string& confId);
104LIBJAMI_PUBLIC std::vector<std::string> getConferenceList(const std::string& accountId);
111LIBJAMI_PUBLIC std::vector<std::string> getParticipantList(const std::string& accountId, const std::string& confId);
112LIBJAMI_PUBLIC std::string getConferenceId(const std::string& accountId, const std::string& callId);
113LIBJAMI_PUBLIC std::map<std::string, std::string> getConferenceDetails(const std::string& accountId,
114 const std::string& callId);
115LIBJAMI_PUBLIC std::vector<libjami::MediaMap> currentMediaList(const std::string& accountId, const std::string& callId);
116LIBJAMI_PUBLIC std::vector<std::map<std::string, std::string>> getConferenceInfos(const std::string& accountId,
117 const std::string& confId);
118LIBJAMI_PUBLIC void setModerator(const std::string& accountId,
119 const std::string& confId,
120 const std::string& accountUri,
121 const bool& state);
123LIBJAMI_PUBLIC void muteParticipant(const std::string& accountId,
124 const std::string& confId,
125 const std::string& accountUri,
126 const bool& state);
127// Note: muting Audio not supported yet
128LIBJAMI_PUBLIC void muteStream(const std::string& accountId,
129 const std::string& confId,
130 const std::string& accountUri,
131 const std::string& deviceId,
132 const std::string& streamId,
133 const bool& state);
135LIBJAMI_PUBLIC void setActiveParticipant(const std::string& accountId,
136 const std::string& confId,
137 const std::string& callId);
138LIBJAMI_PUBLIC void setActiveStream(const std::string& accountId,
139 const std::string& confId,
140 const std::string& accountUri,
141 const std::string& deviceId,
142 const std::string& streamId,
143 const bool& state);
144LIBJAMI_PUBLIC void hangupParticipant(const std::string& accountId,
145 const std::string& confId,
146 const std::string& accountUri,
147 const std::string& deviceId);
149LIBJAMI_PUBLIC void raiseParticipantHand(const std::string& accountId,
150 const std::string& confId,
151 const std::string& peerId,
152 const bool& state);
153LIBJAMI_PUBLIC void raiseHand(const std::string& accountId,
154 const std::string& confId,
155 const std::string& accountUri,
156 const std::string& deviceId,
157 const bool& state);
158
159/* File Playback methods */
160LIBJAMI_PUBLIC bool startRecordedFilePlayback(const std::string& filepath);
162
163/* General audio methods */
164LIBJAMI_PUBLIC bool toggleRecording(const std::string& accountId, const std::string& callId);
165/* DEPRECATED */
166LIBJAMI_PUBLIC void setRecording(const std::string& accountId, const std::string& callId);
167
168LIBJAMI_PUBLIC void recordPlaybackSeek(double value);
169LIBJAMI_PUBLIC bool getIsRecording(const std::string& accountId, const std::string& callId);
170LIBJAMI_PUBLIC void playDTMF(const std::string& key);
171LIBJAMI_PUBLIC void startTone(int32_t start, int32_t type);
172
173LIBJAMI_PUBLIC bool switchInput(const std::string& accountId, const std::string& callId, const std::string& resource);
174
175/* Instant messaging */
176LIBJAMI_PUBLIC void sendTextMessage(const std::string& accountId,
177 const std::string& callId,
178 const std::map<std::string, std::string>& messages,
179 const std::string& from,
180 bool isMixed);
181
182// Call signal type definitions
184{
186 {
187 constexpr static const char* name = "StateChange";
188 using cb_type = void(const std::string&, const std::string&, const std::string&, int);
189 };
191 {
192 constexpr static const char* name = "TransferFailed";
193 using cb_type = void(void);
194 };
196 {
197 constexpr static const char* name = "TransferSucceeded";
198 using cb_type = void(void);
199 };
201 {
202 constexpr static const char* name = "RecordPlaybackStopped";
203 using cb_type = void(const std::string&);
204 };
206 {
207 constexpr static const char* name = "VoiceMailNotify";
208 using cb_type = void(const std::string&, int32_t, int32_t, int32_t);
209 };
211 {
212 constexpr static const char* name = "IncomingMessage";
213 using cb_type = void(const std::string&,
214 const std::string&,
215 const std::string&,
216 const std::map<std::string, std::string>&);
217 };
219 {
220 constexpr static const char* name = "IncomingCall";
221 using cb_type = void(const std::string&,
222 const std::string&,
223 const std::string&,
224 const std::vector<std::map<std::string, std::string>>&);
225 };
227 {
228 constexpr static const char* name = "MediaChangeRequested";
229 using cb_type = void(const std::string&,
230 const std::string&,
231 const std::vector<std::map<std::string, std::string>>&);
232 };
234 {
235 constexpr static const char* name = "RecordPlaybackFilepath";
236 using cb_type = void(const std::string&, const std::string&);
237 };
239 {
240 constexpr static const char* name = "ConferenceCreated";
241 using cb_type = void(const std::string&, const std::string&, const std::string&);
242 };
244 {
245 constexpr static const char* name = "ConferenceChanged";
246 using cb_type = void(const std::string&, const std::string&, const std::string&);
247 };
249 {
250 constexpr static const char* name = "UpdatePlaybackScale";
251 using cb_type = void(const std::string&, unsigned, unsigned);
252 };
254 {
255 constexpr static const char* name = "ConferenceRemoved";
256 using cb_type = void(const std::string&, const std::string&);
257 };
259 {
260 constexpr static const char* name = "RecordingStateChanged";
261 using cb_type = void(const std::string&, int);
262 };
264 {
265 constexpr static const char* name = "RtcpReportReceived";
266 using cb_type = void(const std::string&, const std::map<std::string, int>&);
267 };
269 {
270 constexpr static const char* name = "PeerHold";
271 using cb_type = void(const std::string&, bool);
272 };
274 {
275 constexpr static const char* name = "VideoMuted";
276 using cb_type = void(const std::string&, bool);
277 };
279 {
280 constexpr static const char* name = "AudioMuted";
281 using cb_type = void(const std::string&, bool);
282 };
284 {
285 constexpr static const char* name = "ConnectionUpdate";
286 using cb_type = void(const std::string&, int);
287 };
289 {
290 constexpr static const char* name = "OnConferenceInfosUpdated";
291 using cb_type = void(const std::string&, const std::vector<std::map<std::string, std::string>>&);
292 };
294 {
295 constexpr static const char* name = "RemoteRecordingChanged";
296 using cb_type = void(const std::string&, const std::string&, bool);
297 };
298 // Report media negotiation status
300 {
301 constexpr static const char* name = "MediaNegotiationStatus";
302 using cb_type = void(const std::string&,
303 const std::string&,
304 const std::vector<std::map<std::string, std::string>>&);
305 };
306};
307
308} // namespace libjami
309
310#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.
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)
std::string getConferenceId(const std::string &accountId, const std::string &callId)
bool hold(const std::string &accountId, const std::string &callId)
std::string placeCall(const std::string &accountId, const std::string &to)
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)
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)
NOTE: Despite its name, this returns the list of call IDs (subcalls) in the conference,...
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 resume(const std::string &accountId, const std::string &callId)
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)
bool resumeConference(const std::string &accountId, const std::string &confId)
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)
bool start(const std::filesystem::path &config_file) noexcept
Start asynchronously daemon created by init().
Definition jami.cpp:104
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 &, 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::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