WebRTC module

SignallingInterface

Transport-agnostic signalling interface for WebRTC session setup.

#include <icy/webrtc/signalling.h>

class SignallingInterface

Defined in src/webrtc/include/icy/webrtc/signalling.h:42

Implementations handle the exchange of SDP offers/answers and ICE candidates between peers over whatever transport is available: Symple, plain WebSocket, REST, MQTT, carrier pigeon, etc.

PeerSession takes a reference to this interface. Implement it to plug in your own signalling backend.

PeerSession dispatches outbound SDP and ICE candidates on its event loop. Call its public control methods on that same loop when using a loop-affine signalling transport.

The three message categories:

  • SDP: offer/answer exchange (the session description)
  • Candidate: trickle ICE candidates
  • Control: call lifecycle (init, accept, reject, hangup)

Public Attributes

ReturnNameDescription
ThreadSignal< void(const std::string &, const std::string &, const std::string &)>SdpReceivedFires when an SDP offer or answer arrives from a remote peer. Parameters: peerId, type ("offer"/"answer"), sdp.
ThreadSignal< void(const std::string &, const std::string &, const std::string &)>CandidateReceivedFires when an ICE candidate arrives from a remote peer. Parameters: peerId, candidate, mid.
ThreadSignal< void(const std::string &, const std::string &, const std::string &)>ControlReceivedFires when a control message arrives from a remote peer. Parameters: peerId, type ("init"/"accept"/"reject"/"hangup"), reason.

SdpReceived

ThreadSignal< void(const std::string &, const std::string &, const std::string &)> SdpReceived

Type: ThreadSignal< void(const std::string &, const std::string &, const std::string &)>

Defined in src/webrtc/include/icy/webrtc/signalling.h:81

Fires when an SDP offer or answer arrives from a remote peer. Parameters: peerId, type ("offer"/"answer"), sdp.


CandidateReceived

ThreadSignal< void(const std::string &, const std::string &, const std::string &)> CandidateReceived

Type: ThreadSignal< void(const std::string &, const std::string &, const std::string &)>

Defined in src/webrtc/include/icy/webrtc/signalling.h:85

Fires when an ICE candidate arrives from a remote peer. Parameters: peerId, candidate, mid.


ControlReceived

ThreadSignal< void(const std::string &, const std::string &, const std::string &)> ControlReceived

Type: ThreadSignal< void(const std::string &, const std::string &, const std::string &)>

Defined in src/webrtc/include/icy/webrtc/signalling.h:89

Fires when a control message arrives from a remote peer. Parameters: peerId, type ("init"/"accept"/"reject"/"hangup"), reason.

Public Methods

ReturnNameDescription
~SignallingInterface virtualDefaulted destructor.
voidsendSdp virtualSend an SDP offer or answer to the remote peer.
voidsendCandidate virtualSend an ICE candidate to the remote peer.
voidsendControl virtualSend a control message to the remote peer.

~SignallingInterface

virtual

virtual ~SignallingInterface() = default

Defined in src/webrtc/include/icy/webrtc/signalling.h:45

Defaulted destructor.


sendSdp

virtual

virtual void sendSdp(const std::string & peerId, const std::string & type, const std::string & sdp)

Defined in src/webrtc/include/icy/webrtc/signalling.h:55

Send an SDP offer or answer to the remote peer.

Reimplemented by

Parameters

ParameterTypeDescription
peerIdconst std::string &Remote peer identifier.
typeconst std::string &"offer" or "answer".
sdpconst std::string &The SDP string.

sendCandidate

virtual

virtual void sendCandidate(const std::string & peerId, const std::string & candidate, const std::string & mid)

Defined in src/webrtc/include/icy/webrtc/signalling.h:63

Send an ICE candidate to the remote peer.

Reimplemented by

Parameters

ParameterTypeDescription
peerIdconst std::string &Remote peer identifier.
candidateconst std::string &The candidate string (from RTCIceCandidate).
midconst std::string &The sdpMid value.

sendControl

virtual

virtual void sendControl(const std::string & peerId, const std::string & type, const std::string & reason = {})

Defined in src/webrtc/include/icy/webrtc/signalling.h:71

Send a control message to the remote peer.

Reimplemented by

Parameters

ParameterTypeDescription
peerIdconst std::string &Remote peer identifier.
typeconst std::string &Control type: "init", "accept", "reject", "hangup".
reasonconst std::string &Optional reason string (for reject/hangup).