42placeCall(
const std::string& accountId,
const std::string& to)
45 JAMI_WARN(
"This API is deprecated, use placeCallWithMedia() instead");
50placeCallWithMedia(
const std::string& accountId,
const std::string& to,
const std::vector<libjami::MediaMap>& mediaList)
54 JAMI_DBG(
"No number entered - Call aborted");
63 const std::string& callId,
64 const std::vector<libjami::MediaMap>& mediaList)
67 if (
auto call = account->getCall(callId)) {
68 return call->requestMediaChange(mediaList);
69 }
else if (
auto conf = account->getConference(callId)) {
70 return conf->requestMediaChange(mediaList);
77refuse(
const std::string& accountId,
const std::string& callId)
83accept(
const std::string& accountId,
const std::string& callId)
89acceptWithMedia(
const std::string& accountId,
const std::string& callId,
const std::vector<libjami::MediaMap>& mediaList)
96 const std::string& callId,
97 const std::vector<libjami::MediaMap>& mediaList)
100 if (
auto call = account->getCall(callId)) {
102 call->answerMediaChangeRequest(mediaList);
104 }
catch (
const std::runtime_error& e) {
112hangUp(
const std::string& accountId,
const std::string& callId)
124hold(
const std::string& accountId,
const std::string& callId)
130resume(
const std::string& accountId,
const std::string& callId)
136muteLocalMedia(
const std::string& accountId,
const std::string& callId,
const std::string& mediaType,
bool mute)
139 if (
auto call = account->getCall(callId)) {
140 JAMI_DBG(
"Muting [%s] for call %s", mediaType.c_str(), callId.c_str());
141 call->muteMedia(mediaType, mute);
143 }
else if (
auto conf = account->getConference(callId)) {
144 JAMI_DEBUG(
"[conf:{}] Muting local host [{}]", callId, mediaType);
145 conf->muteLocalHost(mute, mediaType);
148 JAMI_WARNING(
"ID {} doesn't match any call or conference", callId);
155transfer(
const std::string& accountId,
const std::string& callId,
const std::string& to)
161attendedTransfer(
const std::string& accountId,
const std::string& transferID,
const std::string& targetID)
164 if (
auto call = account->getCall(transferID))
165 return call->attendedTransfer(targetID);
171 const std::string& sel_callId,
172 const std::string& account2Id,
173 const std::string& drag_callId)
188 if (
auto conf = account->getConference(confId)) {
189 conf->setLayout(
static_cast<int>(layout));
190 }
else if (
auto call = account->getCall(confId)) {
192 root[
"layout"] = layout;
193 call->sendConfOrder(root);
202 if (
auto call = account->getCall(callId))
203 return call->isConferenceParticipant();
209 const std::string& callId,
210 const std::string& account2Id,
211 const std::string& confId)
236 const std::string& sel_confId,
237 const std::string& account2Id,
238 const std::string& drag_confId)
255std::map<std::string, std::string>
259 if (
auto conf = account->getConference(confId))
260 return {{
"ID", confId},
261 {
"STATE", conf->getStateStr()},
263 {
"VIDEO_SOURCE", conf->getVideoInput()},
269std::vector<std::map<std::string, std::string>>
273 if (
auto call = account->getCall(callId)) {
274 return call->currentMediaList();
275 }
else if (
auto conf = account->getConference(callId)) {
276 return conf->currentMediaList();
279 JAMI_WARN(
"Call not found %s", callId.c_str());
283std::vector<std::string>
287 return account->getConferenceList();
291std::vector<std::string>
295 if (
auto conf = account->getConference(confId)) {
296 const auto& subcalls(conf->getSubCalls());
297 return {subcalls.begin(), subcalls.end()};
306 if (
auto call = account->getCall(callId))
307 if (
auto conf = call->getConference())
308 return conf->getConfId();
346 if (
auto call = account->getCall(callId)) {
347 return call->isRecording();
348 }
else if (
auto conf = account->getConference(callId)) {
349 return conf->isRecording();
355std::map<std::string, std::string>
359 if (
auto call = account->getCall(callId))
360 return call->getDetails();
364std::vector<std::string>
370std::vector<std::string>
373 if (accountId.empty())
376 return account->getCallList();
377 JAMI_WARN(
"Unknown account: %s", accountId.c_str());
381std::vector<std::map<std::string, std::string>>
385 if (
auto conf = account->getConference(confId))
386 return conf->getConferenceInfos();
387 else if (
auto call = account->getCall(confId))
388 return call->getConferenceInfos();
396 auto code = key.data()[0];
400 current_call->carryingDTMFdigits(code);
416switchInput(
const std::string& accountId,
const std::string& callId,
const std::string& resource)
419 if (
auto conf = account->getConference(callId)) {
420 conf->switchInput(resource);
422 }
else if (
auto call = account->getCall(callId)) {
423 call->switchInput(resource);
432 const std::string& callId,
433 const std::map<std::string, std::string>& messages,
434 const std::string& from,
443setModerator(
const std::string& accountId,
const std::string& confId,
const std::string& peerId,
const bool& state)
446 if (
auto conf = account->getConference(confId)) {
447 conf->setModerator(peerId, state);
449 JAMI_WARNING(
"[conf:{}] Failed to change moderator {} (conference not found)", confId, peerId);
455muteParticipant(
const std::string& accountId,
const std::string& confId,
const std::string& peerId,
const bool& state)
457 JAMI_ERROR(
"muteParticipant is deprecated, please use muteStream");
459 if (
auto conf = account->getConference(confId)) {
460 conf->muteParticipant(peerId, state);
461 }
else if (
auto call = account->getCall(confId)) {
463 root[
"muteParticipant"] = peerId;
465 call->sendConfOrder(root);
472 const std::string& confId,
473 const std::string& accountUri,
474 const std::string& deviceId,
475 const std::string& streamId,
479 if (
auto conf = account->getConference(confId)) {
480 conf->muteStream(accountUri, deviceId, streamId, state);
481 }
else if (
auto call = account->getCall(confId)) {
482 if (call->conferenceProtocolVersion() == 1) {
484 sinkVal[
"muteAudio"] = state;
485 Json::Value mediasObj;
486 mediasObj[streamId] = sinkVal;
487 Json::Value deviceVal;
488 deviceVal[
"medias"] = mediasObj;
489 Json::Value deviceObj;
490 deviceObj[deviceId] = deviceVal;
491 Json::Value accountVal;
492 deviceVal[
"devices"] = deviceObj;
494 root[accountUri] = deviceVal;
496 call->sendConfOrder(root);
497 }
else if (call->conferenceProtocolVersion() == 0) {
499 root[
"muteParticipant"] = accountUri;
501 call->sendConfOrder(root);
510 JAMI_ERR() <<
"setActiveParticipant is deprecated, please use setActiveStream";
512 if (
auto conf = account->getConference(confId)) {
513 conf->setActiveParticipant(participant);
514 }
else if (
auto call = account->getCall(confId)) {
516 root[
"activeParticipant"] = participant;
517 call->sendConfOrder(root);
524 const std::string& confId,
525 const std::string& accountUri,
526 const std::string& deviceId,
527 const std::string& streamId,
531 if (
auto conf = account->getConference(confId)) {
532 conf->setActiveStream(streamId, state);
533 }
else if (
auto call = std::static_pointer_cast<jami::SIPCall>(account->getCall(confId))) {
534 call->setActiveMediaStream(accountUri, deviceId, streamId, state);
541 const std::string& confId,
542 const std::string& accountUri,
543 const std::string& deviceId)
546 if (
auto conf = account->getConference(confId)) {
547 conf->hangupParticipant(accountUri, deviceId);
548 }
else if (
auto call = std::static_pointer_cast<jami::SIPCall>(account->getCall(confId))) {
549 if (call->conferenceProtocolVersion() == 1) {
550 Json::Value deviceVal;
552 Json::Value deviceObj;
553 deviceObj[deviceId] = deviceVal;
554 Json::Value accountVal;
555 deviceVal[
"devices"] = deviceObj;
557 root[accountUri] = deviceVal;
559 call->sendConfOrder(root);
560 }
else if (call->conferenceProtocolVersion() == 0) {
562 root[
"hangupParticipant"] = accountUri;
563 call->sendConfOrder(root);
571 const std::string& confId,
572 const std::string& peerId,
575 JAMI_ERR() <<
"raiseParticipantHand is deprecated, please use raiseHand";
577 if (
auto conf = account->getConference(confId)) {
578 if (
auto call = std::static_pointer_cast<jami::SIPCall>(conf->getCallFromPeerID(peerId))) {
579 if (
auto* transport = call->getTransport())
580 conf->setHandRaised(std::string(transport->deviceId()), state);
582 }
else if (
auto call = account->getCall(confId)) {
584 root[
"handRaised"] = peerId;
586 call->sendConfOrder(root);
593 const std::string& confId,
594 const std::string& accountUri,
595 const std::string& deviceId,
599 if (
auto conf = account->getConference(confId)) {
600 auto device = deviceId;
602 device = std::string(account->currentDeviceId());
603 conf->setHandRaised(device, state);
604 }
else if (
auto call = std::static_pointer_cast<jami::SIPCall>(account->getCall(confId))) {
605 if (call->conferenceProtocolVersion() == 1) {
606 Json::Value deviceVal;
607 deviceVal[
"raiseHand"] = state;
608 Json::Value deviceObj;
609 std::string device = deviceId.empty() ? std::string(account->currentDeviceId()) : deviceId;
610 deviceObj[device] = deviceVal;
611 Json::Value accountVal;
612 deviceVal[
"devices"] = deviceObj;
614 std::string uri = accountUri.empty() ? account->getUsername() : accountUri;
615 root[uri] = deviceVal;
617 call->sendConfOrder(root);
618 }
else if (call->conferenceProtocolVersion() == 0) {
620 root[
"handRaised"] = account->getUsername();
622 call->sendConfOrder(root);
bool addMainParticipant(const std::string &accountId, const std::string &confId)
Bind the main participant to a conference (mainly called on a double click action)
bool resumeConference(const std::string &accountId, const std::string &confId)
Resume all conference participants.
bool resumeCall(const std::string &accountId, const std::string &callId)
Functions which occur with a user's action Resume call.
bool startRecordedFilePlayback(const std::string &)
Start playback fo a recorded file if and only if audio layer is not already started.
static LIBJAMI_TEST_EXPORT Manager & instance()
void playDtmf(char code)
Play the dtmf-associated sound.
bool joinConference(const std::string &accountId, const std::string &confId1, const std::string &account2Id, const std::string &confId2)
Join two conference together into one unique conference.
std::vector< std::string > getCallList() const
Get list of calls (internal subcalls are filter-out)
bool detachParticipant(const std::string &callId)
Detach a participant from a conference, put the call on hold, do not hangup it.
bool refuseCall(const std::string &accountId, const std::string &id)
Functions which occur with a user's action Refuse the call.
bool toggleRecordingCall(const std::string &accountId, const std::string &id)
Set recording on / off Start recording.
void playTone()
Play a ringtone.
void createConfFromParticipantList(const std::string &accountId, const std::vector< std::string > &)
Create a conference from a list of participant.
bool hangupCall(const std::string &accountId, const std::string &callId)
Functions which occur with a user's action Hangup the call.
void recordingPlaybackSeek(const double value)
void playToneWithMessage()
Play a special ringtone ( BUSY ) if there's at least one message on the voice mail.
void stopRecordedFilePlayback()
Stop playback of recorded file.
bool detachHost(const std::shared_ptr< Conference > &conf={})
Detach the local participant from curent conference.
bool addSubCall(const std::string &accountId, const std::string &callId, const std::string &account2Id, const std::string &confId)
Add a subcall to a conference.
std::string outgoingCall(const std::string &accountId, const std::string &callee, const std::vector< libjami::MediaMap > &mediaList={})
Place a new call.
void sendCallTextMessage(const std::string &accountId, const std::string &callID, const std::map< std::string, std::string > &messages, const std::string &from, bool isMixed)
Send a new text message to the call, if participate to a conference, send to all participant.
bool transferCall(const std::string &accountId, const std::string &id, const std::string &to)
Functions which occur with a user's action Transfer the call.
bool joinParticipant(const std::string &accountId, const std::string &callId1, const std::string &account2Id, const std::string &callId2, bool attached=true)
Join two participants to create a conference.
bool holdConference(const std::string &accountId, const std::string &confId)
Hold all conference participants.
void stopTone()
Acts on the audio streams and audio files.
bool hangupConference(const std::string &accountId, const std::string &confId)
Functions which occur with a user's action Hangup the conference (hangup every participants)
bool acceptCall(const std::string &accountId, const std::string &callId, const std::vector< libjami::MediaMap > &mediaList={})
Functions which occur with a user's action Answer the call.
bool holdCall(const std::string &accountId, const std::string &callId)
Functions which occur with a user's action Hold call.
#define JAMI_ERROR(formatstr,...)
#define JAMI_DEBUG(formatstr,...)
#define JAMI_WARNING(formatstr,...)
static constexpr const char TRUE_STR[]
static constexpr const char FALSE_STR[]
static void runOnMainThread(Callback &&cb)
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 registerSignalHandlers(const std::map< std::string, std::shared_ptr< CallbackWrapperBase > > &handlers)
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().
SIPCall are SIP implementation of a normal Call.
Specific VoIPLink for SIP (SIP core for incoming and outgoing events).