Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::Sdp Class Reference

#include <sdp.h>

Collaboration diagram for jami::Sdp:
Collaboration graph

Public Types

using MediaSlot = std::pair< MediaDescription, MediaDescription >
 

Public Member Functions

void addIceAttributes (const dhtnet::IceTransport::Attribute &&ice_attrs)
 
void addIceCandidates (unsigned media_index, const std::vector< std::string > &cands)
 
void cleanSessionMedia ()
 Remove all media in the session media vector.
 
void clearIce ()
 
bool createOffer (const std::vector< MediaAttribute > &mediaList)
 
const pjmedia_sdp_sessiongetActiveLocalSdpSession () const
 
std::vector< MediaDescriptiongetActiveMediaDescription (bool remote) const
 
const pjmedia_sdp_sessiongetActiveRemoteSdpSession () const
 
dhtnet::IceTransport::Attribute getIceAttributes () const
 
std::vector< std::string > getIceCandidates (unsigned media_index) const
 
uint16_t getLocalAudioControlPort () const
 
uint16_t getLocalAudioPort () const
 
pjmedia_sdp_sessiongetLocalSdpSession ()
 Read accessor.
 
uint16_t getLocalVideoControlPort () const
 
uint16_t getLocalVideoPort () const
 
std::vector< MediaDescriptiongetMediaDescriptions (const pjmedia_sdp_session *session, bool remote) const
 
std::vector< MediaSlotgetMediaSlots () const
 
std::string_view getPublishedIP () const
 
dhtnet::IpAddr getPublishedIPAddr () const
 
pjmedia_sdp_sessiongetRemoteSdpSession ()
 Read accessor.
 
SdpDirection getSdpDirection () const
 
unsigned int getTelephoneEventType () const
 
bool processIncomingOffer (const std::vector< MediaAttribute > &mediaList)
 Build a new SDP answer using mediaList.
 
 Sdp (const std::string &id)
 
void setActiveLocalSdpSession (const pjmedia_sdp_session *sdp)
 Set the negotiated sdp offer from the sip payload.
 
void setActiveRemoteSdpSession (const pjmedia_sdp_session *sdp)
 Retrieve the negotiated sdp offer from the sip payload.
 
void setLocalMediaCapabilities (MediaType type, const std::vector< std::shared_ptr< SystemCodecInfo > > &selectedCodecs)
 Set the local media capabilities.
 
void setLocalPublishedAudioPorts (uint16_t audio_port, uint16_t control_port)
 
void setLocalPublishedVideoPorts (uint16_t video_port, uint16_t control_port)
 
void setPublishedIP (const dhtnet::IpAddr &addr)
 
void setPublishedIP (const std::string &addr, pj_uint16_t addr_type=pj_AF_UNSPEC())
 
void setReceivedOffer (const pjmedia_sdp_session *remote)
 
bool startNegotiation ()
 Start the sdp negotiation.
 
 ~Sdp ()
 

Static Public Member Functions

static dhtnet::IceTransport::Attribute getIceAttributes (const pjmedia_sdp_session *session)
 
static std::vector< MediaAttributegetMediaAttributeListFromSdp (const pjmedia_sdp_session *sdpSession, bool ignoreDisabled=false)
 
static constexpr std::string_view getSdpDirectionStr (SdpDirection direction)
 
static void printSession (const pjmedia_sdp_session *session, const char *header, SdpDirection direction)
 Log the given session.
 

Friends

class test::SDPTest
 

Detailed Description

Definition at line 60 of file sdp.h.

Member Typedef Documentation

◆ MediaSlot

Definition at line 178 of file sdp.h.

Constructor & Destructor Documentation

◆ Sdp()

jami::Sdp::Sdp ( const std::string &  id)

Definition at line 56 of file sdp.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ ~Sdp()

jami::Sdp::~Sdp ( )

Definition at line 72 of file sdp.cpp.

References jami::SIPAccountBase::releasePort().

Here is the call graph for this function:

Member Function Documentation

◆ addIceAttributes()

void jami::Sdp::addIceAttributes ( const dhtnet::IceTransport::Attribute &&  ice_attrs)

Definition at line 948 of file sdp.cpp.

References jami::sip_utils::CONST_PJ_STR(), and jami::emitSignal().

Here is the call graph for this function:

◆ addIceCandidates()

void jami::Sdp::addIceCandidates ( unsigned  media_index,
const std::vector< std::string > &  cands 
)

Definition at line 889 of file sdp.cpp.

References jami::sip_utils::CONST_PJ_STR(), jami::emitSignal(), and JAMI_ERR.

Here is the call graph for this function:

◆ cleanSessionMedia()

