|
Yate
|
A holder for a SDP session. More...
#include <yatesdp.h>
Public Types | |
| enum | { MediaMissing , MediaStarted , MediaMuted } |
Public Member Functions | |
| SDPSession (SDPParser *parser) | |
| SDPSession (SDPParser *parser, NamedList ¶ms) | |
| virtual | ~SDPSession () |
| const String & | getHost () const |
| const String & | getRtpAddr () const |
| bool | setMedia (ObjList *media, bool preserveExisting=false) |
| void | putMedia (NamedList &msg, bool putPort=true) |
| SDPMedia * | getMedia (const String &name) const |
| void | setRfc2833 (const String &value) |
| void | setRfc2833 (const String *value) |
| bool | dispatchRtp (SDPMedia *media, const char *addr, bool start, bool pick, RefObject *context=0) |
| bool | dispatchRtp (const char *addr, bool start, RefObject *context=0) |
| bool | startRtp (RefObject *context=0) |
| bool | updateSDP (const NamedList ¶ms, bool defaults=true) |
| bool | updateRtpSDP (const NamedList ¶ms) |
| MimeSdpBody * | createSDP (const char *addr, ObjList *mediaList=0) |
| MimeSdpBody * | createSDP () |
| MimeSdpBody * | createPasstroughSDP (NamedList &msg, bool update=true, bool allowEmptyAddr=false) |
| MimeSdpBody * | createRtpSDP (const char *addr, const NamedList &msg) |
| MimeSdpBody * | createRtpSDP (const char *addr, bool start) |
| MimeSdpBody * | createRtpSDP (bool start) |
| void | updateFormats (const NamedList &msg, bool changeMedia=false) |
| bool | addSdpParams (NamedList &msg, const MimeBody *body) |
| bool | addSdpParams (NamedList &msg, const String &rawSdp) |
| bool | addRtpParams (NamedList &msg, const String &natAddr=String::empty(), const MimeBody *body=0, bool force=false, bool allowEmptyAddr=false) |
| virtual void | resetSdp (bool all=true) |
| virtual Message * | buildChanRtp (SDPMedia *media, const char *addr, bool start, RefObject *context) |
| virtual Message * | buildChanRtp (RefObject *context)=0 |
| bool | localRtpChanged () const |
| void | setLocalRtpChanged (bool chg=false) |
Static Public Member Functions | |
| static void | putMedia (NamedList &msg, ObjList *media, bool putPort=true) |
| static ObjList * | updateRtpSDP (const NamedList ¶ms, String &rtpAddr, ObjList *oldList=0, bool allowEmptyAddr=false) |
Protected Member Functions | |
| virtual void | mediaChanged (const SDPMedia &media) |
| virtual void | dispatchingRtp (Message *&msg, SDPMedia *media) |
| void | setSdpDebug (DebugEnabler *enabler=0, void *ptr=0, const String &traceId=String::empty()) |
| void | printRtpMedia (const char *reason) |
| void | setFormatsExtra (const NamedList &list, bool out) |
Protected Attributes | |
| SDPParser * | m_parser |
| int | m_mediaStatus |
| bool | m_rtpForward |
| bool | m_sdpForward |
| String | m_originAddr |
| String | m_externalAddr |
| String | m_rtpAddr |
| String | m_rtpLocalAddr |
| String | m_rtpNatAddr |
| ObjList * | m_rtpMedia |
| int | m_sdpSession |
| int | m_sdpVersion |
| unsigned int | m_sdpHash |
| String | m_host |
| bool | m_secure |
| int | m_rfc2833 |
| bool | m_ipv6 |
| NamedList | m_amrExtra |
A holder for a SDP session.
This class holds RTP/SDP data for multiple media types NOTE: The SDPParser pointer held by this class is assumed to be non NULL
| anonymous enum |
RTP media status enumeration
| SDPSession | ( | SDPParser * | parser | ) |
Constructor
| parser | The SDP parser whose data this object will use |
| SDPSession | ( | SDPParser * | parser, |
| NamedList & | params ) |
Constructor
| parser | The SDP parser whose data this object will use |
| params | SDP session parameters |
|
virtual |
Destructor. Reset the object
| bool addRtpParams | ( | NamedList & | msg, |
| const String & | natAddr = String::empty(), | ||
| const MimeBody * | body = 0, | ||
| bool | force = false, | ||
| bool | allowEmptyAddr = false ) |
Add RTP forwarding parameters to a message (media and address)
| msg | Destination list |
| natAddr | Optional NAT address if detected |
| body | Pointer to the body to extract raw SDP from |
| force | True to override RTP forward flag |
| allowEmptyAddr | Allow empty address in parameters (default: false) |
References String::empty().
| bool addSdpParams | ( | NamedList & | msg, |
| const MimeBody * | body ) |
Add raw SDP forwarding parameter from body if SDP forward is enabled
| msg | Destination list |
| body | Mime body to process |
Add raw SDP forwarding parameter if SDP forward is enabled
| msg | Destination list |
| rawSdp | The raw sdp content |
|
pure virtual |
Build a chan.rtp message without media information
| context | Pointer to reference counted user provided context |
|
virtual |
Build a chan.rtp message and populate with media information
| media | The media list |
| addr | Remote RTP address |
| start | True to request RTP start |
| context | Pointer to reference counted user provided context |
| MimeSdpBody * createPasstroughSDP | ( | NamedList & | msg, |
| bool | update = true, | ||
| bool | allowEmptyAddr = false ) |
Creates a SDP from RTP address data present in message. Use the raw SDP if present.
| msg | The list of parameters |
| update | True to update RTP/SDP data if raw SDP is not found in the list |
| allowEmptyAddr | Allow empty address in parameters (default: false) |
|
inline |
Creates a set of started external RTP channels from remote addr and builds SDP from them
| start | True to create a started RTP |
References createRtpSDP(), and createSDP().
|
inline |
Creates a set of RTP channels from address and media info and builds SDP from them
| addr | Remote RTP address used when dispatching the chan.rtp message |
| start | True to create a started RTP |
References createSDP(), dispatchRtp(), and getRtpAddr().
|
inline |
Creates a set of unstarted external RTP channels from remote addr and builds SDP from them
| addr | Remote RTP address used when dispatching the chan.rtp message |
| msg | List of parameters used to update data |
References createRtpSDP(), and updateSDP().
Referenced by createRtpSDP(), and createRtpSDP().
| MimeSdpBody * createSDP | ( | ) |
Creates a SDP body for current media status
| MimeSdpBody * createSDP | ( | const char * | addr, |
| ObjList * | mediaList = 0 ) |
Creates a SDP body from transport address and list of media descriptors
| addr | The address to set. Use own host if empty |
| mediaList | Optional media list. Use own list if the given one is 0 |
Referenced by createRtpSDP(), and createRtpSDP().
|
protectedvirtual |
Dispatch rtp notification. This method is called before dispatching the message. Clear the message to stop dispatch
| msg | Message to dispatch |
| media | Media for which the message is going to be dispatched |
| bool dispatchRtp | ( | const char * | addr, |
| bool | start, | ||
| RefObject * | context = 0 ) |
Calls dispatchRtp() for each media in the list Update it on success. Remove it on failure
| addr | Remote RTP address |
| start | True to request RTP start |
| context | Pointer to user provided context, optional |
| bool dispatchRtp | ( | SDPMedia * | media, |
| const char * | addr, | ||
| bool | start, | ||
| bool | pick, | ||
| RefObject * | context = 0 ) |
Build and dispatch a chan.rtp message for a given media. Update media on success
| media | The media to use |
| addr | Remote RTP address |
| start | True to request RTP start |
| pick | True to update local parameters (other then media) from returned message |
| context | Pointer to user provided context, optional |
Referenced by createRtpSDP().
|
inline |
Get RTP local host
Retrieve a single media description
| name | Name of the media to retrieve |
|
inline |
| bool localRtpChanged | ( | ) | const |
Check if local RTP data changed for at least one media
|
protectedvirtual |
Media changed notification. This method is called when setting new media and an old one changed
| media | Old media that changed |
|
protected |
Print current media to output
| reason | Reason to print |
|
inline |
Put session media parameters into a list of parameters
| msg | Destination list |
| putPort | True to add the media port |
References putMedia().
Put specified media parameters into a list of parameters
| msg | Destination list |
| media | List of SDP media information |
| putPort | True to add the media port |
Referenced by putMedia().
|
virtual |
Reset this object to default values
| all | True to reset all parameters including configuration |
|
protected |
Set extra parameters for formats
| list | List of parameters |
| out | True if session is outgoing, false otherwise |
| void setLocalRtpChanged | ( | bool | chg = false | ) |
Set or reset the local RTP data changed flag for all media
| chg | The new value for local RTP data changed flag of all media |
| bool setMedia | ( | ObjList * | media, |
| bool | preserveExisting = false ) |
Set a new media list
| media | New media list |
| preserveExisting | Try to preserve existing started media |
| void setRfc2833 | ( | const String & | value | ) |
Update the RFC 2833 availability and payload
| value | String to get payload or availability |
Referenced by setRfc2833().
|
inline |
Update the RFC 2833 availability and payload
| value | Pointer to string to get payload or availability |
References setRfc2833().
|
protected |
Set data used in debug
| enabler | The DebugEnabler to use (0 to to use the parser) |
| ptr | Pointer to print, 0 to use the session pointer |
| traceId | Trace ID to use for debugging |
References String::empty().
| bool startRtp | ( | RefObject * | context = 0 | ) |
Try to start RTP (calls dispatchRtp()) for each media in the list
| context | Pointer to user provided context, optional |
| void updateFormats | ( | const NamedList & | msg, |
| bool | changeMedia = false ) |
Update media format lists from parameters
| msg | Parameter list |
| changeMedia | True to update media list if required |
| bool updateRtpSDP | ( | const NamedList & | params | ) |
Update RTP/SDP data from parameters
| params | List of parameters to update from |
|
static |
Update RTP/SDP data from parameters
| params | Parameter list |
| rtpAddr | String to be filled with rtp address from the list |
| oldList | Optional existing media list (found media will be removed from it and added to the returned list |
| allowEmptyAddr | Allow empty address in parameters (default: false) |
| bool updateSDP | ( | const NamedList & | params, |
| bool | defaults = true ) |
Update from parameters and optionally build a default SDP.
| params | List of parameters to update from |
| defaults | Build a default SDP from parser formats if no media is found in params |
Referenced by createRtpSDP().