~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

Viewing changes to daemon/src/client/callmanager.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
 
3
 *  Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
18
 *
 
19
 *  Additional permission under GNU GPL version 3 section 7:
 
20
 *
 
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.
 
29
 */
 
30
 
 
31
#ifndef __SFL_CALLMANAGER_H__
 
32
#define __SFL_CALLMANAGER_H__
 
33
 
 
34
#ifdef HAVE_CONFIG_H
 
35
#include "config.h"
 
36
#endif
 
37
 
 
38
#if HAVE_DBUS
 
39
 
 
40
#include "dbus/dbus_cpp.h"
 
41
 
 
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"
 
45
#endif
 
46
 
 
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"
 
52
 
 
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"
 
56
#endif
 
57
 
 
58
#else
 
59
// these includes normally come with DBus C++
 
60
#include <vector>
 
61
#include <map>
 
62
#include <string>
 
63
#endif  // HAVE_DBUS
 
64
 
 
65
#include <stdexcept>
 
66
 
 
67
class CallManagerException: public std::runtime_error {
 
68
    public:
 
69
        CallManagerException(const std::string& str = "") :
 
70
            std::runtime_error("A CallManagerException occured: " + str) {}
 
71
};
 
72
 
 
73
namespace sfl {
 
74
class AudioZrtpSession;
 
75
}
 
76
 
 
77
class CallManager
 
78
#if HAVE_DBUS
 
79
    : public org::sflphone::SFLphone::CallManager_adaptor,
 
80
  public DBus::IntrospectableAdaptor,
 
81
  public DBus::ObjectAdaptor
 
82
#endif
 
83
{
 
84
    public:
 
85
 
 
86
#if HAVE_DBUS
 
87
        CallManager(DBus::Connection& connection);
 
88
#else
 
89
        CallManager();
 
90
#endif
 
91
 
 
92
        /* methods exported by this interface,
 
93
         * you will have to implement them in your ObjectAdaptor
 
94
         */
 
95
 
 
96
        /* Call related methods */
 
97
        bool placeCall(const std::string& accountID, const std::string& callID, const std::string& to);
 
98
 
 
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();
 
108
 
 
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);
 
125
 
 
126
        /* File Playback methods */
 
127
        bool startRecordedFilePlayback(const std::string& filepath);
 
128
        void stopRecordedFilePlayback(const std::string& filepath);
 
129
 
 
130
        /* General audio methods */
 
131
        bool toggleRecording(const std::string& callID);
 
132
        /* DEPRECATED */
 
133
        void setRecording(const std::string& callID);
 
134
 
 
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);
 
140
 
 
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);
 
147
 
 
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);
 
151
 
 
152
#ifdef __ANDROID__
 
153
        // signals must be implemented manually for Android
 
154
        void callStateChanged(const std::string& callID, const std::string& state);
 
155
 
 
156
        void transferFailed();
 
157
 
 
158
        void transferSucceeded();
 
159
 
 
160
        void recordPlaybackStopped(const std::string& path);
 
161
 
 
162
        void voiceMailNotify(const std::string& callID, const std::string& nd_msg);
 
163
 
 
164
        void incomingMessage(const std::string& ID, const std::string& from, const std::string& msg);
 
165
 
 
166
        void incomingCall(const std::string& accountID, const std::string& callID, const std::string& from);
 
167
 
 
168
        void recordPlaybackFilepath(const std::string& id, const std::string& filename);
 
169
 
 
170
        void conferenceCreated(const std::string& confID);
 
171
 
 
172
        void conferenceChanged(const std::string& confID,const std::string& state);
 
173
 
 
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);
 
181
 
 
182
#endif // __ANDROID__
 
183
private:
 
184
 
 
185
#if HAVE_ZRTP
 
186
        sfl::AudioZrtpSession * getAudioZrtpSession(const std::string& callID);
 
187
#endif
 
188
};
 
189
 
 
190
#endif//CALLMANAGER_H