19 #ifndef _RES_PJSIP_SESSION_H
20 #define _RES_PJSIP_SESSION_H
37 #include "asterisk/res_pjsip.h"
42 struct pjsip_inv_session;
50 struct pjmedia_sdp_media;
51 struct pjmedia_sdp_session;
56 enum ast_sip_session_t38state {
67 struct ast_sip_session_caps;
168 enum ast_sip_session_call_direction {
169 AST_SIP_SESSION_INCOMING_CALL = 0,
170 AST_SIP_SESSION_OUTGOING_CALL,
250 typedef
int (*ast_sip_session_request_creation_cb)(struct
ast_sip_session *session, pjsip_tx_data *tdata);
251 typedef
int (*ast_sip_session_response_cb)(struct
ast_sip_session *session, pjsip_rx_data *rdata);
252 typedef
int (*ast_sip_session_sdp_creation_cb)(struct
ast_sip_session *session, pjmedia_sdp_session *sdp);
263 enum ast_sip_session_response_priority {
268 AST_SIP_SESSION_BEFORE_REDIRECTING = (1 << 0),
276 AST_SIP_SESSION_BEFORE_MEDIA = (1 << 1),
281 AST_SIP_SESSION_AFTER_MEDIA = (1 << 2),
296 enum ast_sip_supplement_priority priority;
331 int (*incoming_request)(
struct ast_sip_session *session,
struct pjsip_rx_data *rdata);
347 void (*incoming_response)(
struct ast_sip_session *session,
struct pjsip_rx_data *rdata);
352 void (*outgoing_request)(
struct ast_sip_session *session,
struct pjsip_tx_data *tdata);
357 void (*outgoing_response)(
struct ast_sip_session *session,
struct pjsip_tx_data *tdata);
364 enum ast_sip_session_response_priority response_priority;
367 enum ast_sip_session_sdp_stream_defer {
369 AST_SIP_SESSION_SDP_DEFER_NOT_HANDLED,
371 AST_SIP_SESSION_SDP_DEFER_ERROR,
373 AST_SIP_SESSION_SDP_DEFER_NOT_NEEDED,
375 AST_SIP_SESSION_SDP_DEFER_NEEDED,
415 const struct pjmedia_sdp_session *sdp,
int index,
struct ast_stream *asterisk_stream);
428 const struct pjmedia_sdp_session *remote,
struct ast_stream *stream);
449 const struct pjmedia_sdp_session *local,
const struct pjmedia_sdp_session *remote,
int index,
504 struct ast_sip_contact *contact, pjsip_inv_session *inv, pjsip_rx_data *rdata);
538 struct ast_sip_contact *contact,
const char *location,
const char *request_user,
551 void ast_sip_session_terminate(
struct ast_sip_session *session,
int response);
561 int ast_sip_session_defer_termination(
struct ast_sip_session *session);
568 void ast_sip_session_defer_termination_cancel(
struct ast_sip_session *session);
616 #define ast_sip_session_register_supplement(supplement) \
617 ast_sip_session_register_supplement_with_module(AST_MODULE_SELF, supplement)
638 void ast_sip_session_remove_supplements(
struct ast_sip_session *session);
693 void ast_sip_session_remove_datastore(
struct ast_sip_session *session,
const char *name);
720 ast_sip_session_request_creation_cb on_request_creation,
721 ast_sip_session_sdp_creation_cb on_sdp_creation,
722 ast_sip_session_response_cb on_response,
723 enum ast_sip_session_refresh_method method,
724 int generate_new_sdp,
741 ast_sip_session_sdp_creation_cb on_sdp_creation);
752 void ast_sip_session_send_response(
struct ast_sip_session *session, pjsip_tx_data *tdata);
763 void ast_sip_session_send_request(
struct ast_sip_session *session, pjsip_tx_data *tdata);
771 int ast_sip_session_create_invite(
struct ast_sip_session *session, pjsip_tx_data **tdata);
784 void ast_sip_session_send_request_with_cb(
struct ast_sip_session *session, pjsip_tx_data *tdata,
785 ast_sip_session_response_cb on_response);
809 pjsip_dialog *ast_sip_session_get_dialog(
const struct ast_sip_session *session);
819 pjsip_inv_state ast_sip_session_get_pjsip_inv_state(
const struct ast_sip_session *session);
926 int fd, ast_sip_session_media_read_cb callback);
942 ast_sip_session_media_write_cb callback);
964 const char *ast_sip_session_get_name(
const struct ast_sip_session *session);
989 const char *protocol,
int code,
const char *text);
structure for secure RTP audio
Information needed to identify an endpoint in a call.
enum ast_sip_session_t38state t38state
Main Channel structure associated with a channel.
struct ast_sip_endpoint * endpoint
#define AST_LIST_HEAD(name, type)
Defines a structure to be used to hold a list of specified type.
struct ast_sip_session_media_state * pending_media_state
unsigned int defer_terminate
unsigned int terminate_while_deferred
struct ao2_container * datastores
unsigned int ended_while_deferred
A handler for SDPs in SIP sessions.
static 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)
Function which defers an incoming media stream.
static 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)
Function which applies a negotiated stream.
void * pvt
Pointer to channel specific implementation information, must be ao2 object.
Structure for a data store type.
Structure for an UDPTL session.
A structure which contains a channel implementation and session.
struct ast_sip_session * session
Pointer to session.
unsigned int early_confirmed
Structure for a data store object.
static void stream_destroy(struct ast_sip_session_media *session_media)
Function which destroys the RTP instance when session ends.
char exten[AST_MAX_EXTENSION]
struct pjsip_inv_session * inv_session
Socket address structure.
A structure describing a SIP session.
struct ast_format_cap * direct_media_cap
struct ast_sip_session_media_state * active_media_state
struct ast_sip_session::@271 media_stats
pjsip_rx_data * deferred_reinvite
General Asterisk PBX channel definitions.
SRTP and SDP Security descriptions.
#define AST_MAX_EXTENSION
pj_timer_entry rescheduled_reinvite
const struct ast_datastore_info * info
struct ast_channel * channel
A set of macros to manage forward-linked lists.
#define AST_VECTOR(name, type)
Define a vector structure.
An entity with which Asterisk communicates.
static int negotiate_incoming_sdp_stream(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const pjmedia_sdp_session *sdp, int index, struct ast_stream *asterisk_stream)
Function which negotiates an incoming media stream.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
struct ast_module * module
static void stream_stop(struct ast_sip_session_media *session_media)
Function which stops the RTP instance.
enum ast_sip_dtmf_mode dtmf
static void change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struct pjmedia_sdp_media *stream, struct ast_sip_transport *transport)
Function which updates the media stream with external media address, if applicable.
pj_timer_entry scheduled_termination
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
struct ast_sip_session::@270 delayed_requests
Structure used for sending delayed requests.
struct controlling the suspension of the session's serializer.
struct ast_sip_session_suspender * suspended
static 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)
Function which creates an outgoing stream.
A supplement to SIP message processing.
A ast_taskprocessor structure is a singleton by name.
enum ast_sip_session_call_direction call_direction
Data structure associated with a single frame of data.
unsigned int authentication_challenge_count
ast_media_type
Types of media.
pjsip_fromto_hdr * saved_from_hdr
struct ast_sip_contact * contact
unsigned int moh_passthrough