WebRTC module

SignallingInterface

Transport-agnostic signalling interface for WebRTC session setup.

SignallingInterface

#include <icy/webrtc/signalling.h>

Subclassed by: SympleServerSignaller, SympleSignaller, WebSocketSignaller

Transport-agnostic signalling interface for WebRTC session setup.

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.

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

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

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

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

Public Methods

ReturnNameDescription
voidsendSdpSend an SDP offer or answer to the remote peer.
voidsendCandidateSend an ICE candidate to the remote peer.
voidsendControlSend a control message to the remote peer.

sendSdp

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

Send an SDP offer or answer to the remote peer.

Parameters

  • peerId Remote peer identifier.

  • type "offer" or "answer".

  • sdp The SDP string.


sendCandidate

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

Send an ICE candidate to the remote peer.

Parameters

  • peerId Remote peer identifier.

  • candidate The candidate string (from RTCIceCandidate).

  • mid The sdpMid value.


sendControl

void sendControl(const std::string & peerId, const std::string & type, const std::string & reason)

Send a control message to the remote peer.

Parameters

  • peerId Remote peer identifier.

  • type Control type: "init", "accept", "reject", "hangup".

  • reason Optional reason string (for reject/hangup).