sipxtacklib  Version 3.3
Public Types | Protected Member Functions | Friends | List of all members
SdpBody Class Reference

Container for MIME type application/sdp. More...

#include <SdpBody.h>

Inheritance diagram for SdpBody:
Inheritance graph
[legend]
Collaboration diagram for SdpBody:
Collaboration graph
[legend]

Public Types

enum  SessionDirection {
  Unknown,
  Inactive,
  SendOnly,
  RecvOnly,
  SendRecv
}
 
- Public Types inherited from HttpBody
enum  BodyClassTypes {
  UNKNOWN_BODY_CLASS = 0,
  HTTP_BODY_CLASS,
  SMIME_BODY_CLASS,
  SDP_BODY_CLASS,
  PIDF_BODY_CLASS,
  DIALOG_EVENT_BODY_CLASS
}
 

Public Member Functions

====================== Constructors and Destructors
 SdpBody (const char *bytes=NULL, int byteCount=-1)
 Construct from an existing SDP message value, or create an empty body. More...
 
 SdpBody (const SdpBody &rSdpBody)
 Copy constructor. More...
 
virtual ~SdpBody ()
 Destructor. More...
 
====================== Message Serialization Interfaces
virtual int getLength () const
 Get the string length this body would be if serialized. More...
 
virtual void getBytes (const char **bytes, int *length) const
 Get the serialized string representation of this SDP message. More...
 
virtual void getBytes (UtlString *bytes, int *length) const
 Get the serialized string representation of this SDP message. More...
 
====================== Header Setting Interfaces

These methods set the standard header fields (the ones not in a media set)

void setStandardHeaderFields (const char *sessionName, const char *emailAddress, const char *phoneNumber, const char *originatorAddress)
 
void setSessionNameField (const char *sessionName)
 
void setOriginator (const char *userId, int sessionId, int sessionVersion, const char *address)
 
void setEmailAddressField (const char *emailAddress)
 
void setPhoneNumberField (const char *phoneNumber)
 
void addEpochTime (unsigned long epochStartTime, unsigned long epochEndTime=0)
 
void addNtpTime (unsigned long ntpStartTime, unsigned long ntpEndTime=0)
 
UtlBoolean getMediaStreamDirection (int mediaIndex, SessionDirection &direction) const
 
void setRtpTcpRole (RtpTcpRoles role)
 
UtlString getRtpTcpRole () const
 
====================== Field Reading Interfaces

Use these interfaces to get field values rather than the generic interfaces below.

int getMediaSetCount () const
 Get the number of media description sets. More...
 
int findMediaType (const char *mediaType, int startMediaIndex=0) const
 Get the index to the next media set of the given type. More...
 
UtlBoolean getMediaData (int mediaIndex, UtlString *mediaType, int *mediaPort, int *mediaPortPairs, UtlString *mediaTransportType, int maxPayloadTypes, int *numPayloadTypes, int payloadTypes[]) const
 Read a full media line. More...
 
const bool isTransportAvailable (const OsSocket::IpProtocolSocketType protocol, const SIPX_MEDIA_TYPE mediaType) const
 Inspects whether the given transport type and media type combination is specified as an m-line in the sdp. More...
 
UtlBoolean getMediaNetworkType (int mediaIndex, UtlString *networkType) const
 Read whether the media network type is IP4 or IP6. More...
 
UtlBoolean getMediaAddress (int mediaIndex, UtlString *address) const
 Get IP address for the indicated media stream. More...
 
UtlBoolean getMediaType (int mediaIndex, UtlString *mediaType) const
 Get the media type for the indicated media stream. More...
 
UtlBoolean getMediaPort (int mediaIndex, int *port) const
 Get the port number for the indicated media stream. More...
 
UtlBoolean getMediaRtcpPort (int mediaIndex, int *port) const
 
UtlBoolean getMediaPortCount (int mediaIndex, int *numPorts) const
 Get the number of port pairs in media stream. More...
 
UtlBoolean getMediaProtocol (int mediaIndex, UtlString *transportProtocol) const
 Get the transport protocol for the indicated media stream. More...
 
UtlBoolean getMediaPayloadType (int mediaIndex, int maxTypes, int *numTypes, int payloadTypes[]) const
 Get the payload types for the indicated media stream. More...
 