void jami::Sdp::cleanSessionMedia ( )

Remove all media in the session media vector.

◆ clearIce()

void jami::Sdp::clearIce ( )

Definition at line 1004 of file sdp.cpp.

References clearIce(), setActiveLocalSdpSession(), and setActiveRemoteSdpSession().

Referenced by clearIce().

Here is the call graph for this function:

◆ createOffer()

bool jami::Sdp::createOffer ( const std::vector< MediaAttribute > &  mediaList)

Definition at line 539 of file sdp.cpp.

References jami::emitSignal(), JAMI_DEBUG, JAMI_ERR, jami::OFFER, and printSession().

Here is the call graph for this function:

◆ getActiveLocalSdpSession()

const pjmedia_sdp_session * jami::Sdp::getActiveLocalSdpSession ( ) const
inline

Definition at line 86 of file sdp.h.

◆ getActiveMediaDescription()

std::vector< MediaDescription > jami::Sdp::getActiveMediaDescription ( bool  remote) const

Definition at line 751 of file sdp.cpp.

References getMediaDescriptions().

Here is the call graph for this function:

◆ getActiveRemoteSdpSession()

const pjmedia_sdp_session * jami::Sdp::getActiveRemoteSdpSession ( ) const
inline

Definition at line 95 of file sdp.h.

◆ getIceAttributes() [1/2]

dhtnet::IceTransport::Attribute jami::Sdp::getIceAttributes ( ) const

Definition at line 964 of file sdp.cpp.

References jami::emitSignal(), and getIceAttributes().

Referenced by getIceAttributes().

Here is the call graph for this function:

◆ getIceAttributes() [2/2]

dhtnet::IceTransport::Attribute jami::Sdp::getIceAttributes ( const pjmedia_sdp_session session)
static

Definition at line 972 of file sdp.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ getIceCandidates()

std::vector< std::string > jami::Sdp::getIceCandidates ( unsigned  media_index) const

Definition at line 909 of file sdp.cpp.

References jami::emitSignal(), JAMI_ERR, and JAMI_WARN.

Here is the call graph for this function:

◆ getLocalAudioControlPort()

uint16_t jami::Sdp::getLocalAudioControlPort ( ) const
inline

Definition at line 168 of file sdp.h.

◆ getLocalAudioPort()

uint16_t jami::Sdp::getLocalAudioPort ( ) const
inline

Definition at line 166 of file sdp.h.

◆ getLocalSdpSession()

pjmedia_sdp_session * jami::Sdp::getLocalSdpSession ( )
inline

Read accessor.

Get the local passive sdp session information before negotiation

Returns
The structure that describes a SDP session

Definition at line 84 of file sdp.h.

◆ getLocalVideoControlPort()

uint16_t jami::Sdp::getLocalVideoControlPort ( ) const
inline

Definition at line 164 of file sdp.h.

◆ getLocalVideoPort()

uint16_t jami::Sdp::getLocalVideoPort ( ) const
inline

Definition at line 162 of file sdp.h.

◆ getMediaAttributeListFromSdp()

std::vector< MediaAttribute > jami::Sdp::getMediaAttributeListFromSdp ( const pjmedia_sdp_session sdpSession,
bool  ignoreDisabled = false 
)
static

Definition at line 1028 of file sdp.cpp.

References direction, jami::emitSignal(), JAMI_WARN, jami::MEDIA_AUDIO, jami::MEDIA_VIDEO, jami::RTP_SAVP, jami::SENDONLY, jami::SENDRECV, and jami::UNKNOWN.

Referenced by jami::transaction_request_cb().

Here is the call graph for this function:

◆ getMediaDescriptions()

◆ getMediaSlots()

std::vector< Sdp::MediaSlot > jami::Sdp::getMediaSlots ( ) const

Definition at line 876 of file sdp.cpp.

References jami::emitSignal(), and getMediaDescriptions().

Here is the call graph for this function:

◆ getPublishedIP()

std::string_view jami::Sdp::getPublishedIP ( ) const
inline

Definition at line 148 of file sdp.h.

◆ getPublishedIPAddr()

dhtnet::IpAddr jami::Sdp::getPublishedIPAddr ( ) const
inline

Definition at line 146 of file sdp.h.

◆ getRemoteSdpSession()

pjmedia_sdp_session * jami::Sdp::getRemoteSdpSession ( )
inline

Read accessor.

Get the remote passive sdp session information before negotiation

Returns
The structure that describe the SDP session

Definition at line 93 of file sdp.h.

◆ getSdpDirection()

SdpDirection jami::Sdp::getSdpDirection ( ) const
inline

Definition at line 193 of file sdp.h.

