44placeCall(
const std::string& accountId,
const std::string& to)
47 JAMI_WARN(
"This API is deprecated, use placeCallWithMedia() instead");
53 const std::string& to,
54 const std::vector<libjami::MediaMap>& mediaList)
58 JAMI_DBG(
"No number entered - Call aborted");
67 const std::string& callId,
68 const std::vector<libjami::MediaMap>& mediaList)
71 if (
auto call = account->getCall(callId)) {
72 return call->requestMediaChange(mediaList);
73 }
else if (
auto conf = account->getConference(callId)) {
74 return conf->requestMediaChange(mediaList);
81refuse(
const std::string& accountId,
const std::string& callId)
87accept(
const std::string& accountId,
const std::string& callId)
94 const std::string& callId,
95 const std::vector<libjami::MediaMap>& mediaList)
102 const std::string& callId,
103 const std::vector<libjami::MediaMap>& mediaList)
106 if (
auto call = account->getCall(callId)) {
108 call->answerMediaChangeRequest(mediaList);
110 }
catch (
const std::runtime_error& e) {
118hangUp(
const std::string& accountId,
const std::string& callId)
130hold(
const std::string& accountId,
const std::string& callId)
136unhold(
const std::string& accountId,
const std::string& callId)
143 const std::string& callId,
144 const std::string& mediaType,
148 if (
auto call = account->getCall(callId)) {
149 JAMI_DBG(
"Muting [%s] for call %s", mediaType.c_str(), callId.c_str());
150 call->muteMedia(mediaType, mute);
152 }
else if (
auto conf = account->getConference(callId)) {
153 JAMI_DBG(
"Muting local host [%s] for conference %s", mediaType.c_str(), callId.c_str());
154 conf->muteLocalHost(mute, mediaType);
157 JAMI_WARN(
"ID %s doesn't match any call or conference", callId.c_str());
164transfer(
const std::string& accountId,
const std::string& callId,
const std::string& to)
171 const std::string& transferID,
172 const std::string& targetID)
175 if (
auto call = account->getCall(transferID))
176 return call->attendedTransfer(targetID);
182 const std::string& sel_callId,
183 const std::string& account2Id,
184 const std::string& drag_callId)
191 const std::vector<std::string>& participants)
200 if (
auto conf = account->getConference(confId)) {
201 conf->setLayout(layout);
202 }
else if (
auto call = account->getCall(confId)) {
204 root[
"layout"] = layout;
205 call->sendConfOrder(root);
214 if (
auto call = account->getCall(callId))
215 return call->isConferenceParticipant();
222 JAMI_WARNING(
"startSmartInfo is deprecated and does nothing.");
228 JAMI_WARNING(
"stopSmartInfo is deprecated and does nothing.");
233 const std::string& callId,
234 const std::string& account2Id,
235 const std::string& confId)
260 const std::string& sel_confId,
261 const std::string& account2Id,
262 const std::string& drag_confId)
279std::map<std::string, std::string>
283 if (
auto conf = account->getConference(confId))
284 return {{
"ID", confId},
285 {
"STATE", conf->getStateStr()},
287 {
"VIDEO_SOURCE", conf->getVideoInput()},
293std::vector<std::map<std::string, std::string>>
297 if (
auto call = account->getCall(callId)) {
298 return call->currentMediaList();
299 }
else if (
auto conf = account->getConference(callId)) {
300 return conf->currentMediaList();
303 JAMI_WARN(
"Call not found %s", callId.c_str());
307std::vector<std::string>
311 return account->getConferenceList();
315std::vector<std::string>
319 if (
auto conf = account->getConference(confId)) {
320 const auto& subcalls(conf->getSubCalls());
321 return {subcalls.begin(), subcalls.end()};
330 if (
auto call = account->getCall(callId))
331 if (
auto conf = call->getConference())
332 return conf->getConfId();
370 if (
auto call = account->getCall(callId)) {
371 return call->isRecording();
372 }
else if (
auto conf = account->getConference(callId)) {
373 return conf->isRecording();
379std::map<std::string, std::string>
383 if (
auto call = account->getCall(callId))
384 return call->getDetails();
388std::vector<std::string>
394std::vector<std::string>
397 if (accountId.empty())
400 return account->getCallList();
401 JAMI_WARN(
"Unknown account: %s", accountId.c_str());
405std::vector<std::map<std::string, std::string>>
409 if (
auto conf = account->getConference(confId))
410 return conf->getConferenceInfos();
411 else if (
auto call = account->getCall(confId))
412 return call->getConferenceInfos();
420 auto code = key.data()[0];
424 current_call->carryingDTMFdigits(code);
440switchInput(
const std::string& accountId,
const std::string& callId,
const std::string& resource)
443 if (
auto conf = account->getConference(callId)) {
444 conf->switchInput(resource);
446 }
else if (
auto call = account->getCall(callId)) {
447 call->switchInput(resource);
456 const std::string& confId,
457 const std::string& resource)
465 const std::string& callId,
466 const std::map<std::string, std::string>& messages,
467 const std::string& from,
477 const std::string& confId,
478 const std::string& peerId,
482 if (
auto conf = account->getConference(confId)) {
483 conf->setModerator(peerId, state);
485 JAMI_WARN(
"Fail to change moderator %s, conference %s not found",
494 const std::string& confId,
495 const std::string& peerId,
498 JAMI_ERROR(
"muteParticipant is deprecated, please use muteStream");
500 if (
auto conf = account->getConference(confId)) {
501 conf->muteParticipant(peerId, state);
502 }
else if (
auto call = account->getCall(confId)) {
504 root[
"muteParticipant"] = peerId;
506 call->sendConfOrder(root);
513 const std::string& confId,
514 const std::string& accountUri,
515 const std::string& deviceId,
516 const std::string& streamId,
520 if (
auto conf = account->getConference(confId)) {
521 conf->muteStream(accountUri, deviceId, streamId, state);
522 }
else if (
auto call = account->getCall(confId)) {
523 if (call->conferenceProtocolVersion() == 1) {
525 sinkVal[
"muteAudio"] = state;
526 Json::Value mediasObj;
527 mediasObj[streamId] = sinkVal;
528 Json::Value deviceVal;
529 deviceVal[
"medias"] = mediasObj;
530 Json::Value deviceObj;
531 deviceObj[deviceId] = deviceVal;
532 Json::Value accountVal;
533 deviceVal[
"devices"] = deviceObj;
535 root[accountUri] = deviceVal;
537 call->sendConfOrder(root);
538 }
else if (call->conferenceProtocolVersion() == 0) {
540 root[
"muteParticipant"] = accountUri;
542 call->sendConfOrder(root);
550 const std::string& confId,
551 const std::string& participant)
553 JAMI_ERR() <<
"setActiveParticipant is deprecated, please use setActiveStream";
555 if (
auto conf = account->getConference(confId)) {
556 conf->setActiveParticipant(participant);
557 }
else if (
auto call = account->getCall(confId)) {
559 root[
"activeParticipant"] = participant;
560 call->sendConfOrder(root);
567 const std::string& confId,
568 const std::string& accountUri,
569 const std::string& deviceId,
570 const std::string& streamId,
574 if (
auto conf = account->getConference(confId)) {
575 conf->setActiveStream(streamId, state);
576 }
else if (
auto call = std::static_pointer_cast<jami::SIPCall>(account->getCall(confId))) {
577 call->setActiveMediaStream(accountUri, deviceId, streamId, state);
584 const std::string& confId,
585 const std::string& accountUri,
586 const std::string& deviceId)
589 if (
auto conf = account->getConference(confId)) {
590 conf->hangupParticipant(accountUri, deviceId);
591 }
else if (
auto call = std::static_pointer_cast<jami::SIPCall>(account->getCall(confId))) {
592 if (call->conferenceProtocolVersion() == 1) {
593 Json::Value deviceVal;
595 Json::Value deviceObj;
596 deviceObj[deviceId] = deviceVal;
597 Json::Value accountVal;
598 deviceVal[
"devices"] = deviceObj;
600 root[accountUri] = deviceVal;
602 call->sendConfOrder(root);
603 }
else if (call->conferenceProtocolVersion() == 0) {
605 root[
"hangupParticipant"] = accountUri;
606 call->sendConfOrder(root);
614 const std::string& confId,
615 const std::string& peerId,
618 JAMI_ERR() <<
"raiseParticipantHand is deprecated, please use raiseHand";
620 if (
auto conf = account->getConference(confId)) {
621 if (
auto call = std::static_pointer_cast<jami::SIPCall>(
622 conf->getCallFromPeerID(peerId))) {
623 if (
auto* transport = call->getTransport())
624 conf->setHandRaised(std::string(transport->deviceId()), state);
626 }
else if (
auto call = account->getCall(confId)) {
628 root[
"handRaised"] = peerId;
630 call->sendConfOrder(root);
637 const std::string& confId,
638 const std::string& accountUri,
639 const std::string& deviceId,
643 if (
auto conf = account->getConference(confId)) {
644 auto device = deviceId;
646 device = std::string(account->currentDeviceId());
647 conf->setHandRaised(device, state);
648 }
else if (
auto call = std::static_pointer_cast<jami::SIPCall>(account->getCall(confId))) {
649 if (call->conferenceProtocolVersion() == 1) {
650 Json::Value deviceVal;
651 deviceVal[
"raiseHand"] = state;
652 Json::Value deviceObj;
653 std::string device = deviceId.empty() ? std::string(account->currentDeviceId())
655 deviceObj[device] = deviceVal;
656 Json::Value accountVal;
657 deviceVal[
"devices"] = deviceObj;
659 std::string uri = accountUri.empty() ? account->getUsername() : accountUri;
660 root[uri] = deviceVal;
662 call->sendConfOrder(root);
663 }
else if (call->conferenceProtocolVersion() == 0) {
665 root[
"handRaised"] = account->getUsername();
667 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 answerCall(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 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.
bool offHoldCall(const std::string &accountId, const std::string &callId)
Functions which occur with a user's action Put the call off hold.
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)
bool onHoldCall(const std::string &accountId, const std::string &callId)
Functions which occur with a user's action Put the call on hold.
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 every participant to a conference.
void stopTone()
Acts on the audio streams and audio files.
bool unHoldConference(const std::string &accountId, const std::string &confId)
Unhold all conference participants.
bool hangupConference(const std::string &accountId, const std::string &confId)
Functions which occur with a user's action Hangup the conference (hangup every participants)
#define JAMI_ERROR(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.
LIBJAMI_PUBLIC bool start(const std::filesystem::path &config_file={}) noexcept
Start asynchronously daemon created by init().
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)
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 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)
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)
SIPCall are SIP implementation of a normal Call.
Specific VoIPLink for SIP (SIP core for incoming and outgoing events).