callmanager.h 5.04 KB
Newer Older
1
/*
2
 *  Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
3
 *  Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
4 5 6
 *                                                                              
 *  This program is free software; you can redistribute it and/or modify
 *  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 9 10 11 12 13 14 15 16 17
 *  (at your option) any later version.
 *                                                                                
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *                                                                              
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 19 20 21 22 23 24 25 26 27 28
 *
 *  Additional permission under GNU GPL version 3 section 7:
 *
 *  If you modify this program, or any covered work, by linking or
 *  combining it with the OpenSSL project's OpenSSL library (or a
 *  modified version of that library), containing parts covered by the
 *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
 *  grants you additional permission to convey the resulting work.
 *  Corresponding Source for a non-source form of such a combination
 *  shall include the source code for the parts of OpenSSL used as well
 *  as that of the covered work.
29 30
 */
 
31 32
#ifndef __SFL_CALLMANAGER_H__
#define __SFL_CALLMANAGER_H__
33

Julien Bonjean's avatar
Julien Bonjean committed
34 35
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
36
#include "callmanager-glue.h"
Julien Bonjean's avatar
Julien Bonjean committed
37 38
#pragma GCC diagnostic error "-Wignored-qualifiers"
#pragma GCC diagnostic error "-Wunused-parameter"
39

40
#include <dbus-c++/dbus.h>
41 42 43 44 45 46 47 48 49 50 51 52 53
#include <exception>

class CallManagerException: public std::exception
{
    virtual const char* what() const throw()
    {
    return "A CallManagerException occured";
    }
};

namespace sfl {
    class AudioZrtpSession;
}
54 55

class CallManager
56
: public org::sflphone::SFLphone::CallManager_adaptor,
57 58 59
  public DBus::IntrospectableAdaptor,
  public DBus::ObjectAdaptor
{
60 61 62 63
    public:

        CallManager(DBus::Connection& connection);
        static const char* SERVER_PATH;
64

65 66 67
        /* methods exported by this interface,
         * you will have to implement them in your ObjectAdaptor
         */
68

Alexandre Savard's avatar
Alexandre Savard committed
69
        /* Call related methods */
70
        void placeCall( const std::string& accountID, const std::string& callID, const std::string& to );
Alexandre Savard's avatar
Alexandre Savard committed
71
        void placeCallFirstAccount( const std::string& callID, const std::string& to );
72

73 74 75 76 77 78
        void refuse( const std::string& callID );
        void accept( const std::string& callID );
        void hangUp( const std::string& callID );
        void hold( const std::string& callID );
        void unhold( const std::string& callID );
        void transfert( const std::string& callID, const std::string& to );
Alexandre Savard's avatar
Alexandre Savard committed
79
        std::map< std::string, std::string > getCallDetails( const std::string& callID );
80
        std::vector< std::string > getCallList (void);
Alexandre Savard's avatar
Alexandre Savard committed
81
        std::string getCurrentCallID(  );
82

Alexandre Savard's avatar
Alexandre Savard committed
83 84
        /* Conference related methods */
        void joinParticipant( const std::string& sel_callID, const std::string& drag_callID );
85 86 87 88 89 90 91 92 93 94
	void addParticipant( const std::string& callID, const std::string& confID );
	void addMainParticipant( const std::string& confID );
	void detachParticipant( const std::string& callID );
	void joinConference( const std::string& sel_confID, const std::string& drag_confID );
	void hangUpConference( const std::string& confID );
	void holdConference( const std::string& confID );
	void unholdConference( const std::string& confID );
	std::vector< std::string > getConferenceList (void);
	std::vector< std::string > getParticipantList (const std::string& confID);
	std::map< std::string, std::string > getConferenceDetails ( const std::string& callID );
95

96
	/* General audio methods */
97 98 99 100 101 102 103
        void setVolume( const std::string& device, const double& value );
        double getVolume( const std::string& device );
        void setRecording( const std::string& callID );
        bool getIsRecording(const std::string& callID);
        std::string getCurrentCodecName(const std::string& callID);
        void playDTMF( const std::string& key );
        void startTone( const int32_t& start, const int32_t& type );
104

105
	/* Security related methods */
106 107 108 109 110 111 112 113
        void setSASVerified(const std::string& callID);
        void resetSASVerified(const std::string& callID);
        void setConfirmGoClear(const std::string& callID);
        void requestGoClear(const std::string& callID);
        void acceptEnrollment(const std::string& callID, const bool& accepted);
        void setPBXEnrollment(const std::string& callID, const bool& yesNo);    
        
    private:
114

115
        sfl::AudioZrtpSession * getAudioZrtpSession(const std::string& callID);
116 117
};

Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
118

119
#endif//CALLMANAGER_H