◆ getSdpDirectionStr()

constexpr std::string_view jami::Sdp::getSdpDirectionStr ( SdpDirection  direction)
staticconstexpr

Definition at line 452 of file sdp.cpp.

References jami::ANSWER, direction, jami::emitSignal(), and jami::OFFER.

Referenced by printSession().

Here is the call graph for this function:

◆ getTelephoneEventType()

unsigned int jami::Sdp::getTelephoneEventType ( ) const
inline

Definition at line 181 of file sdp.h.

◆ printSession()

void jami::Sdp::printSession ( const pjmedia_sdp_session session,
const char header,
SdpDirection  direction 
)
static

Log the given session.

Note
crypto lines with are removed for security

Definition at line 462 of file sdp.cpp.

References direction, jami::emitSignal(), getSdpDirectionStr(), jami::Manager::instance(), JAMI_ERROR, and JAMI_LOG.

Referenced by createOffer(), processIncomingOffer(), jami::sdp_media_update_cb(), and startNegotiation().

Here is the call graph for this function:

◆ processIncomingOffer()

bool jami::Sdp::processIncomingOffer ( const std::vector< MediaAttribute > &  mediaList)

Build a new SDP answer using mediaList.

Parameters
mediaListThe list of media attributes to build the answer

Definition at line 588 of file sdp.cpp.

References jami::ANSWER, jami::emitSignal(), JAMI_DEBUG, JAMI_ERR, jami::OFFER, and printSession().

Here is the call graph for this function:

◆ setActiveLocalSdpSession()

void jami::Sdp::setActiveLocalSdpSession ( const pjmedia_sdp_session sdp)

Set the negotiated sdp offer from the sip payload.

Parameters
sdpthe negotiated offer

Definition at line 124 of file sdp.cpp.

References jami::emitSignal(), and JAMI_DBG.

Referenced by clearIce(), and startNegotiation().

Here is the call graph for this function:

◆ setActiveRemoteSdpSession()

void jami::Sdp::setActiveRemoteSdpSession ( const pjmedia_sdp_session sdp)

Retrieve the negotiated sdp offer from the sip payload.

Parameters
sdpthe negotiated offer

Definition at line 132 of file sdp.cpp.

References jami::emitSignal(), and JAMI_DBG.

Referenced by clearIce(), and startNegotiation().

Here is the call graph for this function:

◆ setLocalMediaCapabilities()

void jami::Sdp::setLocalMediaCapabilities ( MediaType  type,
const std::vector< std::shared_ptr< SystemCodecInfo > > &  selectedCodecs 
)

Set the local media capabilities.

Parameters
Listof codec in preference order

Definition at line 420 of file sdp.cpp.

References jami::emitSignal(), jami::Manager::instance(), jami::MEDIA_AUDIO, and jami::MEDIA_VIDEO.

Here is the call graph for this function:

◆ setLocalPublishedAudioPorts()

void jami::Sdp::setLocalPublishedAudioPorts ( uint16_t  audio_port,
uint16_t  control_port 
)
inline

Definition at line 150 of file sdp.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ setLocalPublishedVideoPorts()

void jami::Sdp::setLocalPublishedVideoPorts ( uint16_t  video_port,
uint16_t  control_port 
)
inline

Definition at line 156 of file sdp.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ setPublishedIP() [1/2]

void jami::Sdp::setPublishedIP ( const dhtnet::IpAddr &  addr)

Definition at line 391 of file sdp.cpp.

References jami::emitSignal(), and setPublishedIP().

Here is the call graph for this function:

◆ setPublishedIP() [2/2]

void jami::Sdp::setPublishedIP ( const std::string &  addr,
pj_uint16_t  addr_type = pj_AF_UNSPEC() 
)

Definition at line 374 of file sdp.cpp.

References jami::sip_utils::CONST_PJ_STR(), jami::emitSignal(), and JAMI_ERR.

Referenced by setPublishedIP().

Here is the call graph for this function:

◆ setReceivedOffer()

void jami::Sdp::setReceivedOffer ( const pjmedia_sdp_session remote)

Definition at line 578 of file sdp.cpp.

References jami::emitSignal(), and JAMI_ERR.

Here is the call graph for this function:

◆ startNegotiation()

bool jami::Sdp::startNegotiation ( )

Start the sdp negotiation.

Definition at line 633 of file sdp.cpp.

References jami::emitSignal(), JAMI_DBG, JAMI_ERR, JAMI_WARN, printSession(), setActiveLocalSdpSession(), and setActiveRemoteSdpSession().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ test::SDPTest

friend class test::SDPTest
friend

Definition at line 203 of file sdp.h.


The documentation for this class was generated from the following files: