voicecallApi.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include <boost/function.hpp>
7 #include <boost/system/error_code.hpp>
8 #include <boost/shared_ptr.hpp>
9 
10 #include <vector>
11 #include "iVoiceCallSource.h"
12 
13 class VoiceCallClient;
14 
15 #ifndef VOICECALL_TYPES
16 #define VOICECALL_TYPES
17 
23 namespace dpyVoicecall {
24 
30 typedef boost::function<void(boost::system::error_code, std::list<dpyVoicecall::VoiceCallSourceInfo> sourcesList)> call_sources_list_handler_function;
31 
36 typedef boost::function<void(const bool &available)> service_availability_handler;
37 
45 typedef boost::function<void(boost::system::error_code& error_code, std::string& sourceid, std::string& callid, dpyVoicecall::CallStatus status)> call_event_handler_function;
46 
51 typedef boost::function<void(boost::system::error_code& error_code)> request_handler_function;
52 
58 typedef boost::function<void(boost::system::error_code& error_code, const std::string& callid)> make_call_handler_function;
59 
60 
67 typedef boost::function<void(boost::system::error_code error_code,const std::string& callid, dpyVoicecall::CallInformation callinfo)> get_info_handler_function;
68 
75 typedef boost::function<void(boost::system::error_code error_code,std::map<std::string,dpyVoicecall::CallInformation> callList)> get_all_call_info_handler_function;
76 
83 typedef boost::function<void(boost::system::error_code, dpyVoicecall::VoiceCallSourceInfo sourceInfo, ListEvent event)> source_list_event_handler_function;
84 
91 typedef boost::function<void(boost::system::error_code, std::string callsourceid, SourceStatus event)> source_status_handler_function;
92 
98 typedef boost::function<void(boost::system::error_code error_code,std::string sourceid, std::map<dpyVoicecall::CallParameter,std::string> callConfiguration )> get_call_config_handler_function;
99 }
100 
101 #endif
102 
109 {
110 private:
111  boost::shared_ptr<VoiceCallClient> mClient;
112 public:
117  explicit VoiceCall(std::string ip = "127.0.0.1");
118 
122  ~VoiceCall();
123 
124  bool isAlive();
129  void monitorServiceAvailability_S(dpyVoicecall::service_availability_handler handler);
130 
134  void monitorServiceAvailability_U();
135 
140  void asyncGetCallSources(dpyVoicecall::call_sources_list_handler_function handler);
141 
146  void getCallEvents_S(dpyVoicecall::call_event_handler_function handler);
147 
153  void getCallSourceStatus(std::string sourceid, dpyVoicecall::source_status_handler_function handler);
154 
159  void callSourceListEvent_S(dpyVoicecall::source_list_event_handler_function handler);
160 
165  void monitorSourcesStatusEvents_S(dpyVoicecall::source_status_handler_function handler);
166 
174  void asyncSetCallConfiguration(std::string sourceid,const dpyVoicecall::CallParameter& param, const std::string& value, dpyVoicecall::request_handler_function handler);
175 
182  void asyncGetCallConfiguration(std::string sourceid,std::list<dpyVoicecall::CallParameter> parameters, dpyVoicecall::get_call_config_handler_function handler);
183 
190  void asyncMakeCall(const std::string& sourceid, const std::string& destination, dpyVoicecall::make_call_handler_function handler);
191 
197  void asyncAnswerCall(const std::string& callid, dpyVoicecall::request_handler_function handler);
198 
204  void asyncFinishCall(const std::string& callid, dpyVoicecall::request_handler_function handler);
205 
211  void asyncGetCallInfo(const std::string& callid, dpyVoicecall::get_info_handler_function handler);
212 
217  void asyncGetAllCallInfo(dpyVoicecall::get_all_call_info_handler_function handler);
218 
219 
220 };
boost::function< void(boost::system::error_code, std::list< dpyVoicecall::VoiceCallSourceInfo > sourcesList)> call_sources_list_handler_function
Prototype of the handler function for getting available call sources.
Definition: voicecallApi.h:30
boost::function< void(boost::system::error_code error_code, std::string sourceid, std::map< dpyVoicecall::CallParameter, std::string > callConfiguration)> get_call_config_handler_function
Handler for get call configuration.
Definition: voicecallApi.h:98
boost::function< void(boost::system::error_code &error_code, const std::string &callid)> make_call_handler_function
Callback handler used when making calls.
Definition: voicecallApi.h:58
boost::function< void(boost::system::error_code error_code, const std::string &callid, dpyVoicecall::CallInformation callinfo)> get_info_handler_function
Handler for get info function callback.
Definition: voicecallApi.h:67
boost::function< void(boost::system::error_code, std::string callsourceid, SourceStatus event)> source_status_handler_function
Prototype of the handler function for subscribing to source status events.
Definition: voicecallApi.h:91
boost::function< void(const bool &available)> service_availability_handler
Prototype of the handler function used to monitor service availability.
Definition: voicecallApi.h:36
Interacts with the voicecall service in order to manage calls.
Definition: voicecallApi.h:108
boost::function< void(boost::system::error_code error_code, std::map< std::string, dpyVoicecall::CallInformation > callList)> get_all_call_info_handler_function
Handler for get info function callback.
Definition: voicecallApi.h:75
boost::function< void(boost::system::error_code &error_code)> request_handler_function
Handler for answer function callback. This type of function is called to check the result...
Definition: voicecallApi.h:51
Interacts with the voicecall service in order to manage calls.
Definition: voicecallClient.h:15
CallParameter
Defines the Voice Call Configuration parameters that can be configured.
Definition: iVoiceCallSource.h:39
Deepsy Voicecall namespace that includes the different enums, structs or method signatures that shoul...
boost::function< void(boost::system::error_code &error_code, std::string &sourceid, std::string &callid, dpyVoicecall::CallStatus status)> call_event_handler_function
Handler for call event function callback.
Definition: voicecallApi.h:45
boost::function< void(boost::system::error_code, dpyVoicecall::VoiceCallSourceInfo sourceInfo, ListEvent event)> source_list_event_handler_function
Prototype of the handler function for subscribing to list events.
Definition: voicecallApi.h:83