zdk.net
Call.h
1 //
2 // Call.h
3 // ZDK
4 //
5 
6 #ifndef ZDK_NET_Call_h
7 #define ZDK_NET_Call_h
8 
9 #include "native_shared_ptr.h"
10 #include "PublicInterfaces.h"
11 #include "BrandingInfo.h"
12 #include "CallStatus.h"
13 #include "AudioVideoCodecs.h"
14 #include "VideoCallInfo.h"
15 #include "Account.h"
16 #include "CallEventsHandler.h"
17 #include "VideoRendererEventsHandler.h"
18 #include "VideoFrameFormat.h"
19 #include "OriginType.h"
20 #include "DTMFCodes.h"
21 #include "AudioFileFormat.h"
22 #include "Result.h"
23 #include "CameraSensorLocation.h"
24 #include "ZHandle.h"
25 
26 using namespace System::Collections::Generic;
27 
28 namespace ZDK_NET
29 {
30  ref class BrandingInfo;
31  ref class CallStatus;
32  ref class VideoCallInfo;
33  ref class Account;
34  ref class CallEventsHandler;
35  ref class VideoRendererEventsHandler;
36  ref class Call;
37  ref class Result;
38 
39  public ref class Call : ZHandle
40  {
41  private:
42  //LISTENERS:
43  static GeneralStatusEventListener *CallEventsHandler_Listener = nullptr;
44  static GeneralStatusEventListener *VideoRendererEventsHandler_Listener = nullptr;
45 
46  static bool RegisterEventListeners()
47  {
48  std::shared_ptr<GeneralStatusEventListener> CallEventsHandler_Listener_tmp = std::make_shared<GeneralStatusEventListener>();
49  CallEventsHandler_Listener = CallEventsHandler_Listener_tmp.get();
50  listenersMap->try_emplace(reinterpret_cast<intptr_t>(CallEventsHandler_Listener), std::move(CallEventsHandler_Listener_tmp));
51  std::shared_ptr<GeneralStatusEventListener> VideoRendererEventsHandler_Listener_tmp = std::make_shared<GeneralStatusEventListener>();
52  VideoRendererEventsHandler_Listener = VideoRendererEventsHandler_Listener_tmp.get();
53  listenersMap->try_emplace(reinterpret_cast<intptr_t>(VideoRendererEventsHandler_Listener), std::move(VideoRendererEventsHandler_Listener_tmp));
54  return true;
55  }
56 
57  static bool RegisteredEventListeners = RegisterEventListeners();
58  public:
59  ZDK::ICall* cppRef = nullptr;
60 
61  Call(ZDK::Shared::Call src);
62  ~Call();
63  !Call();
64 
69  property long long CallHandle
70  {
71  long long get();
72  }
73 
74  property ZDK_NET::BrandingInfo^ Branding
75  {
76  ZDK_NET::BrandingInfo^ get();
77  void set(ZDK_NET::BrandingInfo^ value);
78  }
79 
86  property ZDK_NET::CallStatus^ Status
87  {
88  ZDK_NET::CallStatus^ get();
89  }
90 
95  property System::String^ CalleeNumber
96  {
97  System::String^ get();
98  }
99 
104  property System::String^ CalleeName
105  {
106  System::String^ get();
107  }
108 
115  property ZDK_NET::AudioVideoCodecs CodecInUse
116  {
117  ZDK_NET::AudioVideoCodecs get();
118  }
119 
129  property bool OnSpeaker
130  {
131  bool get();
132  void set(bool value);
133  }
134 
141  property bool Held
142  {
143  bool get();
144  void set(bool value);
145  }
146 
155  property bool Muted
156  {
157  bool get();
158  void set(bool value);
159  }
160 
169  property ZDK_NET::VideoCallInfo^ VideoCallInfo
170  {
171  ZDK_NET::VideoCallInfo^ get();
172  }
173 
174  property bool IsFirstClass
175  {
176  bool get();
177  }
178 
185  property ZDK_NET::Account^ Owner
186  {
187  ZDK_NET::Account^ get();
188  }
189 
194  property System::String^ RecordFileName
195  {
196  void set(System::String^ value);
197  }
198 
206 
214 
218 
219  void SetVideoRendererNotificationsListener(ZDK_NET::VideoRendererEventsHandler^ value);
220 
231 
241 
249 
265 
275 
293 
312  ZDK_NET::Result^ BlindTransfer(System::String^ transferee);
313 
323 
333 
348  void SendVideoFrame(unsigned char* bytes, int byteCount, ZDK_NET::VideoFrameFormat type);
349 
357 
367  ZDK_NET::CameraSensorLocation VideoGetCameraLocation();
368 
376 
387  bool HasVideo(ZDK_NET::OriginType origin);
388 
392 
396 
404 
421  ZDK_NET::Result^ SendDTMF(ZDK_NET::DTMFCodes dtmf);
422 
430 
438 
449  ZDK_NET::Result^ EnableZrtp(bool enabled);
450 
461  ZDK_NET::Result^ ConfirmZrtpSas(bool confirmed);
462 
471  ZDK_NET::Result^ ConfigureCallRecordFormat(ZDK_NET::AudioFileFormat format);
472 
473  virtual long long Handle() override;
474 
475  virtual void Initialize() override;
476 
477  virtual void ReleaseReference() override;
478 
479  };
480 }
481 
482 #endif
ZDK_NET::Call::VideoToggleCamera
ZDK_NET::Result ^ VideoToggleCamera()
Toggles the camera.
ZDK_NET::Result
API invocation status result.
Definition: Result.h:24
ZDK_NET::CallEventsHandler
Definition: CallEventsHandler.h:386
ZDK_NET::Call::AttendedTransfer
ZDK_NET::Result ^ AttendedTransfer(ZDK_NET::Call^ transferee)
Initiates an attended call transfer.
ZDK_NET::BrandingInfo
Definition: BrandingInfo.h:19
ZDK_NET::Call::StartHandlingVoipPhoneCallEvents
void StartHandlingVoipPhoneCallEvents()
Start handling Call events.
ZDK_NET::Call::AcceptCallTransfer
ZDK_NET::Call ^ AcceptCallTransfer()
Accept a call transfer request.
ZDK_NET::Call::DropAllEventListeners
void DropAllEventListeners()
Drops all event listeners.
ZDK_NET::Call::DropCallStatusListener
void DropCallStatusListener(ZDK_NET::CallEventsHandler^ value)
Drops Call status listener.
ZDK_NET::Call::ConfirmZrtpSas
ZDK_NET::Result ^ ConfirmZrtpSas(bool confirmed)
Enables ZRTP.
ZDK_NET::VideoRendererEventsHandler
Definition: VideoRendererEventsHandler.h:30
ZDK_NET::Call::OfferVideo
ZDK_NET::Result ^ OfferVideo()
Offers Video.
ZDK_NET::Call::Ringing
ZDK_NET::Result ^ Ringing()
Notifies the remote party that we are ringing (incoming calls)
ZDK_NET::Call::HasVideo
bool HasVideo(ZDK_NET::OriginType origin)
Gets if video is present.
ZDK_NET::Call::VideoGetCameraLocation
ZDK_NET::CameraSensorLocation VideoGetCameraLocation()
Provides Camera location.
ZDK_NET::Call::SendDTMF
ZDK_NET::Result ^ SendDTMF(ZDK_NET::DTMFCodes dtmf)
Sends a DTMF signal over a call.
ZDK_NET::Call::BlindTransfer
ZDK_NET::Result ^ BlindTransfer(System::String^ transferee)
Initiates an unattended call transfer.
ZDK_NET::Call::StartRecording
ZDK_NET::Result ^ StartRecording()
Start recording call.
GeneralStatusEventListener
Definition: GeneralStatusEventListener.h:90
ZDK_NET::Account
The main account class.
Definition: Account.h:38
ZDK_NET::CallStatus
Call's status information.
Definition: CallStatus.h:27
ZDK_NET::Call::ConfigureCallRecordFormat
ZDK_NET::Result ^ ConfigureCallRecordFormat(ZDK_NET::AudioFileFormat format)
Configures a call recording's encoding format and its specific settings.
ZDK_NET::Call::NotifyAccountOfOwnershipChange
ZDK_NET::Result ^ NotifyAccountOfOwnershipChange()
Notify upon Account ownership changes.
ZDK_NET::Call
Definition: Call.h:40
ZDK_NET::Call::SendVideoFrame
void SendVideoFrame(unsigned char *bytes, int byteCount, ZDK_NET::VideoFrameFormat type)
Send a video frame over the network.
ZDK_NET::VideoCallInfo
Definition: VideoCallInfo.h:21
ZDK_NET::Call::RejectCallTransfer
ZDK_NET::Result ^ RejectCallTransfer()
Rejects a call transfer request.
ZDK_NET::Call::RestartVideoCapture
ZDK_NET::Result ^ RestartVideoCapture()
Restart Video capture.
ZDK_NET::Call::AcceptCall
ZDK_NET::Result ^ AcceptCall()
Accepts an incoming call.
ZDK_NET::Call::StopRecording
ZDK_NET::Result ^ StopRecording()
Stop recording.
ZDK_NET::Call::EnableZrtp
ZDK_NET::Result ^ EnableZrtp(bool enabled)
Enables ZRTP.
ZDK_NET::Call::AcceptVideo
ZDK_NET::Result ^ AcceptVideo(bool accept)
Accepts an incoming offer for video.
ZDK_NET::Call::SetCallStatusListener
void SetCallStatusListener(ZDK_NET::CallEventsHandler^ value)
Sets Call status listener.
ZDK_NET::Call::StopHandlingVoipPhoneCallEvents
void StopHandlingVoipPhoneCallEvents()
Stops handling Call events.
ZDK_NET::ZHandle
Definition: ZHandle.h:18
ZDK_NET::Call::HangUp
ZDK_NET::Result ^ HangUp()
Hang up the call.