Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_ua.h>
#include <pjlib.h>
#include <pjmedia.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
#include "asterisk/res_pjsip_session_caps.h"
#include "asterisk/callerid.h"
#include "asterisk/datastore.h"
#include "asterisk/module.h"
#include "asterisk/logger.h"
#include "asterisk/astobj2.h"
#include "asterisk/lock.h"
#include "asterisk/uuid.h"
#include "asterisk/pbx.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/causes.h"
#include "asterisk/sdp_srtp.h"
#include "asterisk/dsp.h"
#include "asterisk/acl.h"
#include "asterisk/features_config.h"
#include "asterisk/pickup.h"
#include "asterisk/test.h"
#include "asterisk/stream.h"
#include "asterisk/vector.h"
Go to the source code of this file.
Data Structures | |
struct | ast_sip_session_delayed_request |
Structure used for sending delayed requests. More... | |
struct | ast_sip_session_suspender |
struct controlling the suspension of the session's serializer. More... | |
struct | new_invite |
struct | sdp_handler_list |
struct | sip_session_media_bundle_group |
Bundle group building structure. More... | |
Macros | |
#define | CHECKER() |
#define | DATASTORE_BUCKETS 53 |
#define | DEFAULT_NUM_SESSION_MEDIA 2 |
#define | FREE_STATE() |
#define | GET_STREAM_NAME_SAFE(_stream) (_stream ? ast_stream_get_name(_stream) : "") |
#define | GET_STREAM_SAFE(_topology, _i) (_i < ast_stream_topology_get_count(_topology) ? ast_stream_topology_get_stream(_topology, _i) : NULL) |
#define | GET_STREAM_STATE_SAFE(_stream) (_stream ? ast_stream_get_state(_stream) : AST_STREAM_STATE_END) |
#define | MEDIA_BUCKETS 7 |
#define | MOD_DATA_NAT_HOOK "nat_hook" |
#define | MOD_DATA_ON_RESPONSE "on_response" |
#define | print_debug_details(inv, tsx, e) __print_debug_details(__PRETTY_FUNCTION__, (inv), (tsx), (e)) |
#define | RESET_STATE(__num) |
#define | SDP_HANDLER_BUCKETS 11 |
#define | STATE_NONE(_stream_state) (_stream_state == AST_STREAM_STATE_END) |
#define | STATE_REMOVED(_stream_state) (_stream_state == AST_STREAM_STATE_REMOVED) |
#define | STREAM_REMOVED(_stream) (ast_stream_get_state(_stream) == AST_STREAM_STATE_REMOVED) |
Functions | |
static void | __print_debug_details (const char *function, pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | add_bundle_groups (struct ast_sip_session *session, pj_pool_t *pool, pjmedia_sdp_session *answer) |
static int | add_sdp_streams (struct ast_sip_session_media *session_media, struct ast_sip_session *session, pjmedia_sdp_session *answer, const struct pjmedia_sdp_session *remote, struct ast_stream *stream) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
struct ast_sip_channel_pvt * | ast_sip_channel_pvt_alloc (void *pvt, struct ast_sip_session *session) |
Allocate a new SIP channel pvt structure. More... | |
struct ast_sip_session * | ast_sip_dialog_get_session (pjsip_dialog *dlg) |
Retrieves a session from a dialog. More... | |
int | ast_sip_session_add_datastore (struct ast_sip_session *session, struct ast_datastore *datastore) |
Add a datastore to a SIP session. More... | |
struct ast_sip_session * | ast_sip_session_alloc (struct ast_sip_endpoint *endpoint, struct ast_sip_contact *contact, pjsip_inv_session *inv_session, pjsip_rx_data *rdata) |
Allocate a new SIP session. More... | |
struct ast_datastore * | ast_sip_session_alloc_datastore (const struct ast_datastore_info *info, const char *uid) |
Alternative for ast_datastore_alloc() More... | |
int | ast_sip_session_create_invite (struct ast_sip_session *session, pjsip_tx_data **tdata) |
Creates an INVITE request. More... | |
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. More... | |
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. More... | |
void | ast_sip_session_defer_termination_cancel (struct ast_sip_session *session) |
Cancel a pending deferred termination. More... | |
void | ast_sip_session_end_if_deferred (struct ast_sip_session *session) |
End the session if it had been previously deferred. More... | |
struct ast_datastore * | ast_sip_session_get_datastore (struct ast_sip_session *session, const char *name) |
Retrieve a session datastore. More... | |
const char * | ast_sip_session_get_name (const struct ast_sip_session *session) |
Get the channel or endpoint name associated with the session. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
struct ast_sip_session_media_state * | ast_sip_session_media_state_alloc (void) |
Allocate a session media state structure. More... | |
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. More... | |
void | ast_sip_session_media_state_free (struct ast_sip_session_media_state *media_state) |
Free a session media state structure. More... | |
void | ast_sip_session_media_state_reset (struct ast_sip_session_media_state *media_state) |
Reset a media state to a clean state. More... | |
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. More... | |
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. More... | |
int | ast_sip_session_regenerate_answer (struct ast_sip_session *session, ast_sip_session_sdp_creation_cb on_sdp_creation) |
Regenerate SDP Answer. More... | |
int | ast_sip_session_register_sdp_handler (struct ast_sip_session_sdp_handler *handler, const char *stream_type) |
Register an SDP handler. More... | |
void | ast_sip_session_remove_datastore (struct ast_sip_session *session, const char *name) |
Remove a session datastore from the session. More... | |
void | ast_sip_session_resume_reinvite (struct ast_sip_session *session) |
Resumes processing of a deferred incoming re-invite. More... | |
void | ast_sip_session_send_request (struct ast_sip_session *session, pjsip_tx_data *tdata) |
Send a SIP request. More... | |
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. More... | |
void | ast_sip_session_send_response (struct ast_sip_session *session, pjsip_tx_data *tdata) |
Send a SIP response. More... | |
void | ast_sip_session_suspend (struct ast_sip_session *session) |
Request and wait for the session serializer to be suspended. More... | |
void | ast_sip_session_terminate (struct ast_sip_session *session, int response) |
Terminate a session and, if possible, send the provided response code. More... | |
void | ast_sip_session_unregister_sdp_handler (struct ast_sip_session_sdp_handler *handler, const char *stream_type) |
Unregister an SDP handler. More... | |
void | ast_sip_session_unsuspend (struct ast_sip_session *session) |
Request the session serializer be unsuspended. More... | |
AST_TEST_DEFINE (test_resolve_refresh_media_states) | |
static int | check_content_disposition (pjsip_rx_data *rdata) |
static int | check_content_disposition_in_multipart (pjsip_multipart_part *part) |
static void | check_delayed_requests (struct ast_sip_session *session, int(*cb)(void *vsession)) |
static int | check_request_status (pjsip_inv_session *inv, pjsip_event *e) |
static int | check_sdp_content_type_supported (pjsip_media_type *content_type) |
static struct pjmedia_sdp_session * | create_local_sdp (pjsip_inv_session *inv, struct ast_sip_session *session, const pjmedia_sdp_session *offer) |
static int | datastore_cmp (void *obj, void *arg, int flags) |
static int | datastore_hash (const void *obj, int flags) |
static int | delay_request (struct ast_sip_session *session, ast_sip_session_request_creation_cb on_request, ast_sip_session_sdp_creation_cb on_sdp_creation, ast_sip_session_response_cb on_response, int generate_new_sdp, enum delayed_method method, struct ast_sip_session_media_state *pending_media_state, struct ast_sip_session_media_state *active_media_state, int queue_head) |
static const char * | delayed_method2str (enum delayed_method method) |
static struct ast_sip_session_delayed_request * | delayed_request_alloc (enum delayed_method method, 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, int generate_new_sdp, struct ast_sip_session_media_state *pending_media_state, struct ast_sip_session_media_state *active_media_state) |
static void | delayed_request_free (struct ast_sip_session_delayed_request *delay) |
static pj_bool_t | does_method_match (const pj_str_t *message_method, const char *supplement_method) |
static pjmedia_sdp_session * | generate_session_refresh_sdp (struct ast_sip_session *session) |
static enum sip_get_destination_result | get_destination (struct ast_sip_session *session, pjsip_rx_data *rdata) |
Determine where in the dialplan a call should go. More... | |
static int | get_mid_bundle_group (const pjmedia_sdp_session *sdp, const char *mid) |
static int | handle_incoming (struct ast_sip_session *session, pjsip_rx_data *rdata, enum ast_sip_session_response_priority response_priority) |
static void | handle_incoming_before_media (pjsip_inv_session *inv, struct ast_sip_session *session, pjsip_rx_data *rdata) |
static void | handle_incoming_request (struct ast_sip_session *session, pjsip_rx_data *rdata) |
static void | handle_incoming_response (struct ast_sip_session *session, pjsip_rx_data *rdata, enum ast_sip_session_response_priority response_priority) |
static int | handle_incoming_sdp (struct ast_sip_session *session, const pjmedia_sdp_session *sdp) |
static int | handle_negotiated_sdp (struct ast_sip_session *session, const pjmedia_sdp_session *local, const pjmedia_sdp_session *remote) |
static int | handle_negotiated_sdp_session_media (struct ast_sip_session_media *session_media, struct ast_sip_session *session, const pjmedia_sdp_session *local, const pjmedia_sdp_session *remote, int index, struct ast_stream *asterisk_stream) |
static void | handle_new_invite_request (pjsip_rx_data *rdata) |
static void | handle_outgoing_request (struct ast_sip_session *session, pjsip_tx_data *tdata) |
static void | handle_outgoing_response (struct ast_sip_session *session, pjsip_tx_data *tdata) |
static void | handle_session_begin (struct ast_sip_session *session) |
static void | handle_session_destroy (struct ast_sip_session *session) |
static void | handle_session_end (struct ast_sip_session *session) |
static pj_bool_t | has_supplement (const struct ast_sip_session *session, const pjsip_rx_data *rdata) |
static struct ast_sip_session_media_state * | internal_sip_session_media_state_alloc (size_t sessions, size_t read_callbacks) |
static int | invite_collision_timeout (void *vsession) |
static int | invite_proceeding (void *vsession) |
static int | invite_terminated (void *vsession) |
static int | is_media_state_valid (const char *session_name, struct ast_sip_session_media_state *state) |
static int | is_stream_limitation_reached (enum ast_media_type type, const struct ast_sip_endpoint *endpoint, int *type_streams) |
static int | load_module (void) |
static int | media_stats_local_ssrc_cmp (const struct ast_rtp_instance_stats *vec_elem, const struct ast_rtp_instance_stats *srch) |
static int | new_invite (struct new_invite *invite) |
static int | new_invite_initial_answer (pjsip_inv_session *inv_session, pjsip_rx_data *rdata, int answer_code, int terminate_code, pj_bool_t notify) |
static pj_bool_t | outbound_invite_auth (pjsip_rx_data *rdata) |
static pjsip_inv_session * | pre_session_setup (pjsip_rx_data *rdata, const struct ast_sip_endpoint *endpoint) |
static int | remove_handler (void *obj, void *arg, void *data, int flags) |
static void | remove_stream_from_bundle (struct ast_sip_session_media *session_media, struct ast_stream *stream) |
static void | reschedule_reinvite (struct ast_sip_session *session, ast_sip_session_response_cb on_response) |
static void | resend_reinvite (pj_timer_heap_t *timer, pj_timer_entry *entry) |
static struct ast_sip_session_media_state * | resolve_refresh_media_states (const char *session_name, struct ast_sip_session_media_state *delayed_pending_state, struct ast_sip_session_media_state *delayed_active_state, struct ast_sip_session_media_state *current_active_state, int run_post_validation) |
static int | sdp_handler_list_cmp (void *obj, void *arg, int flags) |
static int | sdp_handler_list_hash (const void *obj, int flags) |
static int | sdp_requires_deferral (struct ast_sip_session *session, const pjmedia_sdp_session *sdp) |
Determine whether the SDP provided requires deferral of negotiating or not. More... | |
static int | send_delayed_request (struct ast_sip_session *session, struct ast_sip_session_delayed_request *delay) |
static void | session_datastore_destroy (void *obj) |
static void | session_destructor (void *obj) |
static int | session_end (void *vsession) |
static int | session_end_completion (void *vsession) |
static int | session_end_if_disconnected (int id, pjsip_inv_session *inv) |
static void | session_inv_on_create_offer (pjsip_inv_session *inv, pjmedia_sdp_session **p_offer) |
static void | session_inv_on_media_update (pjsip_inv_session *inv, pj_status_t status) |
static void | session_inv_on_new_session (pjsip_inv_session *inv, pjsip_event *e) |
static pjsip_redirect_op | session_inv_on_redirected (pjsip_inv_session *inv, const pjsip_uri *target, const pjsip_event *e) |
static void | session_inv_on_rx_offer (pjsip_inv_session *inv, const pjmedia_sdp_session *offer) |
static void | session_inv_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) |
static void | session_inv_on_tsx_state_changed (pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e) |
static void | session_media_dtor (void *obj) |
static void | session_media_set_handler (struct ast_sip_session_media *session_media, struct ast_sip_session_sdp_handler *handler) |
Set an SDP stream handler for a corresponding session media. More... | |
static pj_bool_t | session_on_rx_request (pjsip_rx_data *rdata) |
Called when a new SIP request comes into PJSIP. More... | |
static pj_bool_t | session_on_rx_response (pjsip_rx_data *rdata) |
static void | session_on_tsx_state (pjsip_transaction *tsx, pjsip_event *e) |
static void | session_outgoing_nat_hook (pjsip_tx_data *tdata, struct ast_sip_transport *transport) |
Hook for modifying outgoing messages with SDP to contain the proper address information. More... | |
static pj_bool_t | session_reinvite_on_rx_request (pjsip_rx_data *rdata) |
static void | session_termination_cb (pj_timer_heap_t *timer_heap, struct pj_timer_entry *entry) |
static int | session_termination_task (void *data) |
static void | set_from_header (struct ast_sip_session *session) |
static int | set_mid_and_bundle_group (struct ast_sip_session *session, struct ast_sip_session_media *session_media, const pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream) |
static void | set_remote_mslabel_and_stream_group (struct ast_sip_session *session, struct ast_sip_session_media *session_media, const pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream, struct ast_stream *asterisk_stream) |
static int | setup_outbound_invite_auth (pjsip_dialog *dlg) |
static void | sip_channel_destroy (void *obj) |
Destructor for SIP channel. More... | |
static void | sip_session_defer_termination_stop_timer (struct ast_sip_session *session) |
static int | 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 *pending_media_state, struct ast_sip_session_media_state *active_media_state, int queued) |
static int | sip_session_suspend_task (void *data) |
static void | sip_session_suspender_dtor (void *vdoomed) |
static int | stream_destroy (void *obj, void *arg, int flags) |
static int | test_is_media_session_equal (struct ast_sip_session_media *left, struct ast_sip_session_media *right) |
static int | test_is_media_state_equal (struct ast_sip_session_media_state *left, struct ast_sip_session_media_state *right, int assert_on_failure) |
static struct ast_sip_session_media * | test_media_add (struct ast_sip_session_media_state *media_state, const char *name, enum ast_media_type type, enum ast_stream_state state, int position) |
static struct ast_stream * | test_stream_alloc (const char *name, enum ast_media_type type, enum ast_stream_state state) |
static int | unload_module (void) |
static int | update_completed (void *vsession) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Session resource" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND, .requires = "res_pjsip", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static pjsip_inv_callback | inv_callback |
static struct ast_sip_nat_hook * | nat_hook |
NAT hook for modifying outgoing messages with SDP. More... | |
static pjsip_module | outbound_invite_auth_module |
static struct ao2_container * | sdp_handlers |
Registered SDP stream handlers. More... | |
static pjsip_module | session_module |
static pjsip_module | session_reinvite_module |
#define CHECKER | ( | ) |
Referenced by AST_TEST_DEFINE().
#define DATASTORE_BUCKETS 53 |
Definition at line 1226 of file res_pjsip_session.c.
Referenced by ast_sip_session_alloc().
#define DEFAULT_NUM_SESSION_MEDIA 2 |
Definition at line 61 of file res_pjsip_session.c.
Referenced by ast_sip_session_media_state_alloc().
#define FREE_STATE | ( | ) |
#define GET_STREAM_NAME_SAFE | ( | _stream | ) | (_stream ? ast_stream_get_name(_stream) : "") |
Definition at line 1739 of file res_pjsip_session.c.
Referenced by is_media_state_valid(), and resolve_refresh_media_states().
#define GET_STREAM_SAFE | ( | _topology, | |
_i | |||
) | (_i < ast_stream_topology_get_count(_topology) ? ast_stream_topology_get_stream(_topology, _i) : NULL) |
Definition at line 1737 of file res_pjsip_session.c.
Referenced by resolve_refresh_media_states().
#define GET_STREAM_STATE_SAFE | ( | _stream | ) | (_stream ? ast_stream_get_state(_stream) : AST_STREAM_STATE_END) |
Definition at line 1738 of file res_pjsip_session.c.
Referenced by resolve_refresh_media_states().
#define MEDIA_BUCKETS 7 |
Definition at line 1227 of file res_pjsip_session.c.
#define MOD_DATA_NAT_HOOK "nat_hook" |
Definition at line 58 of file res_pjsip_session.c.
Referenced by session_outgoing_nat_hook().
#define MOD_DATA_ON_RESPONSE "on_response" |
Definition at line 57 of file res_pjsip_session.c.
Referenced by ast_sip_session_send_request_with_cb(), and session_inv_on_tsx_state_changed().
#define print_debug_details | ( | inv, | |
tsx, | |||
e | |||
) | __print_debug_details(__PRETTY_FUNCTION__, (inv), (tsx), (e)) |
Definition at line 4396 of file res_pjsip_session.c.
Referenced by session_inv_on_state_changed(), and session_inv_on_tsx_state_changed().
#define RESET_STATE | ( | __num | ) |
Referenced by AST_TEST_DEFINE().
#define SDP_HANDLER_BUCKETS 11 |
Definition at line 55 of file res_pjsip_session.c.
Referenced by load_module().
#define STATE_NONE | ( | _stream_state | ) | (_stream_state == AST_STREAM_STATE_END) |
Definition at line 1736 of file res_pjsip_session.c.
Referenced by resolve_refresh_media_states().
#define STATE_REMOVED | ( | _stream_state | ) | (_stream_state == AST_STREAM_STATE_REMOVED) |
Definition at line 1735 of file res_pjsip_session.c.
Referenced by resolve_refresh_media_states().
#define STREAM_REMOVED | ( | _stream | ) | (ast_stream_get_state(_stream) == AST_STREAM_STATE_REMOVED) |
Definition at line 1734 of file res_pjsip_session.c.
Referenced by is_media_state_valid(), and resolve_refresh_media_states().
enum delayed_method |
Enumerator | |
---|---|
DELAYED_METHOD_INVITE | |
DELAYED_METHOD_UPDATE | |
DELAYED_METHOD_BYE |
Definition at line 1295 of file res_pjsip_session.c.
Definition at line 3645 of file res_pjsip_session.c.
|
static |
Definition at line 4347 of file res_pjsip_session.c.
References ast_channel_name(), ast_log, ast_sorcery_object_get_id(), ast_sip_session::channel, DEBUG_ATLEAST, ast_sip_session::endpoint, LOG_DEBUG, and NULL.
|
static |
Definition at line 6128 of file res_pjsip_session.c.
|
static |
Definition at line 6128 of file res_pjsip_session.c.
|
static |
Definition at line 5011 of file res_pjsip_session.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), AST_VECTOR_GET, AST_VECTOR_SIZE, sip_session_media_bundle_group::attr_string, ast_sip_endpoint_media_configuration::bundle, ast_sip_session_media::bundle_group, ast_sip_session::endpoint, ast_sip_endpoint::media, ast_sip_session_media::mid, sip_session_media_bundle_group::mids, ast_sip_session::pending_media_state, and ast_sip_endpoint_media_configuration::webrtc.
Referenced by create_local_sdp().
|
static |
Definition at line 4957 of file res_pjsip_session.c.
References ao2_cleanup, ao2_find, ast_codec_media_type2str(), AST_LIST_TRAVERSE, ast_sip_session_get_name(), ast_str_tmp, ast_stream_to_str(), ast_sip_session_sdp_handler::create_outgoing_sdp_stream, handler(), ast_sip_session_media::handler, ast_sip_session_sdp_handler::next, NULL, OBJ_KEY, RAII_VAR, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, session_media_set_handler(), and ast_sip_session_media::type.
Referenced by create_local_sdp().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 6128 of file res_pjsip_session.c.
struct ast_sip_channel_pvt* ast_sip_channel_pvt_alloc | ( | void * | pvt, |
struct ast_sip_session * | session | ||
) |
Allocate a new SIP channel pvt structure.
pvt | Pointer to channel specific information |
session | Pointer to SIP session |
non-NULL | success |
NULL | failure |
Definition at line 2974 of file res_pjsip_session.c.
References ao2_alloc, ao2_ref, NULL, ast_sip_channel_pvt::pvt, session, ast_sip_channel_pvt::session, and sip_channel_destroy().
Referenced by chan_pjsip_new().
struct ast_sip_session* ast_sip_dialog_get_session | ( | pjsip_dialog * | dlg | ) |
Retrieves a session from a dialog.
dlg | The dialog to retrieve the session from |
non-NULL | if session exists |
NULL | if no session |
Definition at line 3630 of file res_pjsip_session.c.
References ao2_ref, ast_sip_session::inv_session, NULL, and session.
Referenced by assign_uuid(), refer_incoming_attended_request(), refer_incoming_invite_request(), session_outgoing_nat_hook(), and session_reinvite_on_rx_request().
int ast_sip_session_add_datastore | ( | struct ast_sip_session * | session, |
struct ast_datastore * | datastore | ||
) |
Add a datastore to a SIP session.
Note that SIP uses reference counted datastores. The datastore passed into this function must have been allocated using ao2_alloc() or there will be serious problems.
session | The session to add the datastore to |
datastore | The datastore to be added to the session |
0 | Success |
-1 | Failure |
Definition at line 1273 of file res_pjsip_session.c.
References ao2_link, ast_assert, ast_strlen_zero, ast_sip_session::datastores, ast_datastore::info, NULL, and ast_datastore::uid.
Referenced by add_header(), chan_pjsip_incoming_request(), chan_pjsip_session_begin(), handle_incoming_request(), incoming_request(), session_refresh_state_get_or_alloc(), and t38_state_get_or_alloc().
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.
This will take care of allocating the datastores container on the session as well as placing all registered supplements onto the session.
The endpoint that is passed in will have its reference count increased by one since the session will be keeping a reference to the endpoint. The session will relinquish this reference when the session is destroyed.
endpoint | The endpoint that this session communicates with |
contact | The contact associated with this session |
inv_session | The PJSIP INVITE session data |
rdata | INVITE request received (NULL if for outgoing allocation) |
Definition at line 2990 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_bump, ao2_cleanup, ao2_container_alloc_hash, ao2_ref, ast_dsp_new(), ast_dsp_set_features(), ast_format_cap_alloc, AST_FORMAT_CAP_FLAG_DEFAULT, AST_LIST_HEAD_INIT, AST_LIST_HEAD_INIT_NOLOCK, ast_log, ast_party_id_init(), ast_sip_create_serializer(), ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), AST_SIP_DTMF_AUTO, AST_SIP_DTMF_INBAND, ast_sip_get_distributor_serializer(), ast_sip_session_add_supplements(), ast_sip_session_media_state_alloc(), ast_sorcery_object_get_id(), ast_taskprocessor_build_name(), AST_TASKPROCESSOR_MAX_NAME, AST_VECTOR_INIT, ast_sip_session::authentication_challenge_count, ast_sip_session::contact, DATASTORE_BUCKETS, datastore_cmp(), datastore_hash(), ast_sip_session::datastores, ast_sip_session::delayed_requests, ast_sip_session::direct_media_cap, ast_sip_session::dsp, DSP_FEATURE_DIGIT_DETECT, DSP_FEATURE_FAX_DETECT, ast_sip_session::dtmf, ast_sip_endpoint::dtmf, ast_sip_session::endpoint, ast_sip_endpoint::faxdetect, handle_session_begin(), ast_sip_session::id, ast_sip_session::inv_session, LOG_ERROR, ast_sip_session::moh_passthrough, ast_sip_endpoint::moh_passthrough, NULL, ast_sip_session::pending_media_state, RAII_VAR, ast_sip_session::serializer, session, session_destructor(), and ast_sip_session::supplements.
Referenced by ast_sip_session_create_outgoing(), and handle_new_invite_request().
struct ast_datastore* ast_sip_session_alloc_datastore | ( | const struct ast_datastore_info * | info, |
const char * | uid | ||
) |
Alternative for ast_datastore_alloc()
There are two major differences between this and ast_datastore_alloc() 1) This allocates a refcounted object 2) This will fill in a uid if one is not provided
DO NOT call ast_datastore_free() on a datastore allocated in this way since that function will attempt to free the datastore rather than play nicely with its refcount.
info | Callbacks for datastore |
uid | Identifier for datastore |
NULL | Failed to allocate datastore |
non-NULL | Newly allocated datastore |
Definition at line 1243 of file res_pjsip_session.c.
References ao2_alloc, ao2_cleanup, ao2_ref, ast_strdup, ast_strlen_zero, ast_uuid_generate_str(), AST_UUID_STR_LEN, sip_to_pjsip::info(), NULL, RAII_VAR, session_datastore_destroy(), and ast_datastore::uid.
Referenced by add_header(), chan_pjsip_incoming_request(), chan_pjsip_session_begin(), handle_incoming_request(), incoming_request(), session_refresh_state_get_or_alloc(), and t38_state_get_or_alloc().
int ast_sip_session_create_invite | ( | struct ast_sip_session * | session, |
pjsip_tx_data ** | tdata | ||
) |
Creates an INVITE request.
session | Starting session for the INVITE |
tdata | The created request. |
Definition at line 2847 of file res_pjsip_session.c.
References ast_sip_session_get_name(), create_local_sdp(), ast_sip_session::endpoint, ast_sip_session::inv_session, NULL, ast_sip_endpoint::preferred_codec_only, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and set_from_header().
Referenced by call().
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.
The endpoint that is passed in will have its reference count increased by one since the session will be keeping a reference to the endpoint. The session will relinquish this reference when the session is destroyed.
endpoint | The endpoint that this session uses for settings |
contact | The contact that this session will communicate with |
location | Name of the location to call, be it named location or explicit URI. Overrides contact if present. |
request_user | Optional request user to place in the request URI if permitted |
req_topology | The requested capabilities |
Definition at line 3317 of file res_pjsip_session.c.
References ao2_bump, ao2_cleanup, ao2_ref, ast_sip_session::aor, ast_sip_endpoint::aors, ast_log, ast_party_id_copy(), AST_SIP_CONTACT_FILTER_REACHABLE, ast_sip_create_dialog_uac(), ast_sip_location_retrieve_contact_and_aor_from_list_filtered(), ast_sip_session_alloc(), ast_sip_session_create_joint_call_stream(), AST_SIP_SESSION_OUTGOING_CALL, ast_sorcery_object_get_id(), ast_str_tmp, ast_stream_free(), ast_stream_get_format_count(), ast_stream_get_state(), AST_STREAM_STATE_REMOVED, ast_stream_topology_alloc(), ast_stream_topology_append_stream(), ast_stream_topology_clone(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_stream_topology_to_str(), ast_strlen_zero, ast_sip_session::call_direction, ast_sip_endpoint::extensions, ast_sip_endpoint_extensions::flags, ast_sip_session::id, ast_sip_endpoint::id, LOG_ERROR, ast_sip_endpoint::media, ast_sip_timer_options::min_se, NULL, ast_sip_session::pending_media_state, RAII_VAR, S_OR, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, ast_sip_endpoint_id_configuration::self, ast_sip_timer_options::sess_expires, session, session_end(), session_end_completion(), setup_outbound_invite_auth(), timer, ast_sip_endpoint_extensions::timer, ast_sip_session_media_state::topology, ast_sip_endpoint_media_configuration::topology, and ast_sip_contact::uri.
Referenced by request().
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.
session | The session to defer termination on |
0 | Success |
-1 | Failure |
Definition at line 3554 of file res_pjsip_session.c.
References ao2_ref, ast_assert, ast_sip_get_pjsip_endpoint(), ast_sip_session::defer_end, ast_sip_session::defer_terminate, ast_sip_session::ended_while_deferred, ast_sip_session::scheduled_termination, and session_termination_cb().
Referenced by refer_incoming_attended_request(), and refer_incoming_blind_request().
void ast_sip_session_defer_termination_cancel | ( | struct ast_sip_session * | session | ) |
Cancel a pending deferred termination.
session | The session to cancel a deferred termination on. |
Definition at line 3596 of file res_pjsip_session.c.
References ast_sip_session_terminate(), ast_sip_session::defer_terminate, sip_session_defer_termination_stop_timer(), and ast_sip_session::terminate_while_deferred.
Referenced by defer_termination_cancel_task(), refer_incoming_attended_request(), and refer_incoming_blind_request().
void ast_sip_session_end_if_deferred | ( | struct ast_sip_session * | session | ) |
End the session if it had been previously deferred.
session | The session to end if it had been deferred |
Definition at line 3614 of file res_pjsip_session.c.
References ast_debug, ast_sip_session_get_name(), ast_sip_session::defer_end, ast_sip_session::ended_while_deferred, and session_end().
Referenced by defer_termination_cancel_task(), refer_attended_task(), refer_incoming_attended_request(), refer_incoming_blind_request(), and session_end_if_deferred_task().
struct ast_datastore* ast_sip_session_get_datastore | ( | struct ast_sip_session * | session, |
const char * | name | ||
) |
Retrieve a session datastore.
The datastore retrieved will have its reference count incremented. When the caller is done with the datastore, the reference counted needs to be decremented using ao2_ref().
session | The session from which to retrieve the datastore |
name | The name of the datastore to retrieve |
NULL | Failed to find the specified datastore |
non-NULL | The specified datastore |
Definition at line 1285 of file res_pjsip_session.c.
References ao2_find, ast_sip_session::datastores, and OBJ_KEY.
Referenced by add_header(), chan_pjsip_get_rtp_peer(), channel_read_pjsip(), direct_media_mitigate_glare(), handle_outgoing_response(), incoming_request(), outgoing_request(), read_header(), remove_header(), session_refresh_state_get_or_alloc(), t38_automatic_reject(), t38_state_get_or_alloc(), and update_header().
const char* ast_sip_session_get_name | ( | const struct ast_sip_session * | session | ) |
Get the channel or endpoint name associated with the session.
session |
Channel | name or endpoint name or "unknown" |
Definition at line 115 of file res_pjsip_session.c.
References ast_channel_name(), ast_sorcery_object_get_id(), ast_sip_session::channel, and ast_sip_session::endpoint.
Referenced by add_sdp_streams(), answer(), apply_negotiated_sdp_stream(), ast_sip_session_create_invite(), ast_sip_session_end_if_deferred(), ast_sip_session_media_state_add(), ast_sip_session_regenerate_answer(), ast_sip_session_terminate(), call(), chan_pjsip_call(), chan_pjsip_incoming_ack(), chan_pjsip_incoming_request(), chan_pjsip_incoming_response(), chan_pjsip_incoming_response_update_cause(), chan_pjsip_new(), chan_pjsip_session_begin(), chan_pjsip_session_end(), create_local_sdp(), create_outgoing_sdp_stream(), delay_request(), generate_session_refresh_sdp(), get_codecs(), get_destination(), handle_incoming_before_media(), handle_incoming_request(), handle_incoming_response(), handle_incoming_sdp(), handle_negotiated_sdp(), handle_negotiated_sdp_session_media(), handle_new_invite_request(), handle_outgoing_request(), handle_outgoing_response(), invite_collision_timeout(), invite_proceeding(), invite_terminated(), negotiate_incoming_sdp_stream(), new_invite(), on_topology_change_response(), outbound_invite_auth(), pbx_start_incoming_request(), reschedule_reinvite(), resend_reinvite(), sdp_requires_deferral(), send_delayed_request(), send_topology_change_refresh(), session_destructor(), session_inv_on_media_update(), session_inv_on_rx_offer(), session_inv_on_state_changed(), session_inv_on_tsx_state_changed(), session_on_rx_request(), session_on_rx_response(), session_on_tsx_state(), session_outgoing_nat_hook(), set_caps(), set_from_header(), set_incoming_call_offer_cap(), and sip_session_refresh().
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.
session | The session to check against |
stream | The pending stream |
1 | if stream will be default |
0 | if stream will NOT be the default |
Definition at line 359 of file res_pjsip_session.c.
References ast_channel_name(), ast_log, ast_stream_get_state(), ast_stream_get_type(), AST_STREAM_STATE_REMOVED, ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_sip_session::channel, LOG_WARNING, ast_sip_session::pending_media_state, and ast_sip_session_media_state::topology.
Referenced by create_outgoing_sdp_stream(), handle_incoming_sdp(), handle_negotiated_sdp_session_media(), negotiate_incoming_sdp_stream(), sdp_requires_deferral(), and set_caps().
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.
session | The session |
session_media | The media session |
fd | The file descriptor |
callback | The read callback |
0 | the read callback was successfully added |
-1 | the read callback could not be added |
Definition at line 385 of file res_pjsip_session.c.
References AST_VECTOR_APPEND, ast_sip_session_media_read_callback_state::fd, and ast_sip_session::pending_media_state.
Referenced by apply_negotiated_sdp_stream().
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.
session | The session |
session_media | The media session to retrieve the transport for |
Definition at line 414 of file res_pjsip_session.c.
References ast_strlen_zero, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_sip_endpoint_media_configuration::bundle, ast_sip_session_media::bundle_group, ast_sip_session::endpoint, ast_sip_endpoint::media, ast_sip_session_media::mid, and ast_sip_session::pending_media_state.
Referenced by apply_negotiated_sdp_stream(), create_outgoing_sdp_stream(), and negotiate_incoming_sdp_stream().
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.
session | The session |
session_media | The media session |
callback | The write callback |
0 | the write callback was successfully add |
-1 | the write callback is already set to something different |
Definition at line 398 of file res_pjsip_session.c.
References ast_sip_session_media::write_callback.
Referenced by apply_negotiated_sdp_stream().
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.
This allocates a session media of the specified type. The position argument determines where in the vector that the new session media will be inserted.
session | Session on which to query active media state for |
media_state | Media state to place the session media into |
type | The type of the session media |
position | Position at which to insert the new session media. |
non-NULL | success |
NULL | failure |
Definition at line 490 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_ref, ast_asprintf, ast_codec_media_type2str(), ast_free, ast_sip_session_get_name(), ast_strdup, ast_stream_get_name(), ast_stream_get_state(), AST_STREAM_STATE_REMOVED, ast_stream_topology_get_stream(), ast_trace, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, ast_sip_endpoint_media_configuration::bundle, ast_sip_session_media::bundle_group, ast_sip_session_media::bundled, ast_sip_session_media_state::default_session, ast_sip_session_media::encryption, ast_sip_media_rtp_configuration::encryption, ast_sip_session::endpoint, ast_sip_media_rtp_configuration::ice_support, ast_sip_session_media::keepalive_sched_id, ast_sip_endpoint::media, ast_sip_session_media::mid, NULL, ast_sip_session_media::remote_ice, ast_sip_session_media::remote_rtcp_mux, ast_sip_endpoint_media_configuration::rtcp_mux, ast_sip_endpoint_media_configuration::rtp, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, session_media_dtor(), ast_sip_session_media::stream_name, ast_sip_session_media::stream_num, ast_sip_session_media::timeout_sched_id, ast_sip_session_media_state::topology, ast_sip_session_media::type, type, and ast_sip_endpoint_media_configuration::webrtc.
Referenced by create_local_sdp(), handle_incoming_sdp(), sdp_requires_deferral(), and t38_create_media_state().
struct ast_sip_session_media_state* ast_sip_session_media_state_alloc | ( | void | ) |
Allocate a session media state structure.
non-NULL | success |
NULL | failure |
Definition at line 238 of file res_pjsip_session.c.
References DEFAULT_NUM_SESSION_MEDIA, and internal_sip_session_media_state_alloc().
Referenced by ast_sip_session_alloc(), session_refresh_state_get_or_alloc(), t38_create_media_state(), and topology_change_refresh_data_alloc().
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.
media_state | The media state to clone |
non-NULL | success |
NULL | failure |
Definition at line 297 of file res_pjsip_session.c.
References ao2_bump, ao2_cleanup, ast_sip_session_media_state_free(), ast_stream_get_state(), ast_stream_get_type(), AST_STREAM_STATE_REMOVED, ast_stream_topology_clone(), ast_stream_topology_get_stream(), AST_VECTOR_GET, AST_VECTOR_GET_ADDR, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, ast_sip_session_media_state::default_session, internal_sip_session_media_state_alloc(), NULL, ast_sip_session_media_read_callback_state::read_callback, ast_sip_session_media_state::topology, and type.
Referenced by handle_negotiated_sdp(), reschedule_reinvite(), resolve_refresh_media_states(), sip_session_refresh(), and t38_reinvite_sdp_cb().
void ast_sip_session_media_state_free | ( | struct ast_sip_session_media_state * | media_state | ) |
Free a session media state structure.
Definition at line 344 of file res_pjsip_session.c.
References ast_free, ast_sip_session_media_state_reset(), and AST_VECTOR_FREE.
Referenced by ast_sip_session_media_state_clone(), delay_request(), delayed_request_free(), handle_negotiated_sdp(), reschedule_reinvite(), resolve_refresh_media_states(), session_destructor(), session_refresh_state_destroy(), sip_session_refresh(), t38_create_media_state(), t38_reinvite_response_cb(), t38_state_destroy(), and topology_change_refresh_data_free().
void ast_sip_session_media_state_reset | ( | struct ast_sip_session_media_state * | media_state | ) |
Reset a media state to a clean state.
media_state | The media state to reset |
Definition at line 278 of file res_pjsip_session.c.
References ao2_cleanup, AST_MEDIA_TYPE_END, ast_stream_topology_free(), AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_RESET, ast_sip_session_media_state::default_session, NULL, and ast_sip_session_media_state::topology.
Referenced by ast_sip_session_media_state_free(), ast_sip_session_terminate(), handle_negotiated_sdp(), on_topology_change_response(), session_inv_on_media_update(), session_inv_on_rx_offer(), session_reinvite_on_rx_request(), sip_session_refresh(), and t38_reinvite_response_cb().
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.
media_state | The media state to save |
Definition at line 244 of file res_pjsip_session.c.
References ast_calloc, ast_free, ast_rtp_instance_get_stats(), AST_RTP_INSTANCE_STAT_ALL, AST_VECTOR_APPEND, AST_VECTOR_GET, AST_VECTOR_REMOVE_CMP_UNORDERED, AST_VECTOR_SIZE, media_stats_local_ssrc_cmp(), NULL, and ast_sip_session_media::rtp.
Referenced by ast_sip_session_terminate(), and handle_negotiated_sdp().
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.
This method will inspect the session in order to construct an appropriate session refresh request. As with any outgoing request in res_pjsip_session, this will call into registered supplements in case they wish to add anything.
Note: The on_request_creation callback may or may not be called in the same thread where this function is called. Request creation may need to be delayed due to the current INVITE transaction state.
session | The session on which the reinvite will be sent |
on_request_creation | Callback called when request is created |
on_sdp_creation | Callback called when SDP is created |
on_response | Callback called when response for request is received |
method | The method that should be used when constructing the session refresh |
generate_new_sdp | Boolean to indicate if a new SDP should be created |
media_state | Optional requested media state for the SDP |
0 | Successfully sent refresh |
-1 | Failure to send refresh |
Definition at line 2524 of file res_pjsip_session.c.
References NULL, and sip_session_refresh().
Referenced by dtmf_mode_refresh_cb(), refresh_write_cb(), remote_send_hold_refresh(), send_direct_media_request(), send_topology_change_refresh(), t38_interpret_parameters(), and update_connected_line_information().
int ast_sip_session_regenerate_answer | ( | struct ast_sip_session * | session, |
ast_sip_session_sdp_creation_cb | on_sdp_creation | ||
) |
Regenerate SDP Answer.
This method is used when an SDP offer has been received but an SDP answer has not been sent yet. It requests that a new local SDP be created and set as the SDP answer. As with any outgoing request in res_pjsip_session, this will call into registered supplements in case they wish to add anything.
session | The session on which the answer will be updated |
on_sdp_creation | Callback called when SDP is created |
generate_new_sdp | Boolean to indicate if a new SDP should be created |
0 | Successfully updated the SDP answer |
-1 | Failure to updated the SDP answer |
Definition at line 2535 of file res_pjsip_session.c.
References ast_channel_name(), ast_log, ast_sip_session_get_name(), ast_sip_session::channel, create_local_sdp(), ast_sip_session::inv_session, LOG_WARNING, NULL, SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.
Referenced by dtmf_mode_refresh_cb().
int ast_sip_session_register_sdp_handler | ( | struct ast_sip_session_sdp_handler * | handler, |
const char * | stream_type | ||
) |
Register an SDP handler.
An SDP handler is responsible for parsing incoming SDP streams and ensuring that Asterisk can cope with the contents. Similarly, the SDP handler will be responsible for constructing outgoing SDP streams.
Multiple handlers for the same stream type may be registered. They will be visited in the order they were registered. Handlers will be visited for each stream type until one claims to have handled the stream.
handler | The SDP handler to register |
stream_type | The type of media stream for which to call the handler |
0 | Success |
-1 | Failure |
Definition at line 138 of file res_pjsip_session.c.
References ao2_alloc, ao2_cleanup, ao2_find, ao2_link, ast_debug, AST_LIST_HEAD_INIT_NOLOCK, AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE, ast_log, ast_sip_session_sdp_handler::id, lock, LOG_WARNING, ast_sip_session_sdp_handler::next, NULL, OBJ_KEY, RAII_VAR, and SCOPED_AO2LOCK.
Referenced by load_module().
void ast_sip_session_remove_datastore | ( | struct ast_sip_session * | session, |
const char * | name | ||
) |
Remove a session datastore from the session.
This operation may cause the datastore's free() callback to be called if the reference count reaches zero.
session | The session to remove the datastore from |
name | The name of the datastore to remove |
Definition at line 1290 of file res_pjsip_session.c.
References ao2_callback, ast_sip_session::datastores, NULL, OBJ_KEY, OBJ_NODATA, and OBJ_UNLINK.
Referenced by direct_media_mitigate_glare(), handle_outgoing_response(), outgoing_request(), refresh_write_cb(), and session_refresh_state_get_or_alloc().
void ast_sip_session_resume_reinvite | ( | struct ast_sip_session * | session | ) |
Resumes processing of a deferred incoming re-invite.
session | The session which has a pending incoming re-invite |
Definition at line 2798 of file res_pjsip_session.c.
References ast_sip_get_pjsip_endpoint(), ast_sip_session::channel, ast_sip_session::deferred_reinvite, and NULL.
Referenced by t38_automatic_reject(), and t38_interpret_parameters().
void ast_sip_session_send_request | ( | struct ast_sip_session * | session, |
pjsip_tx_data * | tdata | ||
) |
Send a SIP request.
This will send the SIP request specified in tdata and call into any registered supplements' outgoing_request callback.
session | The session to which to send the request |
tdata | The request to send |
Definition at line 2842 of file res_pjsip_session.c.
References ast_sip_session_send_request_with_cb(), and NULL.
Referenced by ast_sip_session_terminate(), call(), check_request_status(), handle_incoming_before_media(), outbound_invite_auth(), session_inv_on_tsx_state_changed(), transmit_info_dtmf(), and transmit_info_with_vidupdate().
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.
This will send the request out exactly the same as ast_sip_send_request() does. The difference is that when a response arrives, the specified callback will be called into
session | The session on which to send the request |
tdata | The request to send |
on_response | Callback to be called when a response is received |
Definition at line 2818 of file res_pjsip_session.c.
References ast_sip_mod_data_set, handle_outgoing_request(), ast_sip_session::inv_session, and MOD_DATA_ON_RESPONSE.
Referenced by ast_sip_session_send_request(), session_inv_on_tsx_state_changed(), and sip_session_refresh().
void ast_sip_session_send_response | ( | struct ast_sip_session * | session, |
pjsip_tx_data * | tdata | ||
) |
Send a SIP response.
This will send the SIP response specified in tdata and call into any registered supplements' outgoing_response callback.
session | The session on which to send the response. |
tdata | The response to send |
Definition at line 2576 of file res_pjsip_session.c.
References handle_outgoing_response(), ast_sip_session::inv_session, session_on_rx_request(), session_on_rx_response(), and session_on_tsx_state().
Referenced by answer(), ast_sip_session_terminate(), chan_pjsip_incoming_request(), indicate(), new_invite(), refer_incoming_invite_request(), transfer_redirect(), and update_connected_line_information().
void ast_sip_session_suspend | ( | struct ast_sip_session * | session | ) |
Request and wait for the session serializer to be suspended.
session | Which session to suspend the serializer. |
Definition at line 3155 of file res_pjsip_session.c.
References ao2_alloc, ao2_lock, ao2_object_get_lockaddr(), ao2_ref, ao2_unlock, ast_assert, ast_cond_init, ast_cond_wait, ast_sip_push_task(), ast_taskprocessor_is_suspended(), ast_taskprocessor_is_task(), ast_taskprocessor_suspend(), ast_sip_session_suspender::cond_complete, ast_sip_session_suspender::cond_suspended, NULL, ast_sip_session::serializer, sip_session_suspend_task(), sip_session_suspender_dtor(), ast_sip_session::suspended, and ast_sip_session_suspender::suspended.
Referenced by chan_pjsip_indicate().
void ast_sip_session_terminate | ( | struct ast_sip_session * | session, |
int | response | ||
) |
Terminate a session and, if possible, send the provided response code.
session | The session to terminate |
response | The response code to use for termination if possible |
Definition at line 3451 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, ast_debug, AST_LIST_REMOVE_HEAD, ast_sip_session_get_name(), ast_sip_session_media_state_reset(), ast_sip_session_media_stats_save(), ast_sip_session_send_request(), ast_sip_session_send_response(), ast_sip_session::defer_terminate, delay_request(), DELAYED_METHOD_BYE, delayed_request_free(), ast_sip_session::delayed_requests, ast_sip_session::inv_session, ast_sip_session_delayed_request::next, NULL, ast_sip_session::pending_media_state, SCOPE_ENTER, SCOPE_EXIT_RTN, session_end(), session_end_completion(), status, SWAP, and ast_sip_session::terminate_while_deferred.
Referenced by ast_sip_session_defer_termination_cancel(), chan_pjsip_incoming_request(), hangup(), send_delayed_request(), and session_termination_task().
void ast_sip_session_unregister_sdp_handler | ( | struct ast_sip_session_sdp_handler * | handler, |
const char * | stream_type | ||
) |
Unregister an SDP handler.
handler | The SDP handler to unregister |
stream_type | Stream type for which the SDP handler was registered |
Definition at line 199 of file res_pjsip_session.c.
References ao2_callback_data, OBJ_KEY, OBJ_NODATA, OBJ_UNLINK, and remove_handler().
Referenced by unload_module().
void ast_sip_session_unsuspend | ( | struct ast_sip_session * | session | ) |
Request the session serializer be unsuspended.
session | Which session to unsuspend the serializer. |
Definition at line 3200 of file res_pjsip_session.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_cond_signal, ast_taskprocessor_unsuspend(), ast_sip_session_suspender::complete, ast_sip_session_suspender::cond_complete, NULL, ast_sip_session::serializer, and ast_sip_session::suspended.
Referenced by chan_pjsip_indicate().
AST_TEST_DEFINE | ( | test_resolve_refresh_media_states | ) |
Definition at line 5660 of file res_pjsip_session.c.
References AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_VIDEO, AST_STREAM_STATE_REMOVED, AST_STREAM_STATE_SENDONLY, AST_STREAM_STATE_SENDRECV, AST_TEST_NOT_RUN, AST_TEST_PASS, CHECKER, sip_to_pjsip::info(), NULL, RESET_STATE, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, TEST_EXECUTE, TEST_INIT, and test_media_add().
|
static |
if there is required media we don't understand, return 1
Definition at line 3891 of file res_pjsip_session.c.
References check_content_disposition_in_multipart(), and NULL.
Referenced by new_invite().
|
static |
Definition at line 3867 of file res_pjsip_session.c.
References check_sdp_content_type_supported().
Referenced by check_content_disposition().
|
static |
Definition at line 1582 of file res_pjsip_session.c.
References ao2_ref, ast_sip_push_task(), and ast_sip_session::serializer.
Referenced by session_inv_on_tsx_state_changed().
|
static |
Definition at line 4560 of file res_pjsip_session.c.
References ast_sip_failover_request(), and ast_sip_session_send_request().
Referenced by session_inv_on_state_changed().
|
static |
Definition at line 3855 of file res_pjsip_session.c.
Referenced by check_content_disposition_in_multipart().
|
static |
Definition at line 5081 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, add_bundle_groups(), add_sdp_streams(), ast_sip_endpoint_media_configuration::address, ast_random(), ast_sip_get_host_ip_string(), ast_sip_session_get_name(), ast_sip_session_media_state_add(), ast_str_tmp, ast_stream_get_type(), ast_stream_to_str(), ast_stream_topology_clone(), ast_stream_topology_free(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_strlen_zero, ast_trace, end, ast_sip_session::endpoint, ast_sip_media_rtp_configuration::ipv6, LOG_ERROR, ast_sip_endpoint::media, ast_sip_session_media::mid, NULL, ast_sip_session::pending_media_state, ast_sip_endpoint_media_configuration::rtp, S_COR, S_OR, SCOPE_ENTER, SCOPE_EXIT, SCOPE_EXIT_EXPR, SCOPE_EXIT_LOG_EXPR, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, ast_sip_endpoint_media_configuration::sdpowner, ast_sip_endpoint_media_configuration::sdpsession, ast_sip_session_media_state::topology, and ast_sip_endpoint_media_configuration::topology.
Referenced by ast_sip_session_create_invite(), ast_sip_session_regenerate_answer(), generate_session_refresh_sdp(), new_invite(), session_inv_on_create_offer(), and session_inv_on_rx_offer().
|
static |
Definition at line 2888 of file res_pjsip_session.c.
References ast_assert, CMP_MATCH, CMP_STOP, NULL, OBJ_KEY, and ast_datastore::uid.
Referenced by ast_sip_session_alloc().
|
static |
Definition at line 2878 of file res_pjsip_session.c.
References ast_assert, ast_str_hash(), NULL, OBJ_KEY, and ast_datastore::uid.
Referenced by ast_sip_session_alloc().
|
static |
Definition at line 1591 of file res_pjsip_session.c.
References AST_LIST_INSERT_HEAD, AST_LIST_INSERT_TAIL, ast_sip_session_get_name(), ast_sip_session_media_state_free(), DELAYED_METHOD_BYE, delayed_request_alloc(), ast_sip_session::delayed_requests, LOG_ERROR, ast_sip_session_delayed_request::next, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, and SCOPE_EXIT_RTN_VALUE.
Referenced by ast_sip_session_terminate(), reschedule_reinvite(), and sip_session_refresh().
|
static |
Definition at line 1310 of file res_pjsip_session.c.
References DELAYED_METHOD_BYE, DELAYED_METHOD_INVITE, DELAYED_METHOD_UPDATE, and str.
Referenced by invite_proceeding(), invite_terminated(), and send_delayed_request().
|
static |
Definition at line 1355 of file res_pjsip_session.c.
References ast_sip_session_delayed_request::active_media_state, ast_calloc, ast_sip_session_delayed_request::generate_new_sdp, ast_sip_session_delayed_request::method, method, NULL, ast_sip_session_delayed_request::on_request_creation, ast_sip_session_delayed_request::on_response, ast_sip_session_delayed_request::on_sdp_creation, and ast_sip_session_delayed_request::pending_media_state.
Referenced by delay_request().
|
static |
Definition at line 1379 of file res_pjsip_session.c.
References ast_sip_session_delayed_request::active_media_state, ast_free, ast_sip_session_media_state_free(), and ast_sip_session_delayed_request::pending_media_state.
Referenced by ast_sip_session_terminate(), invite_proceeding(), invite_terminated(), and session_destructor().
|
static |
Definition at line 4129 of file res_pjsip_session.c.
References ast_strlen_zero, and method.
Referenced by handle_incoming_request(), handle_incoming_response(), handle_outgoing_request(), handle_outgoing_response(), and has_supplement().
|
static |
Definition at line 1621 of file res_pjsip_session.c.
References ast_sip_session_get_name(), create_local_sdp(), ast_sip_session::inv_session, NULL, SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.
Referenced by sip_session_refresh().
|
static |
Determine where in the dialplan a call should go.
This uses the username in the request URI to try to match an extension in the endpoint's configured context in order to route the call.
session | The inbound SIP session |
rdata | The SIP INVITE |
Definition at line 3666 of file res_pjsip_session.c.
References ast_sip_endpoint::allow_overlap, ao2_ref, ast_canmatch_extension(), ast_copy_pj_str(), ast_exists_extension(), ast_get_chan_features_pickup_config(), ast_log, ast_sip_session_get_name(), AST_SIP_USER_OPTIONS_TRUNCATE_CHECK, ast_strdupa, ast_sip_endpoint::context, ast_sip_session::endpoint, ast_sip_session::exten, ast_sip_session::inv_session, LOG_ERROR, NULL, ast_features_pickup_config::pickupexten, ast_sip_session::request_uri, SIP_GET_DEST_EXTEN_FOUND, SIP_GET_DEST_EXTEN_NOT_FOUND, SIP_GET_DEST_EXTEN_PARTIAL, and SIP_GET_DEST_UNSUPPORTED_URI.
Referenced by new_invite().
|
static |
Definition at line 612 of file res_pjsip_session.c.
References ast_copy_pj_str(), ast_sip_session_media::bundle_group, strsep(), and value.
Referenced by set_mid_and_bundle_group().
|
static |
Definition at line 4469 of file res_pjsip_session.c.
References handle_incoming_request(), and handle_incoming_response().
Referenced by handle_incoming_before_media(), session_inv_on_redirected(), and session_inv_on_tsx_state_changed().
|
static |
Definition at line 4583 of file res_pjsip_session.c.
References ast_debug, AST_SIP_SESSION_BEFORE_MEDIA, ast_sip_session_get_name(), ast_sip_session_send_request(), handle_incoming(), and NULL.
Referenced by session_inv_on_state_changed().
|
static |
Definition at line 4398 of file res_pjsip_session.c.
References AST_LIST_TRAVERSE, ast_sip_session_get_name(), does_method_match(), ast_sip_session_supplement::incoming_request, ast_sip_session_supplement::method, SCOPE_ENTER, SCOPE_EXIT, and ast_sip_session::supplements.
Referenced by handle_incoming(), and new_invite().
|
static |
Definition at line 4449 of file res_pjsip_session.c.
References AST_LIST_TRAVERSE, ast_sip_session_get_name(), does_method_match(), ast_sip_session_supplement::incoming_response, ast_sip_session_supplement::method, ast_sip_session_supplement::response_priority, SCOPE_ENTER, SCOPE_EXIT, and ast_sip_session::supplements.
Referenced by handle_incoming().
|
static |
Definition at line 764 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, ao2_cleanup, ao2_find, ast_asprintf, ast_codec_media_type2str(), ast_copy_pj_str(), ast_free, AST_LIST_TRAVERSE, AST_MEDIA_TYPE_END, ast_media_type_from_str(), ast_sip_session_get_name(), ast_sip_session_is_pending_stream_default(), ast_sip_session_media_state_add(), ast_str_tmp, ast_stream_alloc(), ast_stream_free(), ast_stream_get_metadata(), ast_stream_get_name(), ast_stream_get_state(), ast_stream_set_metadata(), ast_stream_set_state(), AST_STREAM_STATE_INACTIVE, AST_STREAM_STATE_RECVONLY, AST_STREAM_STATE_REMOVED, AST_STREAM_STATE_SENDONLY, AST_STREAM_STATE_SENDRECV, ast_stream_to_str(), ast_stream_topology_alloc(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_stream_topology_set_stream(), ast_strlen_zero, ast_trace, end, ast_sip_session::endpoint, handler(), ast_sip_session_media::handler, ast_sip_session_sdp_handler::id, ast_sip_session::inv_session, is_stream_limitation_reached(), LOG_ERROR, ast_sip_session_sdp_handler::negotiate_incoming_sdp_stream, NULL, OBJ_KEY, ast_sip_session::pending_media_state, RAII_VAR, remove_stream_from_bundle(), SCOPE_ENTER, SCOPE_EXIT, SCOPE_EXIT_EXPR, SCOPE_EXIT_LOG_EXPR, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, session_media_set_handler(), set_mid_and_bundle_group(), set_remote_mslabel_and_stream_group(), ast_sip_session_media_state::topology, and type.
Referenced by new_invite(), and session_inv_on_rx_offer().
|
static |
Definition at line 1063 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, ast_channel_internal_fd_clear(), ast_channel_internal_fd_set(), ast_channel_lock, ast_channel_set_stream_topology(), ast_channel_stream_topology_changed_externally(), ast_channel_unlock, AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED, AST_EXTENDED_FDS, AST_FRAME_CONTROL, ast_log, AST_MEDIA_TYPE_IMAGE, ast_null_frame, ast_queue_frame(), ast_sip_session_get_name(), ast_sip_session_media_state_clone(), ast_sip_session_media_state_free(), ast_sip_session_media_state_reset(), ast_sip_session_media_stats_save(), ast_stream_get_state(), ast_stream_set_state(), AST_STREAM_STATE_REMOVED, ast_stream_topology_clone(), ast_stream_topology_equal(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), AST_VECTOR_GET, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, ast_sip_session_media::changed, ast_sip_session::channel, ast_sip_session_media_state::default_session, ast_sip_session_media_read_callback_state::fd, handle_negotiated_sdp_session_media(), ast_sip_session_media::handler, ast_sip_session::inv_session, LOG_WARNING, NULL, ast_sip_session::pending_media_state, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, session_media_set_handler(), SWAP, and ast_sip_session_media_state::topology.
Referenced by session_inv_on_media_update().
|
static |
Definition at line 964 of file res_pjsip_session.c.
References ao2_cleanup, ao2_find, ast_sip_session_sdp_handler::apply_negotiated_sdp_stream, ast_codec_media_type2str(), ast_copy_pj_str(), ast_debug, AST_LIST_TRAVERSE, ast_sip_session_get_name(), ast_sip_session_is_pending_stream_default(), ast_stream_set_state(), AST_STREAM_STATE_INACTIVE, AST_STREAM_STATE_RECVONLY, AST_STREAM_STATE_SENDONLY, AST_STREAM_STATE_SENDRECV, handler(), ast_sip_session_media::handler, ast_sip_session_sdp_handler::id, ast_sip_session_sdp_handler::next, NULL, OBJ_KEY, RAII_VAR, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, session_media_set_handler(), set_mid_and_bundle_group(), set_remote_mslabel_and_stream_group(), ast_sip_session_sdp_handler::stream_stop, and ast_sip_session_media::type.
Referenced by handle_negotiated_sdp().
|
static |
Definition at line 4050 of file res_pjsip_session.c.
References ao2_cleanup, ao2_ref, ast_alloca, ast_assert, ast_pjsip_rdata_get_endpoint(), ast_sip_session_alloc(), ast_sip_session_get_name(), AST_SIP_SESSION_INCOMING_CALL, ast_taskprocessor_is_task(), ast_sip_session::call_direction, ast_sip_session::endpoint, ast_sip_session::inv_session, new_invite(), new_invite_initial_answer(), NULL, pre_session_setup(), RAII_VAR, new_invite::rdata, SCOPE_ENTER, SCOPE_EXIT, SCOPE_EXIT_RTN, ast_sip_session::serializer, session, new_invite::session, and TRACE_ATLEAST.
Referenced by session_on_rx_request().
|
static |
Definition at line 4481 of file res_pjsip_session.c.
References AST_LIST_TRAVERSE, ast_sip_message_apply_transport(), ast_sip_session_get_name(), does_method_match(), ast_sip_session::endpoint, ast_sip_session_supplement::method, ast_sip_session_supplement::outgoing_request, SCOPE_ENTER, SCOPE_EXIT, ast_sip_session::supplements, and ast_sip_endpoint::transport.
Referenced by ast_sip_session_send_request_with_cb().
|
static |
Definition at line 4498 of file res_pjsip_session.c.
References AST_LIST_TRAVERSE, ast_sip_message_apply_transport(), ast_sip_session_get_name(), does_method_match(), ast_sip_session::endpoint, LOG_ERROR, ast_sip_session_supplement::method, NULL, ast_sip_session_supplement::outgoing_response, SCOPE_ENTER, SCOPE_EXIT, SCOPE_EXIT_LOG_RTN, ast_sip_session::supplements, and ast_sip_endpoint::transport.
Referenced by ast_sip_session_send_response().
|
static |
Definition at line 4415 of file res_pjsip_session.c.
References AST_LIST_TRAVERSE, ast_sip_session_supplement::next, ast_sip_session_supplement::session_begin, and ast_sip_session::supplements.
Referenced by ast_sip_session_alloc().
|
static |
Definition at line 4426 of file res_pjsip_session.c.
References AST_LIST_TRAVERSE, ast_sip_session_supplement::next, ast_sip_session_supplement::session_destroy, and ast_sip_session::supplements.
Referenced by session_destructor().
|
static |
Definition at line 4437 of file res_pjsip_session.c.
References AST_LIST_TRAVERSE, ast_sip_session_supplement::next, ast_sip_session_supplement::session_end, and ast_sip_session::supplements.
Referenced by session_end().
|
static |
Definition at line 4142 of file res_pjsip_session.c.
References AST_LIST_TRAVERSE, does_method_match(), ast_sip_session_supplement::method, method, and ast_sip_session::supplements.
Referenced by session_on_rx_request().
|
static |
Definition at line 214 of file res_pjsip_session.c.
References ast_calloc, ast_free, AST_VECTOR_FREE, AST_VECTOR_INIT, and NULL.
Referenced by ast_sip_session_media_state_alloc(), and ast_sip_session_media_state_clone().
|
static |
Definition at line 1538 of file res_pjsip_session.c.
References ao2_ref, ast_sip_session_get_name(), ast_sip_session::inv_session, invite_terminated(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and session.
Referenced by resend_reinvite().
|
static |
Definition at line 1440 of file res_pjsip_session.c.
References ao2_ref, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_sip_session_get_name(), ast_trace, delayed_method2str(), DELAYED_METHOD_BYE, DELAYED_METHOD_INVITE, DELAYED_METHOD_UPDATE, delayed_request_free(), ast_sip_session::delayed_requests, ast_sip_session_delayed_request::method, ast_sip_session_delayed_request::next, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, send_delayed_request(), and session.
Referenced by session_inv_on_tsx_state_changed(), and update_completed().
|
static |
Definition at line 1487 of file res_pjsip_session.c.
References ao2_ref, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_sip_session_get_name(), ast_trace, delayed_method2str(), DELAYED_METHOD_BYE, DELAYED_METHOD_INVITE, DELAYED_METHOD_UPDATE, delayed_request_free(), ast_sip_session::delayed_requests, ast_sip_session_delayed_request::method, ast_sip_session_delayed_request::next, ast_sip_session::rescheduled_reinvite, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, send_delayed_request(), and session.
Referenced by invite_collision_timeout(), session_inv_on_tsx_state_changed(), and update_completed().
|
static |
Definition at line 1751 of file res_pjsip_session.c.
References ast_codec_media_type2str(), ast_str_tmp, ast_stream_get_name(), ast_stream_get_type(), ast_stream_to_str(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_stream_topology_to_str(), ast_strings_equal(), ast_strlen_zero, AST_VECTOR_GET, AST_VECTOR_SIZE, end, GET_STREAM_NAME_SAFE, ast_sip_session_media::label, NULL, SCOPE_ENTER, SCOPE_EXIT, SCOPE_EXIT_EXPR, SCOPE_EXIT_RTN_VALUE, session_count, ast_sip_session_media::stream_num, STREAM_REMOVED, ast_sip_session_media_state::topology, and ast_sip_session_media::type.
Referenced by resolve_refresh_media_states().
|
static |
Definition at line 592 of file res_pjsip_session.c.
References AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_IMAGE, AST_MEDIA_TYPE_TEXT, AST_MEDIA_TYPE_UNKNOWN, AST_MEDIA_TYPE_VIDEO, ast_sip_endpoint_media_configuration::max_audio_streams, ast_sip_endpoint_media_configuration::max_video_streams, ast_sip_endpoint::media, and type.
Referenced by handle_incoming_sdp(), and sip_session_refresh().
|
static |
Definition at line 6074 of file res_pjsip_session.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_module_shutdown_ref, ast_sip_get_pjsip_endpoint(), ast_sip_get_sorcery(), ast_sip_register_service(), ast_sorcery_alloc(), ast_sorcery_create(), AST_TEST_REGISTER, NULL, ast_sip_nat_hook::outgoing_external_message, SDP_HANDLER_BUCKETS, sdp_handler_list_cmp(), sdp_handler_list_hash(), ast_module_info::self, and session_outgoing_nat_hook().
Referenced by unload_module().
|
static |
Definition at line 204 of file res_pjsip_session.c.
References ast_rtp_instance_stats::local_ssrc.
Referenced by ast_sip_session_media_stats_save().
|
static |
Definition at line 3911 of file res_pjsip_session.c.
References ast_sip_session_get_name(), ast_sip_session_send_response(), AST_SOCKADDR_BUFLEN, ast_trace, ast_trace_log, check_content_disposition(), ast_sip_endpoint::context, create_local_sdp(), end, ast_sip_session::endpoint, ast_sip_session::exten, ast_sip_endpoint::extensions, get_destination(), handle_incoming_request(), handle_incoming_sdp(), ast_sip_session::inv_session, LOG_ERROR, LOG_NOTICE, ast_sip_timer_options::min_se, NULL, ast_sip_endpoint::preferred_codec_only, new_invite::rdata, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, ast_sip_timer_options::sess_expires, new_invite::session, SIP_GET_DEST_EXTEN_FOUND, SIP_GET_DEST_EXTEN_NOT_FOUND, SIP_GET_DEST_EXTEN_PARTIAL, SIP_GET_DEST_UNSUPPORTED_URI, timer, and ast_sip_endpoint_extensions::timer.
Referenced by handle_new_invite_request().
|
static |
Definition at line 3742 of file res_pjsip_session.c.
References NULL.
Referenced by handle_new_invite_request(), and pre_session_setup().
|
static |
Definition at line 3231 of file res_pjsip_session.c.
References ast_debug, ast_sip_create_request_with_auth(), ast_sip_session_get_name(), ast_sip_session_send_request(), ast_sip_session::authentication_challenge_count, ast_sip_session::endpoint, MAX_RX_CHALLENGES, ast_sip_endpoint::outbound_auths, and session.
|
static |
Definition at line 3789 of file res_pjsip_session.c.
References ast_sip_create_dialog_uas_locked(), ast_sip_get_pjsip_endpoint(), ast_sip_endpoint::extensions, ast_sip_endpoint_extensions::flags, new_invite_initial_answer(), NULL, and options.
Referenced by handle_new_invite_request().
|
static |
Definition at line 176 of file res_pjsip_session.c.
References ast_debug, AST_LIST_EMPTY, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, CMP_MATCH, CMP_STOP, handler(), ast_sip_session_sdp_handler::id, sdp_handler_list::list, ast_sip_session_sdp_handler::next, and sdp_handler_list::stream_type.
Referenced by ast_sip_session_unregister_sdp_handler().
|
static |
Definition at line 754 of file res_pjsip_session.c.
References ast_free, ast_stream_set_state(), AST_STREAM_STATE_REMOVED, ast_sip_session_media::bundle_group, ast_sip_session_media::bundled, ast_sip_session_media::mid, and NULL.
Referenced by handle_incoming_sdp().
|
static |
Definition at line 4269 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, ao2_ref, ast_random(), ast_sip_get_pjsip_endpoint(), ast_sip_session_get_name(), ast_sip_session_media_state_clone(), ast_sip_session_media_state_free(), ast_stream_topology_equal(), delay_request(), DELAYED_METHOD_INVITE, ast_sip_session::inv_session, LOG_ERROR, NULL, ast_sip_session::pending_media_state, ast_sip_session::rescheduled_reinvite, resend_reinvite(), SCOPE_ENTER, SCOPE_EXIT_LOG_RTN, SCOPE_EXIT_RTN, and ast_sip_session_media_state::topology.
Referenced by session_inv_on_tsx_state_changed().
|
static |
Definition at line 4248 of file res_pjsip_session.c.
References ao2_ref, ast_debug, AST_LIST_EMPTY, ast_sip_push_task(), ast_sip_session_get_name(), ast_sip_session::delayed_requests, invite_collision_timeout(), and ast_sip_session::serializer.
Referenced by reschedule_reinvite().
|
static |
Definition at line 1835 of file res_pjsip_session.c.
References ao2_cleanup, AST_MEDIA_TYPE_END, ast_sip_session_media_state_clone(), ast_sip_session_media_state_free(), ast_str_tmp, ast_stream_clone(), ast_stream_get_name(), ast_stream_get_state(), ast_stream_set_state(), ast_stream_state2str(), AST_STREAM_STATE_END, ast_stream_to_str(), ast_stream_topology_append_stream(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_stream_topology_set_stream(), ast_stream_topology_to_str(), ast_strings_equal(), ast_trace, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, GET_STREAM_NAME_SAFE, GET_STREAM_SAFE, GET_STREAM_STATE_SAFE, is_media_state_valid(), LOG_ERROR, LOG_WARNING, MAX, NULL, RAII_VAR, SCOPE_ENTER, SCOPE_EXIT, SCOPE_EXIT_EXPR, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, STATE_NONE, STATE_REMOVED, STREAM_REMOVED, ast_sip_session_media_state::topology, and ast_sip_session_media::type.
Referenced by sip_session_refresh().
|
static |
Definition at line 129 of file res_pjsip_session.c.
References CMP_MATCH, CMP_STOP, OBJ_KEY, and sdp_handler_list::stream_type.
Referenced by load_module().
|
static |
Definition at line 107 of file res_pjsip_session.c.
References ast_str_hash(), OBJ_KEY, and sdp_handler_list::stream_type.
Referenced by load_module().
|
static |
Determine whether the SDP provided requires deferral of negotiating or not.
1 | re-invite should be deferred and resumed later |
0 | re-invite should not be deferred |
Definition at line 2600 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, ao2_cleanup, ao2_find, ast_codec_media_type2str(), ast_copy_pj_str(), ast_debug, AST_LIST_TRAVERSE, ast_media_type_from_str(), ast_sip_session_get_name(), ast_sip_session_is_pending_stream_default(), ast_sip_session_media_state_add(), AST_SIP_SESSION_SDP_DEFER_ERROR, AST_SIP_SESSION_SDP_DEFER_NEEDED, AST_SIP_SESSION_SDP_DEFER_NOT_HANDLED, AST_SIP_SESSION_SDP_DEFER_NOT_NEEDED, ast_stream_alloc(), ast_stream_free(), ast_stream_get_metadata(), ast_stream_get_name(), ast_stream_set_metadata(), ast_stream_set_state(), AST_STREAM_STATE_INACTIVE, AST_STREAM_STATE_RECVONLY, AST_STREAM_STATE_SENDONLY, AST_STREAM_STATE_SENDRECV, ast_stream_topology_alloc(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_stream_topology_set_stream(), ast_strlen_zero, ast_sip_session_sdp_handler::defer_incoming_sdp_stream, handler(), ast_sip_session_media::handler, NULL, OBJ_KEY, ast_sip_session::pending_media_state, RAII_VAR, session_media_set_handler(), ast_sip_session_media_state::topology, and type.
Referenced by session_reinvite_on_rx_request().
|
static |
Definition at line 1394 of file res_pjsip_session.c.
References ast_sip_session_delayed_request::active_media_state, ast_sip_session_get_name(), AST_SIP_SESSION_REFRESH_METHOD_INVITE, AST_SIP_SESSION_REFRESH_METHOD_UPDATE, ast_sip_session_terminate(), delayed_method2str(), DELAYED_METHOD_BYE, DELAYED_METHOD_INVITE, DELAYED_METHOD_UPDATE, ast_sip_session_delayed_request::generate_new_sdp, LOG_WARNING, ast_sip_session_delayed_request::method, NULL, ast_sip_session_delayed_request::on_request_creation, ast_sip_session_delayed_request::on_response, ast_sip_session_delayed_request::on_sdp_creation, ast_sip_session_delayed_request::pending_media_state, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, and sip_session_refresh().
Referenced by invite_proceeding(), and invite_terminated().
|
static |
Definition at line 1229 of file res_pjsip_session.c.
References ast_free, ast_datastore::data, ast_datastore_info::destroy, ast_datastore::info, NULL, and ast_datastore::uid.
Referenced by ast_sip_session_alloc_datastore().
|
static |
Definition at line 2900 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, ao2_cleanup, ast_sip_session::aor, ast_debug, ast_dsp_free(), ast_free, AST_LIST_HEAD_DESTROY, AST_LIST_REMOVE_HEAD, ast_party_id_free(), ast_sip_session_get_name(), ast_sip_session_media_state_free(), ast_sip_session_remove_supplements(), ast_sorcery_object_get_id(), ast_strdupa, ast_taskprocessor_unreference(), ast_test_suite_event_notify, AST_VECTOR_FREE, AST_VECTOR_RESET, ast_sip_session::contact, ast_sip_session::datastores, delayed_request_free(), ast_sip_session::delayed_requests, ast_sip_session::direct_media_cap, ast_sip_session::dsp, ast_sip_session::endpoint, handle_session_destroy(), ast_sip_session::id, ast_sip_session::inv_session, ast_sip_session_delayed_request::next, ast_sip_session::pending_media_state, ast_sip_session::serializer, and ast_sip_session::supplements.
Referenced by ast_sip_session_alloc().
|
static |
Definition at line 4525 of file res_pjsip_session.c.
References handle_session_end(), and sip_session_defer_termination_stop_timer().
Referenced by ast_sip_session_create_outgoing(), ast_sip_session_end_if_deferred(), ast_sip_session_terminate(), and session_inv_on_state_changed().
|
static |
Definition at line 4548 of file res_pjsip_session.c.
References ao2_cleanup, ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), ast_sip_session::inv_session, and NULL.
Referenced by ast_sip_session_create_outgoing(), ast_sip_session_terminate(), and session_end_if_disconnected().
|
static |
Definition at line 4701 of file res_pjsip_session.c.
References ast_sip_push_task(), id, NULL, ast_sip_session::serializer, session, and session_end_completion().
Referenced by session_inv_on_tsx_state_changed().
|
static |
Definition at line 5259 of file res_pjsip_session.c.
References ast_queue_unhold(), ast_sip_session::channel, create_local_sdp(), ast_sip_session::inv_session, and NULL.
|
static |
Definition at line 5324 of file res_pjsip_session.c.
References ast_sip_media_rtp_configuration::accept_multiple_sdp_answers, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, ast_channel_hangupcause_set(), ast_channel_name(), ast_queue_hangup(), ast_set_hangupsource(), ast_shutdown_final(), ast_sip_session_get_name(), ast_sip_session_media_state_reset(), ast_trace, ast_sip_session::channel, ast_sip_session::endpoint, ast_sip_media_rtp_configuration::follow_early_media_fork, handle_negotiated_sdp(), ast_sip_endpoint::media, ast_sip_session::pending_media_state, ast_sip_endpoint_media_configuration::rtp, SCOPE_ENTER, and SCOPE_EXIT_RTN.
|
static |
Definition at line 4696 of file res_pjsip_session.c.
|
static |
Definition at line 5395 of file res_pjsip_session.c.
References ast_copy_pj_str(), AST_MAX_EXTENSION, ast_shutdown_final(), AST_SIP_REDIRECT_URI_CORE, AST_SIP_REDIRECT_URI_PJSIP, AST_SIP_REDIRECT_USER, AST_SIP_SESSION_BEFORE_REDIRECTING, AST_SIP_USER_OPTIONS_TRUNCATE_CHECK, ast_sorcery_object_get_id(), ast_sip_session::channel, ast_sip_session::endpoint, exten, handle_incoming(), ast_sip_endpoint::redirect_method, and session.
|
static |
Definition at line 5236 of file res_pjsip_session.c.
References answer(), ast_shutdown_final(), ast_sip_session_get_name(), ast_sip_session_media_state_reset(), create_local_sdp(), handle_incoming_sdp(), ast_sip_session::pending_media_state, SCOPE_ENTER, and SCOPE_EXIT_RTN.
|
static |
Definition at line 4615 of file res_pjsip_session.c.
References ast_debug, ast_shutdown_final(), ast_sip_push_task(), ast_sip_session_get_name(), check_request_status(), ast_sip_session::defer_end, ast_sip_session::ended_while_deferred, handle_incoming_before_media(), NULL, print_debug_details, SCOPE_ENTER, SCOPE_EXIT_RTN, ast_sip_session::serializer, session_end(), and type.
|
static |
Definition at line 4731 of file res_pjsip_session.c.
References AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, ast_channel_hangupcause(), ast_channel_name(), ast_debug, AST_LIST_EMPTY, ast_shutdown_final(), ast_sip_create_request_with_auth(), ast_sip_mod_data_get, AST_SIP_SESSION_AFTER_MEDIA, ast_sip_session_get_name(), ast_sip_session_send_request(), ast_sip_session_send_request_with_cb(), ast_sorcery_object_get_id(), ast_test_suite_event_notify, ast_sip_session::authentication_challenge_count, ast_sip_session::channel, check_delayed_requests(), ast_sip_session::delayed_requests, ast_sip_session::endpoint, handle_incoming(), id, ast_sip_session::inv_session, invite_proceeding(), invite_terminated(), MAX_RX_CHALLENGES, MOD_DATA_ON_RESPONSE, NULL, ast_sip_endpoint::outbound_auths, print_debug_details, reschedule_reinvite(), SCOPE_ENTER, SCOPE_EXIT_RTN, session_end_if_disconnected(), and update_completed().
|
static |
Definition at line 469 of file res_pjsip_session.c.
References ao2_callback, ast_free, ast_sdp_srtp_destroy(), ast_sip_session_media::mid, ast_sip_session_media::remote_label, ast_sip_session_media::remote_mslabel, ast_sip_session_media::srtp, stream_destroy(), and ast_sip_session_media::stream_name.
Referenced by ast_sip_session_media_state_add(), and test_media_add().
|
static |
Set an SDP stream handler for a corresponding session media.
This function will properly free resources on the SDP handler currently being used by the session media, then set the session media to use the new SDP handler.
Definition at line 445 of file res_pjsip_session.c.
References ast_assert, handler(), ast_sip_session_media::handler, and ast_sip_session_sdp_handler::stream_destroy.
Referenced by add_sdp_streams(), handle_incoming_sdp(), handle_negotiated_sdp(), handle_negotiated_sdp_session_media(), and sdp_requires_deferral().
|
static |
Called when a new SIP request comes into PJSIP.
This function is called under two circumstances 1) An out-of-dialog request is received by PJSIP 2) An in-dialog request that the inv_session layer does not handle is received (such as an in-dialog INFO)
Except for INVITEs, there is very little we actually do in this function 1) For requests we don't handle, we return PJ_FALSE 2) For new INVITEs, handle them now to prevent retransmissions from trying to setup the same call again. 3) For in-dialog requests we handle, we process them in the .on_state_changed = session_inv_on_state_changed or .on_tsx_state_changed = session_inv_on_tsx_state_changed callbacks instead.
Definition at line 4215 of file res_pjsip_session.c.
References ast_alloca, ast_log, ast_sip_session_get_name(), handle_new_invite_request(), has_supplement(), LOG_WARNING, NULL, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and TRACE_ATLEAST.
Referenced by ast_sip_session_send_response().
|
static |
Definition at line 4185 of file res_pjsip_session.c.
References ast_sip_session_get_name(), NULL, SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.
Referenced by ast_sip_session_send_response().
|
static |
Definition at line 4163 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, ast_sip_session_get_name(), ast_str_tmp, ast_stream_topology_to_str(), ast_trace, NULL, ast_sip_session::pending_media_state, SCOPE_ENTER, SCOPE_EXIT_RTN, and ast_sip_session_media_state::topology.
Referenced by ast_sip_session_send_response().
|
static |
Hook for modifying outgoing messages with SDP to contain the proper address information.
Definition at line 5457 of file res_pjsip_session.c.
References ao2_cleanup, ao2_find, ast_copy_pj_str(), ast_debug, AST_LIST_TRAVERSE, ast_sip_dialog_get_session(), ast_sip_get_transport_state(), ast_sip_is_content_type(), ast_sip_mod_data_get, ast_sip_mod_data_set, ast_sip_session_get_name(), ast_sip_transport_is_local, ast_sockaddr_parse(), ast_sockaddr_stringify_host(), ast_sorcery_object_get_id(), ast_strlen_zero, ast_sip_session_sdp_handler::change_outgoing_sdp_stream_media_address, ast_sip_transport::external_media_address, handler(), host, MOD_DATA_NAT_HOOK, ast_sip_session_sdp_handler::next, NULL, OBJ_KEY, PARSE_PORT_FORBID, and RAII_VAR.
Referenced by load_module().
|
static |
Definition at line 2733 of file res_pjsip_session.c.
References ao2_cleanup, ast_sip_dialog_get_session(), ast_sip_get_pjsip_endpoint(), ast_sip_session_media_state_reset(), ast_sip_session::channel, ast_sip_session::deferred_reinvite, ast_sip_session::inv_session, NULL, ast_sip_session::pending_media_state, RAII_VAR, and sdp_requires_deferral().
|
static |
Definition at line 3545 of file res_pjsip_session.c.
References ao2_cleanup, ast_sip_push_task(), ast_sip_session::serializer, and session_termination_task().
Referenced by ast_sip_session_defer_termination().
|
static |
Definition at line 3530 of file res_pjsip_session.c.
References ao2_ref, ast_sip_session_terminate(), ast_sip_session::defer_terminate, and ast_sip_session::inv_session.
Referenced by session_termination_cb().
|
static |
Definition at line 1637 of file res_pjsip_session.c.
References ast_channel_connected_effective_id(), ast_channel_lock, ast_channel_unlock, ast_debug, ast_party_id_copy(), ast_party_id_free(), ast_party_id_init(), ast_party_id_presentation(), AST_PRES_ALLOWED, AST_PRES_RESTRICTION, ast_sip_add_usereqphone(), ast_sip_get_use_callerid_contact(), ast_sip_modify_id_header(), ast_sip_session_get_name(), ast_strlen_zero, ast_sip_session::channel, ast_sip_endpoint::contact_user, ast_sip_session::endpoint, ast_sip_endpoint::fromdomain, ast_sip_endpoint::fromuser, ast_sip_endpoint::id, ast_sip_session::inv_session, NULL, ast_party_id::number, pbx_builtin_getvar_helper(), S_COR, ast_sip_session::saved_from_hdr, ast_party_number::str, ast_sip_endpoint_id_configuration::trust_outbound, and ast_party_number::valid.
Referenced by ast_sip_session_create_invite().
|
static |
Definition at line 646 of file res_pjsip_session.c.
References ast_calloc, ast_copy_pj_str(), ast_free, ast_sip_endpoint_media_configuration::bundle, ast_sip_session_media::bundle_group, ast_sip_session_media::bundled, ast_sip_session::endpoint, get_mid_bundle_group(), ast_sip_endpoint::media, ast_sip_session_media::mid, and NULL.
Referenced by handle_incoming_sdp(), and handle_negotiated_sdp_session_media().
|
static |
Definition at line 684 of file res_pjsip_session.c.
References ast_copy_pj_str(), ast_free, ast_strdup, ast_stream_set_group(), ast_strlen_zero, AST_VECTOR_GET, AST_VECTOR_SIZE, NULL, ast_sip_session::pending_media_state, ast_sip_session_media::remote_label, ast_sip_session_media::remote_mslabel, strsep(), and tmp().
Referenced by handle_incoming_sdp(), and handle_negotiated_sdp_session_media().
|
static |
Definition at line 3306 of file res_pjsip_session.c.
Referenced by ast_sip_session_create_outgoing().
|
static |
Destructor for SIP channel.
Definition at line 2966 of file res_pjsip_session.c.
References ao2_cleanup, ast_sip_channel_pvt::pvt, and ast_sip_channel_pvt::session.
Referenced by ast_sip_channel_pvt_alloc().
|
static |
Definition at line 3588 of file res_pjsip_session.c.
References ao2_ref, ast_sip_get_pjsip_endpoint(), and ast_sip_session::scheduled_termination.
Referenced by ast_sip_session_defer_termination_cancel(), and session_end().
|
static |
Definition at line 2184 of file res_pjsip_session.c.
References ast_sip_session::active_media_state, ao2_bump, ao2_cleanup, ao2_ref, ast_format_cap_alloc, ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_compatible(), AST_LIST_EMPTY, AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_END, AST_MEDIA_TYPE_IMAGE, AST_MEDIA_TYPE_VIDEO, ast_sip_session_get_name(), ast_sip_session_media_state_clone(), ast_sip_session_media_state_free(), ast_sip_session_media_state_reset(), AST_SIP_SESSION_REFRESH_METHOD_INVITE, ast_sip_session_send_request_with_cb(), ast_str_tmp, ast_stream_clone(), ast_stream_free(), ast_stream_get_formats(), ast_stream_get_metadata(), ast_stream_get_name(), ast_stream_get_state(), ast_stream_get_type(), ast_stream_set_formats(), ast_stream_set_state(), AST_STREAM_STATE_REMOVED, ast_stream_topology_append_stream(), ast_stream_topology_del_stream(), ast_stream_topology_equal(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_stream_topology_to_str(), ast_trace, AST_VECTOR_GET, AST_VECTOR_REMOVE, AST_VECTOR_SIZE, ast_sip_endpoint_media_configuration::codecs, ast_sip_session_media_state::default_session, delay_request(), DELAYED_METHOD_INVITE, DELAYED_METHOD_UPDATE, ast_sip_session::delayed_requests, end, ast_sip_session::endpoint, generate_session_refresh_sdp(), ast_sip_session::inv_session, is_stream_limitation_reached(), LOG_ERROR, LOG_WARNING, ast_sip_endpoint::media, NULL, ast_sip_session::pending_media_state, ast_stream::position, resolve_refresh_media_states(), SCOPE_ENTER, SCOPE_EXIT, SCOPE_EXIT_EXPR, SCOPE_EXIT_LOG_EXPR, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, and ast_sip_session_media_state::topology.
Referenced by ast_sip_session_refresh(), and send_delayed_request().
|
static |
Definition at line 3134 of file res_pjsip_session.c.
References ao2_lock, ao2_object_get_lockaddr(), ao2_ref, ao2_unlock, ast_cond_signal, ast_cond_wait, ast_sip_session_suspender::complete, ast_sip_session_suspender::cond_complete, ast_sip_session_suspender::cond_suspended, and ast_sip_session_suspender::suspended.
Referenced by ast_sip_session_suspend().
|
static |
Definition at line 3118 of file res_pjsip_session.c.
References ast_cond_destroy, ast_sip_session_suspender::cond_complete, and ast_sip_session_suspender::cond_suspended.
Referenced by ast_sip_session_suspend().
|
static |
Definition at line 456 of file res_pjsip_session.c.
References AST_LIST_TRAVERSE, handler(), sdp_handler_list::list, ast_sip_session_sdp_handler::next, and ast_sip_session_sdp_handler::stream_destroy.
Referenced by session_media_dtor().
|
static |
Definition at line 5580 of file res_pjsip_session.c.
Referenced by test_is_media_state_equal().
|
static |
Definition at line 5596 of file res_pjsip_session.c.
References ast_assert, AST_MEDIA_TYPE_END, ast_stream_topology_equal(), AST_VECTOR_GET, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, ast_sip_session_media_state::default_session, ast_sip_session_media::label, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, ast_sip_session_media::stream_num, test_is_media_session_equal(), and ast_sip_session_media_state::topology.
|
static |
Definition at line 5536 of file res_pjsip_session.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_ref, ast_stream_get_state(), AST_STREAM_STATE_REMOVED, ast_stream_topology_append_stream(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_stream_topology_set_stream(), AST_VECTOR_REPLACE, ast_sip_session_media::bundle_group, ast_sip_session_media_state::default_session, ast_sip_session_media::keepalive_sched_id, ast_sip_session_media::label, NULL, ast_stream::position, session_media_dtor(), ast_sip_session_media::stream_num, test_stream_alloc(), ast_sip_session_media::timeout_sched_id, ast_sip_session_media_state::topology, ast_sip_session_media::type, and type.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 5523 of file res_pjsip_session.c.
References ast_stream_alloc(), ast_stream_set_state(), and NULL.
Referenced by test_media_add().
|
static |
Definition at line 6108 of file res_pjsip_session.c.
References ao2_cleanup, AST_MODFLAG_GLOBAL_SYMBOLS, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_APP_DEPEND, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_sip_get_sorcery(), ast_sip_unregister_service(), ast_sorcery_delete(), AST_TEST_UNREGISTER, ASTERISK_GPL_KEY, and load_module().
|
static |
Definition at line 1568 of file res_pjsip_session.c.
References ast_sip_session::inv_session, invite_proceeding(), invite_terminated(), and session.
Referenced by session_inv_on_tsx_state_changed().
|
static |
Definition at line 6128 of file res_pjsip_session.c.
|
static |
Definition at line 6128 of file res_pjsip_session.c.
|
static |
Definition at line 5446 of file res_pjsip_session.c.
|
static |
NAT hook for modifying outgoing messages with SDP.
Definition at line 84 of file res_pjsip_session.c.
|
static |
Definition at line 3290 of file res_pjsip_session.c.
|
static |
Registered SDP stream handlers.
This container is keyed on stream types. Each object in the container is a linked list of handlers for the stream type.
Definition at line 93 of file res_pjsip_session.c.
|
static |
Definition at line 2587 of file res_pjsip_session.c.
|
static |
Definition at line 2812 of file res_pjsip_session.c.