Asterisk - The Open Source Telephony Project
18.5.0
|
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_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) |
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 | hangup_sip2cause (int cause) |
Convert SIP hangup causes to Asterisk hangup causes. More... | |
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 void | local_hold_set_state (struct ast_sip_session_media *session_media, unsigned int held) |
Callback which changes the value of locally held on the media stream. 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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .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 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_function |
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.
Referenced by chan_pjsip_get_uniqueid().
|
static |
Definition at line 75 of file chan_pjsip.c.
|
static |
Definition at line 3438 of file chan_pjsip.c.
|
static |
Definition at line 3438 of file chan_pjsip.c.
|
static |
Definition at line 682 of file chan_pjsip.c.
References ast_channel_name(), ast_log, ast_sip_session_get_name(), ast_sip_session_send_response(), ast_sip_session::channel, answer_data::indent, ast_sip_session::inv_session, LOG_ERROR, LOG_WARNING, NULL, SCOPE_ENTER_TASK, SCOPE_EXIT_RTN_VALUE, answer_data::session, and status.
Referenced by ast_raw_answer_with_stream_topology(), chan_pjsip_answer(), dns_parse_answer(), dns_parse_answer_ex(), dump_answer(), find_and_retrans(), pbx_builtin_incomplete(), session_inv_on_rx_offer(), stun_monitor_request(), tds_log(), verify_mock_cdr_record(), and zapateller_exec().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 3438 of file chan_pjsip.c.
|
static |
Definition at line 2358 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, ast_sip_session::pending_media_state, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, ast_sip_channel_pvt::session, set_channel_on_rtp_instance(), ast_sip_session_media_state::topology, and update_initial_connected_line().
Referenced by ast_call(), chan_pjsip_call(), and native_start().
|
static |
Definition at line 3065 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(), rtp_direct_media_data::chan, ast_sip_session::channel, ast_sip_session::exten, LOG_ERROR, and ast_features_pickup_config::pickupexten.
|
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 1117 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, and RAII_VAR.
Referenced by chan_pjsip_indicate().
|
static |
Function called by core when we should answer a PJSIP session.
Definition at line 726 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, ast_sip_session::channel, answer_data::indent, LOG_ERROR, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, ast_sip_session::serializer, rtp_direct_media_data::session, ast_sip_channel_pvt::session, and answer_data::session.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called by core to actually start calling a remote party.
Definition at line 2385 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.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Internal helper function called when CNG tone is detected.
Definition at line 765 of file chan_pjsip.c.
References ast_async_goto(), ast_channel_caller(), ast_channel_context(), ast_channel_exten(), ast_channel_lock, ast_channel_macrocontext(), 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, ast_sip_session::dsp, DSP_FEATURE_FAX_DETECT, exists(), LOG_ERROR, LOG_NOTICE, NULL, pbx_builtin_setvar_helper(), S_COR, and S_OR.
Referenced by chan_pjsip_read_stream().
|
static |
Function called to get the device state of an endpoint.
Definition at line 1174 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.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called by core to start a DTMF digit.
Definition at line 2150 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, ast_sip_session::dtmf, ast_sip_session_media::rtp, and ast_sip_channel_pvt::session.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called by core to stop a DTMF digit.
Definition at line 2262 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, ast_sip_session::dtmf, info_dtmf_data_alloc(), LOG_WARNING, ast_sip_session_media::rtp, ast_sip_session::serializer, ast_sip_channel_pvt::session, and transmit_info_dtmf().
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called by core to change the underlying owner channel.
Definition at line 1045 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().
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called by RTP engine to get peer capabilities.
Definition at line 244 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, 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 1161 of file chan_pjsip.c.
References ao2_cleanup, ao2_find, NULL, OBJ_SEARCH_KEY, and RAII_VAR.
Referenced by chan_pjsip_devicestate().
|
static |
Function called by RTP engine to get local audio RTP peer.
Definition at line 171 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_session_media::rtp, ast_sip_endpoint_media_configuration::rtp, and ast_sip_channel_pvt::session.
|
static |
Definition at line 1278 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.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called by RTP engine to get local video RTP peer.
Definition at line 215 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_session_media::rtp, ast_sip_endpoint_media_configuration::rtp, and ast_sip_channel_pvt::session.
|
static |
Function called by core to hang up a PJSIP session.
Definition at line 2516 of file chan_pjsip.c.
References ao2_cleanup, ast_channel_hangupcause(), ast_channel_name(), ast_channel_tech_pvt(), ast_log, ast_sip_push_task(), 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.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Definition at line 3241 of file chan_pjsip.c.
References AST_CONTROL_SRCCHANGE, ast_queue_control(), ast_sip_session_get_name(), ast_trace, ast_sip_session::channel, ast_sip_endpoint_media_configuration::direct_media, ast_sip_direct_media_configuration::enabled, ast_sip_session::endpoint, ast_sip_endpoint::media, SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.
|
static |
Function called when a request is received on the session.
Definition at line 3007 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(), ast_sip_session::channel, ast_sip_session::defer_terminate, ast_sip_session::exten, ast_sip_session::inv_session, 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, and set_sipdomain_variable().
|
static |
Function called when a response is received on the session.
Definition at line 3186 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, ast_sip_session::channel, ast_sip_session::endpoint, ast_sip_endpoint::ignore_183_without_sdp, SCOPE_ENTER, and SCOPE_EXIT_RTN.
|
static |
Function called when a response is received on the session.
Definition at line 3156 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_session_get_name(), ast_control_pvt_cause_code::chan_name, ast_sip_session::channel, ast_control_pvt_cause_code::code, hangup_sip2cause(), SCOPE_ENTER, and SCOPE_EXIT_RTN.
|
static |
Function called by core to ask the channel to indicate some sort of condition.
Definition at line 1612 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_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_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(), ast_frame::datalen, ast_sip_session::endpoint, ast_frame::frametype, handle_topology_request_change(), ast_sip_endpoint::inband_progress, indicate(), indicate_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, 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_frame::subclass, T38_PEER_REINVITE, ast_sip_session::t38state, transmit_info_with_vidupdate(), ast_sip_session_media::type, update_connected_line_information(), and ast_sip_endpoint_media_configuration::webrtc.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called to create a new PJSIP Asterisk channel.
Definition at line 547 of file chan_pjsip.c.
References ast_sip_endpoint::accountcode, 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_endpoint, ast_channel_caller(), ast_channel_callgroup_set(), ast_channel_dialed(), 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, ast_sip_endpoint_pickup_configuration::callgroup, rtp_direct_media_data::chan, chan_idx, chan_pjsip_pvt_dtor(), ast_sip_endpoint::channel_vars, ast_sip_endpoint_media_configuration::codecs, compatible_formats_exist(), ast_sip_endpoint::context, ast_sip_session::endpoint, ast_sip_session::id, ast_sip_endpoint::language, LOG_ERROR, ast_sip_endpoint::media, ast_variable::name, ast_party_id::name, ast_sip_endpoint_pickup_configuration::named_callgroups, ast_sip_endpoint_pickup_configuration::named_pickupgroups, ast_variable::next, NULL, ast_party_id::number, ast_party_dialed::number, pbx_builtin_setvar_helper(), ast_sip_session::pending_media_state, ast_sip_endpoint::persistent, ast_sip_endpoint::pickup, ast_sip_endpoint_pickup_configuration::pickupgroup, RAII_VAR, S_COR, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, set_channel_on_rtp_instance(), ast_party_name::str, ast_party_number::str, ast_party_dialed::str, ast_sip_session_media_state::topology, ast_sip_endpoint_media_configuration::topology, ast_party_name::valid, ast_party_number::valid, ast_variable::value, var, and ast_sip_endpoint::zone.
Referenced by chan_pjsip_incoming_request(), and chan_pjsip_request_with_stream_topology().
|
static |
Definition at line 82 of file chan_pjsip.c.
References chan_pjsip_answer(), chan_pjsip_call(), chan_pjsip_devicestate(), chan_pjsip_digit_begin(), chan_pjsip_digit_end(), chan_pjsip_fixup(), chan_pjsip_get_uniqueid(), chan_pjsip_hangup(), chan_pjsip_indicate(), chan_pjsip_queryoption(), chan_pjsip_read_stream(), chan_pjsip_request(), chan_pjsip_request_with_stream_topology(), chan_pjsip_sendtext(), chan_pjsip_sendtext_data(), chan_pjsip_transfer(), chan_pjsip_write(), chan_pjsip_write_stream(), ast_channel::data, ast_frame::data, ast_frame::datalen, digit, ast_frame::stream_num, text, timeout, and type.
Referenced by chan_pjsip_new().
|
static |
Function called to query options on a channel.
Definition at line 1237 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.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called by core to read any waiting frames.
Definition at line 838 of file chan_pjsip.c.
References ast_sip_session::active_media_state, 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, ast_sip_endpoint::asymmetric_rtp_codec, chan_pjsip_cng_tone_detected(), ast_sip_session_media_state::default_session, ast_sip_session::dsp, DSP_FEATURE_FAX_DETECT, ast_sip_session::endpoint, ast_sip_endpoint::faxdetect_timeout, 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, ast_frame::subclass, and ast_sip_session_media::type.
Referenced by chan_pjsip_pvt_dtor().
|
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 1148 of file chan_pjsip.c.
References ao2_find, OBJ_NODATA, OBJ_SEARCH_KEY, and OBJ_UNLINK.
Referenced by chan_pjsip_indicate(), and chan_pjsip_session_end().
|
static |
Definition at line 2694 of file chan_pjsip.c.
References ast_stream_topology_create_from_format_cap(), ast_stream_topology_free(), rtp_direct_media_data::chan, chan_pjsip_request_with_stream_topology(), and NULL.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called by core to create a new outgoing PJSIP session.
Definition at line 2667 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(), ast_sip_session::channel, request_data::dest, NULL, RAII_VAR, request(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, request_data::session, and request_data::topology.
Referenced by chan_pjsip_pvt_dtor(), and chan_pjsip_request().
|
static |
Definition at line 2837 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(), and ast_msg_data_attribute::type.
Referenced by chan_pjsip_pvt_dtor().
|
static |
Function called by core to send text on PJSIP session.
Definition at line 2815 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(), sendtext_data_create(), ast_sip_session::serializer, and ast_sip_channel_pvt::session.
Referenced by chan_pjsip_pvt_dtor(), and chan_pjsip_sendtext().
|
static |
SIP session interaction functions.
Definition at line 2950 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(), ast_sip_endpoint_media_configuration::direct_media, ast_sip_session::endpoint, ast_sip_direct_media_configuration::glare_mitigation, ast_sip_endpoint::media, NULL, RAII_VAR, SCOPE_ENTER, and SCOPE_EXIT_RTN.
|
static |
Function called when the session ends.
Definition at line 2972 of file chan_pjsip.c.
References ast_channel_hangupcause(), ast_channel_name(), ast_channel_uniqueid(), ast_queue_hangup(), ast_queue_hangup_with_cause(), ast_set_hangupsource(), ast_sip_session_get_name(), chan_pjsip_remove_hold(), ast_sip_session::channel, hangup_sip2cause(), ast_sip_session::inv_session, SCOPE_ENTER, and SCOPE_EXIT_RTN.
|
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, cdata(), ast_sip_endpoint_media_configuration::direct_media, ast_sip_direct_media_configuration::disable_on_nat, ast_sip_session::endpoint, LOG_ERROR, ast_sip_endpoint::media, rtp_direct_media_data_create(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, send_direct_media_request(), ast_sip_session::serializer, and ast_sip_channel_pvt::session.
|
static |
Function called by core for Asterisk initiated transfer.
Definition at line 2131 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(), and transfer_data_alloc().
Referenced by chan_pjsip_pvt_dtor().
|
static |
Definition at line 1039 of file chan_pjsip.c.
References chan_pjsip_write_stream().
Referenced by chan_pjsip_pvt_dtor().
|
static |
Definition at line 949 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_media_state::default_session, ast_frame_subclass::format, ast_frame::frametype, ast_frame_subclass::integer, LOG_WARNING, NULL, ast_sip_channel_pvt::session, ast_frame::subclass, ast_sip_session_media::type, and ast_sip_session_media::write_callback.
Referenced by chan_pjsip_pvt_dtor(), and chan_pjsip_write().
|
static |
Definition at line 319 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_last_rx(), ast_rtp_instance_set_prop(), AST_RTP_PROPERTY_RTCP, ast_sockaddr_isnull(), ast_sockaddr_setnull(), ast_sip_session_media::direct_media_addr, NULL, ast_sip_session_media::rtp, and rtp_find_rtcp_fd_position().
Referenced by send_direct_media_request().
|
static |
Clear a channel from a session along with its PVT.
Definition at line 2476 of file chan_pjsip.c.
References ast_channel_tech_pvt_set(), ast_sip_session::channel, NULL, 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 268 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(), ast_sip_endpoint_media_configuration::direct_media, ast_sip_session::endpoint, ast_sip_direct_media_configuration::glare_mitigation, ast_sip_session::inv_session, ast_sip_endpoint::media, NULL, and RAII_VAR.
Referenced by send_direct_media_request().
|
static |
Definition at line 1592 of file chan_pjsip.c.
References ast_sip_push_task(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, send_topology_change_refresh(), ast_sip_session::serializer, topology_change_refresh_data_alloc(), and topology_change_refresh_data_free().
Referenced by chan_pjsip_indicate().
|
static |
Definition at line 2483 of file chan_pjsip.c.
References ao2_bump, ao2_cleanup, ast_channel_name(), ast_channel_tech_pvt(), ast_sip_session_terminate(), hangup_data::cause, hangup_data::chan, clear_session_and_channel(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and ast_sip_channel_pvt::session.
Referenced by ast_hangup(), chan_pjsip_hangup(), hangup_playback(), and manage_calls().
|
static |
Internal function which translates from Asterisk cause codes to SIP response codes.
Definition at line 2402 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 2461 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 2454 of file chan_pjsip.c.
References ast_channel_unref, and hangup_data::chan.
Referenced by hangup_data_alloc().
|
static |
Convert SIP hangup causes to Asterisk hangup causes.
Definition at line 2860 of file chan_pjsip.c.
References AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, AST_CAUSE_BUSY, AST_CAUSE_CALL_REJECTED, 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_USER_RESPONSE, AST_CAUSE_NORMAL, AST_CAUSE_NORMAL_TEMPORARY_FAILURE, AST_CAUSE_NUMBER_CHANGED, AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE, AST_CAUSE_UNALLOCATED, and AST_CAUSE_USER_BUSY.
Referenced by chan_pjsip_incoming_response_update_cause(), and chan_pjsip_session_end().
|
static |
Definition at line 1333 of file chan_pjsip.c.
References ao2_ref, ast_sip_session_send_response(), ast_sip_session::inv_session, NULL, indicate_data::response_code, and indicate_data::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 1308 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, rtp_direct_media_data::session, and indicate_data::session.
Referenced by chan_pjsip_indicate().
|
static |
Definition at line 1300 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 2205 of file chan_pjsip.c.
References ao2_alloc, ao2_ref, digit, info_dtmf_data::digit, info_dtmf_data::duration, info_dtmf_data_destroy(), NULL, rtp_direct_media_data::session, and info_dtmf_data::session.
Referenced by chan_pjsip_digit_end().
|
static |
Definition at line 2199 of file chan_pjsip.c.
References ao2_ref, and info_dtmf_data::session.
Referenced by info_dtmf_data_alloc().
|
static |
Definition at line 1402 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_sip_session::channel, ast_sip_session::endpoint, ast_sip_endpoint::id, ast_party_id::number, ast_sip_endpoint_id_configuration::send_connected_line, ast_sip_endpoint_id_configuration::send_pai, ast_sip_endpoint_id_configuration::send_rpid, ast_sip_endpoint_id_configuration::trust_outbound, 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 824 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ast_format_cap_iscompatible_format(), AST_FORMAT_CMP_NOT_EQUAL, ast_stream_get_formats(), ast_stream_topology_get_stream(), ast_frame_subclass::format, ast_frame::stream_num, ast_frame::subclass, and ast_sip_session_media_state::topology.
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 3304 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, 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_MEDIA_TYPE_AUDIO, AST_MODULE_LOAD_DECLINE, 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_channel_tech::capabilities, channel_type, end, endpoints, LOG_ERROR, LOG_WARNING, NULL, OBJ_NODATA, pjsip_channel_cli_register(), refer_callback_module, uid_hold_hash_fn(), uid_hold_sort_fn(), and update_devstate().
Referenced by unload_module().
|
static |
Callback which changes the value of locally held on the media stream.
Definition at line 1482 of file chan_pjsip.c.
References ast_sip_session_media::locally_held.
Referenced by remote_send_hold_refresh().
|
static |
Definition at line 1549 of file chan_pjsip.c.
References ast_sip_session::active_media_state, 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(), ast_sip_session::channel, ast_sip_session::pending_media_state, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and ast_sip_session_media_state::topology.
Referenced by send_topology_change_refresh().
|
static |
Definition at line 3115 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(), ast_sip_session::channel, LOG_WARNING, SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.
|
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 1490 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ao2_ref, ast_sip_session_refresh(), AST_SIP_SESSION_REFRESH_METHOD_INVITE, AST_VECTOR_CALLBACK_VOID, local_hold_set_state(), and NULL.
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 2559 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, rtp_direct_media_data::session, request_data::session, tmp(), and request_data::topology.
Referenced by _ast_bridge_channel_unlock(), action_add_agi_cmd(), ast_http_body_discard(), ast_http_body_read_status(), ast_http_get_contents(), ast_http_request_close_on_completion(), ast_http_send(), 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_setup(), httpd_process_request(), parse_ewscal_id(), reload(), 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(), rtp_direct_media_data::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, rtp_direct_media_data::cap, cdata(), rtp_direct_media_data::chan, rtp_direct_media_data::rtp, rtp_direct_media_data::session, and rtp_direct_media_data::vrtp.
Referenced by rtp_direct_media_data_create().
|
static |
Helper function to find the position for RTCP.
Definition at line 298 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ast_rtp_instance_fd(), AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, and ast_sip_session_media_read_callback_state::fd.
Referenced by check_for_rtp_changes().
|
static |
Definition at line 396 of file chan_pjsip.c.
References ast_sip_session::active_media_state, 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(), rtp_direct_media_data::cap, cdata(), rtp_direct_media_data::chan, check_for_rtp_changes(), ast_sip_session_media_state::default_session, ast_sip_endpoint_media_configuration::direct_media, ast_sip_session::direct_media_cap, direct_media_mitigate_glare(), ast_sip_session::endpoint, ast_sip_endpoint::media, ast_sip_direct_media_configuration::method, NULL, rtp_direct_media_data::rtp, rtp_direct_media_data::session, ast_sip_channel_pvt::session, and rtp_direct_media_data::vrtp.
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_str_tmp, ast_stream_topology_to_str(), topology_change_refresh_data::media_state, NULL, on_topology_change_response(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, topology_change_refresh_data::session, ast_sip_session_media_state::topology, and topology_change_refresh_data_free().
Referenced by handle_topology_request_change().
|
static |
Definition at line 2744 of file chan_pjsip.c.
References ao2_cleanup, ast_log, AST_MSG_DATA_ATTR_BODY, AST_MSG_DATA_ATTR_CONTENT_TYPE, AST_MSG_DATA_ATTR_FROM, AST_MSG_DATA_ATTR_TO, ast_msg_data_get_attribute(), ast_sip_add_body(), ast_sip_create_request(), ast_sip_send_request(), ast_strlen_zero, ast_sip_body::body_text, ast_sip_session::endpoint, ast_sip_session::inv_session, LOG_ERROR, sendtext_data::msg, NULL, sendtext_data::session, ast_sip_body::subtype, and ast_sip_body::type.
Referenced by chan_pjsip_sendtext_data().
|
static |
Definition at line 2723 of file chan_pjsip.c.
References ao2_alloc, ao2_cleanup, ao2_ref, ast_channel_tech_pvt(), ast_msg_data_dup(), sendtext_data::msg, NULL, sendtext_data_destroy(), ast_sip_channel_pvt::session, and sendtext_data::session.
Referenced by chan_pjsip_sendtext_data().
|
static |
Definition at line 2716 of file chan_pjsip.c.
References ao2_cleanup, ast_free, sendtext_data::msg, and sendtext_data::session.
Referenced by sendtext_data_create().
|
static |
Definition at line 494 of file chan_pjsip.c.
References ast_sip_session::active_media_state, ast_rtp_instance_set_channel_id(), AST_VECTOR_GET, AST_VECTOR_SIZE, and ast_sip_session_media::rtp.
Referenced by call(), chan_pjsip_fixup(), chan_pjsip_new(), and clear_session_and_channel().
|
static |
Definition at line 2994 of file chan_pjsip.c.
References ast_alloca, ast_copy_pj_str(), ast_sip_session::channel, pbx_builtin_setvar_helper(), and ast_sip_session::request_uri.
Referenced by chan_pjsip_incoming_request().
|
static |
Definition at line 1524 of file chan_pjsip.c.
References ao2_bump, ast_calloc, ast_sip_session_media_state_alloc(), ast_stream_topology_clone(), topology_change_refresh_data::media_state, NULL, topology_change_refresh_data::session, ast_sip_session_media_state::topology, and topology_change_refresh_data_free().
Referenced by handle_topology_request_change().
|
static |
Definition at line 1516 of file chan_pjsip.c.
References ao2_cleanup, ast_free, ast_sip_session_media_state_free(), topology_change_refresh_data::media_state, and topology_change_refresh_data::session.
Referenced by handle_topology_request_change(), send_topology_change_refresh(), and topology_change_refresh_data_alloc().
|
static |
Definition at line 2096 of file chan_pjsip.c.
References ao2_cleanup, ao2_ref, ast_sip_endpoint::aors, ast_log, ast_sip_get_sorcery(), ast_sip_location_retrieve_contact_from_aor_list(), ast_sorcery_retrieve_by_id(), AST_STATE_RING, ast_strlen_zero, ast_sip_session::channel, ast_sip_session::inv_session, LOG_ERROR, NULL, transfer_data::session, transfer_data::target, transfer_redirect(), transfer_refer(), and ast_sip_contact::uri.
Referenced by chan_pjsip_transfer().
|
static |
Definition at line 1858 of file chan_pjsip.c.
References ao2_alloc, ao2_ref, ast_strdup, NULL, rtp_direct_media_data::session, transfer_data::session, transfer_data::target, and transfer_data_destroy().
Referenced by chan_pjsip_transfer().
|
static |
Definition at line 1850 of file chan_pjsip.c.
References ao2_cleanup, ast_free, transfer_data::session, and transfer_data::target.
Referenced by transfer_data_alloc().
|
static |
Definition at line 1877 of file chan_pjsip.c.
References ast_channel_name(), AST_CONTROL_TRANSFER, ast_log, ast_queue_control_data(), ast_sip_session_send_response(), AST_TRANSFER_FAILED, AST_TRANSFER_SUCCESS, ast_sip_session::channel, ast_sip_session::inv_session, LOG_WARNING, NULL, and tmp().
Referenced by transfer().
|
static |
Definition at line 2044 of file chan_pjsip.c.
References ao2_ref, AST_CONTROL_TRANSFER, ast_copy_pj_str(), ast_queue_control_data(), ast_sip_add_header(), ast_strlen_zero, AST_TRANSFER_FAILED, AST_TRANSFER_SUCCESS, rtp_direct_media_data::chan, ast_sip_session::channel, ast_sip_session::inv_session, NULL, pbx_builtin_getvar_helper(), refer_callback_module, sub, tmp(), and xfer_client_on_evsub_state().
Referenced by transfer().
|
static |
Definition at line 2218 of file chan_pjsip.c.
References ao2_cleanup, ast_free_ptr(), ast_log, ast_sip_add_body(), ast_sip_create_request(), ast_sip_session_send_request(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_sip_body::body_text, ast_sip_session::endpoint, ast_sip_session::inv_session, LOG_ERROR, NULL, RAII_VAR, and ast_sip_body::type.
Referenced by chan_pjsip_digit_end().
|
static |
Send SIP INFO with video update request.
Definition at line 1351 of file chan_pjsip.c.
References ao2_cleanup, ast_log, ast_sip_add_body(), ast_sip_create_request(), ast_sip_session_send_request(), ast_sip_session::endpoint, ast_sip_session::inv_session, LOG_ERROR, NULL, RAII_VAR, and ast_sip_body::type.
Referenced by chan_pjsip_indicate().
|
static |
Destructor function for transport_info_data.
Definition at line 253 of file chan_pjsip.c.
References ast_free.
|
static |
AO2 hash function for on hold UIDs
Definition at line 1066 of file chan_pjsip.c.
References ast_assert, ast_str_hash(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, and OBJ_SEARCH_OBJECT.
Referenced by load_module().
|
static |
AO2 sort function for on hold UIDs
Definition at line 1084 of file chan_pjsip.c.
References ast_assert, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by load_module().
|
static |
Unload the PJSIP channel from Asterisk.
Definition at line 3403 of file chan_pjsip.c.
References ao2_cleanup, ao2_ref, ast_channel_unregister(), ast_custom_function_unregister(), AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CHANNEL_DRIVER, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_rtp_glue_unregister(), ast_sip_session_unregister_supplement(), ast_sip_unregister_service(), ASTERISK_GPL_KEY, ast_channel_tech::capabilities, load_module(), NULL, pjsip_channel_cli_unregister(), and refer_callback_module.
|
static |
Update connected line information.
Definition at line 1429 of file chan_pjsip.c.
References ao2_ref, ast_log, ast_sip_session_refresh(), AST_SIP_SESSION_REFRESH_METHOD_INVITE, AST_SIP_SESSION_REFRESH_METHOD_UPDATE, ast_sip_session_send_response(), AST_STATE_RING, AST_STATE_RINGING, AST_STATE_UP, ast_sip_session::channel, ast_sip_session::endpoint, ast_sip_endpoint::id, ast_sip_endpoint::inband_progress, ast_sip_session::inv_session, is_colp_update_allowed(), LOG_ERROR, method, NULL, ast_sip_endpoint_id_configuration::refresh_method, and ast_sip_endpoint_id_configuration::rpid_immediate.
Referenced by chan_pjsip_indicate().
|
static |
Definition at line 3254 of file chan_pjsip.c.
References AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), and ast_sorcery_object_get_id().
Referenced by load_module().
|
static |
Definition at line 2333 of file chan_pjsip.c.
References ast_channel_caller(), ast_channel_lock, ast_channel_queue_connected_line_update(), ast_channel_unlock, AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER, ast_party_connected_line_init(), ast_party_id_copy(), ast_sip_session::channel, ast_sip_session::id, ast_party_caller::id, ast_party_connected_line::id, ast_party_id::name, NULL, ast_party_id::number, ast_party_connected_line::source, ast_party_name::valid, and ast_party_number::valid.
Referenced by call().
|
static |
Callback function to report status of implicit REFER-NOTIFY subscription.
This function will be called on any state change in the REFER-NOTIFY subscription. Its primary purpose is to report SUCCESS/FAILURE of a transfer initiated via transfer_refer as well as to terminate the subscription, if necessary.
Definition at line 1927 of file chan_pjsip.c.
References ao2_ref, ast_channel_name(), AST_CONTROL_TRANSFER, ast_debug, ast_queue_control_data(), AST_TRANSFER_FAILED, AST_TRANSFER_SUCCESS, rtp_direct_media_data::chan, NULL, refer_callback_module, and status.
Referenced by transfer_refer().
|
static |
Definition at line 3438 of file chan_pjsip.c.
|
static |
Definition at line 3438 of file chan_pjsip.c.
|
static |
Definition at line 3109 of file chan_pjsip.c.
|
static |
Definition at line 80 of file chan_pjsip.c.
Referenced by chan_pjsip_new().
|
static |
Definition at line 164 of file chan_pjsip.c.
|
static |
Definition at line 3261 of file chan_pjsip.c.
|
static |
Definition at line 3266 of file chan_pjsip.c.
|
static |
Local glue for interacting with the RTP engine core.
Definition at line 486 of file chan_pjsip.c.
|
static |
SIP session supplement structure.
Definition at line 143 of file chan_pjsip.c.
|
static |
SIP session supplement structure just for responses.
Definition at line 155 of file chan_pjsip.c.
struct ast_channel_tech chan_pjsip_tech |
PBX interface structure for channel registration.
Definition at line 109 of file chan_pjsip.c.
|
static |
Definition at line 78 of file chan_pjsip.c.
Referenced by load_module().
|
static |
Definition at line 266 of file chan_pjsip.c.
|
static |
Definition at line 3277 of file chan_pjsip.c.
|
static |
Definition at line 3271 of file chan_pjsip.c.
|
static |
Definition at line 3283 of file chan_pjsip.c.
|
static |
Definition at line 3149 of file chan_pjsip.c.
|
static |
Definition at line 1107 of file chan_pjsip.c.
|
static |
REFER Callback module, used to attach session data structure to subscription.
Definition at line 1915 of file chan_pjsip.c.
Referenced by load_module(), transfer_refer(), unload_module(), and xfer_client_on_evsub_state().
|
static |
Definition at line 3289 of file chan_pjsip.c.
|
static |
Datastore used to store local/remote addresses for the INVITE request that created the PJSIP channel.
Definition at line 261 of file chan_pjsip.c.
|
static |
Definition at line 75 of file chan_pjsip.c.
Referenced by chan_pjsip_get_uniqueid().