iVoiceCallSource.h
1 #ifndef IVOICECALLSOURCE_H_
2 #define IVOICECALLSOURCE_H_
3 
4 #include "iCall.h"
5 #include "iSim.h" //Eliminate when dpyModem::CallStatus is not used
6 #include <list>
7 #include <boost/shared_ptr.hpp>
8 
9 
10 namespace dpyVoicecall {
11 
12 typedef enum
13 {
14  ADDED = 0,
15  REMOVED = 1,
16 } ListEvent;
17 
18 typedef enum
19 {
20  DISABLED = 0,
21  ENABLED = 1,
22  BUSY = 2,
23 } SourceStatus;
24 
25 
26 typedef enum {
27  SIM_CARD = 0,
28  VoIP = 1,
29 } SourceType;
30 
33 {
34  std::string source="";
36 };
37 
40 {
59 };
60 
61 }
62 
68 {
69 public:
70 
76  virtual void updateSourceStatus(const std::string& sourceid, const dpyVoicecall::SourceStatus& status) = 0;
77 
84  virtual void processCallStatusEvent(const std::string& sourceid,const std::string& callid, const dpyVoicecall::CallStatus& status) = 0;
85 
90  {
91  }
92 };
93 
100 {
101 private:
102  std::string mId;
103  dpyVoicecall::SourceStatus mStatus; //< VoiceCall source status
104  std::vector<VoiceCallSourceObserver*> mObserversList;
105 
106 protected:
111  void setSourceStatus(dpyVoicecall::SourceStatus status);
112  void notifySourceStatusUpdate(const std::string& sourceid, const dpyVoicecall::SourceStatus& status);
113  void notifyCallStatusEvent(const std::string& sourceid,const std::string& callid, const dpyVoicecall::CallStatus& status);
114 
115 public:
116 
121  explicit IVoiceCallSource(const std::string& id);
122 
126  virtual ~IVoiceCallSource();
127 
131  virtual void start() = 0;
132 
136  virtual void stop() = 0;
137 
142  std::string getId() const;
143 
148  virtual dpyVoicecall::SourceType getVoiceCallSourceType() = 0;
149 
154  dpyVoicecall::SourceStatus getSourceStatus();
155 
156 
162  virtual boost::system::error_code getCallStatus(dpyVoicecall::CallStatus& status) = 0;
163 
168  virtual std::list<boost::shared_ptr<ICall>> getCallList() = 0;
169 
176  virtual boost::system::error_code getCallInfo(const std::string& callid, dpyVoicecall::CallInformation& info) = 0;
177 
184  virtual boost::system::error_code makeCall(const std::string& destination, std::string& callid) = 0;
185 
190  virtual boost::system::error_code answerCall(const std::string& callid) = 0;
191 
196  virtual boost::system::error_code finishCall(const std::string& callid) = 0;
197 
203  virtual boost::system::error_code muteCall(const std::string& callid, const bool& mute) = 0;
204 
209  virtual boost::system::error_code redialLastNumber() = 0;
210 
217  virtual boost::system::error_code setCallConfigParameter(const dpyVoicecall::CallParameter& param,const std::string& value) = 0;
218 
223  virtual std::map<dpyVoicecall::CallParameter,std::string> getCallConfigParameters() = 0;
224 
230  boost::system::error_code subscribe(VoiceCallSourceObserver* observer);
231 
237  boost::system::error_code unsubscribe(VoiceCallSourceObserver* observer);
238 
239 
240 };
241 
242 #endif /* IVOICECALLSOURCE_H_ */
ListEvent
Definition: iVoiceCallSource.h:12
CallStatus
Defines the possible call status that a sim can report.
Definition: iCall.h:22
Automatic answer.
Definition: iVoiceCallSource.h:42
Audio src sample rate.
Definition: iVoiceCallSource.h:54
Voice IP source type.
Definition: iVoiceCallSource.h:28
Audio mode.
Definition: iVoiceCallSource.h:43
Opus bitrate.
Definition: iVoiceCallSource.h:56
Voice Call Source interface.
Definition: iVoiceCallSource.h:99
SourceStatus
Source Status.
Definition: iVoiceCallSource.h:18
SourceType type
Voice Call Source type.
Definition: iVoiceCallSource.h:35
Baresip app modules.
Definition: iVoiceCallSource.h:58
Local RTP ports.
Definition: iVoiceCallSource.h:52
Defines the structure containing voice call source information.
Definition: iVoiceCallSource.h:32
Type of ring tone.
Definition: iVoiceCallSource.h:44
SourceType
Definition: iVoiceCallSource.h:26
Amplification of the microphone. Multiplication factor.
Definition: iVoiceCallSource.h:48
virtual ~VoiceCallSourceObserver()
Destructor.
Definition: iVoiceCallSource.h:89
Jack module.
Definition: iVoiceCallSource.h:57
SIP Account for baresip.
Definition: iVoiceCallSource.h:50
Local SIP port.
Definition: iVoiceCallSource.h:51
Allowed audio codecs.
Definition: iVoiceCallSource.h:53
Audio play sample rate.
Definition: iVoiceCallSource.h:55
VoiceCallSource Observer class.
Definition: iVoiceCallSource.h:67
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...
ENABLED.
Definition: iVoiceCallSource.h:21
REMOVED.
Definition: iVoiceCallSource.h:15
Maximum retries number.
Definition: iVoiceCallSource.h:49
Amplification of the microphone. ADC Gain.
Definition: iVoiceCallSource.h:47
Volume of ring tone,varies from low to high.
Definition: iVoiceCallSource.h:45
BUSY.
Definition: iVoiceCallSource.h:22
Number of rings before automatic answer if it is enabled.
Definition: iVoiceCallSource.h:41
Struct to keep information of a call.
Definition: iCall.h:43
DISABLED.
Definition: iVoiceCallSource.h:20
Percentage of volume.
Definition: iVoiceCallSource.h:46
ADDED.
Definition: iVoiceCallSource.h:14
Sim card.
Definition: iVoiceCallSource.h:27