19 #ifndef _RES_PJSIP_SESSION_H 20 #define _RES_PJSIP_SESSION_H 40 struct pjsip_inv_session;
48 struct pjmedia_sdp_media;
49 struct pjmedia_sdp_session;
65 struct ast_sip_session_caps;
411 const struct pjmedia_sdp_session *sdp,
int index,
struct ast_stream *asterisk_stream);
424 const struct pjmedia_sdp_session *remote,
struct ast_stream *stream);
445 const struct pjmedia_sdp_session *local,
const struct pjmedia_sdp_session *remote,
int index,
616 #define ast_sip_session_register_supplement(supplement) \ 617 ast_sip_session_register_supplement_with_module(AST_MODULE_SELF, supplement) 724 int generate_new_sdp,
ast_sip_session_response_priority
Describes when a supplement should be called into on incoming responses.
structure for secure RTP audio
void ast_sip_session_send_request(struct ast_sip_session *session, pjsip_tx_data *tdata)
Send a SIP request.
Information needed to identify an endpoint in a call.
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
struct ast_sip_endpoint * endpoint
struct ast_sip_session_media_state * ast_sip_session_media_state_alloc(void)
Allocate a session media state structure.
void ast_sip_session_media_state_free(struct ast_sip_session_media_state *media_state)
Free a session media state structure.
struct ast_frame *(* ast_sip_session_media_read_cb)(struct ast_sip_session *session, struct ast_sip_session_media *session_media)
struct supplements supplements
int(* ast_sip_session_response_cb)(struct ast_sip_session *session, pjsip_rx_data *rdata)
#define AST_LIST_HEAD(name, type)
Defines a structure to be used to hold a list of specified type.
int(* ast_sip_session_request_creation_cb)(struct ast_sip_session *session, pjsip_tx_data *tdata)
int(* ast_sip_session_media_write_cb)(struct ast_sip_session *session, struct ast_sip_session_media *session_media, struct ast_frame *frame)
struct ast_sip_session_media_state * pending_media_state
ast_sip_session_media_encryption
ast_sip_session_call_direction
Indicates the call direction respective to Asterisk.
void ast_sip_session_unsuspend(struct ast_sip_session *session)
Request the session serializer be unsuspended.
struct ast_sip_session_media * ast_sip_session_media_get_transport(struct ast_sip_session *session, struct ast_sip_session_media *session_media)
Retrieve the underlying media session that is acting as transport for a media session.
int ast_sip_session_create_invite(struct ast_sip_session *session, pjsip_tx_data **tdata)
Creates an INVITE request.
void ast_sip_session_terminate(struct ast_sip_session *session, int response)
Terminate a session and, if possible, send the provided response code.
void ast_sip_session_suspend(struct ast_sip_session *session)
Request and wait for the session serializer to be suspended.
unsigned int defer_terminate
static struct sessions sessions
unsigned int terminate_while_deferred
struct ao2_container * datastores
struct ast_sip_session * ast_sip_session_create_outgoing(struct ast_sip_endpoint *endpoint, struct ast_sip_contact *contact, const char *location, const char *request_user, struct ast_stream_topology *req_topology)
Create a new outgoing SIP session.
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.
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.
t38state
T38 States for a call.
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.
void ast_sip_session_unregister_supplement(struct ast_sip_session_supplement *supplement)
Unregister a an supplement to SIP session processing.
struct ast_sip_session_media_state * ast_sip_session_media_state_clone(const struct ast_sip_session_media_state *media_state)
Clone a media state.
struct pjsip_inv_session * inv_session
Socket address structure.
A structure describing a SIP session.
struct ast_format_cap * direct_media_cap
ast_sip_supplement_priority
struct ast_sip_session_media_state * active_media_state
void ast_sip_session_remove_datastore(struct ast_sip_session *session, const char *name)
Remove a session datastore from the session.
void ast_sip_session_register_supplement_with_module(struct ast_module *module, struct ast_sip_session_supplement *supplement)
Register a supplement to SIP session processing.
static int session_end(void *vsession)
struct ast_sip_session_media * ast_sip_session_media_state_add(struct ast_sip_session *session, struct ast_sip_session_media_state *media_state, enum ast_media_type type, int position)
Allocate an ast_session_media and add it to the media state's vector.
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)
pjsip_rx_data * deferred_reinvite
struct ast_sip_session_sdp_handler * next
General Asterisk PBX channel definitions.
int ast_sip_session_register_sdp_handler(struct ast_sip_session_sdp_handler *handler, const char *stream_type)
Register an SDP handler.
struct ast_sip_session * ast_sip_session_alloc(struct ast_sip_endpoint *endpoint, struct ast_sip_contact *contact, pjsip_inv_session *inv, pjsip_rx_data *rdata)
Allocate a new SIP session.
struct ast_datastore * ast_sip_session_alloc_datastore(const struct ast_datastore_info *info, const char *uid)
Alternative for ast_datastore_alloc()
int ast_sip_session_is_pending_stream_default(const struct ast_sip_session *session, const struct ast_stream *stream)
Determines if a provided pending stream will be the default stream or not.
struct ast_datastore * ast_sip_session_get_datastore(struct ast_sip_session *session, const char *name)
Retrieve a session datastore.
SRTP and SDP Security descriptions.
static struct ast_mansession session
struct ast_sip_channel_pvt * ast_sip_channel_pvt_alloc(void *pvt, struct ast_sip_session *session)
Allocate a new SIP channel pvt structure.
int ast_sip_session_refresh(struct ast_sip_session *session, ast_sip_session_request_creation_cb on_request_creation, ast_sip_session_sdp_creation_cb on_sdp_creation, ast_sip_session_response_cb on_response, enum ast_sip_session_refresh_method method, int generate_new_sdp, struct ast_sip_session_media_state *media_state)
Send a reinvite or UPDATE on a session.
#define AST_MAX_EXTENSION
void ast_sip_session_defer_termination_cancel(struct ast_sip_session *session)
Cancel a pending deferred termination.
pj_timer_entry rescheduled_reinvite
struct ast_channel * channel
A set of macros to manage forward-linked lists.
#define AST_VECTOR(name, type)
Define a vector structure.
void ast_sip_session_resume_reinvite(struct ast_sip_session *session)
Resumes processing of a deferred incoming re-invite.
AST_LIST_HEAD_NOLOCK(contactliststruct, contact)
An entity with which Asterisk communicates.
void ast_sip_session_send_response(struct ast_sip_session *session, pjsip_tx_data *tdata)
Send a SIP response.
ast_sip_session_t38state
T.38 states for a session.
void ast_sip_session_unregister_sdp_handler(struct ast_sip_session_sdp_handler *handler, const char *stream_type)
Unregister an SDP handler.
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.
struct ast_taskprocessor * serializer
void ast_sip_session_media_stats_save(struct ast_sip_session *sip_session, struct ast_sip_session_media_state *media_state)
Save a media stats.
void ast_sip_session_remove_supplements(struct ast_sip_session *session)
Remove supplements from a SIP session.
struct ast_module * module
const char * ast_sip_session_get_name(const struct ast_sip_session *session)
Get the channel or endpoint name associated with the session.
static void stream_stop(struct ast_sip_session_media *session_media)
Function which stops the RTP instance.
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.
ast_sip_session_refresh_method
ast_sip_dtmf_mode
DTMF modes for SIP endpoints.
pj_timer_entry scheduled_termination
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
ast_sip_session_sdp_stream_defer
int ast_sip_session_defer_termination(struct ast_sip_session *session)
Defer local termination of a session until remote side terminates, or an amount of time passes...
int ast_sip_session_media_add_read_callback(struct ast_sip_session *session, struct ast_sip_session_media *session_media, int fd, ast_sip_session_media_read_cb callback)
Set a read callback for a media session with a specific file descriptor.
Structure used for sending delayed requests.
struct controlling the suspension of the session's serializer.
struct ast_sip_session_suspender * suspended
struct ast_sip_session_supplement * next
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.
void ast_sip_session_end_if_deferred(struct ast_sip_session *session)
End the session if it had been previously deferred.
Data structure associated with a single frame of data.
int ast_sip_session_media_set_write_callback(struct ast_sip_session *session, struct ast_sip_session_media *session_media, ast_sip_session_media_write_cb callback)
Set a write callback for a media session.
unsigned int authentication_challenge_count
static void session_destroy(struct mansession_session *s)
int ast_sip_session_add_supplements(struct ast_sip_session *session)
Add supplements to a SIP session.
ast_media_type
Types of media.
int ast_sip_session_regenerate_answer(struct ast_sip_session *session, ast_sip_session_sdp_creation_cb on_sdp_creation)
Regenerate SDP Answer.
void ast_sip_session_media_state_reset(struct ast_sip_session_media_state *media_state)
Reset a media state to a clean state.
pjsip_fromto_hdr * saved_from_hdr
struct ast_sip_contact * contact
struct ast_sip_session * ast_sip_dialog_get_session(pjsip_dialog *dlg)
Retrieves a session from a dialog.
int(* ast_sip_session_sdp_creation_cb)(struct ast_sip_session *session, pjmedia_sdp_session *sdp)
int ast_sip_session_add_datastore(struct ast_sip_session *session, struct ast_datastore *datastore)
Add a datastore to a SIP session.
void ast_sip_session_send_request_with_cb(struct ast_sip_session *session, pjsip_tx_data *tdata, ast_sip_session_response_cb on_response)
Send a SIP request and get called back when a response is received.
unsigned int moh_passthrough