Asterisk - The Open Source Telephony Project GIT-master-0644429
|
PSJIP SIP Channel Driver. More...
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_ua.h>
#include <pjlib.h>
#include "asterisk/lock.h"
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/acl.h"
#include "asterisk/callerid.h"
#include "asterisk/file.h"
#include "asterisk/cli.h"
#include "asterisk/app.h"
#include "asterisk/musiconhold.h"
#include "asterisk/causes.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/dsp.h"
#include "asterisk/stasis_endpoints.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/indications.h"
#include "asterisk/format_cache.h"
#include "asterisk/translate.h"
#include "asterisk/threadstorage.h"
#include "asterisk/features_config.h"
#include "asterisk/pickup.h"
#include "asterisk/test.h"
#include "asterisk/message.h"
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
#include "asterisk/stream.h"
#include "pjsip/include/chan_pjsip.h"
#include "pjsip/include/dialplan_functions.h"
#include "pjsip/include/cli_functions.h"
Go to the source code of this file.
Data Structures | |
struct | answer_data |
struct | hangup_data |
struct | indicate_data |
struct | info_dtmf_data |
struct | request_data |
struct | rtp_direct_media_data |
struct | sendtext_data |
struct | topology_change_refresh_data |
struct | transfer_data |
Macros | |
#define | UNIQUEID_BUFSIZE 256 |
Functions | |
static void | __init_uniqueid_threadbuf (void) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | answer (void *data) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | call (void *data) |
static int | call_pickup_incoming_request (struct ast_sip_session *session, pjsip_rx_data *rdata) |
static int | chan_pjsip_add_hold (const char *chan_uid) |
Add a channel ID to the list of PJSIP channels on hold. More... | |
static int | chan_pjsip_answer (struct ast_channel *ast) |
Function called by core when we should answer a PJSIP session. More... | |
static int | chan_pjsip_call (struct ast_channel *ast, const char *dest, int timeout) |
Function called by core to actually start calling a remote party. More... | |
static struct ast_frame * | chan_pjsip_cng_tone_detected (struct ast_channel *ast, struct ast_sip_session *session, struct ast_frame *f) |
Internal helper function called when CNG tone is detected. More... | |
static int | chan_pjsip_devicestate (const char *data) |
Function called to get the device state of an endpoint. More... | |
static int | chan_pjsip_digit_begin (struct ast_channel *chan, char digit) |
Function called by core to start a DTMF digit. More... | |
static int | chan_pjsip_digit_end (struct ast_channel *ast, char digit, unsigned int duration) |
Function called by core to stop a DTMF digit. More... | |
static int | chan_pjsip_fixup (struct ast_channel *oldchan, struct ast_channel *newchan) |
Function called by core to change the underlying owner channel. More... | |
static void | chan_pjsip_get_codec (struct ast_channel *chan, struct ast_format_cap *result) |
Function called by RTP engine to get peer capabilities. More... | |
static int | chan_pjsip_get_hold (const char *chan_uid) |
Determine whether a channel ID is in the list of PJSIP channels on hold. More... | |
static enum ast_rtp_glue_result | chan_pjsip_get_rtp_peer (struct ast_channel *chan, struct ast_rtp_instance **instance) |
Function called by RTP engine to get local audio RTP peer. More... | |
static const char * | chan_pjsip_get_uniqueid (struct ast_channel *ast) |
static enum ast_rtp_glue_result | chan_pjsip_get_vrtp_peer (struct ast_channel *chan, struct ast_rtp_instance **instance) |
Function called by RTP engine to get local video RTP peer. More... | |
static int | chan_pjsip_hangup (struct ast_channel *ast) |
Function called by core to hang up a PJSIP session. More... | |
static int | chan_pjsip_incoming_ack (struct ast_sip_session *session, struct pjsip_rx_data *rdata) |
static int | chan_pjsip_incoming_prack (struct ast_sip_session *session, struct pjsip_rx_data *rdata) |
static int | chan_pjsip_incoming_request (struct ast_sip_session *session, struct pjsip_rx_data *rdata) |
Function called when a request is received on the session. More... | |
static void | chan_pjsip_incoming_response (struct ast_sip_session *session, struct pjsip_rx_data *rdata) |
Function called when a response is received on the session. More... | |
static void | chan_pjsip_incoming_response_update_cause (struct ast_sip_session *session, struct pjsip_rx_data *rdata) |
Function called when a response is received on the session. More... | |
static int | chan_pjsip_indicate (struct ast_channel *ast, int condition, const void *data, size_t datalen) |
Function called by core to ask the channel to indicate some sort of condition. More... | |
static struct ast_channel * | chan_pjsip_new (struct ast_sip_session *session, int state, const char *exten, const char *title, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *cid_name) |
Function called to create a new PJSIP Asterisk channel. More... | |
static void | chan_pjsip_pvt_dtor (void *obj) |
static int | chan_pjsip_queryoption (struct ast_channel *ast, int option, void *data, int *datalen) |
Function called to query options on a channel. More... | |
static struct ast_frame * | chan_pjsip_read_stream (struct ast_channel *ast) |
Function called by core to read any waiting frames. More... | |
static void | chan_pjsip_remove_hold (const char *chan_uid) |
Remove a channel ID from the list of PJSIP channels on hold. More... | |
static struct ast_channel * | chan_pjsip_request (const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause) |
Asterisk core interaction functions. More... | |
static struct ast_channel * | chan_pjsip_request_with_stream_topology (const char *type, struct ast_stream_topology *topology, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause) |
Function called by core to create a new outgoing PJSIP session. More... | |
static int | chan_pjsip_sendtext (struct ast_channel *ast, const char *text) |
static int | chan_pjsip_sendtext_data (struct ast_channel *ast, struct ast_msg_data *msg) |
Function called by core to send text on PJSIP session. More... | |
static void | chan_pjsip_session_begin (struct ast_sip_session *session) |
SIP session interaction functions. More... | |
static void | chan_pjsip_session_end (struct ast_sip_session *session) |
Function called when the session ends. More... | |
static int | chan_pjsip_set_rtp_peer (struct ast_channel *chan, struct ast_rtp_instance *rtp, struct ast_rtp_instance *vrtp, struct ast_rtp_instance *tpeer, const struct ast_format_cap *cap, int nat_active) |
Function called by RTP engine to change where the remote party should send media. More... | |
static int | chan_pjsip_transfer (struct ast_channel *chan, const char *target) |
Function called by core for Asterisk initiated transfer. More... | |
static int | chan_pjsip_write (struct ast_channel *ast, struct ast_frame *f) |
static int | chan_pjsip_write_stream (struct ast_channel *ast, int stream_num, struct ast_frame *f) |
static int | check_for_rtp_changes (struct ast_channel *chan, struct ast_rtp_instance *rtp, struct ast_sip_session_media *media, struct ast_sip_session *session) |
static void | clear_session_and_channel (struct ast_sip_session *session, struct ast_channel *ast) |
Clear a channel from a session along with its PVT. More... | |
static int | compatible_formats_exist (struct ast_stream_topology *top, struct ast_format_cap *cap) |
Determine if a topology is compatible with format capabilities. More... | |
static int | direct_media_mitigate_glare (struct ast_sip_session *session) |
static int | handle_topology_request_change (struct ast_sip_session *session, const struct ast_stream_topology *proposed) |
static int | hangup (void *data) |
static int | hangup_cause2sip (int cause) |
Internal function which translates from Asterisk cause codes to SIP response codes. More... | |
static struct hangup_data * | hangup_data_alloc (int cause, struct ast_channel *chan) |
static void | hangup_data_destroy (void *obj) |
static int | indicate (void *data) |
static struct indicate_data * | indicate_data_alloc (struct ast_sip_session *session, int condition, int response_code, const void *frame_data, size_t datalen) |
static void | indicate_data_destroy (void *obj) |
static struct info_dtmf_data * | info_dtmf_data_alloc (struct ast_sip_session *session, char digit, unsigned int duration) |
static void | info_dtmf_data_destroy (void *obj) |
static int | is_colp_update_allowed (struct ast_sip_session *session) |
static int | is_compatible_format (struct ast_sip_session *session, struct ast_frame *f) |
Determine if the given frame is in a format we've negotiated. More... | |
static int | load_module (void) |
Load the module. More... | |
static int | on_topology_change_response (struct ast_sip_session *session, pjsip_rx_data *rdata) |
static int | pbx_start_incoming_request (struct ast_sip_session *session, pjsip_rx_data *rdata) |
static int | remote_send_hold (void *data) |
Update local hold state to be held. More... | |
static int | remote_send_hold_refresh (struct ast_sip_session *session, unsigned int held) |
Update local hold state and send a re-INVITE with the new SDP. More... | |
static int | remote_send_unhold (void *data) |
Update local hold state to be unheld. More... | |
static int | request (void *obj) |
static struct rtp_direct_media_data * | rtp_direct_media_data_create (struct ast_channel *chan, struct ast_rtp_instance *rtp, struct ast_rtp_instance *vrtp, const struct ast_format_cap *cap, struct ast_sip_session *session) |
static void | rtp_direct_media_data_destroy (void *data) |
static int | rtp_find_rtcp_fd_position (struct ast_sip_session *session, struct ast_rtp_instance *rtp) |
Helper function to find the position for RTCP. More... | |
static int | send_direct_media_request (void *data) |
static int | send_topology_change_refresh (void *data) |
static int | sendtext (void *obj) |
static struct sendtext_data * | sendtext_data_create (struct ast_channel *chan, struct ast_msg_data *msg) |
static void | sendtext_data_destroy (void *obj) |
static void | set_channel_on_rtp_instance (const struct ast_sip_session *session, const char *channel_id) |
static void | set_sipdomain_variable (struct ast_sip_session *session) |
static struct topology_change_refresh_data * | topology_change_refresh_data_alloc (struct ast_sip_session *session, const struct ast_stream_topology *topology) |
static void | topology_change_refresh_data_free (struct topology_change_refresh_data *refresh_data) |
static int | transfer (void *data) |
static struct transfer_data * | transfer_data_alloc (struct ast_sip_session *session, const char *target) |
static void | transfer_data_destroy (void *obj) |
static void | transfer_redirect (struct ast_sip_session *session, const char *target) |
static void | transfer_refer (struct ast_sip_session *session, const char *target) |
static int | transmit_info_dtmf (void *data) |
static int | transmit_info_with_vidupdate (void *data) |
Send SIP INFO with video update request. More... | |
static void | transport_info_destroy (void *obj) |
Destructor function for transport_info_data. More... | |
static int | uid_hold_hash_fn (const void *obj, const int flags) |
static int | uid_hold_sort_fn (const void *obj_left, const void *obj_right, const int flags) |
static int | unload_module (void) |
Unload the PJSIP channel from Asterisk. More... | |
static int | update_connected_line_information (void *data) |
Update connected line information. More... | |
static int | update_devstate (void *obj, void *arg, int flags) |
static void | update_initial_connected_line (struct ast_sip_session *session) |
static void | xfer_client_on_evsub_state (pjsip_evsub *sub, pjsip_event *event) |
Callback function to report status of implicit REFER-NOTIFY subscription. More... | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Channel Driver" , .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 = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DRIVER, .requires = "res_pjsip,res_pjsip_session,res_pjsip_pubsub", } |
static char * | app_pjsip_hangup = "PJSIPHangup" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_sip_session_supplement | call_pickup_supplement |
static unsigned int | chan_idx |
static struct ast_sip_session_supplement | chan_pjsip_ack_supplement |
static struct ast_custom_function | chan_pjsip_dial_contacts_function |
static struct ast_custom_function | chan_pjsip_parse_uri_from_function |
static struct ast_custom_function | chan_pjsip_parse_uri_function |
static struct ast_sip_session_supplement | chan_pjsip_prack_supplement |
static struct ast_rtp_glue | chan_pjsip_rtp_glue |
Local glue for interacting with the RTP engine core. More... | |
static struct ast_sip_session_supplement | chan_pjsip_supplement |
SIP session supplement structure. More... | |
static struct ast_sip_session_supplement | chan_pjsip_supplement_response |
SIP session supplement structure just for responses. More... | |
struct ast_channel_tech | chan_pjsip_tech |
PBX interface structure for channel registration. More... | |
static const char | channel_type [] = "PJSIP" |
static struct ast_datastore_info | direct_media_mitigation_info = { } |
static struct ast_custom_function | dtmf_mode_function |
static struct ast_custom_function | media_offer_function |
static struct ast_custom_function | moh_passthrough_function |
static struct ast_sip_session_supplement | pbx_start_supplement |
static struct ao2_container * | pjsip_uids_onhold |
static pjsip_module | refer_callback_module |
REFER Callback module, used to attach session data structure to subscription. More... | |
static struct ast_custom_function | session_refresh_function |
static struct ast_datastore_info | transport_info |
Datastore used to store local/remote addresses for the INVITE request that created the PJSIP channel. More... | |
static struct ast_threadstorage | uniqueid_threadbuf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_uniqueid_threadbuf , .custom_init = NULL , } |
PSJIP SIP Channel Driver.
Definition in file chan_pjsip.c.
#define UNIQUEID_BUFSIZE 256 |
Definition at line 76 of file chan_pjsip.c.
|
static |
Definition at line 75 of file chan_pjsip.c.
|
static |
Definition at line 3446 of file chan_pjsip.c.
|
static |
Definition at line 3446 of file chan_pjsip.c.
|
static |
Definition at line 687 of file chan_pjsip.c.
References ast_channel_name(), ast_log, ast_sip_session_get_name(), ast_sip_session_send_response(), answer_data::indent, LOG_ERROR, LOG_WARNING, NULL, SCOPE_ENTER_TASK, SCOPE_EXIT_RTN_VALUE, answer_data::session, session, and status.
Referenced by add_bundle_groups(), add_sdp_streams(), ast_dns_resolver_set_result(), ast_raw_answer_with_stream_topology(), ast_search_dns(), ast_stun_request(), ast_unreal_answer(), chan_pjsip_answer(), dns_parse_answer(), dns_parse_answer_ex(), dump_answer(), ebl_callback(), enum_callback(), parse_naptr(), parse_srv(), pbx_builtin_incomplete(), session_inv_on_rx_offer(), srv_callback(), stun_monitor_request(), tds_log(), txt_callback(), verify_mock_cdr_record(), and zapateller_exec().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 3446 of file chan_pjsip.c.
|
static |
Definition at line 2395 of file chan_pjsip.c.
References ao2_ref, ast_channel_name(), ast_channel_uniqueid(), ast_queue_hangup(), ast_set_hangupsource(), ast_sip_session_create_invite(), ast_sip_session_get_name(), ast_sip_session_send_request(), ast_str_tmp, ast_stream_topology_to_str(), ast_sip_session::channel, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, session, set_channel_on_rtp_instance(), and update_initial_connected_line().
Referenced by ast_call(), can_ring_entry(), chan_pjsip_call(), close_rtp_connection(), close_udptl_connection(), configure_local_rtp(), find_call(), native_start(), onAlerting(), onCallCleared(), onCallEstablished(), onModeChanged(), onNewCallCreated(), onOutgoingCall(), onProgress(), ooh323_onReceivedDigit(), ooh323_onReceivedSetup(), ooh323_set_read_format(), ooh323_set_write_format(), ooh323c_set_capability_for_call(), ooh323c_start_call_thread(), ooh323c_start_receive_channel(), ooh323c_start_transmit_channel(), ooh323c_start_transmit_datachannel(), ooh323c_stop_call_thread(), ooh323c_stop_transmit_channel(), ooh323c_stop_transmit_datachannel(), setup_rtp_connection(), setup_rtp_remote(), setup_udptl_connection(), and update_our_aliases().
|
static |
Definition at line 3030 of file chan_pjsip.c.
References ao2_ref, AST_CAUSE_CALL_REJECTED, AST_CAUSE_NORMAL_CLEARING, ast_channel_hangupcause_set(), ast_channel_ref, ast_channel_unref, ast_get_chan_features_pickup_config(), ast_hangup(), ast_log, ast_pickup_call(), LOG_ERROR, ast_features_pickup_config::pickupexten, and session.
|
static |
Add a channel ID to the list of PJSIP channels on hold.
chan_uid | - Unique ID of the channel being put into the hold list |
0 | Channel has been added to or was already in the hold list |
-1 | Failed to add channel to the hold list |
Definition at line 1122 of file chan_pjsip.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_find, ao2_link, ast_copy_string(), NULL, OBJ_SEARCH_KEY, pjsip_uids_onhold, and RAII_VAR.
Referenced by chan_pjsip_indicate().
|
static |
Function called by core when we should answer a PJSIP session.
Definition at line 731 of file chan_pjsip.c.
References answer(), ao2_bump, ao2_ref, ast_channel_lock, ast_channel_name(), ast_channel_tech_pvt(), ast_channel_unlock, ast_log, ast_setstate(), ast_sip_push_task_wait_serializer(), AST_STATE_UP, ast_trace_get_indent, answer_data::indent, LOG_ERROR, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, answer_data::session, ast_sip_channel_pvt::session, and session.
|
static |
Function called by core to actually start calling a remote party.
Definition at line 2422 of file chan_pjsip.c.
References ao2_cleanup, ao2_ref, ast_channel_tech_pvt(), ast_log, ast_sip_push_task(), ast_sip_session_get_name(), ast_str_tmp, ast_stream_topology_to_str(), call(), LOG_WARNING, ast_sip_session::pending_media_state, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, ast_sip_session::serializer, ast_sip_channel_pvt::session, and ast_sip_session_media_state::topology.
|
static |
Internal helper function called when CNG tone is detected.
Definition at line 770 of file chan_pjsip.c.
References ast_async_goto(), ast_channel_caller(), ast_channel_context(), ast_channel_exten(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_dsp_free(), ast_dsp_get_features(), ast_dsp_set_features(), ast_exists_extension(), ast_frfree, ast_log, ast_null_frame, ast_verb, exists(), LOG_ERROR, LOG_NOTICE, NULL, pbx_builtin_setvar_helper(), S_COR, and session.
Referenced by chan_pjsip_read_stream().
|
static |
Function called to get the device state of an endpoint.
Definition at line 1179 of file chan_pjsip.c.
References ao2_cleanup, ao2_ref, ast_channel_snapshot_get_latest(), AST_DEVICE_BUSY, AST_DEVICE_INVALID, AST_DEVICE_NOT_INUSE, AST_DEVICE_ONHOLD, AST_DEVICE_UNAVAILABLE, AST_DEVICE_UNKNOWN, ast_devstate_aggregate_add(), ast_devstate_aggregate_init(), ast_devstate_aggregate_result(), ast_endpoint_get_resource(), ast_endpoint_get_tech(), ast_endpoint_latest_snapshot(), AST_ENDPOINT_OFFLINE, AST_ENDPOINT_ONLINE, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_id(), AST_STATE_BUSY, ast_state_chan2dev(), AST_STATE_RING, AST_STATE_UP, ast_channel_snapshot::base, chan_pjsip_get_hold(), ast_devstate_aggregate::inuse, NULL, RAII_VAR, ast_channel_snapshot::state, state, and ast_channel_snapshot_base::uniqueid.
|
static |
Function called by core to start a DTMF digit.
Definition at line 2187 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ast_channel_tech_pvt(), AST_MEDIA_TYPE_AUDIO, AST_RTP_DTMF_MODE_INBAND, AST_RTP_DTMF_MODE_NONE, ast_rtp_instance_dtmf_begin(), ast_rtp_instance_dtmf_mode_get(), AST_SIP_DTMF_AUTO, AST_SIP_DTMF_AUTO_INFO, AST_SIP_DTMF_INBAND, AST_SIP_DTMF_NONE, AST_SIP_DTMF_RFC_4733, ast_sip_session_media_state::default_session, digit, ast_sip_session::dtmf, ast_sip_session_media::rtp, and ast_sip_channel_pvt::session.
|
static |
Function called by core to stop a DTMF digit.
Definition at line 2299 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ao2_cleanup, ast_channel_name(), ast_channel_tech_pvt(), ast_debug, ast_log, AST_MEDIA_TYPE_AUDIO, AST_RTP_DTMF_MODE_INBAND, AST_RTP_DTMF_MODE_NONE, ast_rtp_instance_dtmf_end_with_duration(), ast_rtp_instance_dtmf_mode_get(), AST_SIP_DTMF_AUTO, AST_SIP_DTMF_AUTO_INFO, AST_SIP_DTMF_INBAND, AST_SIP_DTMF_INFO, AST_SIP_DTMF_NONE, AST_SIP_DTMF_RFC_4733, ast_sip_push_task(), ast_sip_session_media_state::default_session, digit, ast_sip_session::dtmf, info_dtmf_data::duration, info_dtmf_data_alloc(), LOG_WARNING, ast_sip_session_media::rtp, ast_sip_session::serializer, ast_sip_channel_pvt::session, and transmit_info_dtmf().
|
static |
Function called by core to change the underlying owner channel.
Definition at line 1050 of file chan_pjsip.c.
References ast_channel_tech_pvt(), ast_channel_uniqueid(), ast_sip_session::channel, ast_sip_channel_pvt::session, and set_channel_on_rtp_instance().
|
static |
Function called by RTP engine to get peer capabilities.
Definition at line 252 of file chan_pjsip.c.
References ast_channel_name(), ast_channel_nativeformats(), ast_format_cap_append_from_cap(), ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, AST_MEDIA_TYPE_UNKNOWN, ast_str_tmp, result, SCOPE_ENTER, and SCOPE_EXIT_RTN.
|
static |
Determine whether a channel ID is in the list of PJSIP channels on hold.
chan_uid | - Channel being checked |
0 | The channel is not in the hold list |
1 | The channel is in the hold list |
Definition at line 1166 of file chan_pjsip.c.
References ao2_cleanup, ao2_find, NULL, OBJ_SEARCH_KEY, pjsip_uids_onhold, and RAII_VAR.
Referenced by chan_pjsip_devicestate().
|
static |
Function called by RTP engine to get local audio RTP peer.
Definition at line 179 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ao2_ref, ast_assert, ast_channel_tech_pvt(), AST_MEDIA_TYPE_AUDIO, AST_RTP_GLUE_RESULT_FORBID, AST_RTP_GLUE_RESULT_LOCAL, AST_RTP_GLUE_RESULT_REMOTE, AST_SIP_MEDIA_ENCRYPT_NONE, ast_sip_session_get_datastore(), ast_sip_session_media_state::default_session, ast_sip_endpoint_media_configuration::direct_media, ast_sip_direct_media_configuration::enabled, ast_sip_media_rtp_configuration::encryption, ast_sip_session::endpoint, ast_sip_endpoint::media, NULL, ast_sip_endpoint_media_configuration::rtp, ast_sip_session_media::rtp, and ast_sip_channel_pvt::session.
|
static |
Definition at line 1283 of file chan_pjsip.c.
References ast_channel_tech_pvt(), ast_copy_pj_str(), ast_threadstorage_get(), ast_sip_session::inv_session, ast_sip_channel_pvt::session, UNIQUEID_BUFSIZE, and uniqueid_threadbuf.
|
static |
Function called by RTP engine to get local video RTP peer.
Definition at line 223 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ao2_ref, ast_assert, ast_channel_tech_pvt(), AST_MEDIA_TYPE_VIDEO, AST_RTP_GLUE_RESULT_FORBID, AST_RTP_GLUE_RESULT_LOCAL, AST_SIP_MEDIA_ENCRYPT_NONE, ast_sip_session_media_state::default_session, ast_sip_media_rtp_configuration::encryption, ast_sip_session::endpoint, ast_sip_endpoint::media, NULL, ast_sip_endpoint_media_configuration::rtp, ast_sip_session_media::rtp, and ast_sip_channel_pvt::session.
|
static |
Function called by core to hang up a PJSIP session.
Definition at line 2562 of file chan_pjsip.c.
References ao2_cleanup, ast_channel_hangupcause(), ast_channel_name(), ast_channel_tech_pvt(), ast_log, ast_sip_push_task(), hangup_data::cause, ast_sip_session::channel, clear_session_and_channel(), hangup(), hangup_cause2sip(), hangup_data_alloc(), LOG_WARNING, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, ast_sip_session::serializer, and ast_sip_channel_pvt::session.
|
static |
Definition at line 3208 of file chan_pjsip.c.
References AST_CONTROL_SRCCHANGE, ast_queue_control(), ast_sip_session_get_name(), ast_trace, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and session.
|
static |
Definition at line 3221 of file chan_pjsip.c.
References ast_sip_session_get_name(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and session.
|
static |
Function called when a request is received on the session.
Definition at line 2972 of file chan_pjsip.c.
References ao2_cleanup, ast_calloc, ast_sip_session_add_datastore(), ast_sip_session_alloc_datastore(), ast_sip_session_get_name(), ast_sip_session_send_response(), ast_sip_session_terminate(), AST_STATE_RING, chan_pjsip_new(), transport_info_data::local_addr, LOG_ERROR, NULL, RAII_VAR, transport_info_data::remote_addr, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, session, set_sipdomain_variable(), and transport_info.
|
static |
Function called when a response is received on the session.
Definition at line 3151 of file chan_pjsip.c.
References ast_channel_lock, ast_channel_unlock, AST_CONTROL_ANSWER, AST_CONTROL_PROGRESS, AST_CONTROL_RINGING, ast_queue_control(), ast_setstate(), ast_sip_session_get_name(), AST_STATE_RINGING, AST_STATE_UP, ast_trace, SCOPE_ENTER, SCOPE_EXIT_RTN, session, and status.
|
static |
Function called when a response is received on the session.
Definition at line 3121 of file chan_pjsip.c.
References ast_alloca, ast_control_pvt_cause_code::ast_cause, ast_channel_hangupcause_hash_set(), AST_CHANNEL_NAME, ast_channel_name(), AST_CONTROL_PVT_CAUSE_CODE, ast_copy_string(), ast_queue_control_data(), ast_sip_hangup_sip2cause(), ast_sip_session_get_name(), ast_control_pvt_cause_code::chan_name, ast_control_pvt_cause_code::code, SCOPE_ENTER, SCOPE_EXIT_RTN, session, and status.
|
static |
Function called by core to ask the channel to indicate some sort of condition.
Definition at line 1625 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ao2_bump, ao2_cleanup, ao2_ref, ast_assert, ast_channel_get_device_name(), ast_channel_lock, ast_channel_name(), ast_channel_nativeformats(), ast_channel_tech_pvt(), ast_channel_uniqueid(), ast_channel_unlock, AST_CONTROL_BUSY, AST_CONTROL_CONGESTION, AST_CONTROL_CONNECTED_LINE, AST_CONTROL_FLASH, AST_CONTROL_HOLD, AST_CONTROL_INCOMPLETE, AST_CONTROL_MASQUERADE_NOTIFY, AST_CONTROL_PROCEEDING, AST_CONTROL_PROGRESS, AST_CONTROL_PVT_CAUSE_CODE, AST_CONTROL_REDIRECTING, AST_CONTROL_RINGING, AST_CONTROL_SRCCHANGE, AST_CONTROL_SRCUPDATE, AST_CONTROL_STREAM_TOPOLOGY_CHANGED, AST_CONTROL_STREAM_TOPOLOGY_REQUEST_CHANGE, AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED, AST_CONTROL_T38_PARAMETERS, AST_CONTROL_UNHOLD, AST_CONTROL_UPDATE_RTP_PEER, AST_CONTROL_VIDUPDATE, AST_DEVICE_ONHOLD, AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_devstate_changed_literal(), ast_format_cap_iscompatible_format(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_h264, ast_format_h265, ast_format_vp8, ast_format_vp9, AST_FRAME_CONTROL, ast_frame_subclass2str(), ast_log, AST_MEDIA_TYPE_VIDEO, ast_moh_start(), ast_moh_stop(), ast_rtp_instance_write(), ast_sip_get_allow_sending_180_after_183(), ast_sip_push_task(), ast_sip_session_suspend(), ast_sip_session_unsuspend(), ast_sorcery_object_get_id(), AST_STATE_RING, AST_STATE_UP, ast_str_tmp, ast_stream_topology_to_str(), AST_T38_REQUEST_PARMS, ast_test_suite_event_notify, ast_trace, AST_VECTOR_GET, AST_VECTOR_SIZE, chan_pjsip_add_hold(), chan_pjsip_remove_hold(), indicate_data::condition, ast_frame::data, indicate_data::datalen, ast_frame::datalen, digit, info_dtmf_data::duration, ast_sip_session::endpoint, ast_frame::frametype, handle_topology_request_change(), ast_sip_endpoint::inband_progress, indicate(), indicate_data_alloc(), info_dtmf_data_alloc(), ast_frame_subclass::integer, ast_sip_session::inv_session, LOG_ERROR, LOG_WARNING, ast_sip_endpoint::media, ast_sip_session::moh_passthrough, NULL, remote_send_hold(), remote_send_unhold(), ast_control_t38_parameters::request_response, indicate_data::response_code, ast_sip_session_media::rtp, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, ast_sip_session::serializer, ast_sip_channel_pvt::session, ast_sip_session_media_state::sessions, ast_frame::subclass, T38_PEER_REINVITE, ast_sip_session::t38state, transmit_info_dtmf(), transmit_info_with_vidupdate(), ast_sip_session_media::type, update_connected_line_information(), and ast_sip_endpoint_media_configuration::webrtc.
|
static |
Function called to create a new PJSIP Asterisk channel.
Definition at line 547 of file chan_pjsip.c.
References ast_party_caller::ani2, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_ref, AST_ADSI_UNAVAILABLE, ast_atomic_fetchadd_int(), ast_channel_adsicpe_set(), ast_channel_alloc_with_initializers, ast_channel_caller(), ast_channel_callgroup_set(), ast_channel_dialed(), AST_CHANNEL_INITIALIZERS_VERSION, ast_channel_named_callgroups_set(), ast_channel_named_pickupgroups_set(), ast_channel_nativeformats_set(), ast_channel_pickupgroup_set(), ast_channel_priority_set(), ast_channel_rings_set(), ast_channel_set_rawreadformat(), ast_channel_set_rawwriteformat(), ast_channel_set_readformat(), ast_channel_set_stream_topology(), ast_channel_set_writeformat(), ast_channel_stage_snapshot(), ast_channel_stage_snapshot_done(), ast_channel_tech_pvt_set(), ast_channel_tech_set(), ast_channel_uniqueid(), ast_channel_unlock, ast_channel_zone_set(), ast_format_cap_alloc, ast_format_cap_append_from_cap(), ast_format_cap_empty(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_best_by_type(), ast_format_cap_get_format(), ast_get_encoded_str(), ast_get_indication_zone(), ast_hangup(), ast_log, AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_UNKNOWN, ast_party_id_copy(), ast_sip_channel_pvt_alloc(), ast_sip_session_get_name(), ast_sorcery_object_get_id(), AST_STATE_RING, ast_strdup, ast_stream_topology_clone(), ast_stream_topology_free(), ast_stream_topology_get_count(), ast_stream_topology_get_formats(), ast_strlen_zero(), buf, chan_idx, chan_pjsip_pvt_dtor(), chan_pjsip_tech, compatible_formats_exist(), LOG_ERROR, NULL, ast_party_dialed::number, pbx_builtin_setvar_helper(), RAII_VAR, S_COR, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, session, set_channel_on_rtp_instance(), ast_party_dialed::str, var, and ast_channel_initializers::version.
Referenced by chan_pjsip_incoming_request(), and chan_pjsip_request_with_stream_topology().
|
static |
|
static |
Function called to query options on a channel.
Definition at line 1242 of file chan_pjsip.c.
References ast_channel_tech_pvt(), AST_OPTION_T38_STATE, ast_sip_t38_configuration::enabled, ast_sip_session::endpoint, ast_sip_endpoint::media, ast_sip_channel_pvt::session, state, ast_sip_endpoint_media_configuration::t38, T38_ENABLED, T38_LOCAL_REINVITE, T38_PEER_REINVITE, T38_REJECTED, T38_STATE_NEGOTIATED, T38_STATE_NEGOTIATING, T38_STATE_REJECTED, T38_STATE_UNAVAILABLE, T38_STATE_UNKNOWN, and ast_sip_session::t38state.
|
static |
Function called by core to read any waiting frames.
Definition at line 843 of file chan_pjsip.c.
References ao2_ref, ast_channel_fdno(), ast_channel_get_up_time(), ast_channel_is_bridged(), ast_channel_name(), ast_channel_nativeformats(), ast_channel_nativeformats_set(), ast_channel_rawwriteformat(), ast_channel_readformat(), ast_channel_set_unbridged_nolock(), ast_channel_tech_pvt(), ast_channel_writeformat(), ast_debug, ast_dsp_free(), ast_dsp_get_features(), ast_dsp_process(), ast_dsp_set_features(), AST_EXTENDED_FDS, ast_format_cap_alloc, ast_format_cap_append, ast_format_cap_append_from_cap(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_iscompatible_format(), ast_format_cap_remove_by_type(), ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), AST_FRAME_DTMF, AST_FRAME_VOICE, ast_frfree, AST_LIST_NEXT, AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_UNKNOWN, ast_null_frame, ast_set_read_format_path(), ast_set_write_format_path(), AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, chan_pjsip_cng_tone_detected(), ast_sip_session::channel, DSP_FEATURE_FAX_DETECT, ast_frame_subclass::format, ast_frame::frametype, ast_frame_subclass::integer, is_compatible_format(), NULL, ast_sip_session_media_read_callback_state::read_callback, ast_sip_session_media_read_callback_state::session, ast_sip_channel_pvt::session, session, ast_frame::subclass, and ast_sip_session_media::type.
|
static |
Remove a channel ID from the list of PJSIP channels on hold.
chan_uid | - Unique ID of the channel being taken out of the hold list |
Definition at line 1153 of file chan_pjsip.c.
References ao2_find, OBJ_NODATA, OBJ_SEARCH_KEY, OBJ_UNLINK, and pjsip_uids_onhold.
Referenced by chan_pjsip_indicate(), and chan_pjsip_session_end().
|
static |
Asterisk core interaction functions.
Definition at line 2740 of file chan_pjsip.c.
References ast_stream_topology_create_from_format_cap(), ast_stream_topology_free(), chan_pjsip_request_with_stream_topology(), ast_channel::data, NULL, and type.
|
static |
Function called by core to create a new outgoing PJSIP session.
Definition at line 2713 of file chan_pjsip.c.
References ao2_cleanup, AST_CAUSE_FAILURE, ast_channel_name(), ast_sip_push_task_wait_servant(), AST_STATE_DOWN, ast_str_tmp, ast_stream_topology_to_str(), request_data::cause, chan_pjsip_new(), request_data::dest, NULL, RAII_VAR, request(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, request_data::session, session, and request_data::topology.
Referenced by chan_pjsip_request().
|
static |
Definition at line 2883 of file chan_pjsip.c.
References ARRAY_LEN, ast_free, ast_msg_data_alloc(), AST_MSG_DATA_ATTR_BODY, AST_MSG_DATA_SOURCE_TYPE_UNKNOWN, chan_pjsip_sendtext_data(), text, and ast_msg_data_attribute::type.
|
static |
Function called by core to send text on PJSIP session.
Definition at line 2861 of file chan_pjsip.c.
References ao2_ref, ast_channel_name(), ast_channel_tech_pvt(), ast_debug, AST_MSG_DATA_ATTR_BODY, AST_MSG_DATA_ATTR_FROM, AST_MSG_DATA_ATTR_TO, ast_msg_data_get_attribute(), ast_sip_push_task(), sendtext_data::msg, sendtext(), sendtext_data_create(), ast_sip_session::serializer, and ast_sip_channel_pvt::session.
Referenced by chan_pjsip_sendtext().
|
static |
SIP session interaction functions.
Definition at line 2905 of file chan_pjsip.c.
References ao2_cleanup, AST_SIP_DIRECT_MEDIA_GLARE_MITIGATION_NONE, ast_sip_session_add_datastore(), ast_sip_session_alloc_datastore(), ast_sip_session_get_name(), direct_media_mitigation_info, NULL, RAII_VAR, SCOPE_ENTER, SCOPE_EXIT_RTN, and session.
|
static |
Function called when the session ends.
Definition at line 2927 of file chan_pjsip.c.
References ast_channel_hangupcause(), ast_channel_name(), ast_channel_uniqueid(), AST_MEDIA_TYPE_AUDIO, ast_queue_hangup(), ast_queue_hangup_with_cause(), ast_rtp_instance_set_stats_vars(), ast_set_hangupsource(), ast_sip_hangup_sip2cause(), ast_sip_session_get_name(), chan_pjsip_remove_hold(), ast_sip_session_media::rtp, SCOPE_ENTER, SCOPE_EXIT_RTN, and session.
|
static |
Function called by RTP engine to change where the remote party should send media.
Definition at line 448 of file chan_pjsip.c.
References ao2_ref, ast_channel_is_bridged(), ast_channel_name(), ast_channel_tech_pvt(), ast_debug, ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, ast_log, ast_sip_push_task(), ast_str_tmp, rtp_direct_media_data::cap, cdata(), rtp_direct_media_data::chan, ast_sip_session::channel, LOG_ERROR, rtp_direct_media_data::rtp, rtp_direct_media_data_create(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, send_direct_media_request(), session, and rtp_direct_media_data::vrtp.
|
static |
Function called by core for Asterisk initiated transfer.
Definition at line 2168 of file chan_pjsip.c.
References ao2_cleanup, ast_channel_tech_pvt(), ast_log, ast_sip_push_task(), LOG_WARNING, ast_sip_session::serializer, ast_sip_channel_pvt::session, transfer_data::target, transfer(), and transfer_data_alloc().
|
static |
Definition at line 1044 of file chan_pjsip.c.
References chan_pjsip_write_stream().
|
static |
Definition at line 954 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ast_channel_name(), ast_channel_nativeformats(), ast_channel_rawreadformat(), ast_channel_rawwriteformat(), ast_channel_readformat(), ast_channel_readtrans(), ast_channel_tech_pvt(), ast_channel_writeformat(), ast_channel_writetrans(), ast_codec_media_type2str(), ast_debug, ast_format_cap_get_names(), ast_format_cap_iscompatible_format(), AST_FORMAT_CAP_NAMES_LEN, AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), AST_FRAME_CNG, AST_FRAME_MODEM, AST_FRAME_RTCP, AST_FRAME_VIDEO, AST_FRAME_VOICE, ast_log, AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_IMAGE, AST_MEDIA_TYPE_VIDEO, AST_RTP_RTCP_PSFB, ast_str_alloca, ast_translate_path_to_str(), AST_VECTOR_GET, AST_VECTOR_SIZE, ast_sip_session::channel, ast_sip_session_media_state::default_session, ast_frame_subclass::format, ast_frame::frametype, ast_frame_subclass::integer, LOG_WARNING, NULL, ast_sip_channel_pvt::session, session, ast_sip_session_media_state::sessions, ast_sip_session_media::stream_num, ast_frame::subclass, ast_sip_session_media::type, and ast_sip_session_media::write_callback.
Referenced by chan_pjsip_write().
|
static |
Definition at line 327 of file chan_pjsip.c.
References ast_channel_set_fd(), AST_EXTENDED_FDS, ast_rtp_instance_fd(), ast_rtp_instance_get_and_cmp_remote_address, ast_rtp_instance_set_prop(), AST_RTP_PROPERTY_RTCP, ast_sockaddr_isnull(), ast_sockaddr_setnull(), ast_sip_session_media::direct_media_addr, ast_sip_session_media::rtp, rtp_find_rtcp_fd_position(), and session.
Referenced by send_direct_media_request().
|
static |
Clear a channel from a session along with its PVT.
Definition at line 2513 of file chan_pjsip.c.
References ast_channel_tech_pvt_set(), NULL, session, and set_channel_on_rtp_instance().
Referenced by chan_pjsip_hangup(), and hangup().
|
static |
Determine if a topology is compatible with format capabilities.
This will return true if ANY formats in the topology are compatible with the format capabilities.
XXX When supporting true multistream, we will need to be sure to mark which streams from top1 are compatible with which streams from top2. Then the ones that are not compatible will need to be marked as "removed" so that they are negotiated as expected.
top | Topology |
cap | Format capabilities |
1 | The topology has at least one compatible format |
0 | The topology has no compatible formats or an error occurred. |
Definition at line 526 of file chan_pjsip.c.
References ao2_ref, ast_format_cap_get_names(), ast_format_cap_iscompatible(), AST_FORMAT_CAP_NAMES_LEN, ast_str_tmp, ast_stream_topology_get_formats(), ast_stream_topology_to_str(), SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.
Referenced by chan_pjsip_new().
|
static |
Definition at line 276 of file chan_pjsip.c.
References ao2_cleanup, AST_SIP_DIRECT_MEDIA_GLARE_MITIGATION_INCOMING, AST_SIP_DIRECT_MEDIA_GLARE_MITIGATION_NONE, AST_SIP_DIRECT_MEDIA_GLARE_MITIGATION_OUTGOING, ast_sip_session_get_datastore(), ast_sip_session_remove_datastore(), NULL, RAII_VAR, and session.
Referenced by send_direct_media_request().
|
static |
Definition at line 1601 of file chan_pjsip.c.
References ast_sip_push_task(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, send_topology_change_refresh(), session, topology_change_refresh_data_alloc(), and topology_change_refresh_data_free().
Referenced by chan_pjsip_indicate().
|
static |
Definition at line 2520 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ao2_bump, ao2_cleanup, ast_channel_name(), ast_channel_tech_pvt(), AST_MEDIA_TYPE_AUDIO, ast_rtp_instance_set_stats_vars(), ast_sip_session_terminate(), hangup_data::cause, hangup_data::chan, ast_sip_session::channel, clear_session_and_channel(), ast_sip_session_media_state::default_session, ast_sip_session_media::rtp, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, ast_sip_channel_pvt::session, and session.
Referenced by ast_hangup(), chan_pjsip_hangup(), destroy_conference_bridge(), hangup_data_destroy(), hangup_data_init(), hangup_playback(), manage_calls(), play_on_channel(), playback_final_update(), and sla_stop_ringing_station().
|
static |
Internal function which translates from Asterisk cause codes to SIP response codes.
Definition at line 2439 of file chan_pjsip.c.
References AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, AST_CAUSE_CALL_REJECTED, AST_CAUSE_CHAN_NOT_IMPLEMENTED, AST_CAUSE_CONGESTION, AST_CAUSE_DESTINATION_OUT_OF_ORDER, AST_CAUSE_FACILITY_REJECTED, AST_CAUSE_FAILURE, AST_CAUSE_INTERWORKING, AST_CAUSE_INVALID_NUMBER_FORMAT, AST_CAUSE_NO_ANSWER, AST_CAUSE_NO_ROUTE_DESTINATION, AST_CAUSE_NO_ROUTE_TRANSIT_NET, AST_CAUSE_NO_USER_RESPONSE, AST_CAUSE_NORMAL_UNSPECIFIED, AST_CAUSE_NOTDEFINED, AST_CAUSE_NUMBER_CHANGED, AST_CAUSE_SWITCH_CONGESTION, AST_CAUSE_UNALLOCATED, AST_CAUSE_UNREGISTERED, AST_CAUSE_USER_BUSY, and ast_debug.
Referenced by chan_pjsip_hangup().
|
static |
Definition at line 2498 of file chan_pjsip.c.
References ao2_alloc, ast_channel_ref, hangup_data::cause, hangup_data::chan, hangup_data_destroy(), and NULL.
Referenced by chan_pjsip_hangup().
|
static |
Definition at line 2491 of file chan_pjsip.c.
References ast_channel_unref, and hangup_data::chan.
Referenced by hangup_data_alloc().
|
static |
Definition at line 1338 of file chan_pjsip.c.
References ao2_ref, ast_sip_session_send_response(), NULL, indicate_data::response_code, indicate_data::session, and session.
Referenced by ast_channel_request_stream_topology_change(), ast_channel_stream_topology_changed(), chan_pjsip_indicate(), and indicate_data_internal().
|
static |
Definition at line 1313 of file chan_pjsip.c.
References ao2_alloc, ao2_ref, ast_malloc, indicate_data::condition, indicate_data::datalen, indicate_data::frame_data, indicate_data_destroy(), NULL, indicate_data::response_code, indicate_data::session, and session.
Referenced by chan_pjsip_indicate().
|
static |
Definition at line 1305 of file chan_pjsip.c.
References ao2_ref, ast_free, indicate_data::frame_data, and indicate_data::session.
Referenced by indicate_data_alloc().
|
static |
Definition at line 2242 of file chan_pjsip.c.
References ao2_alloc, ao2_ref, digit, info_dtmf_data::digit, info_dtmf_data::duration, info_dtmf_data_destroy(), NULL, info_dtmf_data::session, and session.
Referenced by chan_pjsip_digit_end(), and chan_pjsip_indicate().
|
static |
Definition at line 2236 of file chan_pjsip.c.
References ao2_ref, and info_dtmf_data::session.
Referenced by info_dtmf_data_alloc().
|
static |
Definition at line 1407 of file chan_pjsip.c.
References ast_channel_connected_effective_id(), ast_channel_lock, ast_channel_unlock, ast_party_id_presentation(), AST_PRES_ALLOWED, AST_PRES_RESTRICTION, ast_party_id::number, session, and ast_party_number::valid.
Referenced by update_connected_line_information().
|
static |
Determine if the given frame is in a format we've negotiated.
Definition at line 829 of file chan_pjsip.c.
References ast_format_cap_iscompatible_format(), AST_FORMAT_CMP_NOT_EQUAL, ast_stream_get_formats(), ast_stream_topology_get_stream(), ast_frame_subclass::format, session, ast_frame::stream_num, and ast_frame::subclass.
Referenced by chan_pjsip_read_stream().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 3290 of file chan_pjsip.c.
References AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_callback, ao2_cleanup, ao2_container_alloc_hash, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT, ao2_ref, app_pjsip_hangup, ast_channel_register(), ast_channel_unregister(), ast_custom_function_register, ast_custom_function_unregister(), ast_format_cap_alloc, ast_format_cap_append_by_type(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_log, ast_manager_register_xml, ast_manager_unregister(), AST_MEDIA_TYPE_AUDIO, AST_MODULE_LOAD_DECLINE, ast_register_application_xml, ast_rtp_glue_register, ast_rtp_glue_unregister(), ast_sip_get_endpoints(), ast_sip_register_service(), ast_sip_session_register_supplement, ast_sip_session_unregister_supplement(), ast_sip_unregister_service(), ast_unregister_application(), call_pickup_supplement, ast_channel_tech::capabilities, chan_pjsip_ack_supplement, chan_pjsip_dial_contacts_function, chan_pjsip_parse_uri_from_function, chan_pjsip_parse_uri_function, chan_pjsip_prack_supplement, chan_pjsip_rtp_glue, chan_pjsip_supplement, chan_pjsip_supplement_response, chan_pjsip_tech, channel_type, dtmf_mode_function, end, endpoints, EVENT_FLAG_CALL, EVENT_FLAG_SYSTEM, LOG_ERROR, LOG_WARNING, media_offer_function, moh_passthrough_function, NULL, OBJ_NODATA, pbx_start_supplement, pjsip_action_hangup(), pjsip_app_hangup(), pjsip_channel_cli_register(), pjsip_uids_onhold, refer_callback_module, session_refresh_function, uid_hold_hash_fn(), uid_hold_sort_fn(), and update_devstate().
|
static |
Definition at line 1549 of file chan_pjsip.c.
References AST_CONTROL_STREAM_TOPOLOGY_CHANGED, ast_queue_control(), ast_sip_session_get_name(), ast_sip_session_media_state_reset(), ast_str_tmp, ast_stream_topology_to_str(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and session.
Referenced by send_topology_change_refresh().
|
static |
Definition at line 3080 of file chan_pjsip.c.
References AST_CAUSE_SWITCH_CONGESTION, ast_channel_hangupcause_set(), ast_channel_name(), ast_debug, ast_hangup(), ast_log, AST_PBX_CALL_LIMIT, AST_PBX_FAILED, ast_pbx_start(), AST_PBX_SUCCESS, ast_sip_session_get_name(), LOG_WARNING, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and session.
|
static |
Update local hold state to be held.
Definition at line 1500 of file chan_pjsip.c.
References remote_send_hold_refresh().
Referenced by chan_pjsip_indicate().
|
static |
Update local hold state and send a re-INVITE with the new SDP.
Definition at line 1487 of file chan_pjsip.c.
References ao2_ref, AST_MEDIA_TYPE_AUDIO, ast_sip_session_refresh(), AST_SIP_SESSION_REFRESH_METHOD_INVITE, ast_sip_session_media::locally_held, NULL, and session.
Referenced by remote_send_hold(), and remote_send_unhold().
|
static |
Update local hold state to be unheld.
Definition at line 1506 of file chan_pjsip.c.
References remote_send_hold_refresh().
Referenced by chan_pjsip_indicate().
|
static |
Definition at line 2605 of file chan_pjsip.c.
References ao2_ref, args, AST_APP_ARG, AST_CAUSE_CHANNEL_UNACCEPTABLE, AST_CAUSE_NO_ROUTE_DESTINATION, AST_DECLARE_APP_ARGS, ast_log, AST_NONSTANDARD_APP_ARGS, ast_sip_get_disable_multi_domain(), ast_sip_get_sorcery(), ast_sip_session_create_outgoing(), ast_sorcery_retrieve_by_id(), ast_strdupa, ast_strlen_zero(), request_data::cause, request_data::dest, LOG_ERROR, NULL, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, request_data::session, session, tmp(), and request_data::topology.
Referenced by ast_bridge_channel_merge_inhibit(), ast_bridge_merge_inhibit(), ast_http_body_discard(), ast_http_body_read_status(), ast_http_get_contents(), ast_http_request_close_on_completion(), ast_http_send(), ast_parse_digest(), AST_TEST_DEFINE(), bridge_manager_destroy(), bridge_manager_service_req(), bridge_manager_thread(), bridge_merge_inhibit_nolock(), chan_pjsip_request_with_stream_topology(), ewscal_write_event(), get_ewscal_ids_for(), http_request_tracking_init(), http_request_tracking_setup(), httpd_process_request(), parse_ewscal_id(), run_agi(), send_ews_request_and_parse(), setup_env(), xmpp_pubsub_build_node_request(), xmpp_pubsub_build_publish_skeleton(), xmpp_pubsub_delete_node(), xmpp_pubsub_handle_error(), xmpp_pubsub_iq_create(), xmpp_pubsub_publish_device_state(), xmpp_pubsub_publish_mwi(), xmpp_pubsub_purge_nodes(), xmpp_pubsub_request_nodes(), xmpp_pubsub_subscribe(), and xmpp_pubsub_unsubscribe().
|
static |
Definition at line 377 of file chan_pjsip.c.
References ao2_alloc, ao2_bump, rtp_direct_media_data::cap, cdata(), rtp_direct_media_data::chan, NULL, rtp_direct_media_data::rtp, rtp_direct_media_data_destroy(), session, and rtp_direct_media_data::vrtp.
Referenced by chan_pjsip_set_rtp_peer().
|
static |
Definition at line 366 of file chan_pjsip.c.
References ao2_cleanup, and cdata().
Referenced by rtp_direct_media_data_create().
|
static |
Helper function to find the position for RTCP.
Definition at line 306 of file chan_pjsip.c.
References ast_rtp_instance_fd(), AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, ast_sip_session_media_read_callback_state::fd, and session.
Referenced by check_for_rtp_changes().
|
static |
Definition at line 396 of file chan_pjsip.c.
References ao2_ref, ast_channel_lock, ast_channel_name(), ast_channel_tech_pvt(), ast_channel_unlock, ast_debug, ast_format_cap_append_from_cap(), ast_format_cap_count(), ast_format_cap_identical(), ast_format_cap_remove_by_type(), AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_UNKNOWN, AST_MEDIA_TYPE_VIDEO, ast_sip_session_refresh(), cdata(), ast_sip_session::channel, check_for_rtp_changes(), direct_media_mitigate_glare(), NULL, and session.
Referenced by chan_pjsip_set_rtp_peer().
|
static |
Definition at line 1575 of file chan_pjsip.c.
References ast_sip_session_get_name(), ast_sip_session_refresh(), AST_SIP_SESSION_REFRESH_METHOD_INVITE, AST_SIP_SESSION_REFRESH_METHOD_UPDATE, AST_STATE_RING, AST_STATE_RINGING, ast_str_tmp, ast_stream_topology_to_str(), method, NULL, on_topology_change_response(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, refresh_data::session, session, and topology_change_refresh_data_free().
Referenced by handle_topology_request_change().
|
static |
Definition at line 2790 of file chan_pjsip.c.