UtlBoolean getPtime (int mediaIndex, int &ptime) const
 Get the ptime field for the given media set. More...
 
UtlBoolean getMediaSubfield (int mediaIndex, int subfieldIndex, UtlString *subField) const
 Media field accessor utility. More...
 
UtlBoolean getPayloadRtpMap (int mediaIndex, int payloadType, UtlString &mimeSubtype, int &sampleRate, int &numChannels) const
 Get the subfields of the rtpmap field. More...
 
UtlBoolean getPayloadFormat (int mediaIndex, int payloadType, UtlString &fmtp) const
 
UtlBoolean getSrtpCryptoField (int mediaIndex, int index, SdpSrtpParameters &params) const
 See SdpCodec for utilities to parse the fmtp field (e.g. More...
 
UtlBoolean getControlTrackId (int mediaLineIndex, UtlString &trackId) const
 
UtlBoolean getFramerateField (int mediaIndex, int &videoFramerate) const
 
UtlBoolean getBandwidthField (int &bandwidth) const
 Find the "a" record containing an rtpmap for the given payload type id, parse it and return the parameters for it. More...
 
void getBestAudioCodecs (SdpCodecList &localRtpCodecs, int &numCodecsInCommon, SdpCodec **&commonCodecsForEncoder, UtlString &rtpAddress, int &rtpPort, int &rtcpPort, int &videoRtpPort, int &videoRtcpPort, SdpSrtpParameters &localSrtpParams, SdpSrtpParameters &matchingSrtpParams, int localBandwidth, int &matchingBandwidth, int localVideoFramerate, int &matchingVideoFramerate) const
 Find the send and receive codecs from the rtpCodecs array which are compatible with this SdpBody. More...
 
void getCodecsInCommon (int audioMediaSetIndex, int videoMediaSetIndex, int audioPayloadIdCount, int videoPayloadIdCount, int audioPayloadTypes[], int videoPayloadTypes[], int videoRtpPort, SdpCodecList &localRtpCodecs, int &numCodecsInCommon, SdpCodec *commonCodecsForEncoder[], SdpCodec *commonCodecsForDecoder[]) const
 For local capabilities, get remote media line and supported local codecs. More...
 
int getCodecsInCommon (const SdpMediaLine &localMediaLine, int remoteMediaLineIndex, SdpMediaLine &remoteMediaLine, SdpCodecList &localDecodeCodecs) const
 
UtlBoolean getMediaLine (int remoteMediaLineIndex, SdpMediaLine &mediaLine, const SdpCodecList *codecFactory) const
 Assumes this SDP is the SDP offer and the localMediaLine is the capabilities for the offer. More...
 
void addMediaLine (const SdpMediaLine &mediaLine, SdpBody &sdpBody)
 
void getEncryptionInCommon (SdpSrtpParameters &audioParams, SdpSrtpParameters &remoteParams, SdpSrtpParameters &commonAudioParms) const
 
void getBandwidthInCommon (int localBandwidth, int remoteBandwidth, int &commonBandwidth) const
 
void getVideoFramerateInCommon (int localVideoFramerate, int remoteVideoFramerate, int &commonVideoFramerate) const
 
UtlBoolean getCandidateAttribute (int mediaIndex, int candidateIndex, int &rCandidateId, UtlString &rTransportId, UtlString &rTransportType, uint64_t &rQvalue, UtlString &rCandidateIp, int &rCandidatePort) const
 Get the candidate attribute per draft-ietf-mmusic-ice-05. More...
 
UtlBoolean getCandidateAttributes (const char *szMimeType, int nMaxAddresses, int candidateIds[], UtlString transportIds[], UtlString transportTypes[], uint64_t qvalues[], UtlString candidateIps[], int candidatePorts[], int &nActualAddresses) const
 
UtlBoolean getCandidateAttributes (int mediaIndex, int nMaxAddresses, int candidateIds[], UtlString transportIds[], UtlString transportTypes[], uint64_t qvalues[], UtlString candidateIps[], int candidatePorts[], int &nActualAddresses) const
 
UtlBoolean findValueInField (const char *pField, const char *pvalue) const
 Locates a specific value for an attribute field Used to locate sendonly and recvonly in case if hold and unhold INVITE messages. More...
 
- Public Member Functions inherited from HttpBody
 HttpBody (const char *bytes=NULL, int length=-1, const char *contentType=NULL)
 
 HttpBody (const char *contentType)
 
 HttpBody (const HttpBody &rHttpBody)
 
virtual ~HttpBody ()
 
HttpBodyoperator= (const HttpBody &rhs)
 
void appendBodyPart (const HttpBody &body, const UtlDList &parameters)
 Append a multipart body part to an existing multiparty body. More...
 
virtual const char * getBytes () const
 
UtlBoolean getMultipartBytes (int partIndex, const char **bytes, int *length, int *start) const
 
const MimeBodyPartgetMultipart (int partIndex) const
 
int getMultipartCount () const
 
BodyClassTypes getClassType () const
 
const char * getMultipartBoundary () const
 Get the multipart boundary string. More...
 
const char * getContentType () const
 Get the content type string. More...
 
UtlBoolean isMultipart () const
 

Protected Member Functions

void parseBody (const char *bytes=NULL, int byteCount=-1)
 Parse an existing string into the internal representation. More...
 
====================== Generic SDP field accessors

It is better to use the more specific accessor methods above for the field type you need than to use these generic interfaces.

These may be deprecated in the future.

int getFieldCount () const
 Return the number of fields in the body. More...
 
UtlBoolean getValue (int fieldIndex, UtlString *name, UtlString *value) const
 Return the name and value of the nth field in the body. More...
 
void setValue (const char *name, const char *value)
 Set a specific field. More...
 

Friends

class SdpBodyTest
 

====================== Media Setting Interfaces

These interfaces are used to build up media descriptions

void addCodecsOffer (int iNumAddresses, const UtlString mediaAddresses[], int rtpAudioPorts[], int rtcpAudioPorts[], int rtpVideoPorts[], int rtcpVideoPorts[], RTP_TRANSPORT transportTypes[], int numRtpCodecs, SdpCodec *rtpCodecs[], SdpSrtpParameters &srtpParams, int videoBandwidth, int videoFramerate, RTP_TRANSPORT transportOffering)
 Create a set of media codec and address entries. More...
 
void addCodecsAnswer (int iNumAddresses, UtlString mediaAddresses[], int rtpAudioPorts[], int rtcpAudioPorts[], int rtpVideoPorts[], int rtcpVideoPorts[], RTP_TRANSPORT transportTypes[], int numRtpCodecs, SdpCodec *rtpCodecs[], SdpSrtpParameters &srtpParams, int videoBandwidth, int videoFramerate, const SdpBody *sdpRequest)
 Create a response to a set of media codec and address entries. More...
 
void addMediaLinesAnswer (int numMediaLines, const SdpMediaLine *mediaLines[], const SdpBody &offer)
 
void addMediaData (const char *mediaType, int portNumber, int portPairCount, const char *mediaTransportType, int numPayloadTypes, int payloadType[])
 Create a new media set for SDP message. More...
 
void addCodecParameters (int numRtpCodecs, SdpCodec *rtpCodecs[], const char *szMimeType="audio")
 
void addConnectionAddress (const char *ipAddress)
 Set address. More...
 
void addConnectionAddress (const char *networkType, const char *addressType, const char *ipAddress)
 
void setConnectionAddress (const char *ipAddress)
 Set address. More...
 
void setConnectionAddress (const char *networkType, const char *addressType, const char *ipAddress)
 
void addRtpmap (int payloadType, const char *mimeSubtype, int sampleRate, int numChannels)
 
void addSrtpCryptoField (SdpSrtpParameters &params)
 
void addFormatParameters (int payloadType, const char *formatParameters)
 
void addPtime (int pTime)
 Add a "a" field for the given ptime value in milliseconds. More...
 
void addCandidateAttribute (int candidateId, const char *transportId, const char *transportType, uint64_t qValue, const char *candidateIp, int candidatePort)
 Set the candidate attribute per draft-ietf-mmusic-ice-05. More...
 
static void buildMediaLine (SdpMediaLine::SdpMediaType mediaType, int totalBandwidth, int iNumAddresses, UtlString hostAddresses[], int rtpPorts[], int rtcpPorts[], int numRtpCodecs, SdpCodec *rtpCodecs[], SdpMediaLine &mediaLine)
 

Additional Inherited Members

- Static Public Member Functions inherited from HttpBody
static HttpBodycopyBody (const HttpBody &sourceBody)
 Copy the source HttpBody using the correct derived class constructor. More...
 
static HttpBodycreateBody (const char *bodyBytes, int bodyBytesLength, const char *contentType, const char *contentEncoding)
 Pseudo body factory. More...
 
- Protected Attributes inherited from HttpBody
int bodyLength
 
UtlString mBody
 
UtlString mMultipartBoundary
 
int mBodyPartCount
 
MimeBodyPartmpBodyParts [MAX_HTTP_BODY_PARTS]
 
BodyClassTypes mClassType
 

Detailed Description

Container for MIME type application/sdp.

This body type gets constructed when a HttpBody is a single part MIME or multipart MIME which has a part of type application/sdp. This object has methods to manipulate, iterate and construct SDP fields and media stream definitions

In the descriptions below:

Member Enumeration Documentation

Enumerator
Unknown 
Inactive 
SendOnly 
RecvOnly 
SendRecv 

Constructor & Destructor Documentation

SdpBody ( const char *  bytes = NULL,
int  byteCount = -1 
)

Construct from an existing SDP message value, or create an empty body.

Parameters
bytesNULL creates an empty body
byteCount-1 means treat bytes as null terminated
SdpBody ( const SdpBody rSdpBody)

Copy constructor.

~SdpBody ( )
virtual

Destructor.

Member Function Documentation

int getLength ( ) const
virtual

Get the string length this body would be if serialized.

Reimplemented from HttpBody.

void getBytes ( const char **  bytes,
int *  length 
) const
virtual

Get the serialized string representation of this SDP message.

Parameters
bytesbuffer space where SDP is written, null terminated
lengthnumber of bytes written (not including the null terminator)

Reimplemented from HttpBody.

void getBytes ( UtlString *  bytes,
int *  length 
) const
virtual

Get the serialized string representation of this SDP message.

Parameters
bytesmessage output
lengthnumber of bytes in message

Reimplemented from HttpBody.

void setStandardHeaderFields ( const char *  sessionName,
const char *  emailAddress,
const char *  phoneNumber,
const char *  originatorAddress 
)
Parameters
sessionNameany valid field string
emailAddressemail address per rfc 2327
phoneNumberphone number address per rfc 2327
originatorAddressIP address
void setSessionNameField ( const char *  sessionName)
void setOriginator ( const char *  userId,
int  sessionId,
int  sessionVersion,
const char *  address 
)
Parameters
userIduser id of caller or "-" if host does not support the idea of user logon
sessionIdunique id for this call session
sessionVersionnumber to get incremented each time the SDP data gets modified for this call session
addressIP address
void setEmailAddressField ( const char *  emailAddress)
void setPhoneNumberField ( const char *  phoneNumber)
void addEpochTime ( unsigned long  epochStartTime,
unsigned long  epochEndTime = 0 
)
void addNtpTime ( unsigned long  ntpStartTime,
unsigned long  ntpEndTime = 0 
)
UtlBoolean getMediaStreamDirection ( int  mediaIndex,
SessionDirection direction 
) const
Parameters
mediaIndexwhich media description set to read
void setRtpTcpRole ( RtpTcpRoles  role)
UtlString getRtpTcpRole ( ) const
void addCodecsOffer ( int  iNumAddresses,
const UtlString  mediaAddresses[],
int  rtpAudioPorts[],
int  rtcpAudioPorts[],
int  rtpVideoPorts[],
int  rtcpVideoPorts[],
RTP_TRANSPORT  transportTypes[],
int  numRtpCodecs,
SdpCodec *  rtpCodecs[],
SdpSrtpParameters srtpParams,
int  videoBandwidth,
int  videoFramerate,
RTP_TRANSPORT  transportOffering 
)

Create a set of media codec and address entries.

This method is for building a SdpBody which is in response to a SdpBody send from the other side

void buildMediaLine ( SdpMediaLine::SdpMediaType  mediaType,
int  totalBandwidth,
int  iNumAddresses,
UtlString  hostAddresses[],
int  rtpPorts[],
int  rtcpPorts[],
int  numRtpCodecs,
SdpCodec *  rtpCodecs[],
SdpMediaLine &  mediaLine 
)
static
void addCodecsAnswer ( int  iNumAddresses,
UtlString  mediaAddresses[],
int  rtpAudioPorts[],
int  rtcpAudioPorts[],
int  rtpVideoPorts[],
int  rtcpVideoPorts[],
RTP_TRANSPORT  transportTypes[],
int  numRtpCodecs,
SdpCodec *  rtpCodecs[],
SdpSrtpParameters srtpParams,
int  videoBandwidth,
int  videoFramerate,
const SdpBody sdpRequest 
)

Create a response to a set of media codec and address entries.

This method is for building a SdpBody which is in response to a SdpBody send from the other side

Parameters
sdpRequestSdp we are responding to
void addMediaLinesAnswer ( int  numMediaLines,
const SdpMediaLine *  mediaLines[],
const SdpBody offer 
)
void addMediaData ( const char *  mediaType,
int  portNumber,
int  portPairCount,
const char *  mediaTransportType,
int  numPayloadTypes,
int  payloadType[] 
)

Create a new media set for SDP message.

Parameters
mediaType"audio", "video", "application", "data", "control"
portNumberTCP or UDP port number for the media stream
portPairCountthe number of PAIRS of ports to be used for the media stream.
mediaTransportTypei.e. "RTP/AVP"
numPayloadTypesentries in the payloadType parameter
payloadTypeformat specifier specific to context of mediaTransportType. (i.e. for TRP/AVP u-law this is 0, a-law is 14). see RFC 1890 for the Payload Type numbers
void addCodecParameters ( int  numRtpCodecs,
SdpCodec *  rtpCodecs[],
const char *  szMimeType = "audio" 
)
void addConnectionAddress ( const char *  ipAddress)

Set address.

Set address for SDP message header or specific media set if called after addAddressData.

Parameters
ipAddressfor IP4 this is of the format: nnn.nnn.nnn.nnn where nnn is 0 to 255
void addConnectionAddress ( const char *  networkType,
const char *  addressType,
const char *  ipAddress 
)
Parameters
networkTypenetwork type - should be "IN"
addressTypeaddress type - should be "IP4"
ipAddressIP address
void setConnectionAddress ( const char *  ipAddress)

Set address.

Set address for SDP message header or specific media set if called after addAddressData.

Parameters
ipAddressfor IP4 this is of the format: nnn.nnn.nnn.nnn where nnn is 0 to 255
void setConnectionAddress ( const char *  networkType,
const char *  addressType,
const char *  ipAddress 
)
Parameters
networkTypenetwork type - should be "IN"
addressTypeaddress type - should be "IP4"
ipAddressIP address
void addRtpmap ( int  payloadType,
const char *  mimeSubtype,
int  sampleRate,
int  numChannels 
)
void addSrtpCryptoField ( SdpSrtpParameters params)
void addFormatParameters ( int  payloadType,
const char *  formatParameters 
)
void addPtime ( int  pTime)

Add a "a" field for the given ptime value in milliseconds.

void addCandidateAttribute ( int  candidateId,
const char *  transportId,
const char *  transportType,
uint64_t  qValue,
const char *  candidateIp,
int  candidatePort 
)

Set the candidate attribute per draft-ietf-mmusic-ice-05.

int getMediaSetCount ( ) const

Get the number of media description sets.

int findMediaType ( const char *  mediaType,
int  startMediaIndex = 0 
) const

Get the index to the next media set of the given type.

The default is to start from the begining. The resulting index may be the start index if it is of the given type.

Returns
the media index if it exists, -1 if it does not exist.
Parameters
mediaTypethe media type to search for
startMediaIndexstart searching from here
UtlBoolean getMediaData ( int  mediaIndex,
UtlString *  mediaType,
int *  mediaPort,
int *  mediaPortPairs,
UtlString *  mediaTransportType,
int  maxPayloadTypes,
int *  numPayloadTypes,
int  payloadTypes[] 
) const

Read a full media line.

Parameters
mediaIndexthe index of the media to read (the nth m line)
const bool isTransportAvailable ( const OsSocket::IpProtocolSocketType  protocol,
const SIPX_MEDIA_TYPE  mediaType 
) const

Inspects whether the given transport type and media type combination is specified as an m-line in the sdp.

UtlBoolean getMediaNetworkType ( int  mediaIndex,
UtlString *  networkType 
) const

Read whether the media network type is IP4 or IP6.

Parameters
mediaIndexwhich media description set to read
UtlBoolean getMediaAddress ( int  mediaIndex,
UtlString *  address 
) const

Get IP address for the indicated media stream.

Parameters
mediaIndexwhich media description set to read
UtlBoolean getMediaType ( int  mediaIndex,
UtlString *  mediaType 
) const

Get the media type for the indicated media stream.

Parameters
mediaIndexwhich media description set to read
mediaTypeaudio, video, application, etc.
UtlBoolean getMediaPort ( int  mediaIndex,
int *  port 
) const

Get the port number for the indicated media stream.

Parameters
mediaIndexwhich media description set to read
UtlBoolean getMediaRtcpPort ( int  mediaIndex,
int *  port 
) const
Parameters
mediaIndexwhich media description set to read
UtlBoolean getMediaPortCount ( int  mediaIndex,
int *  numPorts 
) const

Get the number of port pairs in media stream.

Stream pairs start with the port number given by getMediaPort and are incremented from there to derive the additional port numbers

Parameters
mediaIndexwhich media description set to read
UtlBoolean getMediaProtocol ( int  mediaIndex,
UtlString *  transportProtocol 
) const

Get the transport protocol for the indicated media stream.

Parameters
mediaIndexwhich media description set to read
UtlBoolean getMediaPayloadType ( int  mediaIndex,
int  maxTypes,
int *  numTypes,
int  payloadTypes[] 
) const

Get the payload types for the indicated media stream.

Parameters
mediaIndexwhich media description set to read
maxTypessize of the payloadTypes array
numTypesnumber of entries returned in payloadTypes
payloadTypesarray of integer payload types
UtlBoolean getPtime ( int  mediaIndex,
int &  ptime 
) const

Get the ptime field for the given media set.

UtlBoolean getMediaSubfield ( int  mediaIndex,
int  subfieldIndex,
UtlString *  subField 
) const

Media field accessor utility.

UtlBoolean getPayloadRtpMap ( int  mediaIndex,
int  payloadType,
UtlString &  mimeSubtype,
int &  sampleRate,
int &  numChannels 
) const

Get the subfields of the rtpmap field.

Parameters
mediaIndexindex to which m line contains rtpmap
payloadTypewhich rtp map to read
mimeSubtypethe codec name (mime subtype)
sampleRatethe number of samples/sec. (-1 if not set)
numChannelsthe number of channels (-1 if not set)
UtlBoolean getPayloadFormat ( int  mediaIndex,
int  payloadType,
UtlString &  fmtp 
) const
Parameters
mediaIndexindex to which m line contains rtpmap
UtlBoolean getSrtpCryptoField ( int  mediaIndex,
int  index,
SdpSrtpParameters params 
) const

See SdpCodec for utilities to parse the fmtp field (e.g.

getFmtpParameter and getVideoSizes)

Parameters
mediaIndexmediaIndex of crypto field
indexIndex inside of media type
UtlBoolean getControlTrackId ( int  mediaLineIndex,
UtlString &  trackId 
) const
UtlBoolean getFramerateField ( int  mediaIndex,
int &  videoFramerate 
) const
UtlBoolean getBandwidthField ( int &  bandwidth) const

Find the "a" record containing an rtpmap for the given payload type id, parse it and return the parameters for it.

void getBestAudioCodecs ( SdpCodecList &  localRtpCodecs,
int &  numCodecsInCommon,
SdpCodec **&  commonCodecsForEncoder,
UtlString &  rtpAddress,
int &  rtpPort,
int &  rtcpPort,
int &  videoRtpPort,
int &  videoRtcpPort,
SdpSrtpParameters localSrtpParams,
SdpSrtpParameters matchingSrtpParams,
int  localBandwidth,
int &  matchingBandwidth,
int  localVideoFramerate,
int &  matchingVideoFramerate 
) const

Find the send and receive codecs from the rtpCodecs array which are compatible with this SdpBody.

It is assumed that the best are matches are first in the body.

void getCodecsInCommon ( int  audioMediaSetIndex,
int  videoMediaSetIndex,
int  audioPayloadIdCount,
int  videoPayloadIdCount,
int  audioPayloadTypes[],
int  videoPayloadTypes[],
int  videoRtpPort,
SdpCodecList &  localRtpCodecs,
int &  numCodecsInCommon,
SdpCodec *  commonCodecsForEncoder[],
SdpCodec *  commonCodecsForDecoder[] 
) const

For local capabilities, get remote media line and supported local codecs.

int getCodecsInCommon ( const SdpMediaLine &  localMediaLine,
int  remoteMediaLineIndex,
SdpMediaLine &  remoteMediaLine,
SdpCodecList &  localDecodeCodecs 
) const
UtlBoolean getMediaLine ( int  remoteMediaLineIndex,
SdpMediaLine &  mediaLine,
const SdpCodecList *  codecFactory 
) const

Assumes this SDP is the SDP offer and the localMediaLine is the capabilities for the offer.

Parameters
localMediaLine- local capabilities (codecs, ports, addresses, etc.)
remoteMediaLineIndex- index to m line in this SDP offer to which the local capabilities are to be matched.
remoteMediaLine- gets filled in with remote capabilities per indexed m line
localDecodeCodecs- codecs that this side should offer with payload IDs matched where possible.
Returns
number of matched codecs.
void addMediaLine ( const SdpMediaLine &  mediaLine,
SdpBody sdpBody 
)
void getEncryptionInCommon ( SdpSrtpParameters audioParams,
SdpSrtpParameters remoteParams,
SdpSrtpParameters commonAudioParms 
) const
void getBandwidthInCommon ( int  localBandwidth,
int  remoteBandwidth,
int &  commonBandwidth 
) const
void getVideoFramerateInCommon ( int  localVideoFramerate,
int  remoteVideoFramerate,
int &  commonVideoFramerate 
) const
UtlBoolean getCandidateAttribute ( int  mediaIndex,
int  candidateIndex,
int &  rCandidateId,
UtlString &  rTransportId,
UtlString &  rTransportType,
uint64_t &  rQvalue,
UtlString &  rCandidateIp,
int &  rCandidatePort 
) const

Get the candidate attribute per draft-ietf-mmusic-ice-05.

UtlBoolean getCandidateAttributes ( const char *  szMimeType,
int  nMaxAddresses,
int  candidateIds[],
UtlString  transportIds[],
UtlString  transportTypes[],
uint64_t  qvalues[],
UtlString  candidateIps[],
int  candidatePorts[],
int &  nActualAddresses 
) const
UtlBoolean getCandidateAttributes ( int  mediaIndex,
int  nMaxAddresses,
int  candidateIds[],
UtlString  transportIds[],
UtlString  transportTypes[],
uint64_t  qvalues[],
UtlString  candidateIps[],
int  candidatePorts[],
int &  nActualAddresses 
) const
UtlBoolean findValueInField ( const char *  pField,
const char *  pvalue 
) const

Locates a specific value for an attribute field Used to locate sendonly and recvonly in case if hold and unhold INVITE messages.

int getFieldCount ( ) const
protected

Return the number of fields in the body.

UtlBoolean getValue ( int  fieldIndex,
UtlString *  name,
UtlString *  value 
) const
protected

Return the name and value of the nth field in the body.

It is better to use a more specific accessor method for the field type you need than to iterate over all fields using this interface.

Returns
FALSE if there are not enough fields
void setValue ( const char *  name,
const char *  value 
)
protected

Set a specific field.

Parameters
namefield name to set
valuevalue for the named field
void parseBody ( const char *  bytes = NULL,
int  byteCount = -1 
)
protected

Parse an existing string into the internal representation.

Parameters
bytesNULL creates an empty body
byteCount-1 means treat bytes as null terminated

Friends And Related Function Documentation

friend class SdpBodyTest
friend

sipXtackLib home page