2
* Copyright (C) 2004-2013 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__
40
#include "dbus/dbus_cpp.h"
42
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
43
/* This warning option only exists for gcc 4.6.0 and greater. */
44
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
47
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
48
#pragma GCC diagnostic ignored "-Wunused-parameter"
49
#include "dbus/callmanager-glue.h"
50
#pragma GCC diagnostic warning "-Wignored-qualifiers"
51
#pragma GCC diagnostic warning "-Wunused-parameter"
53
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
54
/* This warning option only exists for gcc 4.6.0 and greater. */
55
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
59
// these includes normally come with DBus C++
67
class CallManagerException: public std::runtime_error {
69
CallManagerException(const std::string& str = "") :
70
std::runtime_error("A CallManagerException occured: " + str) {}
74
class AudioZrtpSession;
79
: public org::sflphone::SFLphone::CallManager_adaptor,
80
public DBus::IntrospectableAdaptor,
81
public DBus::ObjectAdaptor
87
CallManager(DBus::Connection& connection);
92
/* methods exported by this interface,
93
* you will have to implement them in your ObjectAdaptor
96
/* Call related methods */
97
bool placeCall(const std::string& accountID, const std::string& callID, const std::string& to);
99
bool refuse(const std::string& callID);
100
bool accept(const std::string& callID);
101
bool hangUp(const std::string& callID);
102
bool hold(const std::string& callID);
103
bool unhold(const std::string& callID);
104
bool transfer(const std::string& callID, const std::string& to);
105
bool attendedTransfer(const std::string& transferID, const std::string& targetID);
106
std::map< std::string, std::string > getCallDetails(const std::string& callID);
107
std::vector< std::string > getCallList();
109
/* Conference related methods */
110
void removeConference(const std::string& conference_id);
111
bool joinParticipant(const std::string& sel_callID, const std::string& drag_callID);
112
void createConfFromParticipantList(const std::vector< std::string >& participants);
113
bool isConferenceParticipant(const std::string& call_id);
114
bool addParticipant(const std::string& callID, const std::string& confID);
115
bool addMainParticipant(const std::string& confID);
116
bool detachParticipant(const std::string& callID);
117
bool joinConference(const std::string& sel_confID, const std::string& drag_confID);
118
bool hangUpConference(const std::string& confID);
119
bool holdConference(const std::string& confID);
120
bool unholdConference(const std::string& confID);
121
std::vector<std::string> getConferenceList();
122
std::vector<std::string> getParticipantList(const std::string& confID);
123
std::string getConferenceId(const std::string& callID);
124
std::map<std::string, std::string> getConferenceDetails(const std::string& callID);
126
/* File Playback methods */
127
bool startRecordedFilePlayback(const std::string& filepath);
128
void stopRecordedFilePlayback(const std::string& filepath);
130
/* General audio methods */
131
bool toggleRecording(const std::string& callID);
133
void setRecording(const std::string& callID);
135
void recordPlaybackSeek(const double& value);
136
bool getIsRecording(const std::string& callID);
137
std::string getCurrentAudioCodecName(const std::string& callID);
138
void playDTMF(const std::string& key);
139
void startTone(const int32_t& start, const int32_t& type);
141
/* Security related methods */
142
void setSASVerified(const std::string& callID);
143
void resetSASVerified(const std::string& callID);
144
void setConfirmGoClear(const std::string& callID);
145
void requestGoClear(const std::string& callID);
146
void acceptEnrollment(const std::string& callID, const bool& accepted);
148
/* Instant messaging */
149
void sendTextMessage(const std::string& callID, const std::string& message);
150
void sendTextMessage(const std::string& callID, const std::string& message, const std::string& from);
153
// signals must be implemented manually for Android
154
void callStateChanged(const std::string& callID, const std::string& state);
156
void transferFailed();
158
void transferSucceeded();
160
void recordPlaybackStopped(const std::string& path);
162
void voiceMailNotify(const std::string& callID, const std::string& nd_msg);
164
void incomingMessage(const std::string& ID, const std::string& from, const std::string& msg);
166
void incomingCall(const std::string& accountID, const std::string& callID, const std::string& from);
168
void recordPlaybackFilepath(const std::string& id, const std::string& filename);
170
void conferenceCreated(const std::string& confID);
172
void conferenceChanged(const std::string& confID,const std::string& state);
174
void updatePlaybackScale(const std::string&, const int32_t&, const int32_t&);
175
void conferenceRemoved(const std::string&);
176
void newCallCreated(const std::string&, const std::string&, const std::string&);
177
void sipCallStateChanged(const std::string&, const std::string&, const int32_t&);
178
void recordingStateChanged(const std::string& callID, const bool& state);
179
void secureSdesOn(const std::string& arg);
180
void secureSdesOff(const std::string& arg);
182
#endif // __ANDROID__
186
sfl::AudioZrtpSession * getAudioZrtpSession(const std::string& callID);
190
#endif//CALLMANAGER_H