blob: 0ea1ab565167fdb2dfdc0143af4c4d2f4fcea6ce [file] [log] [blame]
Adrien BĂ©raud04d822c2015-04-02 17:44:36 -04001/*
2 * Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
3 * Author: Emeric Vigier <emeric.vigier@savoirfairelinux.com>
4 * Alexandre Lision <alexnadre.L@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.
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., 675 Mass Ave, Cambridge, MA 02139, 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%header %{
32
33#include "dring/dring.h"
34
35class Callback {
36public:
37 virtual ~Callback() {}
38 virtual void callOnStateChange(const std::string& call_id, const std::string& state){}
39 virtual void callOnTransferFail(void){}
40 virtual void callOnTransferSuccess(void){}
41 virtual void callOnRecordPlaybackStopped(const std::string& path){}
42 virtual void callOnVoiceMailNotify(const std::string& call_id, int nd_msg){}
43 virtual void callOnIncomingMessage(const std::string& id, const std::string& from, const std::string& msg){}
44 virtual void callOnIncomingCall(const std::string& account_id, const std::string& call_id, const std::string& from){}
45 virtual void callOnRecordPlaybackFilepath(const std::string& id, const std::string& filename){}
46 virtual void callOnConferenceCreated(const std::string& conf_id){}
47 virtual void callOnConferenceChanged(const std::string& conf_id, const std::string& state){}
48 virtual void callOnUpdatePlaybackScale(const std::string& filepath, int position, int scale){}
49 virtual void callOnConferenceRemove(const std::string& conf_id){}
50 virtual void callOnNewCall(const std::string& account_id, const std::string& call_id, const std::string& to){}
51 virtual void callOnSipCallStateChange(const std::string& call_id, const std::string& state, int code){}
52 virtual void callOnRecordStateChange(const std::string& call_id, int state){}
53 virtual void callOnSecureSdesOn(const std::string& call_id){}
54 virtual void callOnSecureSdesOff(const std::string& call_id){}
55 virtual void callOnSecureZrtpOn(const std::string& call_id, const std::string& cipher){}
56 virtual void callOnSecureZrtpOff(const std::string& call_id){}
57 virtual void callOnShowSas(const std::string& call_id, const std::string& sas, int verified){}
58 virtual void callOnZrtpNotSuppOther(const std::string& call_id){}
59 virtual void callOnZrtpNegotiationFail(const std::string& call_id, const std::string& reason, const std::string& severity){}
60 virtual void callOnRtcpReceiveReport(const std::string& call_id, const std::map<std::string, int>& stats){}
61};
62
63
64%}
65
66%feature("director") Callback;
67
68bool sflph_call_place(const std::string& account_id, const std::string& call_id, const std::string& to);
69bool sflph_call_refuse(const std::string& call_id);
70bool sflph_call_accept(const std::string& call_id);
71bool sflph_call_hang_up(const std::string& call_id);
72bool sflph_call_hold(const std::string& call_id);
73bool sflph_call_unhold(const std::string& call_id);
74bool sflph_call_transfer(const std::string& call_id, const std::string& to);
75bool sflph_call_attended_transfer(const std::string& transfer_id, const std::string& target_id);
76std::map<std::string, std::string> sflph_call_get_call_details(const std::string& call_id);
77std::vector<std::string> sflph_call_get_call_list(void);
78void sflph_call_remove_conference(const std::string& conf_id);
79bool sflph_call_join_participant(const std::string& sel_call_id, const std::string& drag_call_id);
80void sflph_call_create_conf_from_participant_list(const std::vector<std::string>& participants);
81bool sflph_call_is_conference_participant(const std::string& call_id);
82bool sflph_call_add_participant(const std::string& call_id, const std::string& conf_id);
83bool sflph_call_add_main_participant(const std::string& conf_id);
84bool sflph_call_detach_participant(const std::string& call_id);
85bool sflph_call_join_conference(const std::string& sel_conf_id, const std::string& drag_conf_id);
86bool sflph_call_hang_up_conference(const std::string& conf_id);
87bool sflph_call_hold_conference(const std::string& conf_id);
88bool sflph_call_unhold_conference(const std::string& conf_id);
89std::vector<std::string> sflph_call_get_conference_list(void);
90std::vector<std::string> sflph_call_get_participant_list(const std::string& conf_id);
91std::vector<std::string> sflph_call_get_display_names(const std::string& conf_id);
92std::string sflph_call_get_conference_id(const std::string& call_id);
93std::map<std::string, std::string> sflph_call_get_conference_details(const std::string& call_id);
94bool sflph_call_play_recorded_file(const std::string& path);
95void sflph_call_stop_recorded_file(const std::string& path);
96bool sflph_call_toggle_recording(const std::string& call_id);
97void sflph_call_set_recording(const std::string& call_id);
98void sflph_call_record_playback_seek(double pos);
99bool sflph_call_is_recording(const std::string& call_id);
100std::string sflph_call_get_current_audio_codec_name(const std::string& call_id);
101void sflph_call_play_dtmf(const std::string& key);
102void sflph_call_start_tone(int start, int type);
103void sflph_call_set_sas_verified(const std::string& call_id);
104void sflph_call_reset_sas_verified(const std::string& call_id);
105void sflph_call_set_confirm_go_clear(const std::string& call_id);
106void sflph_call_request_go_clear(const std::string& call_id);
107void sflph_call_accept_enrollment(const std::string& call_id, bool accepted);
108void sflph_call_send_text_message(const std::string& call_id, const std::string& message);
109
110class Callback {
111public:
112 virtual ~Callback();
113 virtual void callOnStateChange(const std::string& call_id, const std::string& state);
114 virtual void callOnTransferFail(void);
115 virtual void callOnTransferSuccess(void);
116 virtual void callOnRecordPlaybackStopped(const std::string& path);
117 virtual void callOnVoiceMailNotify(const std::string& call_id, int nd_msg);
118 virtual void callOnIncomingMessage(const std::string& id, const std::string& from, const std::string& msg);
119 virtual void callOnIncomingCall(const std::string& account_id, const std::string& call_id, const std::string& from);
120 virtual void callOnRecordPlaybackFilepath(const std::string& id, const std::string& filename);
121 virtual void callOnConferenceCreated(const std::string& conf_id);
122 virtual void callOnConferenceChanged(const std::string& conf_id, const std::string& state);
123 virtual void callOnUpdatePlaybackScale(const std::string& filepath, int position, int scale);
124 virtual void callOnConferenceRemove(const std::string& conf_id);
125 virtual void callOnNewCall(const std::string& account_id, const std::string& call_id, const std::string& to);
126 virtual void callOnSipCallStateChange(const std::string& call_id, const std::string& state, int code);
127 virtual void callOnRecordStateChange(const std::string& call_id, int state);
128 virtual void callOnSecureSdesOn(const std::string& call_id);
129 virtual void callOnSecureSdesOff(const std::string& call_id);
130 virtual void callOnSecureZrtpOn(const std::string& call_id, const std::string& cipher);
131 virtual void callOnSecureZrtpOff(const std::string& call_id);
132 virtual void callOnShowSas(const std::string& call_id, const std::string& sas, int verified);
133 virtual void callOnZrtpNotSuppOther(const std::string& call_id);
134 virtual void callOnZrtpNegotiationFail(const std::string& call_id, const std::string& reason, const std::string& severity);
135 virtual void callOnRtcpReceiveReport(const std::string& call_id, const std::map<std::string, int>& stats);
136};