Asterisk - The Open Source Telephony Project  18.5.0
Data Fields
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_session *remote, int index, struct ast_stream *asterisk_stream)
 Apply a negotiated SDP media stream. More...
 
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. More...
 
int(* create_outgoing_sdp_stream )(struct ast_sip_session *session, struct ast_sip_session_media *session_media, struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_session *remote, struct ast_stream *stream)
 Create an SDP media stream and add it to the outgoing SDP offer or answer. More...
 
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. More...
 
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, int index, struct ast_stream *asterisk_stream)
 Set session details based on a stream in an incoming SDP offer or answer. More...
 
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. More...
 
void(* stream_stop )(struct ast_sip_session_media *session_media)
 Stop a session_media created by this handler but do not destroy resources. More...
 

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 380 of file res_pjsip_session.h.

Field Documentation

◆ apply_negotiated_sdp_stream

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_session *remote, int index, struct ast_stream *asterisk_stream)

Apply a negotiated SDP media stream.

Parameters
sessionThe session for which media is being applied
session_mediaThe media session
localThe entire local negotiated SDP
remoteThe entire remote negotiated SDP
indexThe index of the session media, SDP streams, and Asterisk streams
asterisk_streamThe Asterisk stream representation
Return values
0The stream was not applied by this handler. If there are other registered handlers for this stream type, they will be called.
<0There was an error encountered. No further operation will take place and the current application will be abandoned.
>0The stream was handled by this handler. No further handler of this stream type will be called.

Definition at line 444 of file res_pjsip_session.h.

Referenced by handle_negotiated_sdp_session_media().

◆ change_outgoing_sdp_stream_media_address

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
tdataThe outgoing message itself
streamThe stream on which to operate
transportThe transport the SDP is going out on

Definition at line 431 of file res_pjsip_session.h.

Referenced by session_outgoing_nat_hook().

◆ create_outgoing_sdp_stream

int(* create_outgoing_sdp_stream) (struct ast_sip_session *session, struct ast_sip_session_media *session_media, struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_session *remote, struct ast_stream *stream)

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

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

Definition at line 423 of file res_pjsip_session.h.

Referenced by add_sdp_streams().

◆ defer_incoming_sdp_stream

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
sessionThe session for which the media is being re-invited
session_mediaThe media being reinvited
sdpThe entire SDP. Useful for getting "global" information, such as connections or attributes
streamPJSIP 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.

Definition at line 398 of file res_pjsip_session.h.

Referenced by sdp_requires_deferral().

◆ id

const char* id

◆ negotiate_incoming_sdp_stream

int(* negotiate_incoming_sdp_stream) (struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, int index, struct ast_stream *asterisk_stream)

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

Parameters
sessionThe session for which the media is being negotiated
session_mediaThe media session
sdpThe entire SDP. Useful for getting "global" information, such as connections or attributes
indexThe index for the session media, Asterisk stream, and PJMEDIA stream being negotiated
asterisk_streamThe Asterisk stream representation
Return values
0The stream was not handled by this handler. If there are other registered handlers for this stream type, they will be called.
<0There was an error encountered. No further operation will take place and the current negotiation will be abandoned.
>0The stream was handled by this handler. No further handler of this stream type will be called.

Definition at line 410 of file res_pjsip_session.h.

Referenced by handle_incoming_sdp().

◆ next [1/2]

◆ next [2/2]

struct { ... } next

Next item in the list.

◆ stream_destroy

void(* stream_destroy) (struct ast_sip_session_media *session_media)

Destroy a session_media created by this handler.

Parameters
sessionThe session for which media is being destroyed
session_mediaThe media to destroy

Definition at line 458 of file res_pjsip_session.h.

Referenced by session_media_set_handler(), and stream_destroy().

◆ stream_stop

void(* stream_stop) (struct ast_sip_session_media *session_media)

Stop a session_media created by this handler but do not destroy resources.

Parameters
sessionThe session for which media is being stopped
session_mediaThe media to destroy

Definition at line 452 of file res_pjsip_session.h.

Referenced by handle_negotiated_sdp_session_media(), and t38_reinvite_response_cb().


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