Fork me on GitHub
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions
sdp.h File Reference

SDP processing (headers) More...

#include <inttypes.h>
#include <sofia-sip/sdp.h>
Include dependency graph for sdp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  janus_sdp
 Janus SDP instance. More...

Typedefs

typedef struct janus_sdp janus_sdp
 Janus SDP instance.

Functions

void janus_sdp_free (janus_sdp *sdp)
 Method to free a Janus SDP instance.
Janus SDP setup
int janus_sdp_init (void)
 Janus SDP processor initialization.
void janus_sdp_deinit (void)
 Janus SDP processor deinitialization.
Janus SDP helper methods
janus_sdpjanus_sdp_preparse (const char *jsep_sdp, int *audio, int *video, int *data, int *bundle, int *rtcpmux, int *trickle)
 Method to pre-parse a session description.
int janus_sdp_parse (janus_ice_handle *session, janus_sdp *sdp)
 Method to parse a session description.
int janus_sdp_parse_candidate (janus_ice_stream *stream, const char *candidate, int trickle)
 Method to parse a single candidate.
int janus_sdp_parse_ssrc (janus_ice_stream *stream, const char *ssrc_attr, int video)
 Method to parse a SSRC attribute.
char * janus_sdp_anonymize (const char *sdp)
 Method to strip/anonymize a session description.
char * janus_sdp_merge (janus_ice_handle *session, const char *sdp)
 Method to merge a stripped session description and the right transport information.

Detailed Description

SDP processing (headers)

Author
Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om

Implementation (based on the Sofia-SDP stack) of the SDP parser/merger/generator in the gateway. Each SDP coming from peers is stripped/anonymized before it is passed to the plugins: all DTLS/ICE/transport related information is removed, only leaving the relevant information in place. SDP coming from plugins is stripped/anonymized as well, and merged with the proper DTLS/ICE/transport information before it is sent to the peers.

Todo:
Right now, we only support sessions with up to a single audio and/or a single video stream (as in, a single audio and/or video m-line) plus an optional DataChannel. Later versions of the gateway will add support for more media streams of the same type in a session.

Protocols

Typedef Documentation

typedef struct janus_sdp janus_sdp

Janus SDP instance.

Function Documentation

char* janus_sdp_anonymize ( const char *  sdp)

Method to strip/anonymize a session description.

Parameters
[in]sdpThe session description to strip/anonymize
Returns
A string containing the stripped/anonymized session description in case of success, NULL if the SDP is invalid
void janus_sdp_deinit ( void  )

Janus SDP processor deinitialization.

void janus_sdp_free ( janus_sdp sdp)

Method to free a Janus SDP instance.

Parameters
[in]sdpThe Janus SDP instance to free
int janus_sdp_init ( void  )

Janus SDP processor initialization.

Returns
0 in case of success, -1 in case of an error
char* janus_sdp_merge ( janus_ice_handle session,
const char *  sdp 
)

Method to merge a stripped session description and the right transport information.

Parameters
[in]sessionThe ICE session this session description is related to
[in]sdpThe stripped session description to merge
Returns
A string containing the full session description in case of success, NULL if the SDP is invalid
int janus_sdp_parse ( janus_ice_handle session,
janus_sdp sdp 
)

Method to parse a session description.

This method will parse a session description coming from a peer, and set up the ICE candidates accordingly

Parameters
[in]sessionThe ICE session this session description will modify
[in]sdpThe Janus SDP instance to parse
Returns
0 in case of success, -1 in case of an error
int janus_sdp_parse_candidate ( janus_ice_stream stream,
const char *  candidate,
int  trickle 
)

Method to parse a single candidate.

This method will parse a single remote candidate provided by a peer, whether it is trickling or not

Parameters
[in]streamThe ICE stream this candidate refers to
[in]candidateThe remote candidate to process
[in]trickleWhether this is a trickle candidate, or coming from the SDP
Returns
0 in case of success, a non-zero integer in case of an error
int janus_sdp_parse_ssrc ( janus_ice_stream stream,
const char *  ssrc_attr,
int  video 
)

Method to parse a SSRC attribute.

This method will parse a SSRC attribute, and set it for the peer

Parameters
[in]streamThe ICE stream this candidate refers to
[in]ssrc_attrThe SSRC attribute value to parse
[in]videoWhether this is a video SSRC or not
Returns
0 in case of success, a non-zero integer in case of an error
janus_sdp* janus_sdp_preparse ( const char *  jsep_sdp,
int *  audio,
int *  video,
int *  data,
int *  bundle,
int *  rtcpmux,
int *  trickle 
)

Method to pre-parse a session description.

This method is only used to quickly check how many audio and video lines are in an SDP, and to generate a Janus SDP instance

Parameters
[in]jsep_sdpThe SDP that the browser peer originated
[out]audioThe number of audio m-lines
[out]videoThe number of video m-lines
[out]dataThe number of SCTP m-lines
[out]bundleWhether BUNDLE has been negotiated or not
[out]rtcpmuxWhether rtcp-mux has been negotiated or not
[out]trickleWhether ICE trickling is being used (no candidates) or not
Returns
The Janus SDP instance in case of success, NULL in case the SDP is invalid