|
reSIProcate
SIP stack, Dialog Usage Manager and related libraries
|
This class represents a Flow that is created by the Flow Manager. More...
#include <Flow.hxx>
Public Types | |
| enum | FlowState { Unconnected , ConnectingServer , Connecting , Binding , Allocating , Connected , Ready } |
Public Member Functions | |
| Flow (asio::io_context &ioService, asio::ssl::context &sslContext, unsigned int componentId, const StunTuple &localBinding, MediaStream &mediaStream, bool forceCOMedia, std::shared_ptr< RTCPEventLoggingHandler > rtcpEventLoggingHandler=nullptr, std::shared_ptr< FlowContext > context=nullptr) | |
| ~Flow () | |
| void | activateFlow (uint8_t allocationProps=StunMessage::PropsNone) |
| void | activateFlow (uint64_t reservationToken) |
| bool | isReady () |
| unsigned int | getSelectSocketDescriptor () |
| Returns a socket descriptor that can be used in a select call WARNING - this descriptor should not be used for any other purpose. | |
| unsigned int | getSocketDescriptor () |
| void | send (char *buffer, unsigned int size) |
| Turn Send Methods WARNING - if using Secure media, then there must be room at the end of the passed in buffer for the SRTP HMAC code to be appended It would be good to make this safer | |
| void | sendTo (const asio::ip::address &address, unsigned short port, char *buffer, unsigned int size) |
| void | rawSendTo (const asio::ip::address &address, unsigned short port, const char *buffer, unsigned int size) |
| asio::error_code | receive (char *buffer, unsigned int &size, unsigned int timeout, asio::ip::address *sourceAddress=0, unsigned short *sourcePort=0) |
| Receive Methods. | |
| asio::error_code | receiveFrom (const asio::ip::address &address, unsigned short port, char *buffer, unsigned int &size, unsigned int timeout) |
| void | setActiveDestination (const char *address, unsigned short port) |
| Used to set where this flow should be sending to. | |
| void | startDtlsClient (const char *address, unsigned short port) |
| Dtls-Srtp Methods. | |
| void | setRemoteSDPFingerprint (const resip::Data &hashFunction, const resip::Data &fingerprint) |
| This method should be called when remote fingerprint is discovered via SDP negotiation (RFC 8122 a=fingerprint): hashFunction is its hash function textual name, eg. | |
| const resip::Data | getRemoteSDPFingerprint () |
| Retrieves the stored remote SDP Fingerprint. | |
| const StunTuple & | getLocalTuple () |
| StunTuple | getSessionTuple () |
| StunTuple | getRelayTuple () |
| StunTuple | getReflexiveTuple () |
| uint64_t | getReservationToken () |
| unsigned int | getComponentId () |
Public Member Functions inherited from reTurn::TurnAsyncSocketHandler | |
| TurnAsyncSocketHandler () | |
| virtual | ~TurnAsyncSocketHandler () |
Static Public Attributes | |
| static int | maxReceiveFifoDuration = 10 |
| static int | maxReceiveFifoSize = 100 * maxReceiveFifoDuration |
| static int | dtlsHandshakeEvictionGrace = 5 |
| Seconds after which a server DTLS handshake still in progress gives up its place, when a flow already has as many DTLS associations as it allows, to a new peer that has completed the cookie exchange: a real handshake takes a few round trips; one that hasn't finished by then has stalled (eg. | |
Friends | |
| class | FlowDtlsSocketContext |
This class represents a Flow that is created by the Flow Manager.
A flow is a bi-directional stream of data for communicating with an endpoint, that may use UDP, TCP or TLS over TCP. A flow may also use a Turn Allocation to transmit data to/from an endpoint.
Author: Scott Godin (sgodin AT SipSpectrum DOT com)
| Flow::Flow | ( | asio::io_context & | ioService, |
| asio::ssl::context & | sslContext, | ||
| unsigned int | componentId, | ||
| const StunTuple & | localBinding, | ||
| MediaStream & | mediaStream, | ||
| bool | forceCOMedia, | ||
| std::shared_ptr< RTCPEventLoggingHandler > | rtcpEventLoggingHandler = nullptr, |
||
| std::shared_ptr< FlowContext > | context = nullptr |
||
| ) |
| const resip::Data Flow::getRemoteSDPFingerprint | ( | ) |
| void Flow::setRemoteSDPFingerprint | ( | const resip::Data & | hashFunction, |
| const resip::Data & | fingerprint | ||
| ) |
This method should be called when remote fingerprint is discovered via SDP negotiation (RFC 8122 a=fingerprint): hashFunction is its hash function textual name, eg.
"sha-256". SRTP is only set up for dtls-srtp connections whose peer certificate matches it, so none is set up until this is called; connections that have already completed their handshake are checked now. Calling it means DTLS-SRTP was negotiated: from then on, media is only sent to, and passed on from, endpoints whose DTLS handshake has set up SRTP - never in the clear.
|
friend |
|
static |
Seconds after which a server DTLS handshake still in progress gives up its place, when a flow already has as many DTLS associations as it allows, to a new peer that has completed the cookie exchange: a real handshake takes a few round trips; one that hasn't finished by then has stalled (eg.
to hold the place)
|
static |