WebRTC support helpers

SympleServerSignaller

Server-side Symple signaller for virtual peers and embedded apps.

SympleServerSignaller

#include <icy/webrtc/support/sympleserversignaller.h>

Inherits: SignallingInterface

Server-side Symple signaller for virtual peers and embedded apps.

This adapter sends signalling messages through a [smpl::Server](icy-smpl-Server.html#server-11) on behalf of a local virtual peer address, and accepts inbound Symple call messages through [onMessage()](#onmessage-2).

The remote peer identifier on this signalling boundary is the full Symple address string (user|id).

Public Methods

ReturnNameDescription
SympleServerSignaller
SympleServerSignallerDeleted constructor.
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.
voidonMessage
voidsetRemoteAddress
const std::string &localAddress const inline
const std::string &remoteAddress const inline

SympleServerSignaller

SympleServerSignaller(smpl::Server & server, std::string localAddress, std::string remoteAddress)

SympleServerSignaller

SympleServerSignaller(const SympleServerSignaller &) = delete

Deleted constructor.


sendSdp

virtual

virtual 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

virtual

virtual 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

virtual

virtual 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).


onMessage

void onMessage(const json::Value & msg)

setRemoteAddress

void setRemoteAddress(std::string remoteAddress)

localAddress

const inline

inline const std::string & localAddress() const

remoteAddress

const inline

inline const std::string & remoteAddress() const

Private Attributes

ReturnNameDescription
smpl::Server &_server
std::string_localAddress
std::string_remoteAddress
Synchronizer_dispatch
std::mutex_mutex
std::deque< OutboundMessage >_pending
bool_closing

_server

smpl::Server & _server

_localAddress

std::string _localAddress

_remoteAddress

std::string _remoteAddress

_dispatch

Synchronizer _dispatch

_mutex

std::mutex _mutex

_pending

std::deque< OutboundMessage > _pending

_closing

bool _closing = false

Private Methods

ReturnNameDescription
voidsend
boolsendNow
voidflushPending

send

void send(const std::string & action, const std::string & to, const json::Value & data)

sendNow

bool sendNow(const std::string & to, const json::Value & msg)

flushPending

void flushPending()