2
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
3
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
* Additional permission under GNU GPL version 3 section 7:
21
* If you modify this program, or any covered work, by linking or
22
* combining it with the OpenSSL project's OpenSSL library (or a
23
* modified version of that library), containing parts covered by the
24
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
25
* grants you additional permission to convey the resulting work.
26
* Corresponding Source for a non-source form of such a combination
27
* shall include the source code for the parts of OpenSSL used as well
28
* as that of the covered work.
31
#ifndef __SFL_CALLMANAGER_H__
32
#define __SFL_CALLMANAGER_H__
35
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
36
/* This warning option only exists for gcc 4.6.0 and greater. */
37
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
40
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
41
#pragma GCC diagnostic ignored "-Wunused-parameter"
42
#include "callmanager-glue.h"
43
#pragma GCC diagnostic warning "-Wignored-qualifiers"
44
#pragma GCC diagnostic warning "-Wunused-parameter"
46
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
47
/* This warning option only exists for gcc 4.6.0 and greater. */
48
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
53
class CallManagerException: public std::runtime_error {
55
CallManagerException(const std::string& str="") :
56
std::runtime_error("A CallManagerException occured: " + str) {}
60
class AudioZrtpSession;
64
: public org::sflphone::SFLphone::CallManager_adaptor,
65
public DBus::IntrospectableAdaptor,
66
public DBus::ObjectAdaptor {
69
CallManager(DBus::Connection& connection);
71
/* methods exported by this interface,
72
* you will have to implement them in your ObjectAdaptor
75
/* Call related methods */
76
bool placeCall(const std::string& accountID, const std::string& callID, const std::string& to);
78
bool refuse(const std::string& callID);
79
bool accept(const std::string& callID);
80
bool hangUp(const std::string& callID);
81
bool hold(const std::string& callID);
82
bool unhold(const std::string& callID);
83
bool transfer(const std::string& callID, const std::string& to);
84
bool attendedTransfer(const std::string& transferID, const std::string& targetID);
85
std::map< std::string, std::string > getCallDetails(const std::string& callID);
86
std::vector< std::string > getCallList();
88
/* Conference related methods */
89
bool joinParticipant(const std::string& sel_callID, const std::string& drag_callID);
90
void createConfFromParticipantList(const std::vector< std::string >& participants);
91
bool addParticipant(const std::string& callID, const std::string& confID);
92
bool addMainParticipant(const std::string& confID);
93
bool detachParticipant(const std::string& callID);
94
bool joinConference(const std::string& sel_confID, const std::string& drag_confID);
95
bool hangUpConference(const std::string& confID);
96
bool holdConference(const std::string& confID);
97
bool unholdConference(const std::string& confID);
98
std::vector<std::string> getConferenceList();
99
std::vector<std::string> getParticipantList(const std::string& confID);
100
std::string getConferenceId(const std::string& callID);
101
std::map<std::string, std::string> getConferenceDetails(const std::string& callID);
103
/* File Playback methods */
104
bool startRecordedFilePlayback(const std::string& filepath);
105
void stopRecordedFilePlayback(const std::string& filepath);
107
/* General audio methods */
108
void setVolume(const std::string& device, const double& value);
109
double getVolume(const std::string& device);
110
void setRecording(const std::string& callID);
111
void recordPlaybackSeek(const double& value);
112
bool getIsRecording(const std::string& callID);
113
std::string getCurrentAudioCodecName(const std::string& callID);
114
void playDTMF(const std::string& key);
115
void startTone(const int32_t& start, const int32_t& type);
117
/* Security related methods */
118
void setSASVerified(const std::string& callID);
119
void resetSASVerified(const std::string& callID);
120
void setConfirmGoClear(const std::string& callID);
121
void requestGoClear(const std::string& callID);
122
void acceptEnrollment(const std::string& callID, const bool& accepted);
124
/* Instant messaging */
125
void sendTextMessage(const std::string& callID, const std::string& message);
130
sfl::AudioZrtpSession * getAudioZrtpSession(const std::string& callID);
134
#endif//CALLMANAGER_H