class RTPSession

Full RTP session. More...

Full nameTelEngine::RTPSession
Definition#include <libs/yrtp/yatertp.h>
InheritsTelEngine::RTPProcessor [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Protected Methods


Detailed Description

An unidirectional or bidirectional RTP session

enum Direction { FullStop = 0, RecvOnly = 1, SendOnly = 2, SendRecv = 3 }

Direction

Direction of the session

 RTPSession ()

RTPSession

Default constructor, creates a detached session

 ~RTPSession ()

~RTPSession

[virtual]

Destructor - shuts down the session and destroys the transport

void  rtpData (const void* data, int len)

rtpData

[virtual]

This method is called to process a RTP packet.

Parameters:
dataPointer to raw RTP data
lenLength of the data packet

Reimplemented from RTPProcessor.

void  rtcpData (const void* data, int len)

rtcpData

[virtual]

This method is called to process a RTCP packet.

Parameters:
dataPointer to raw RTCP data
lenLength of the data packet

Reimplemented from RTPProcessor.

bool  rtpRecvData (bool marker, unsigned int timestamp, const void* data, int len)

rtpRecvData

[virtual]

Process one RTP data packet

Parameters:
markerSet to true if the marker bit is set
timestampSampling instant of the packet data
dataPointer to data block to process
lenLength of the data block in bytes

Returns: True if data was handled

bool  rtpRecvEvent (int event, char key, int duration, int volume, unsigned int timestamp)

rtpRecvEvent

[virtual]

Process one RTP event

Parameters:
eventReceived event code
keyReceived key (for events 0-16) or zero
durationDuration of the event as number of samples
volumeAttenuation of the tone, zero for don't care
timestampSampling instant of the initial packet data

Returns: True if data was handled

void  rtpNewPayload (int payload, unsigned int timestamp)

rtpNewPayload

[virtual]

Method called for unknown payload types just before attempting to call rtpRecvData(). This is a good opportunity to change the payload type and continue.

Parameters:
payloadPayload number
timestampSampling instant of the unexpected packet data

void  rtpNewSSRC (u_int32_t newSsrc, bool marker)

rtpNewSSRC

[virtual]

Method called when a packet with an unexpected SSRC is received just before processing further. This is a good opportunity to change the SSRC and continue

Parameters:
newSsrcSSRC received in packet
markerTrue if marker bit is set in the RTP packet

RTPSender*  createSender ()

createSender

[virtual]

Create a new RTP sender for this session. Override this method to create objects derived from RTPSender.

Returns: Pointer to the new sender or NULL on failure

RTPReceiver*  createReceiver ()

createReceiver

[virtual]

Create a new RTP receiver for this session. Override this method to create objects derived from RTPReceiver.

Returns: Pointer to the new receiver or NULL on failure

RTPTransport*  createTransport ()

createTransport

[virtual]

Create a new RTP transport for this session. Override this method to create objects derived from RTPTransport.

Returns: Pointer to the new transport or NULL on failure

Cipher*  createCipher (const String& name, Cipher::Direction dir)

createCipher

[virtual]

Create a cipher when required for SRTP

Parameters:
nameName of the cipher to create
dirDirection the cipher must be able to handle

Returns: Pointer to newly allocated Cipher or NULL

bool  checkCipher (const String& name)

checkCipher

[virtual]

Check if a cipher is supported for SRTP

Parameters:
nameName of the cipher to check

Returns: True if the specified cipher is supported

bool  initTransport ()

initTransport

Initialize the RTP session, attach a transport if there is none

Returns: True if initialized, false on some failure

bool  initGroup (int msec = 0, Thread::Priority prio = Thread::Normal)

initGroup

Initialize the RTP session, attach a group if none is present

Parameters:
msecMinimum time to sleep in group loop in milliseconds
prioThread priority to run the new group

Returns: True if initialized, false on some failure

inline bool  rtpSend (bool marker, int payload, unsigned int timestamp, const void* data, int len)

rtpSend

Send one RTP payload packet

Parameters:
markerSet to true if the marker bit must be set
payloadPayload number
timestampSampling instant of the packet data
dataPointer to data block to send
lenLength of the data block

Returns: True if data sending was attempted

inline bool  rtpSendData (bool marker, unsigned int timestamp, const void* data, int len)

rtpSendData

Send one RTP data packet

Parameters:
markerSet to true if the marker bit must be set
timestampSampling instant of the packet data
dataPointer to data block to send
lenLength of the data block

Returns: True if data sending was attempted

inline bool  rtpSendEvent (int event, int duration, int volume = 0, unsigned int timestamp = 0)

rtpSendEvent

Send one RTP event

Parameters:
eventEvent code to send
durationDuration of the event as number of samples
volumeAttenuation of the tone, zero for don't care
timestampSampling instant of the packet data, zero to use current

Returns: True if data sending was attempted

inline bool  rtpSendKey (char key, int duration, int volume = 0, unsigned int timestamp = 0)

rtpSendKey

Send one RTP key event

Parameters:
keyKey to send
durationDuration of the event as number of samples
volumeAttenuation of the tone, zero for don't care
timestampSampling instant of the packet data, zero to use current

Returns: True if data sending was attempted

inline int  padding ()

padding

[const]

Get the payload padding size

Returns: Chunk size to pad the payload to a multiple of

inline bool  padding (int chunk)

padding

Set the padding to a multiple of a data chunk

Parameters:
chunkSize to pad the payload to a multiple of

Returns: True if the new chunk size is valid

inline void  setDejitter (unsigned int mindelay = 20, unsigned int maxdelay = 50)

setDejitter

Allocate and set a new dejitter buffer for the receiver in the session

Parameters:
mindelayMinimum length of the dejitter buffer in microseconds
maxdelayMaximum length of the dejitter buffer in microseconds

inline RTPTransport*  transport ()

transport

[const]

Get the RTP/RTCP transport of data handled by this session.

Returns: A pointer to the RTPTransport of this session

void  transport (RTPTransport* trans)

transport

Set the RTP/RTCP transport of data handled by this session

Parameters:
transA pointer to the new RTPTransport for this session

inline RTPSender*  sender ()

sender

[const]

Get the RTP/RTCP sender of this session

Returns: A pointer to the RTPSender of this session

void  sender (RTPSender* send)

sender

Set the RTP/RTCP sender of this session

Parameters:
sendA pointer to the new RTPSender of this session or NULL

inline RTPReceiver*  receiver ()

receiver

[const]

Get the RTP/RTCP receiver of this session

Returns: A pointer to the RTPReceiver of this session

void  receiver (RTPReceiver* recv)

receiver

Set the RTP/RTCP receiver of this session

Parameters:
recvA pointer to the new RTPReceiver of this session or NULL

inline Direction  direction ()

direction

[const]

Get the direction of this session

Returns: Session's direction as a Direction enum

bool  direction (Direction dir)

direction

Set the direction of this session. A transport must exist for this method to succeed.

Parameters:
dirNew Direction for this session

Returns: True if direction was set, false if a failure occured

inline bool  addDirection (Direction dir)

addDirection

Add a direction of this session. A transport must exist for this method to succeed.

Parameters:
dirNew Direction to add for this session

Returns: True if direction was set, false if a failure occured

inline bool  delDirection (Direction dir)

delDirection

Delete a direction of this session. A transport must exist for this method to succeed.

Parameters:
dirDirection to remove for this session

Returns: True if direction was set, false if a failure occured

bool  dataPayload (int type)

dataPayload

Set the data payload type for both receiver and sender.

Parameters:
typePayload type, -1 to disable

Returns: True if changed, false if invalid payload type

bool  eventPayload (int type)

eventPayload

Set the event payload type for both receiver and sender.

Parameters:
typePayload type, -1 to disable

Returns: True if changed, false if invalid payload type

bool  silencePayload (int type)

silencePayload

Set the silence payload type for both receiver and sender.

Parameters:
typePayload type, -1 to disable

Returns: True if changed, false if invalid payload type

inline bool  localAddr (SocketAddr& addr, bool rtcp = true)

localAddr

Set the local network address of the RTP transport of this session

Parameters:
addrNew local RTP transport address
rtcpEnable RTCP in this session

Returns: True if address set, false if a failure occured

inline bool  remoteAddr (SocketAddr& addr, bool sniff = false)

remoteAddr

Set the remote network address of the RTP transport of this session

Parameters:
addrNew remote RTP transport address
sniffAutomatically adjust the address from the first incoming packet

Returns: True if address set, false if a failure occured

inline bool  setTOS (int tos)

setTOS

Set the Type Of Service for the RTP transport socket

Parameters:
tosType Of Service bits to set

Returns: True if operation was successfull, false if an error occured

inline Socket*  rtpSock ()

rtpSock

Get the RTP socket used by this session

Returns: Pointer to the RTP socket, NULL if no transport exists

inline bool  drillHole ()

drillHole

Drill a hole in a firewall or NAT for the RTP and RTCP sockets

Returns: True if at least a packet was sent for the RTP socket

void  setTimeout (int interval)

setTimeout

Set the interval until receiver timeout is detected

Parameters:
intervalMilliseconds until receiver times out, zero to disable

inline RTPSecure*  security ()

security

[const]

Get the stored security provider or of the sender

Returns: A pointer to the RTPSecure or NULL

void  security (RTPSecure* secure)

security

Store a security provider for the sender

Parameters:
securePointer to the new RTPSecure or NULL

void  timerTick (const Time& when)

timerTick

[protected virtual]

Method called periodically to push any asynchronous data or statistics

Parameters:
whenTime to use as base in all computing

Reimplemented from RTPProcessor.

void  timeout (bool initial)

timeout

[protected virtual]

Method called when the receiver timed out

Parameters:
initialTrue if no packet was ever received in this session


Generated by: paulc on bussard on Wed Oct 21 01:57:30 2009, using kdoc 2.0a54.