ast_sip_session_sdp_handler Struct Reference

A handler for SDPs in SIP sessions. More...

#include <res_pjsip_session.h>

Collaboration diagram for ast_sip_session_sdp_handler:

Collaboration graph
[legend]

Data Fields

int(* apply_negotiated_sdp_stream )(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *local, const struct pjmedia_sdp_media *local_stream, const struct pjmedia_sdp_session *remote, const struct pjmedia_sdp_media *remote_stream)
 Apply a negotiated SDP media stream.
void(* change_outgoing_sdp_stream_media_address )(struct pjsip_tx_data *tdata, struct pjmedia_sdp_media *stream, struct ast_sip_transport *transport)
 Update media stream with external address if applicable.
int(* create_outgoing_sdp_stream )(struct ast_sip_session *session, struct ast_sip_session_media *session_media, struct pjmedia_sdp_session *sdp)
 Create an SDP media stream and add it to the outgoing SDP offer or answer.
enum
ast_sip_session_sdp_stream_defer(* 
defer_incoming_sdp_stream )(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream)
 Determine whether a stream requires that the re-invite be deferred. If a stream can not be immediately negotiated the re-invite can be deferred and resumed at a later time. It is up to the handler which caused deferral to occur to resume it.
int(* handle_incoming_sdp_stream )(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, struct pjmedia_sdp_media *stream)
 Create an SDP media stream and add it to the outgoing SDP offer or answer.
const char * id
int(* negotiate_incoming_sdp_stream )(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream)
 Set session details based on a stream in an incoming SDP offer or answer.
struct {
   struct
ast_sip_session_sdp_handler *   next
next
void(* stream_destroy )(struct ast_sip_session_media *session_media)
 Destroy a session_media created by this handler.

Detailed Description

A handler for SDPs in SIP sessions.

An SDP handler is registered by a module that is interested in being the responsible party for specific types of SDP streams.

Definition at line 284 of file res_pjsip_session.h.


Field Documentation

int(* apply_negotiated_sdp_stream)(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *local, const struct pjmedia_sdp_media *local_stream, const struct pjmedia_sdp_session *remote, const struct pjmedia_sdp_media *remote_stream)

Apply a negotiated SDP media stream.

Parameters:
session The session for which media is being applied
session_media The media to be setup for this session
local The entire local negotiated SDP
local_stream The local stream which to apply
remote The entire remote negotiated SDP
remote_stream The remote stream which to apply
Return values:
0 The stream was not applied by this handler. If there are other registered handlers for this stream type, they will be called.
<0 There was an error encountered. No further operation will take place and the current application will be abandoned.
>0 The stream was handled by this handler. No further handler of this stream type will be called.

Referenced by handle_negotiated_sdp_session_media().

void(* change_outgoing_sdp_stream_media_address)(struct pjsip_tx_data *tdata, struct pjmedia_sdp_media *stream, struct ast_sip_transport *transport)

Update media stream with external address if applicable.

Parameters:
tdata The outgoing message itself
stream The stream on which to operate
transport The transport the SDP is going out on

Referenced by session_outgoing_nat_hook().

int(* create_outgoing_sdp_stream)(struct ast_sip_session *session, struct ast_sip_session_media *session_media, struct pjmedia_sdp_session *sdp)

Create an SDP media stream and add it to the outgoing SDP offer or answer.

Parameters:
session The session for which media is being added
session_media The media to be setup for this session
sdp The entire SDP as currently built
Return values:
0 This handler has no stream to add. If there are other registered handlers for this stream type, they will be called.
<0 There was an error encountered. No further operation will take place and the current SDP negotiation will be abandoned.
>0 The handler has a stream to be added to the SDP. No further handler of this stream type will be called.

Referenced by add_sdp_streams().

enum ast_sip_session_sdp_stream_defer(* defer_incoming_sdp_stream)(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream)

Determine whether a stream requires that the re-invite be deferred. If a stream can not be immediately negotiated the re-invite can be deferred and resumed at a later time. It is up to the handler which caused deferral to occur to resume it.

Parameters:
session The session for which the media is being re-invited
session_media The media being reinvited
sdp The entire SDP. Useful for getting "global" information, such as connections or attributes
stream PJSIP incoming SDP media lines to parse by handler.
Returns:
enum ast_sip_session_defer_stream
Note:
This is optional, if not implemented the stream is assumed to not be deferred.

Referenced by sdp_requires_deferral().

int(* handle_incoming_sdp_stream)(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, struct pjmedia_sdp_media *stream)

Create an SDP media stream and add it to the outgoing SDP offer or answer.

Parameters:
session The session for which media is being added
session_media The media to be setup for this session
stream The stream on which to operate
Return values:
0 The stream was not handled by this handler. If there are other registered handlers for this stream type, they will be called.
<0 There was an error encountered. No further operation will take place and the current negotiation will be abandoned.
>0 The stream was handled by this handler. No further handler of this stream type will be called.

const char* id

int(* negotiate_incoming_sdp_stream)(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream)

Set session details based on a stream in an incoming SDP offer or answer.

Parameters:
session The session for which the media is being negotiated
session_media The media to be setup for this session
sdp The entire SDP. Useful for getting "global" information, such as connections or attributes
stream The stream on which to operate
Return values:
0 The stream was not handled by this handler. If there are other registered handlers for this stream type, they will be called.
<0 There was an error encountered. No further operation will take place and the current negotiation will be abandoned.
>0 The stream was handled by this handler. No further handler of this stream type will be called.

Referenced by handle_incoming_sdp().

struct { ... } next

Next item in the list.

void(* stream_destroy)(struct ast_sip_session_media *session_media)

Destroy a session_media created by this handler.

Parameters:
session The session for which media is being destroyed
session_media The media to destroy

Referenced by session_media_dtor(), and session_media_set_handler().


The documentation for this struct was generated from the following file:

Generated on Thu Apr 16 06:35:38 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6