OpenTera WebRTC API (C++) 1.2.6
WebSocketSignalingClient.h
1 #ifndef OPENTERA_WEBRTC_NATIVE_CLIENT_SIGNALING_SIO_SIGNALING_CLIENT_H
2 #define OPENTERA_WEBRTC_NATIVE_CLIENT_SIGNALING_SIO_SIGNALING_CLIENT_H
3 
4 #include <OpenteraWebrtcNativeClient/Signaling/SignalingClient.h>
5 
6 #include <ixwebsocket/IXWebSocket.h>
7 
8 namespace opentera
9 {
11  {
12  ix::WebSocket m_ws;
13  std::string m_sessionId;
14 
15  public:
17  ~WebSocketSignalingClient() override;
18 
19  DECLARE_NOT_COPYABLE(WebSocketSignalingClient);
20  DECLARE_NOT_MOVABLE(WebSocketSignalingClient);
21 
22  void setTlsVerificationEnabled(bool isEnabled) override;
23 
24  bool isConnected() override;
25  std::string sessionId() override;
26 
27  void connect() override;
28  void close() override;
29  void closeSync() override;
30 
31  void callAll() override;
32  void callIds(const std::vector<std::string>& ids) override;
33  void closeAllRoomPeerConnections() override;
34 
35  void callPeer(const std::string& toId, const std::string& sdp) override;
36  void makePeerCallAnswer(const std::string& toId, const std::string& sdp) override;
37  void rejectCall(const std::string& toId) override;
38  void sendIceCandidate(
39  const std::string& sdpMid,
40  int sdpMLineIndex,
41  const std::string& candidate,
42  const std::string& toId) override;
43 
44  private:
45  void connectWsEvents();
46 
47  void onWsOpenEvent();
48  void onWsCloseEvent();
49  void onWsErrorEvent(const std::string& error);
50  void onWsMessage(const std::string& message);
51 
52  void onJoinRoomAnswerEvent(const nlohmann::json& data);
53 
54  void onRoomClientsEvent(const nlohmann::json& data);
55 
56  void onMakePeerCallEvent(const nlohmann::json& data);
57  void onPeerCallReceivedEvent(const nlohmann::json& data);
58  void onPeerCallAnswerReceivedEvent(const nlohmann::json& data);
59  void onCloseAllPeerConnectionsRequestReceivedEvent();
60  void onIceCandidateReceivedEvent(const nlohmann::json& data);
61  };
62 }
63 
64 #endif
Definition: SignalingClient.h:16
Represents a signaling server configuration.
Definition: SignalingServerConfiguration.h:14
Definition: WebSocketSignalingClient.h:11