Asterisk - The Open Source Telephony Project GIT-master-f08020d
Loading...
Searching...
No Matches
Macros | Functions | Variables
channel_internal_api.c File Reference

Channel Accessor API. More...

#include "asterisk.h"
#include <unistd.h>
#include <fcntl.h>
#include "asterisk/alertpipe.h"
#include "asterisk/paths.h"
#include "asterisk/channel.h"
#include "asterisk/channel_internal.h"
#include "asterisk/endpoints.h"
#include "asterisk/indications.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_endpoints.h"
#include "asterisk/stringfields.h"
#include "asterisk/stream.h"
#include "asterisk/test.h"
#include "asterisk/vector.h"
#include "channel_private.h"
#include "channelstorage.h"
Include dependency graph for channel_internal_api.c:

Go to the source code of this file.

Macros

#define DEFINE_STRINGFIELD_GETTER_FOR(field)
 
#define DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR(field, publish, assert_on_null, invalidate)
 
#define DEFINE_STRINGFIELD_SETTERS_FOR(field, assert_on_null)
 
#define DIALED_CAUSES_BUCKETS   37
 

Functions

struct ast_channel__ast_channel_internal_alloc (void(*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *file, int line, const char *function)
 
struct ast_channel__ast_channel_internal_alloc_with_initializers (void(*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const struct ast_channel_initializers *initializers, const char *file, int line, const char *function)
 
enum ast_channel_adsicpe ast_channel_adsicpe (const struct ast_channel *chan)
 
void ast_channel_adsicpe_set (struct ast_channel *chan, enum ast_channel_adsicpe value)
 
int ast_channel_alert_writable (struct ast_channel *chan)
 
int ast_channel_alert_write (struct ast_channel *chan)
 
enum ama_flags ast_channel_amaflags (const struct ast_channel *chan)
 
void ast_channel_amaflags_set (struct ast_channel *chan, enum ama_flags value)
 
struct timeval ast_channel_answertime (struct ast_channel *chan)
 
void ast_channel_answertime_set (struct ast_channel *chan, struct timeval *value)
 
const char * ast_channel_appl (const struct ast_channel *chan)
 
void ast_channel_appl_set (struct ast_channel *chan, const char *value)
 
struct ast_audiohook_listast_channel_audiohooks (const struct ast_channel *chan)
 
void ast_channel_audiohooks_set (struct ast_channel *chan, struct ast_audiohook_list *value)
 
struct ast_autochan_listast_channel_autochans (struct ast_channel *chan)
 
pthread_t ast_channel_blocker (const struct ast_channel *chan)
 
void ast_channel_blocker_set (struct ast_channel *chan, pthread_t value)
 
int ast_channel_blocker_tid (const struct ast_channel *chan)
 
void ast_channel_blocker_tid_set (struct ast_channel *chan, int value)
 
const char * ast_channel_blockproc (const struct ast_channel *chan)
 
void ast_channel_blockproc_set (struct ast_channel *chan, const char *value)
 
struct ast_party_callerast_channel_caller (struct ast_channel *chan)
 
void ast_channel_caller_set (struct ast_channel *chan, struct ast_party_caller *value)
 
ast_group_t ast_channel_callgroup (const struct ast_channel *chan)
 
void ast_channel_callgroup_set (struct ast_channel *chan, ast_group_t value)
 
ast_callid ast_channel_callid (const struct ast_channel *chan)
 
void ast_channel_callid_cleanup (struct ast_channel *chan)
 
void ast_channel_callid_set (struct ast_channel *chan, ast_callid callid)
 
struct ast_cdrast_channel_cdr (const struct ast_channel *chan)
 
void ast_channel_cdr_set (struct ast_channel *chan, struct ast_cdr *value)
 
struct ast_party_connected_lineast_channel_connected (struct ast_channel *chan)
 
struct ast_party_id ast_channel_connected_effective_id (struct ast_channel *chan)
 
struct ast_party_connected_lineast_channel_connected_indicated (struct ast_channel *chan)
 
void ast_channel_connected_set (struct ast_channel *chan, struct ast_party_connected_line *value)
 
const char * ast_channel_context (const struct ast_channel *chan)
 
void ast_channel_context_set (struct ast_channel *chan, const char *value)
 
struct timeval ast_channel_creationtime (struct ast_channel *chan)
 
void ast_channel_creationtime_set (struct ast_channel *chan, struct timeval *value)
 
const char * ast_channel_data (const struct ast_channel *chan)
 
void ast_channel_data_set (struct ast_channel *chan, const char *value)
 
struct ast_datastore_listast_channel_datastores (struct ast_channel *chan)
 
struct ast_party_dialedast_channel_dialed (struct ast_channel *chan)
 
int ast_channel_dialed_causes_add (const struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code, int datalen)
 Add cause code information to the channel.
 
struct ast_strast_channel_dialed_causes_channels (const struct ast_channel *chan)
 Retrieve a comma-separated list of channels for which dialed cause information is available.
 
void ast_channel_dialed_causes_clear (const struct ast_channel *chan)
 Clear all cause information from the channel.
 
struct ast_control_pvt_cause_codeast_channel_dialed_causes_find (const struct ast_channel *chan, const char *chan_name)
 Retrieve a ref-counted cause code information structure.
 
struct ao2_iteratorast_channel_dialed_causes_find_multiple (const struct ast_channel *chan, const char *chan_name)
 Retrieve a ref-counted cause code information structure iterator.
 
void ast_channel_dialed_set (struct ast_channel *chan, struct ast_party_dialed *value)
 
char ast_channel_dtmf_digit_to_emulate (const struct ast_channel *chan)
 
void ast_channel_dtmf_digit_to_emulate_set (struct ast_channel *chan, char value)
 
struct timeval * ast_channel_dtmf_tv (struct ast_channel *chan)
 
void ast_channel_dtmf_tv_set (struct ast_channel *chan, struct timeval *value)
 
struct ast_frameast_channel_dtmff (struct ast_channel *chan)
 
void ast_channel_dtmff_set (struct ast_channel *chan, struct ast_frame *value)
 
unsigned int ast_channel_emulate_dtmf_duration (const struct ast_channel *chan)
 
void ast_channel_emulate_dtmf_duration_set (struct ast_channel *chan, unsigned int value)
 
struct ast_endpointast_channel_endpoint (const struct ast_channel *chan)
 
void ast_channel_endpoint_set (struct ast_channel *chan, struct ast_endpoint *endpoint)
 
const char * ast_channel_exten (const struct ast_channel *chan)
 
void ast_channel_exten_set (struct ast_channel *chan, const char *value)
 
int ast_channel_fd (const struct ast_channel *chan, int which)
 
int ast_channel_fd_add (struct ast_channel *chan, int value)
 Add a file descriptor to the channel without a fixed position.
 
int ast_channel_fd_count (const struct ast_channel *chan)
 Retrieve the number of file decriptor positions present on the channel.
 
int ast_channel_fd_isset (const struct ast_channel *chan, int which)
 
int ast_channel_fdno (const struct ast_channel *chan)
 
void ast_channel_fdno_set (struct ast_channel *chan, int value)
 
unsigned int ast_channel_fin (const struct ast_channel *chan)
 
void ast_channel_fin_set (struct ast_channel *chan, unsigned int value)
 
struct ast_flagsast_channel_flags (struct ast_channel *chan)
 
int ast_channel_forward_endpoint (struct ast_channel *chan, struct ast_endpoint *endpoint)
 Forward channel stasis messages to the given endpoint.
 
unsigned int ast_channel_fout (const struct ast_channel *chan)
 
void ast_channel_fout_set (struct ast_channel *chan, unsigned int value)
 
struct ast_framehook_listast_channel_framehooks (const struct ast_channel *chan)
 
void ast_channel_framehooks_set (struct ast_channel *chan, struct ast_framehook_list *value)
 
struct ast_generatorast_channel_generator (const struct ast_channel *chan)
 
void ast_channel_generator_set (struct ast_channel *chan, struct ast_generator *value)
 
void * ast_channel_generatordata (const struct ast_channel *chan)
 
void ast_channel_generatordata_set (struct ast_channel *chan, void *value)
 
struct ast_streamast_channel_get_default_stream (struct ast_channel *chan, enum ast_media_type type)
 Retrieve the default stream of a specific media type on a channel.
 
struct ast_stream_topologyast_channel_get_stream_topology (const struct ast_channel *chan)
 Retrieve the topology of streams on a channel.
 
void * ast_channel_get_stream_topology_change_source (struct ast_channel *chan)
 Retrieve the source that initiated the last stream topology change.
 
struct ast_hangup_handler_listast_channel_hangup_handlers (struct ast_channel *chan)
 
int ast_channel_hangupcause (const struct ast_channel *chan)
 
void ast_channel_hangupcause_set (struct ast_channel *chan, int value)
 
int ast_channel_hold_state (const struct ast_channel *chan)
 
void ast_channel_hold_state_set (struct ast_channel *chan, int value)
 
unsigned long ast_channel_insmpl (const struct ast_channel *chan)
 
void ast_channel_insmpl_set (struct ast_channel *chan, unsigned long value)
 
ast_alert_status_t ast_channel_internal_alert_flush (struct ast_channel *chan)
 
ast_alert_status_t ast_channel_internal_alert_read (struct ast_channel *chan)
 
int ast_channel_internal_alert_readable (struct ast_channel *chan)
 
int ast_channel_internal_alert_readfd (struct ast_channel *chan)
 
void ast_channel_internal_alertpipe_clear (struct ast_channel *chan)
 
void ast_channel_internal_alertpipe_close (struct ast_channel *chan)
 
int ast_channel_internal_alertpipe_init (struct ast_channel *chan)
 
void ast_channel_internal_alertpipe_swap (struct ast_channel *chan1, struct ast_channel *chan2)
 Swap the interal alertpipe between two channels.
 
struct ast_bridgeast_channel_internal_bridge (const struct ast_channel *chan)
 
struct ast_bridge_channelast_channel_internal_bridge_channel (const struct ast_channel *chan)
 
void ast_channel_internal_bridge_channel_set (struct ast_channel *chan, struct ast_bridge_channel *value)
 
void ast_channel_internal_bridge_set (struct ast_channel *chan, struct ast_bridge *value)
 
void ast_channel_internal_cleanup (struct ast_channel *chan)
 
void ast_channel_internal_copy_linkedid (struct ast_channel *dest, struct ast_channel *source)
 Copy the full linkedid channel id structure from one channel to another.
 
enum ast_channel_error ast_channel_internal_errno (void)
 
void ast_channel_internal_errno_set (enum ast_channel_error error)
 
void ast_channel_internal_fd_clear (struct ast_channel *chan, int which)
 
void ast_channel_internal_fd_clear_all (struct ast_channel *chan)
 
void ast_channel_internal_fd_set (struct ast_channel *chan, int which, int value)
 
void ast_channel_internal_finalize (struct ast_channel *chan)
 
int ast_channel_internal_is_finalized (struct ast_channel *chan)
 
struct ast_channelast_channel_internal_oldest_linkedid (struct ast_channel *a, struct ast_channel *b)
 Determine which channel has an older linkedid.
 
void ast_channel_internal_set_fake_ids (struct ast_channel *chan, const char *uniqueid, const char *linkedid)
 Set uniqueid and linkedid string value only (not time)
 
void ast_channel_internal_set_stream_topology (struct ast_channel *chan, struct ast_stream_topology *topology)
 
void ast_channel_internal_set_stream_topology_change_source (struct ast_channel *chan, void *change_source)
 
int ast_channel_internal_setup_topics (struct ast_channel *chan)
 
void ast_channel_internal_swap_endpoint_forward (struct ast_channel *a, struct ast_channel *b)
 Swap endpoint_forward between two channels.
 
void ast_channel_internal_swap_endpoints (struct ast_channel *a, struct ast_channel *b)
 Swap endpoints between two channels.
 
void ast_channel_internal_swap_snapshots (struct ast_channel *a, struct ast_channel *b)
 Swap snapshots beteween two channels.
 
void ast_channel_internal_swap_stream_topology (struct ast_channel *chan1, struct ast_channel *chan2)
 
void ast_channel_internal_swap_topics (struct ast_channel *a, struct ast_channel *b)
 Swap topics beteween two channels.
 
void ast_channel_internal_swap_uniqueid_and_linkedid (struct ast_channel *a, struct ast_channel *b)
 Swap uniqueid and linkedid beteween two channels.
 
int ast_channel_is_multistream (struct ast_channel *chan)
 Determine if a channel is multi-stream capable.
 
int ast_channel_is_t38_active (struct ast_channel *chan)
 This function will check if T.38 is active on the channel.
 
int ast_channel_is_t38_active_nolock (struct ast_channel *chan)
 ast_channel_is_t38_active variant. Use this if the channel is already locked prior to calling.
 
struct ast_jbast_channel_jb (struct ast_channel *chan)
 
void ast_channel_jb_set (struct ast_channel *chan, struct ast_jb *value)
 
const char * ast_channel_lastcontext (const struct ast_channel *chan)
 
const char * ast_channel_lastexten (const struct ast_channel *chan)
 
const char * ast_channel_linkedid (const struct ast_channel *chan)
 
struct ast_channelast_channel_masq (const struct ast_channel *chan)
 
void ast_channel_masq_set (struct ast_channel *chan, struct ast_channel *value)
 
struct ast_channelast_channel_masqr (const struct ast_channel *chan)
 
void ast_channel_masqr_set (struct ast_channel *chan, struct ast_channel *value)
 
void * ast_channel_music_state (const struct ast_channel *chan)
 
void ast_channel_music_state_set (struct ast_channel *chan, void *value)
 
void ast_channel_name_build (struct ast_channel *chan, const char *fmt,...)
 
void ast_channel_name_build_va (struct ast_channel *chan, const char *fmt, va_list ap)
 
void ast_channel_name_set (struct ast_channel *chan, const char *value)
 
struct ast_namedgroups * ast_channel_named_callgroups (const struct ast_channel *chan)
 
void ast_channel_named_callgroups_set (struct ast_channel *chan, struct ast_namedgroups *value)
 
struct ast_namedgroups * ast_channel_named_pickupgroups (const struct ast_channel *chan)
 
void ast_channel_named_pickupgroups_set (struct ast_channel *chan, struct ast_namedgroups *value)
 
struct ast_format_capast_channel_nativeformats (const struct ast_channel *chan)
 
void ast_channel_nativeformats_set (struct ast_channel *chan, struct ast_format_cap *value)
 
struct ast_formatast_channel_oldwriteformat (struct ast_channel *chan)
 
unsigned long ast_channel_outsmpl (const struct ast_channel *chan)
 
void ast_channel_outsmpl_set (struct ast_channel *chan, unsigned long value)
 
struct ast_pbxast_channel_pbx (const struct ast_channel *chan)
 
void ast_channel_pbx_set (struct ast_channel *chan, struct ast_pbx *value)
 
ast_group_t ast_channel_pickupgroup (const struct ast_channel *chan)
 
void ast_channel_pickupgroup_set (struct ast_channel *chan, ast_group_t value)
 
int ast_channel_priority (const struct ast_channel *chan)
 
void ast_channel_priority_set (struct ast_channel *chan, int value)
 
struct ast_formatast_channel_rawreadformat (struct ast_channel *chan)
 
struct ast_formatast_channel_rawwriteformat (struct ast_channel *chan)
 
struct ast_formatast_channel_readformat (struct ast_channel *chan)
 
struct ast_readq_listast_channel_readq (struct ast_channel *chan)
 
struct ast_trans_pvtast_channel_readtrans (const struct ast_channel *chan)
 
void ast_channel_readtrans_set (struct ast_channel *chan, struct ast_trans_pvt *value)
 
struct ast_party_redirectingast_channel_redirecting (struct ast_channel *chan)
 
struct ast_party_id ast_channel_redirecting_effective_from (struct ast_channel *chan)
 
struct ast_party_id ast_channel_redirecting_effective_orig (struct ast_channel *chan)
 
struct ast_party_id ast_channel_redirecting_effective_to (struct ast_channel *chan)
 
void ast_channel_redirecting_set (struct ast_channel *chan, struct ast_party_redirecting *value)
 
int ast_channel_rings (const struct ast_channel *chan)
 
void ast_channel_rings_set (struct ast_channel *chan, int value)
 
struct ast_sched_contextast_channel_sched (const struct ast_channel *chan)
 
void ast_channel_sched_set (struct ast_channel *chan, struct ast_sched_context *value)
 
char ast_channel_sending_dtmf_digit (const struct ast_channel *chan)
 
void ast_channel_sending_dtmf_digit_set (struct ast_channel *chan, char value)
 
struct timeval ast_channel_sending_dtmf_tv (const struct ast_channel *chan)
 
void ast_channel_sending_dtmf_tv_set (struct ast_channel *chan, struct timeval value)
 
void ast_channel_set_is_t38_active (struct ast_channel *chan, int is_t38_active)
 Sets the is_t38_active flag.
 
void ast_channel_set_is_t38_active_nolock (struct ast_channel *chan, int is_t38_active)
 Variant of ast_channel_set_is_t38_active. Use this if the channel is already locked prior to calling.
 
void ast_channel_set_oldwriteformat (struct ast_channel *chan, struct ast_format *format)
 
void ast_channel_set_rawreadformat (struct ast_channel *chan, struct ast_format *format)
 
void ast_channel_set_rawwriteformat (struct ast_channel *chan, struct ast_format *format)
 
void ast_channel_set_readformat (struct ast_channel *chan, struct ast_format *format)
 
struct ast_stream_topologyast_channel_set_stream_topology (struct ast_channel *chan, struct ast_stream_topology *topology)
 Set the topology of streams on a channel.
 
void ast_channel_set_unbridged (struct ast_channel *chan, int value)
 Sets the unbridged flag and queues a NULL frame on the channel to trigger a check by bridge_channel_wait.
 
void ast_channel_set_unbridged_nolock (struct ast_channel *chan, int value)
 Variant of ast_channel_set_unbridged. Use this if the channel is already locked prior to calling.
 
void ast_channel_set_writeformat (struct ast_channel *chan, struct ast_format *format)
 
struct ast_channel_snapshotast_channel_snapshot (const struct ast_channel *chan)
 
struct ast_flagsast_channel_snapshot_segment_flags (struct ast_channel *chan)
 
void ast_channel_snapshot_set (struct ast_channel *chan, struct ast_channel_snapshot *snapshot)
 
int ast_channel_softhangup_internal_flag (struct ast_channel *chan)
 
void ast_channel_softhangup_internal_flag_add (struct ast_channel *chan, int value)
 
void ast_channel_softhangup_internal_flag_clear (struct ast_channel *chan, int value)
 
void ast_channel_softhangup_internal_flag_set (struct ast_channel *chan, int value)
 
enum ast_channel_state ast_channel_state (const struct ast_channel *chan)
 
void ast_channel_state_set (struct ast_channel *chan, enum ast_channel_state value)
 
struct ast_filestreamast_channel_stream (const struct ast_channel *chan)
 
void ast_channel_stream_set (struct ast_channel *chan, struct ast_filestream *value)
 
int ast_channel_streamid (const struct ast_channel *chan)
 
void ast_channel_streamid_set (struct ast_channel *chan, int value)
 
const struct ast_channel_techast_channel_tech (const struct ast_channel *chan)
 
int ast_channel_tech_hangupcause (const struct ast_channel *chan)
 
void ast_channel_tech_hangupcause_set (struct ast_channel *chan, int value)
 
void * ast_channel_tech_pvt (const struct ast_channel *chan)
 
void ast_channel_tech_pvt_set (struct ast_channel *chan, void *value)
 
void ast_channel_tech_set (struct ast_channel *chan, const struct ast_channel_tech *value)
 
const char * ast_channel_tenantid (const struct ast_channel *chan)
 
void ast_channel_tenantid_set (struct ast_channel *chan, const char *value)
 
struct ast_timerast_channel_timer (const struct ast_channel *chan)
 
void ast_channel_timer_set (struct ast_channel *chan, struct ast_timer *value)
 
void * ast_channel_timingdata (const struct ast_channel *chan)
 
void ast_channel_timingdata_set (struct ast_channel *chan, void *value)
 
int ast_channel_timingfd (const struct ast_channel *chan)
 
void ast_channel_timingfd_set (struct ast_channel *chan, int value)
 
ast_timing_func_t ast_channel_timingfunc (const struct ast_channel *chan)
 
void ast_channel_timingfunc_set (struct ast_channel *chan, ast_timing_func_t value)
 
struct stasis_topicast_channel_topic (struct ast_channel *chan)
 A topic which publishes the events for a particular channel.
 
unsigned short ast_channel_transfercapability (const struct ast_channel *chan)
 
void ast_channel_transfercapability_set (struct ast_channel *chan, unsigned short value)
 
int ast_channel_unbridged (struct ast_channel *chan)
 This function will check if the bridge needs to be re-evaluated due to external changes.
 
int ast_channel_unbridged_nolock (struct ast_channel *chan)
 ast_channel_unbridged variant. Use this if the channel is already locked prior to calling.
 
const char * ast_channel_uniqueid (const struct ast_channel *chan)
 
struct varsheadast_channel_varshead (struct ast_channel *chan)
 
void ast_channel_varshead_set (struct ast_channel *chan, struct varshead *value)
 
int ast_channel_visible_indication (const struct ast_channel *chan)
 
void ast_channel_visible_indication_set (struct ast_channel *chan, int value)
 
struct ast_filestreamast_channel_vstream (const struct ast_channel *chan)
 
void ast_channel_vstream_set (struct ast_channel *chan, struct ast_filestream *value)
 
int ast_channel_vstreamid (const struct ast_channel *chan)
 
void ast_channel_vstreamid_set (struct ast_channel *chan, int value)
 
struct timeval * ast_channel_whentohangup (struct ast_channel *chan)
 
void ast_channel_whentohangup_set (struct ast_channel *chan, struct timeval *value)
 
struct ast_formatast_channel_writeformat (struct ast_channel *chan)
 
struct ast_trans_pvtast_channel_writetrans (const struct ast_channel *chan)
 
void ast_channel_writetrans_set (struct ast_channel *chan, struct ast_trans_pvt *value)
 
struct ast_tone_zoneast_channel_zone (const struct ast_channel *chan)
 
void ast_channel_zone_set (struct ast_channel *chan, struct ast_tone_zone *value)
 
 AST_THREADSTORAGE_CUSTOM_SCOPE (channel_errno, NULL, ast_free_ptr, static)
 
static void channel_set_default_streams (struct ast_channel *chan)
 
static int collect_names_cb (void *obj, void *arg, int flags)
 
 DEFINE_STRINGFIELD_GETTER_FOR (accountcode)
 
 DEFINE_STRINGFIELD_GETTER_FOR (call_forward)
 
 DEFINE_STRINGFIELD_GETTER_FOR (dialcontext)
 
 DEFINE_STRINGFIELD_GETTER_FOR (hangupsource)
 
 DEFINE_STRINGFIELD_GETTER_FOR (language)
 
 DEFINE_STRINGFIELD_GETTER_FOR (latest_musicclass)
 
 DEFINE_STRINGFIELD_GETTER_FOR (musicclass)
 
 DEFINE_STRINGFIELD_GETTER_FOR (name)
 
 DEFINE_STRINGFIELD_GETTER_FOR (parkinglot)
 
 DEFINE_STRINGFIELD_GETTER_FOR (peeraccount)
 
 DEFINE_STRINGFIELD_GETTER_FOR (userfield)
 
 DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR (accountcode, 1, 0, AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE)
 
 DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR (hangupsource, 0, 0, AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP)
 
 DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR (language, 1, 0, AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE)
 
 DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR (peeraccount, 1, 0, AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER)
 
 DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR (userfield, 0, 0, AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (call_forward, 0)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (dialcontext, 0)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (latest_musicclass, 0)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (musicclass, 0)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (parkinglot, 0)
 
static int pvt_cause_cmp_fn (void *obj, void *vstr, int flags)
 Comparison function for pvt cause code frames.
 
static int pvt_cause_hash_fn (const void *vpc, const int flags)
 Hash function for pvt cause code frames.
 
static int remove_dialstatus_cb (void *obj, void *arg, int flags)
 

Variables

const struct ast_channelstorage_drivercurrent_channel_storage_driver
 The current channel storage driver.
 
struct ast_channelstorage_instancecurrent_channel_storage_instance
 The current channel storage instance.
 
static int uniqueint
 The monotonically increasing integer counter for channel uniqueids.
 

Detailed Description

Channel Accessor API.

This file is intended to be the only file that ever accesses the internals of an ast_channel. All other files should use the accessor functions defined here.

Author
Terry Wilson

Definition in file channel_internal_api.c.

Macro Definition Documentation

◆ DEFINE_STRINGFIELD_GETTER_FOR

#define DEFINE_STRINGFIELD_GETTER_FOR (   field)
Value:
const char *ast_channel_##field(const struct ast_channel *chan) \
{ \
return chan->field; \
}
Main Channel structure associated with a channel.

Definition at line 119 of file channel_internal_api.c.

120{ \
121 return chan->field; \
122}

◆ DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR

#define DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR (   field,
  publish,
  assert_on_null,
  invalidate 
)

Definition at line 84 of file channel_internal_api.c.

86{ \
87 if ((assert_on_null)) ast_assert(!ast_strlen_zero(value)); \
88 if (!strcmp(value, chan->field)) return; \
89 ast_string_field_set(chan, field, value); \
92} \
93 \
94void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) \
95{ \
96 ast_string_field_build_va(chan, field, fmt, ap); \
97 ast_channel_snapshot_invalidate_segment(chan, invalidate); \
98 if (publish && ast_channel_internal_is_finalized(chan)) ast_channel_publish_snapshot(chan); \
99} \
100void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) \
101{ \
102 va_list ap; \
103 va_start(ap, fmt); \
104 ast_channel_##field##_build_va(chan, fmt, ap); \
105 va_end(ap); \
106}
if(!yyg->yy_init)
Definition ast_expr2f.c:854
int ast_channel_internal_is_finalized(struct ast_channel *chan)
void ast_channel_snapshot_invalidate_segment(struct ast_channel *chan, enum ast_channel_snapshot_segment_invalidation segment)
Invalidate a channel snapshot segment from being reused.
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
unsigned char publish
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition strings.h:65
int value
Definition syslog.c:37
#define ast_assert(a)
Definition utils.h:779

◆ DEFINE_STRINGFIELD_SETTERS_FOR

#define DEFINE_STRINGFIELD_SETTERS_FOR (   field,
  assert_on_null 
)

Definition at line 64 of file channel_internal_api.c.

66{ \
67 if ((assert_on_null)) ast_assert(!ast_strlen_zero(value)); \
68 if (!strcmp(value, chan->field)) return; \
69 ast_string_field_set(chan, field, value); \
70} \
71 \
72void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) \
73{ \
74 ast_string_field_build_va(chan, field, fmt, ap); \
75} \
76void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) \
77{ \
78 va_list ap; \
79 va_start(ap, fmt); \
80 ast_channel_##field##_build_va(chan, fmt, ap); \
81 va_end(ap); \
82}

◆ DIALED_CAUSES_BUCKETS

#define DIALED_CAUSES_BUCKETS   37

Definition at line 1242 of file channel_internal_api.c.

Function Documentation

◆ __ast_channel_internal_alloc()

struct ast_channel * __ast_channel_internal_alloc ( void(*)(void *obj)  destructor,
const struct ast_assigned_ids assignedids,
const struct ast_channel requestor,
const char *  file,
int  line,
const char *  function 
)

Definition at line 1321 of file channel_internal_api.c.

1323{
1324 return __ast_channel_internal_alloc_with_initializers(destructor, assignedids, requestor, NULL, file, line, function);
1325}
struct ast_channel * __ast_channel_internal_alloc_with_initializers(void(*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const struct ast_channel_initializers *initializers, const char *file, int line, const char *function)
#define NULL
Definition resample.c:96

References __ast_channel_internal_alloc_with_initializers(), and NULL.

Referenced by __ast_dummy_channel_alloc().

◆ __ast_channel_internal_alloc_with_initializers()

struct ast_channel * __ast_channel_internal_alloc_with_initializers ( void(*)(void *obj)  destructor,
const struct ast_assigned_ids assignedids,
const struct ast_channel requestor,
const struct ast_channel_initializers initializers,
const char *  file,
int  line,
const char *  function 
)

Definition at line 1244 of file channel_internal_api.c.

1246{
1247 struct ast_channel *tmp;
1248
1249 tmp = __ao2_alloc(sizeof(*tmp), destructor,
1250 AO2_ALLOC_OPT_LOCK_MUTEX, "", file, line, function);
1251
1252 if (!tmp) {
1253 return NULL;
1254 }
1255
1256 if ((ast_string_field_init(tmp, 128))) {
1257 return ast_channel_unref(tmp);
1258 }
1259
1262 if (!tmp->dialed_causes) {
1263 return ast_channel_unref(tmp);
1264 }
1265
1266 /* Check initializers validity here for early abort. Unfortunately, we can't do much here because
1267 * tenant ID is part of linked ID, which would overwrite it further down. */
1268 if (initializers) {
1269 if (initializers->version == 0) {
1270 ast_log(LOG_ERROR, "Channel initializers must have a non-zero version.\n");
1271 return ast_channel_unref(tmp);
1272 } else if (initializers->version != AST_CHANNEL_INITIALIZERS_VERSION) {
1273 ast_log(LOG_ERROR, "ABI mismatch for ast_channel_initializers. "
1274 "Please ensure all modules were compiled for "
1275 "this version of Asterisk.\n");
1276 return ast_channel_unref(tmp);
1277 }
1278 }
1279
1280 /* set the creation time in the uniqueid */
1281 tmp->uniqueid.creation_time = time(NULL);
1283
1284 /* use provided id or default to historical {system-}time.# format */
1285 if (assignedids && !ast_strlen_zero(assignedids->uniqueid)) {
1286 ast_copy_string(tmp->uniqueid.unique_id, assignedids->uniqueid, sizeof(tmp->uniqueid.unique_id));
1288 snprintf(tmp->uniqueid.unique_id, sizeof(tmp->uniqueid.unique_id), "%li.%d",
1289 (long)(tmp->uniqueid.creation_time),
1291 } else {
1292 snprintf(tmp->uniqueid.unique_id, sizeof(tmp->uniqueid.unique_id), "%s-%li.%d",
1294 (long)(tmp->uniqueid.creation_time),
1296 }
1297
1298 /* copy linked id from parent channel if known */
1299 if (requestor) {
1300 tmp->linkedid = requestor->linkedid;
1301 } else {
1302 tmp->linkedid = tmp->uniqueid;
1303 }
1304
1305 /* Things like tenant ID need to be set here, otherwise they would be overwritten by
1306 * things like inheriting linked ID above. */
1307 if (initializers) {
1308 ast_copy_string(tmp->linkedid.tenant_id, initializers->tenantid, sizeof(tmp->linkedid.tenant_id));
1309 }
1310
1311 AST_VECTOR_INIT(&tmp->fds, AST_MAX_FDS);
1312
1313 /* Force all channel snapshot segments to be created on first use, so we don't have to check if
1314 * an old snapshot exists.
1315 */
1317
1318 return tmp;
1319}
#define ast_log
Definition astobj2.c:42
@ AO2_ALLOC_OPT_LOCK_MUTEX
Definition astobj2.h:363
void * __ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
Definition astobj2.c:768
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
Definition astobj2.h:1303
#define AST_CHANNEL_INITIALIZERS_VERSION
struct ABI version
Definition channel.h:620
#define AST_MAX_FDS
Definition channel.h:196
#define ast_channel_unref(c)
Decrease channel reference count.
Definition channel.h:3018
static int uniqueint
The monotonically increasing integer counter for channel uniqueids.
static int pvt_cause_cmp_fn(void *obj, void *vstr, int flags)
Comparison function for pvt cause code frames.
#define DIALED_CAUSES_BUCKETS
static int pvt_cause_hash_fn(const void *vpc, const int flags)
Hash function for pvt cause code frames.
#define LOG_ERROR
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition lock.h:764
const char * ast_config_AST_SYSTEM_NAME
Definition options.c:171
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition strings.h:425
const char * uniqueid
Definition channel.h:607
char unique_id[AST_MAX_UNIQUEID]
char tenant_id[AST_MAX_TENANT_ID]
const char * tenantid
Definition channel.h:626
uint32_t version
struct ABI version
Definition channel.h:625
struct ast_channel_id uniqueid
struct ao2_container * dialed_causes
struct ast_flags snapshot_segment_flags
struct ast_channel_id linkedid
#define ast_set_flag(p, flag)
Definition utils.h:71
#define AST_FLAGS_ALL
Definition utils.h:217
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
Definition vector.h:124

References __ao2_alloc(), AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ast_atomic_fetchadd_int(), AST_CHANNEL_INITIALIZERS_VERSION, ast_channel_unref, ast_config_AST_SYSTEM_NAME, ast_copy_string(), AST_FLAGS_ALL, ast_log, AST_MAX_FDS, ast_set_flag, ast_string_field_init, ast_strlen_zero(), AST_VECTOR_INIT, ast_channel_id::creation_time, ast_channel_id::creation_unique, ast_channel::dialed_causes, DIALED_CAUSES_BUCKETS, ast_channel::linkedid, LOG_ERROR, NULL, pvt_cause_cmp_fn(), pvt_cause_hash_fn(), ast_channel::snapshot_segment_flags, ast_channel_id::tenant_id, ast_channel_initializers::tenantid, ast_channel_id::unique_id, ast_assigned_ids::uniqueid, ast_channel::uniqueid, uniqueint, and ast_channel_initializers::version.

Referenced by __ast_channel_alloc_ap(), and __ast_channel_internal_alloc().

◆ ast_channel_adsicpe()

enum ast_channel_adsicpe ast_channel_adsicpe ( const struct ast_channel chan)

Definition at line 648 of file channel_internal_api.c.

649{
650 return chan->adsicpe;
651}
enum ast_channel_adsicpe adsicpe

References ast_channel::adsicpe.

◆ ast_channel_adsicpe_set()

void ast_channel_adsicpe_set ( struct ast_channel chan,
enum ast_channel_adsicpe  value 
)

◆ ast_channel_alert_writable()

int ast_channel_alert_writable ( struct ast_channel chan)

Definition at line 992 of file channel_internal_api.c.

993{
994 return ast_alertpipe_writable(chan->alertpipe);
995}
int attribute_pure ast_alertpipe_writable(int alert_pipe[2])
Determine if the alert pipe is writable.
Definition alertpipe.h:130

References ast_channel::alertpipe, and ast_alertpipe_writable().

Referenced by __ast_queue_frame().

◆ ast_channel_alert_write()

int ast_channel_alert_write ( struct ast_channel chan)

Definition at line 977 of file channel_internal_api.c.

978{
979 return ast_alertpipe_write(chan->alertpipe);
980}
ssize_t ast_alertpipe_write(int alert_pipe[2])
Write an event to an alert pipe.
Definition alertpipe.c:120

References ast_channel::alertpipe, and ast_alertpipe_write().

Referenced by __ast_queue_frame(), __ast_read(), and channel_do_masquerade().

◆ ast_channel_amaflags()

enum ama_flags ast_channel_amaflags ( const struct ast_channel chan)

◆ ast_channel_amaflags_set()

void ast_channel_amaflags_set ( struct ast_channel chan,
enum ama_flags  value 
)

◆ ast_channel_answertime()

struct timeval ast_channel_answertime ( struct ast_channel chan)

Definition at line 853 of file channel_internal_api.c.

854{
855 return chan->answertime;
856}
struct timeval answertime

Referenced by ast_channel_get_up_time_ms(), and set_channel_answer_time().

◆ ast_channel_answertime_set()

void ast_channel_answertime_set ( struct ast_channel chan,
struct timeval *  value 
)

Definition at line 858 of file channel_internal_api.c.

859{
860 chan->answertime = *value;
861}

References ast_channel::answertime, and value.

Referenced by set_channel_answer_time().

◆ ast_channel_appl()

const char * ast_channel_appl ( const struct ast_channel chan)

◆ ast_channel_appl_set()

void ast_channel_appl_set ( struct ast_channel chan,
const char *  value 
)

◆ ast_channel_audiohooks()

struct ast_audiohook_list * ast_channel_audiohooks ( const struct ast_channel chan)

◆ ast_channel_audiohooks_set()

void ast_channel_audiohooks_set ( struct ast_channel chan,
struct ast_audiohook_list value 
)

Definition at line 460 of file channel_internal_api.c.

461{
462 chan->audiohooks = value;
463}

References ast_channel::audiohooks, and value.

Referenced by __ast_read(), ast_audiohook_attach(), ast_write_stream(), and destroy_hooks().

◆ ast_channel_autochans()

struct ast_autochan_list * ast_channel_autochans ( struct ast_channel chan)

Definition at line 739 of file channel_internal_api.c.

740{
741 return &chan->autochans;
742}
struct ast_autochan_list autochans

References ast_channel::autochans.

Referenced by __ast_channel_alloc_ap(), ast_autochan_destroy(), ast_autochan_new_channel(), and ast_autochan_setup().

◆ ast_channel_blocker()

pthread_t ast_channel_blocker ( const struct ast_channel chan)

Definition at line 1080 of file channel_internal_api.c.

1081{
1082 return chan->blocker;
1083}
pthread_t blocker

References ast_channel::blocker.

Referenced by __ast_queue_frame(), ast_softhangup_nolock(), and channel_do_masquerade().

◆ ast_channel_blocker_set()

void ast_channel_blocker_set ( struct ast_channel chan,
pthread_t  value 
)

Definition at line 1084 of file channel_internal_api.c.

1085{
1086 chan->blocker = value;
1087}

References ast_channel::blocker, and value.

◆ ast_channel_blocker_tid()

int ast_channel_blocker_tid ( const struct ast_channel chan)

Definition at line 1089 of file channel_internal_api.c.

1090{
1091 return chan->blocker_tid;
1092}

References ast_channel::blocker_tid.

Referenced by ast_hangup().

◆ ast_channel_blocker_tid_set()

void ast_channel_blocker_tid_set ( struct ast_channel chan,
int  value 
)

Definition at line 1093 of file channel_internal_api.c.

1094{
1095 chan->blocker_tid = value;
1096}

References ast_channel::blocker_tid, and value.

◆ ast_channel_blockproc()

const char * ast_channel_blockproc ( const struct ast_channel chan)

Definition at line 197 of file channel_internal_api.c.

198{
199 return chan->blockproc;
200}
const char * blockproc

References ast_channel::blockproc.

Referenced by ast_hangup(), and serialize_showchan().

◆ ast_channel_blockproc_set()

void ast_channel_blockproc_set ( struct ast_channel chan,
const char *  value 
)

Definition at line 201 of file channel_internal_api.c.

202{
203 chan->blockproc = value;
204}

References ast_channel::blockproc, and value.

◆ ast_channel_caller()

struct ast_party_caller * ast_channel_caller ( struct ast_channel chan)

Definition at line 755 of file channel_internal_api.c.

756{
757 return &chan->caller;
758}
struct ast_party_caller caller
Channel Caller ID information.

References ast_channel::caller.

Referenced by __analog_handle_event(), __analog_ss_thread(), __ast_channel_alloc_ap(), __ast_goto_if_exists(), __ast_pbx_run(), action_meetmelist(), after_bridge_move_channel(), agent_request_exec(), analog_ss_thread(), app_exec(), ast_app_dtget(), ast_ari_channels_dial(), ast_bridge_setup_after_goto(), ast_cel_fabricate_channel_from_event(), ast_channel_destructor(), ast_channel_set_caller(), ast_channel_set_caller_event(), ast_do_pickup(), ast_dummy_channel_destructor(), ast_iax2_new(), ast_pbx_h_exten_run(), ast_set_callerid(), ast_str_retrieve_variable(), AST_TEST_DEFINE(), ast_unreal_call_setup(), ast_var_channels_table(), background_detect_exec(), begin_dial_prerun(), blacklist_read(), bridge_reconfigured_connected_line_update(), callerid_read(), callerid_write(), cc_generic_agent_init(), chan_pjsip_cng_tone_detected(), chan_pjsip_new(), channel_do_masquerade(), channel_snapshot_caller_create(), collect_digits(), console_call(), copy_caller_data(), copy_message(), dahdi_handle_dtmf(), dahdi_handle_event(), dahdi_new(), dial_exec_full(), dial_trunk(), dialog_info_generate_body_content(), disa_exec(), do_forward(), fax_detect_framehook(), find_matching_endif(), find_matching_endwhile(), findmeexec(), forward_message(), gosub_exec(), gosub_run(), grab_transfer(), handle_cli_confbridge_list_item(), handle_gosub(), handle_setpriority(), handle_showchan(), incoming_in_dialog_request(), isAnsweringMachine(), isexten_function_read(), launch_monitor_thread(), leave_voicemail(), leave_voicemail(), local_call(), manager_queues_status(), meetme_show_cmd(), minivm_greet_exec(), minivm_notify_exec(), my_get_callerid(), my_handle_dtmf(), onModeChanged(), ooh323_rtp_read(), originate_exec(), park_local_transfer(), pbx_builtin_background(), pbx_builtin_waitexten(), pbx_outgoing_attempt(), pbx_parse_location(), privacy_exec(), queue_connected_line_update(), queue_exec(), readexten_exec(), recalling_enter(), ring_entry(), run_externnotify(), serialize_showchan(), setup_env(), setup_privacy_args(), sla_ring_station(), sms_exec(), socket_process_helper(), start_automixmonitor(), try_calling(), unistim_new(), unreal_colp_redirect_indicate(), update_connected_line_from_peer(), update_connected_line_from_peer(), update_initial_connected_line(), valid_exit(), vm_authenticate(), wait_for_answer(), waitstream_core(), write_metadata(), and zapateller_exec().

◆ ast_channel_caller_set()

void ast_channel_caller_set ( struct ast_channel chan,
struct ast_party_caller value 
)

◆ ast_channel_callgroup()

ast_group_t ast_channel_callgroup ( const struct ast_channel chan)

◆ ast_channel_callgroup_set()

void ast_channel_callgroup_set ( struct ast_channel chan,
ast_group_t  value 
)
Precondition
chan is locked

Definition at line 945 of file channel_internal_api.c.

946{
947 chan->callgroup = value;
948}

References ast_channel::callgroup, and value.

Referenced by chan_pjsip_new(), dahdi_new(), func_channel_write_real(), jingle_new(), and unistim_new().

◆ ast_channel_callid()

ast_callid ast_channel_callid ( const struct ast_channel chan)

◆ ast_channel_callid_cleanup()

void ast_channel_callid_cleanup ( struct ast_channel chan)

Definition at line 935 of file channel_internal_api.c.

936{
937 chan->callid = 0;
938}

References ast_channel::callid.

Referenced by ast_channel_destructor().

◆ ast_channel_callid_set()

void ast_channel_callid_set ( struct ast_channel chan,
ast_callid  value 
)
Precondition
chan is locked

Definition at line 664 of file channel_internal_api.c.

665{
666 char call_identifier_from[AST_CALLID_BUFFER_LENGTH];
667 char call_identifier_to[AST_CALLID_BUFFER_LENGTH];
668 call_identifier_from[0] = '\0';
669 ast_callid_strnprint(call_identifier_to, sizeof(call_identifier_to), callid);
670 if (chan->callid) {
671 ast_callid_strnprint(call_identifier_from, sizeof(call_identifier_from), chan->callid);
672 ast_debug(3, "Channel Call ID changing from %s to %s\n", call_identifier_from, call_identifier_to);
673 }
674
675 chan->callid = callid;
676
677 ast_test_suite_event_notify("CallIDChange",
678 "State: CallIDChange\r\n"
679 "Channel: %s\r\n"
680 "CallID: %s\r\n"
681 "PriorCallID: %s",
682 ast_channel_name(chan),
683 call_identifier_to,
684 call_identifier_from);
685}
const char * ast_channel_name(const struct ast_channel *chan)
void ast_callid_strnprint(char *buffer, size_t buffer_size, ast_callid callid)
copy a string representation of the callid into a target string
Definition logger.c:2258
#define ast_debug(level,...)
Log a DEBUG message.
#define AST_CALLID_BUFFER_LENGTH
#define ast_test_suite_event_notify(s, f,...)
Definition test.h:189

References AST_CALLID_BUFFER_LENGTH, ast_callid_strnprint(), ast_channel_name(), ast_debug, ast_test_suite_event_notify, and ast_channel::callid.

Referenced by __ast_pbx_run(), ast_iax2_new(), ast_unreal_channel_push_to_bridge(), ast_unreal_new_channels(), common_recall_channel_setup(), dahdi_new(), iax2_request(), jingle_new(), and request_channel().

◆ ast_channel_cdr()

struct ast_cdr * ast_channel_cdr ( const struct ast_channel chan)

Definition at line 464 of file channel_internal_api.c.

465{
466 return chan->cdr;
467}
struct ast_cdr * cdr

References ast_channel::cdr.

Referenced by ast_channel_destructor(), ast_channel_log(), ast_dummy_channel_destructor(), cdr_read_callback(), and cdr_retrieve_time().

◆ ast_channel_cdr_set()

void ast_channel_cdr_set ( struct ast_channel chan,
struct ast_cdr value 
)

Definition at line 468 of file channel_internal_api.c.

469{
470 chan->cdr = value;
471}

References ast_channel::cdr, and value.

Referenced by ast_channel_destructor(), ast_dummy_channel_destructor(), custom_log(), manager_log(), and write_cdr().

◆ ast_channel_connected()

struct ast_party_connected_line * ast_channel_connected ( struct ast_channel chan)

◆ ast_channel_connected_effective_id()

struct ast_party_id ast_channel_connected_effective_id ( struct ast_channel chan)

Definition at line 767 of file channel_internal_api.c.

768{
769 return ast_party_id_merge(&chan->connected.id, &chan->connected.priv);
770}
struct ast_party_id ast_party_id_merge(struct ast_party_id *base, struct ast_party_id *overlay)
Merge a given party id into another given party id.
Definition channel.c:1888
struct ast_party_id priv
Private connected party ID.
Definition channel.h:470
struct ast_party_id id
Connected party ID.
Definition channel.h:460

References ast_party_id_merge().

Referenced by caller_id_outgoing_request(), caller_id_outgoing_response(), generate_status(), handle_showchan(), is_colp_update_allowed(), set_from_header(), and stir_shaken_outgoing_request().

◆ ast_channel_connected_indicated()

struct ast_party_connected_line * ast_channel_connected_indicated ( struct ast_channel chan)

Definition at line 763 of file channel_internal_api.c.

764{
765 return &chan->connected_indicated;
766}
struct ast_party_connected_line connected_indicated
Channel Connected Line ID information that was last indicated.

References ast_channel::connected_indicated.

Referenced by __ast_channel_alloc_ap(), after_bridge_move_channel(), ast_channel_destructor(), ast_dummy_channel_destructor(), and indicate_connected_line().

◆ ast_channel_connected_set()

void ast_channel_connected_set ( struct ast_channel chan,
struct ast_party_connected_line value 
)

◆ ast_channel_context()

const char * ast_channel_context ( const struct ast_channel chan)

Definition at line 215 of file channel_internal_api.c.

216{
217 return chan->context;
218}
char context[AST_MAX_CONTEXT]

References ast_channel::context.

Referenced by __analog_ss_thread(), __ast_goto_if_exists(), __ast_pbx_run(), _while_exec(), action_blind_transfer(), action_bridge(), action_dialplan_exec(), analog_ss_thread(), ast_bridge_setup_after_goto(), ast_call_forward(), ast_cc_call_init(), ast_channel_log(), ast_channel_yank(), ast_pbx_h_exten_run(), ast_str_retrieve_variable(), AST_TEST_DEFINE(), ast_var_channels_table(), ast_waitstream_exten(), background_detect_exec(), blind_transfer_exec(), bridge_exec(), by_exten_cb(), cc_generic_agent_init(), cc_interfaces_datastore_init(), chan_pjsip_cng_tone_detected(), channel_snapshot_dialplan_create(), channelstorage_exten_cb(), collect_digits(), common_exec(), conf_run(), dahdi_handle_dtmf(), dial_exec_full(), dialout(), do_forward(), eval_exten_read(), expand_gosub_args(), extenspy_exec(), fax_detect_framehook(), feature_blind_transfer(), find_matching_endif(), find_matching_endwhile(), forward_message(), func_channel_read(), func_channel_write_real(), get_cid_name(), get_transfer_context(), gosub_exec(), gosub_run(), goto_exten(), goto_parser(), handle_call_forward(), handle_gosub(), handle_setpriority(), handle_showchan(), iax2_call(), if_helper(), launch_monitor_thread(), leave_voicemail(), leave_voicemail(), log_exec(), lua_pbx_exec(), minivm_greet_exec(), my_handle_dtmf(), onedigit_goto(), onModeChanged(), ooh323_rtp_read(), pbx_builtin_background(), pbx_builtin_goto(), pbx_builtin_setvar_multiple(), pbx_builtin_waitexten(), pbx_extension_helper(), pbx_parse_location(), pickup_exec(), raise_exception(), readexten_exec(), realtime_exec(), ring_entry(), serialize_showchan(), setup_env(), setup_peer_after_bridge_goto(), setup_peer_after_bridge_goto(), try_calling(), vm_authenticate(), vm_execmain(), vmauthenticate(), and wait_for_answer().

◆ ast_channel_context_set()

void ast_channel_context_set ( struct ast_channel chan,
const char *  value 
)

◆ ast_channel_creationtime()

struct timeval ast_channel_creationtime ( struct ast_channel chan)

◆ ast_channel_creationtime_set()

void ast_channel_creationtime_set ( struct ast_channel chan,
struct timeval *  value 
)

◆ ast_channel_data()

const char * ast_channel_data ( const struct ast_channel chan)

◆ ast_channel_data_set()

void ast_channel_data_set ( struct ast_channel chan,
const char *  value 
)

◆ ast_channel_datastores()

struct ast_datastore_list * ast_channel_datastores ( struct ast_channel chan)

◆ ast_channel_dialed()

struct ast_party_dialed * ast_channel_dialed ( struct ast_channel chan)

◆ ast_channel_dialed_causes_add()

int ast_channel_dialed_causes_add ( const struct ast_channel chan,
const struct ast_control_pvt_cause_code cause_code,
int  datalen 
)

Add cause code information to the channel.

Since
11

This function makes use of datastore operations on the channel, so it is important to lock the channel before calling this function. The passed in data is copied and so is still owned by the caller.

Parameters
chanThe channel on which to add information
cause_codeThe cause information to be added to the channel
datalenThe total length of the structure since its length is variable
Return values
0on success
-1on error

Definition at line 1203 of file channel_internal_api.c.

1204{
1205 struct ast_control_pvt_cause_code *ao2_cause_code;
1206 char *arg = ast_strdupa(cause_code->chan_name);
1207
1209
1210 ao2_cause_code = ao2_alloc(datalen, NULL);
1211 if (ao2_cause_code) {
1212 memcpy(ao2_cause_code, cause_code, datalen);
1213 ao2_link(chan->dialed_causes, ao2_cause_code);
1214 ao2_ref(ao2_cause_code, -1);
1215 return 0;
1216 }
1217
1218 return -1;
1219}
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition astmm.h:298
#define ao2_link(container, obj)
Add an object to a container.
Definition astobj2.h:1532
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
Definition astobj2.h:1693
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition astobj2.h:459
@ OBJ_NODATA
Definition astobj2.h:1044
@ OBJ_MULTIPLE
Definition astobj2.h:1049
@ OBJ_UNLINK
Definition astobj2.h:1039
#define ao2_alloc(data_size, destructor_fn)
Definition astobj2.h:409
static int remove_dialstatus_cb(void *obj, void *arg, int flags)

References ao2_alloc, ao2_callback, ao2_link, ao2_ref, ast_strdupa, ast_control_pvt_cause_code::chan_name, ast_channel::dialed_causes, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, and remove_dialstatus_cb().

Referenced by ast_channel_hangupcause_hash_set().

◆ ast_channel_dialed_causes_channels()

struct ast_str * ast_channel_dialed_causes_channels ( const struct ast_channel chan)

Retrieve a comma-separated list of channels for which dialed cause information is available.

Since
11

This function makes use of datastore operations on the channel, so it is important to lock the channel before calling this function.

Parameters
chanThe channel from which to retrieve information
Return values
NULLon allocation failure
Pointerto an ast_str object containing the desired information which must be freed

Definition at line 1142 of file channel_internal_api.c.

1143{
1144 struct ast_str *chanlist = ast_str_create(128);
1145
1146 if (!chanlist) {
1147 return NULL;
1148 }
1149
1151
1152 return chanlist;
1153}
static int collect_names_cb(void *obj, void *arg, int flags)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
Definition strings.h:659
Support for dynamic strings.
Definition strings.h:623
List of channel drivers.
Definition app_dial.c:804

References ao2_callback, ast_str_create, collect_names_cb(), ast_channel::dialed_causes, and NULL.

Referenced by hangupcause_keys_read().

◆ ast_channel_dialed_causes_clear()

void ast_channel_dialed_causes_clear ( const struct ast_channel chan)

Clear all cause information from the channel.

Since
11

This function makes use of datastore operations on the channel, so it is important to lock the channel before calling this function.

Parameters
chanThe channel from which to clear information

Definition at line 1221 of file channel_internal_api.c.

References ao2_callback, ast_channel::dialed_causes, NULL, OBJ_MULTIPLE, OBJ_NODATA, and OBJ_UNLINK.

Referenced by hangupcause_clear_exec().

◆ ast_channel_dialed_causes_find()

struct ast_control_pvt_cause_code * ast_channel_dialed_causes_find ( const struct ast_channel chan,
const char *  chan_name 
)

Retrieve a ref-counted cause code information structure.

Since
11

This function makes use of datastore operations on the channel, so it is important to lock the channel before calling this function. This function increases the ref count of the returned object, so the calling function must decrease the reference count when it is finished with the object.

Parameters
chanThe channel from which to retrieve information
chan_nameThe name of the channel about which to retrieve information
Return values
NULLon search failure
Pointerto a ref-counted ast_control_pvt_cause_code object containing the desired information

Definition at line 1155 of file channel_internal_api.c.

1156{
1157 struct ao2_iterator causes;
1158 struct ast_control_pvt_cause_code *cause_code;
1159
1161 while ((cause_code = ao2_iterator_next(&causes))) {
1162 if (strcmp(cause_code->chan_name, chan_name)) {
1163 ao2_ref(cause_code, -1);
1164 continue;
1165 }
1166 if (!cause_code->cause_extended) {
1168 return cause_code;
1169 }
1170 ao2_ref(cause_code, -1);
1171 }
1173
1174 return NULL;
1175}
#define ao2_iterator_next(iter)
Definition astobj2.h:1911
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
static const struct causes_map causes[]
Definition channel.c:136
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Definition astobj2.h:1821

References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_control_pvt_cause_code::cause_extended, causes, ast_control_pvt_cause_code::chan_name, ast_channel::dialed_causes, and NULL.

Referenced by hangupcause_read().

◆ ast_channel_dialed_causes_find_multiple()

struct ao2_iterator * ast_channel_dialed_causes_find_multiple ( const struct ast_channel chan,
const char *  chan_name 
)

Retrieve a ref-counted cause code information structure iterator.

Since
20.17.0, 22.8.0, 23.1.0

This function makes use of datastore operations on the channel, so it is important to lock the channel before calling this function. This function increases the ref count of the returned object, so the calling function must decrease the reference count when it is finished with the object.

Parameters
chanThe channel from which to retrieve information
chan_nameThe name of the channel about which to retrieve information
Return values
NULLon search failure
Pointerto a ao2_iterator object containing the desired information

Definition at line 1177 of file channel_internal_api.c.

1178{
1179 struct ao2_iterator *causes;
1180 struct ast_control_pvt_cause_code *cause_code;
1181
1183 while ((cause_code = ao2_iterator_next(causes))) {
1184 ao2_ref(cause_code, -1);
1185 }
1187
1189}
#define ao2_find(container, arg, flags)
Definition astobj2.h:1736
@ OBJ_SEARCH_KEY
The arg parameter is a search key, but is not an object.
Definition astobj2.h:1101

References ao2_find, ao2_iterator_destroy(), ao2_iterator_next, ao2_ref, causes, ast_control_pvt_cause_code::chan_name, ast_channel::dialed_causes, OBJ_MULTIPLE, and OBJ_SEARCH_KEY.

Referenced by hangupcause_read().

◆ ast_channel_dialed_set()

void ast_channel_dialed_set ( struct ast_channel chan,
struct ast_party_dialed value 
)

◆ ast_channel_dtmf_digit_to_emulate()

char ast_channel_dtmf_digit_to_emulate ( const struct ast_channel chan)

Definition at line 250 of file channel_internal_api.c.

251{
252 return chan->dtmf_digit_to_emulate;
253}
char dtmf_digit_to_emulate

References ast_channel::dtmf_digit_to_emulate.

Referenced by __ast_read().

◆ ast_channel_dtmf_digit_to_emulate_set()

void ast_channel_dtmf_digit_to_emulate_set ( struct ast_channel chan,
char  value 
)

Definition at line 254 of file channel_internal_api.c.

255{
257}

References ast_channel::dtmf_digit_to_emulate, and value.

Referenced by __ast_read().

◆ ast_channel_dtmf_tv()

struct timeval * ast_channel_dtmf_tv ( struct ast_channel chan)

Definition at line 791 of file channel_internal_api.c.

792{
793 return &chan->dtmf_tv;
794}
struct timeval dtmf_tv

References ast_channel::dtmf_tv.

Referenced by __ast_read(), should_skip_dtmf(), and should_trigger_dtmf_emulating().

◆ ast_channel_dtmf_tv_set()

void ast_channel_dtmf_tv_set ( struct ast_channel chan,
struct timeval *  value 
)

Definition at line 831 of file channel_internal_api.c.

832{
833 chan->dtmf_tv = *value;
834}

References ast_channel::dtmf_tv, and value.

Referenced by __ast_read().

◆ ast_channel_dtmff()

struct ast_frame * ast_channel_dtmff ( struct ast_channel chan)

Definition at line 747 of file channel_internal_api.c.

748{
749 return &chan->dtmff;
750}
struct ast_frame dtmff

References ast_channel::dtmff.

Referenced by __ast_read(), and queue_dtmf_readq().

◆ ast_channel_dtmff_set()

void ast_channel_dtmff_set ( struct ast_channel chan,
struct ast_frame value 
)

Definition at line 803 of file channel_internal_api.c.

804{
805 chan->dtmff = *value;
806}

References ast_channel::dtmff, and value.

◆ ast_channel_emulate_dtmf_duration()

unsigned int ast_channel_emulate_dtmf_duration ( const struct ast_channel chan)

Definition at line 381 of file channel_internal_api.c.

382{
383 return chan->emulate_dtmf_duration;
384}
unsigned int emulate_dtmf_duration

References ast_channel::emulate_dtmf_duration.

Referenced by __ast_read().

◆ ast_channel_emulate_dtmf_duration_set()

void ast_channel_emulate_dtmf_duration_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 385 of file channel_internal_api.c.

386{
388}

References ast_channel::emulate_dtmf_duration, and value.

Referenced by __ast_read().

◆ ast_channel_endpoint()

struct ast_endpoint * ast_channel_endpoint ( const struct ast_channel chan)

Definition at line 1620 of file channel_internal_api.c.

1621{
1622 return chan->endpoint;
1623}
struct ast_endpoint * endpoint

References ast_channel::endpoint.

◆ ast_channel_endpoint_set()

void ast_channel_endpoint_set ( struct ast_channel chan,
struct ast_endpoint endpoint 
)

Definition at line 1625 of file channel_internal_api.c.

1626{
1627 if (chan->endpoint) {
1629 ao2_ref(chan->endpoint, -1);
1630 }
1631
1632 chan->endpoint = ao2_bump(endpoint);
1633
1634 if (chan->endpoint) {
1636 }
1637}
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
Definition astobj2.h:480
int ast_endpoint_add_channel(struct ast_endpoint *endpoint, struct ast_channel *chan)
Adds a channel to the given endpoint.
int ast_endpoint_remove_channel(struct ast_endpoint *endpoint, struct ast_channel *chan)
Removes a channel from the given endpoint.

References ao2_bump, ao2_ref, ast_endpoint_add_channel(), ast_endpoint_remove_channel(), and ast_channel::endpoint.

Referenced by __ast_channel_alloc_ap(), and ast_channel_destructor().

◆ ast_channel_exten()

const char * ast_channel_exten ( const struct ast_channel chan)

Definition at line 232 of file channel_internal_api.c.

233{
234 return chan->exten;
235}
char exten[AST_MAX_EXTENSION]

References ast_channel::exten.

Referenced by __ast_goto_if_exists(), __ast_pbx_run(), _while_exec(), action_bridge(), action_dialplan_exec(), ast_bridge_setup_after_goto(), ast_cc_call_init(), ast_channel_log(), ast_channel_yank(), ast_pbx_h_exten_run(), ast_str_retrieve_variable(), AST_TEST_DEFINE(), ast_var_channels_table(), bridge_exec(), by_exten_cb(), cc_generic_agent_init(), cc_interfaces_datastore_init(), chan_pjsip_cng_tone_detected(), channel_snapshot_dialplan_create(), channelstorage_exten_cb(), dahdi_handle_dtmf(), dial_exec_full(), do_forward(), eval_exten_read(), expand_gosub_args(), fax_detect_framehook(), feature_blind_transfer(), find_matching_endif(), find_matching_endwhile(), forward_message(), func_channel_read(), func_channel_write_real(), get_cid_name(), gosub_exec(), gosub_run(), goto_parser(), handle_frame(), handle_gosub(), handle_setpriority(), handle_showchan(), if_helper(), launch_monitor_thread(), leave_voicemail(), leave_voicemail(), log_exec(), lua_pbx_exec(), my_handle_dtmf(), onModeChanged(), ooh323_rtp_read(), pbx_builtin_goto(), pbx_builtin_setvar_multiple(), pbx_builtin_waitexten(), pbx_extension_helper(), pbx_parse_location(), raise_exception(), realtime_exec(), ring_entry(), serialize_showchan(), setup_env(), setup_peer_after_bridge_goto(), setup_peer_after_bridge_goto(), setup_privacy_args(), try_calling(), and wait_for_answer().

◆ ast_channel_exten_set()

void ast_channel_exten_set ( struct ast_channel chan,
const char *  value 
)

Definition at line 240 of file channel_internal_api.c.

241{
242 if (!*chan->lastexten || strcmp(value, chan->exten)) {
243 /* only copy to last exten when it changes, unless it's empty to begin with */
244 ast_copy_string(chan->lastexten, chan->exten, sizeof(chan->lastexten));
245 }
246 ast_copy_string(chan->exten, value, sizeof(chan->exten));
248}
char lastexten[AST_MAX_EXTENSION]

References AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN, ast_channel_snapshot_invalidate_segment(), ast_copy_string(), ast_channel::exten, ast_channel::lastexten, and value.

Referenced by __analog_ss_thread(), __ast_channel_alloc_ap(), __ast_request_and_dial(), action_dialplan_exec(), analog_ss_thread(), ari_originate_dial(), ast_add_extension2_lockopt(), ast_bridge_setup_after_goto(), ast_cel_fabricate_channel_from_event(), ast_explicit_goto(), ast_iax2_new(), ast_pbx_h_exten_run(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), dahdi_new(), dial_exec_full(), dialout(), do_monitor_headset(), do_notify(), forward_message(), generic_recall(), gosub_exec(), gosub_run(), handle_gosub(), handle_response_cmgr(), handle_setextension(), jingle_new(), leave_voicemail(), minivm_greet_exec(), ooh323_new(), pbx_builtin_background(), pbx_extension_helper(), pbx_outgoing_exec(), return_exec(), ring_entry(), select_entry(), set_ext_pri(), unistim_ss(), and wait_for_answer().

◆ ast_channel_fd()

int ast_channel_fd ( const struct ast_channel chan,
int  which 
)

Definition at line 1053 of file channel_internal_api.c.

1054{
1055 return (which >= AST_VECTOR_SIZE(&chan->fds)) ? -1 : AST_VECTOR_GET(&chan->fds, which);
1056}
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
Definition vector.h:620
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.
Definition vector.h:691

References AST_VECTOR_GET, and AST_VECTOR_SIZE.

Referenced by __dahdi_exception(), analog_exception(), ast_channel_fd_isset(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), ast_waitfor_nandfds(), build_conf(), channel_do_masquerade(), conf_run(), flash_exec(), meetme_menu_admin_extended(), native_chan_changed(), native_start(), serialize_showchan(), and swap_subs().

◆ ast_channel_fd_add()

int ast_channel_fd_add ( struct ast_channel chan,
int  value 
)

Add a file descriptor to the channel without a fixed position.

Since
15
Parameters
chanThe channel to add the file descriptor to
valueThe file descriptor
Precondition
chan is locked
Returns
The position of the file descriptor

Definition at line 1067 of file channel_internal_api.c.

1068{
1069 int pos = AST_EXTENDED_FDS;
1070
1071 while (ast_channel_fd_isset(chan, pos)) {
1072 pos += 1;
1073 }
1074
1075 AST_VECTOR_REPLACE(&chan->fds, pos, value);
1076
1077 return pos;
1078}
#define AST_EXTENDED_FDS
Definition channel.h:197
int ast_channel_fd_isset(const struct ast_channel *chan, int which)
#define AST_VECTOR_REPLACE(vec, idx, elem)
Replace an element at a specific position in a vector, growing the vector if needed.
Definition vector.h:295

References ast_channel_fd_isset(), AST_EXTENDED_FDS, AST_VECTOR_REPLACE, and value.

Referenced by AST_TEST_DEFINE().

◆ ast_channel_fd_count()

int ast_channel_fd_count ( const struct ast_channel chan)

Retrieve the number of file decriptor positions present on the channel.

Since
15
Parameters
chanThe channel to get the count of
Precondition
chan is locked
Returns
The number of file descriptor positions

Definition at line 1062 of file channel_internal_api.c.

1063{
1064 return AST_VECTOR_SIZE(&chan->fds);
1065}

References AST_VECTOR_SIZE.

Referenced by AST_TEST_DEFINE(), ast_waitfor_nandfds(), and channel_do_masquerade().

◆ ast_channel_fd_isset()

int ast_channel_fd_isset ( const struct ast_channel chan,
int  which 
)

Definition at line 1057 of file channel_internal_api.c.

1058{
1059 return ast_channel_fd(chan, which) > -1;
1060}
int ast_channel_fd(const struct ast_channel *chan, int which)

References ast_channel_fd().

Referenced by __ast_read(), and ast_channel_fd_add().

◆ ast_channel_fdno()

int ast_channel_fdno ( const struct ast_channel chan)

◆ ast_channel_fdno_set()

void ast_channel_fdno_set ( struct ast_channel chan,
int  value 
)

Definition at line 294 of file channel_internal_api.c.

295{
296 chan->fdno = value;
297}

References ast_channel::fdno, and value.

Referenced by __ast_read(), ast_settimeout_full(), ast_waitfor_nandfds(), channel_do_masquerade(), and read_test().

◆ ast_channel_fin()

unsigned int ast_channel_fin ( const struct ast_channel chan)

Definition at line 389 of file channel_internal_api.c.

390{
391 return chan->fin;
392}
unsigned int fin

References ast_channel::fin.

Referenced by __ast_read(), channel_set_debug(), and serialize_showchan().

◆ ast_channel_fin_set()

void ast_channel_fin_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 393 of file channel_internal_api.c.

394{
395 chan->fin = value;
396}

References ast_channel::fin, and value.

Referenced by __ast_channel_alloc_ap(), __ast_read(), and channel_set_debug().

◆ ast_channel_flags()

struct ast_flags * ast_channel_flags ( struct ast_channel chan)

Definition at line 1127 of file channel_internal_api.c.

1128{
1129 return &chan->flags;
1130}
struct ast_flags flags

References ast_channel::flags.

Referenced by __analog_ss_thread(), __ast_pbx_run(), __ast_queue_frame(), __ast_read(), __ast_request_and_dial(), action_bridge(), action_redirect(), agent_request_exec(), analog_ss_thread(), ari_channels_handle_originate_with_id(), ast_async_goto(), ast_audiohook_attach(), ast_autoservice_start(), ast_autoservice_stop(), ast_bridge_channel_playfile(), ast_bridge_join(), ast_bridge_setup_after_goto(), ast_call(), ast_can_pickup(), ast_channel_clear_flag(), ast_channel_defer_dtmf(), ast_channel_destructor(), ast_channel_end_dtmf(), ast_channel_move(), ast_channel_publish_snapshot(), ast_channel_set_flag(), ast_channel_snapshot_create(), ast_channel_stage_snapshot(), ast_channel_stage_snapshot_done(), ast_channel_yank(), ast_explicit_goto(), ast_hangup(), ast_iax2_new(), ast_indicate_data(), ast_pbx_h_exten_run(), ast_raw_answer_with_stream_topology(), ast_readstring_full(), ast_sendtext_data(), ast_setstate(), ast_settimeout_full(), ast_softhangup_nolock(), ast_streamfile(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), ast_transfer_protocol(), ast_unreal_new_channels(), ast_var_channels_table(), ast_waitfor_nandfds(), ast_waitfordigit_full(), ast_write_stream(), bridge_channel_internal_join(), bridge_channel_internal_pull(), bridge_impart_internal(), bridge_reconfigured_connected_line_update(), call_forward_inherit(), channel_do_masquerade(), channel_spy(), common_exec(), dahdi_new(), dahdi_read(), deactivate_generator_nolock(), dial_exec_full(), eivr_comm(), gosub_exec(), gosub_run(), handle_exec(), handle_gosub(), limits_interval_playback(), linear_alloc(), local_ast_moh_start(), local_ast_moh_stop(), optimize_lock_chan_stack(), optimize_lock_peer_stack(), pbx_builtin_background(), pbx_outgoing_attempt(), playtones_alloc(), retrydial_exec(), return_exec(), serialize_showchan(), should_skip_dtmf(), should_trigger_dtmf_emulating(), tonepair_alloc(), and waitstream_core().

◆ ast_channel_forward_endpoint()

int ast_channel_forward_endpoint ( struct ast_channel chan,
struct ast_endpoint endpoint 
)

Forward channel stasis messages to the given endpoint.

Since
12
Parameters
chanThe channel to forward from
endpointThe endpoint to forward to
Return values
0Success
non-zeroFailure

Definition at line 1467 of file channel_internal_api.c.

1469{
1470 ast_assert(chan != NULL);
1471 ast_assert(endpoint != NULL);
1472
1473 chan->endpoint_forward =
1475 ast_endpoint_topic(endpoint));
1476 if (!chan->endpoint_forward) {
1477 return -1;
1478 }
1479
1480 return 0;
1481}
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
struct stasis_topic * ast_endpoint_topic(struct ast_endpoint *endpoint)
Returns the topic for a specific endpoint.
struct stasis_forward * stasis_forward_all(struct stasis_topic *from_topic, struct stasis_topic *to_topic)
Create a subscription which forwards all messages from one topic to another.
Definition stasis.c:1645
struct stasis_forward * endpoint_forward

References ast_assert, ast_channel_topic(), ast_endpoint_topic(), ast_channel::endpoint_forward, NULL, and stasis_forward_all().

Referenced by ast_endpoint_add_channel().

◆ ast_channel_fout()

unsigned int ast_channel_fout ( const struct ast_channel chan)

Definition at line 397 of file channel_internal_api.c.

398{
399 return chan->fout;
400}
unsigned int fout

References ast_channel::fout.

Referenced by ast_write_stream(), channel_set_debug(), and serialize_showchan().

◆ ast_channel_fout_set()

void ast_channel_fout_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 401 of file channel_internal_api.c.

402{
403 chan->fout = value;
404}

References ast_channel::fout, and value.

Referenced by __ast_channel_alloc_ap(), ast_write_stream(), and channel_set_debug().

◆ ast_channel_framehooks()

struct ast_framehook_list * ast_channel_framehooks ( const struct ast_channel chan)

◆ ast_channel_framehooks_set()

void ast_channel_framehooks_set ( struct ast_channel chan,
struct ast_framehook_list value 
)

Definition at line 576 of file channel_internal_api.c.

577{
578 chan->framehooks = value;
579}

References ast_channel::framehooks, and value.

Referenced by ast_framehook_attach(), and ast_framehook_list_destroy().

◆ ast_channel_generator()

struct ast_generator * ast_channel_generator ( const struct ast_channel chan)

◆ ast_channel_generator_set()

void ast_channel_generator_set ( struct ast_channel chan,
struct ast_generator value 
)

Definition at line 584 of file channel_internal_api.c.

585{
586 chan->generator = value;
587}

References ast_channel::generator, and value.

Referenced by ast_activate_generator(), ast_hangup(), and deactivate_generator_nolock().

◆ ast_channel_generatordata()

void * ast_channel_generatordata ( const struct ast_channel chan)

◆ ast_channel_generatordata_set()

void ast_channel_generatordata_set ( struct ast_channel chan,
void *  value 
)

◆ ast_channel_get_default_stream()

struct ast_stream * ast_channel_get_default_stream ( struct ast_channel chan,
enum ast_media_type  type 
)

Retrieve the default stream of a specific media type on a channel.

Parameters
chanThe channel to get the stream from
typeThe media type of the default stream
Precondition
chan is locked
Return values
non-NULLsuccess
NULLfailure

Definition at line 1575 of file channel_internal_api.c.

1577{
1578 ast_assert(chan != NULL);
1580
1581 return chan->default_streams[type];
1582}
static const char type[]
@ AST_MEDIA_TYPE_END
Definition codec.h:36
struct ast_stream * default_streams[AST_MEDIA_TYPE_END]

References ast_assert, AST_MEDIA_TYPE_END, ast_channel::default_streams, NULL, and type.

Referenced by __ast_read(), ast_unreal_write_stream(), ast_write_stream(), and stream_echo_write_error().

◆ ast_channel_get_stream_topology()

struct ast_stream_topology * ast_channel_get_stream_topology ( const struct ast_channel chan)

◆ ast_channel_get_stream_topology_change_source()

void * ast_channel_get_stream_topology_change_source ( struct ast_channel chan)

Retrieve the source that initiated the last stream topology change.

Parameters
chanThe channel
Return values
Thechannel's stream topology change source

Definition at line 539 of file channel_internal_api.c.

540{
542}
void * stream_topology_change_source

References ast_channel::stream_topology_change_source.

Referenced by native_rtp_stream_topology_changed(), and simple_bridge_stream_topology_changed().

◆ ast_channel_hangup_handlers()

struct ast_hangup_handler_list * ast_channel_hangup_handlers ( struct ast_channel chan)

◆ ast_channel_hangupcause()

int ast_channel_hangupcause ( const struct ast_channel chan)

◆ ast_channel_hangupcause_set()

void ast_channel_hangupcause_set ( struct ast_channel chan,
int  value 
)

◆ ast_channel_hold_state()

int ast_channel_hold_state ( const struct ast_channel chan)

◆ ast_channel_hold_state_set()

void ast_channel_hold_state_set ( struct ast_channel chan,
int  value 
)

Definition at line 361 of file channel_internal_api.c.

362{
363 chan->hold_state = value;
364}

References ast_channel::hold_state, and value.

Referenced by __ast_channel_alloc_ap(), __ast_dummy_channel_alloc(), and indicate_data_internal().

◆ ast_channel_insmpl()

unsigned long ast_channel_insmpl ( const struct ast_channel chan)

Definition at line 405 of file channel_internal_api.c.

406{
407 return chan->insmpl;
408}
unsigned long insmpl

References ast_channel::insmpl.

◆ ast_channel_insmpl_set()

void ast_channel_insmpl_set ( struct ast_channel chan,
unsigned long  value 
)

Definition at line 409 of file channel_internal_api.c.

410{
411 chan->insmpl = value;
412}

References ast_channel::insmpl, and value.

◆ ast_channel_internal_alert_flush()

ast_alert_status_t ast_channel_internal_alert_flush ( struct ast_channel chan)

Definition at line 982 of file channel_internal_api.c.

983{
984 return ast_alertpipe_flush(chan->alertpipe);
985}
ast_alert_status_t ast_alertpipe_flush(int alert_pipe[2])
Consume all alerts written to the alert pipe.
Definition alertpipe.c:134

References ast_channel::alertpipe, and ast_alertpipe_flush().

Referenced by chan_cleanup().

◆ ast_channel_internal_alert_read()

ast_alert_status_t ast_channel_internal_alert_read ( struct ast_channel chan)

Definition at line 987 of file channel_internal_api.c.

988{
989 return ast_alertpipe_read(chan->alertpipe);
990}
ast_alert_status_t ast_alertpipe_read(int alert_pipe[2])
Read an event from an alert pipe.
Definition alertpipe.c:102

References ast_channel::alertpipe, and ast_alertpipe_read().

Referenced by __ast_queue_frame(), and __ast_read().

◆ ast_channel_internal_alert_readable()

int ast_channel_internal_alert_readable ( struct ast_channel chan)

Definition at line 997 of file channel_internal_api.c.

998{
999 return ast_alertpipe_readable(chan->alertpipe);
1000}
int attribute_pure ast_alertpipe_readable(int alert_pipe[2])
Determine if the alert pipe is readable.
Definition alertpipe.h:114

References ast_channel::alertpipe, and ast_alertpipe_readable().

◆ ast_channel_internal_alert_readfd()

int ast_channel_internal_alert_readfd ( struct ast_channel chan)

Definition at line 1017 of file channel_internal_api.c.

1018{
1019 return ast_alertpipe_readfd(chan->alertpipe);
1020}
int attribute_pure ast_alertpipe_readfd(int alert_pipe[2])
Get the alert pipe's read file descriptor.
Definition alertpipe.h:146

References ast_channel::alertpipe, and ast_alertpipe_readfd().

Referenced by __ast_channel_alloc_ap().

◆ ast_channel_internal_alertpipe_clear()

void ast_channel_internal_alertpipe_clear ( struct ast_channel chan)

Definition at line 1002 of file channel_internal_api.c.

1003{
1005}
void ast_alertpipe_clear(int alert_pipe[2])
Sets the alert pipe file descriptors to default values.
Definition alertpipe.h:98

References ast_channel::alertpipe, and ast_alertpipe_clear().

Referenced by __ast_channel_alloc_ap(), and __ast_dummy_channel_alloc().

◆ ast_channel_internal_alertpipe_close()

void ast_channel_internal_alertpipe_close ( struct ast_channel chan)

Definition at line 1007 of file channel_internal_api.c.

1008{
1010}
void ast_alertpipe_close(int alert_pipe[2])
Close an alert pipe.
Definition alertpipe.c:79

References ast_channel::alertpipe, and ast_alertpipe_close().

Referenced by ast_channel_destructor().

◆ ast_channel_internal_alertpipe_init()

int ast_channel_internal_alertpipe_init ( struct ast_channel chan)

Definition at line 1012 of file channel_internal_api.c.

1013{
1014 return ast_alertpipe_init(chan->alertpipe);
1015}
int ast_alertpipe_init(int alert_pipe[2])
Initialize an alert pipe.
Definition alertpipe.c:38

References ast_channel::alertpipe, and ast_alertpipe_init().

Referenced by __ast_channel_alloc_ap().

◆ ast_channel_internal_alertpipe_swap()

void ast_channel_internal_alertpipe_swap ( struct ast_channel chan1,
struct ast_channel chan2 
)

Swap the interal alertpipe between two channels.

Note
Handle all of the necessary locking before calling this

Definition at line 1022 of file channel_internal_api.c.

1023{
1024 ast_alertpipe_swap(chan1->alertpipe, chan2->alertpipe);
1025}
void ast_alertpipe_swap(int alert_pipe_1[2], int alert_pipe_2[2])
Swap the file descriptors from two alert pipes.
Definition alertpipe.h:161

References ast_channel::alertpipe, and ast_alertpipe_swap().

Referenced by channel_do_masquerade().

◆ ast_channel_internal_bridge()

struct ast_bridge * ast_channel_internal_bridge ( const struct ast_channel chan)

Definition at line 1107 of file channel_internal_api.c.

1108{
1109 return chan->bridge;
1110}
struct ast_bridge * bridge

References ast_channel::bridge.

Referenced by ast_channel_get_bridge(), ast_channel_is_bridged(), ast_unreal_fixup(), bridge_channel_internal_join(), and try_merge_optimize_out().

◆ ast_channel_internal_bridge_channel()

struct ast_bridge_channel * ast_channel_internal_bridge_channel ( const struct ast_channel chan)

◆ ast_channel_internal_bridge_channel_set()

void ast_channel_internal_bridge_channel_set ( struct ast_channel chan,
struct ast_bridge_channel value 
)

◆ ast_channel_internal_bridge_set()

void ast_channel_internal_bridge_set ( struct ast_channel chan,
struct ast_bridge value 
)

◆ ast_channel_internal_cleanup()

void ast_channel_internal_cleanup ( struct ast_channel chan)

Definition at line 1427 of file channel_internal_api.c.

1428{
1429 if (chan->dialed_causes) {
1430 ao2_t_ref(chan->dialed_causes, -1,
1431 "done with dialed causes since the channel is going away");
1432 chan->dialed_causes = NULL;
1433 }
1434
1436
1439
1440 ao2_cleanup(chan->topic);
1441 chan->topic = NULL;
1442
1444
1445 AST_VECTOR_FREE(&chan->fds);
1446}
#define ao2_t_ref(o, delta, tag)
Definition astobj2.h:460
#define ao2_cleanup(obj)
Definition astobj2.h:1934
void ast_channel_internal_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
Definition stasis.c:1615
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
struct stasis_topic * topic
struct stasis_forward * channel_forward
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
Definition vector.h:185

References ao2_cleanup, ao2_t_ref, ast_channel_internal_set_stream_topology(), ast_string_field_free_memory, AST_VECTOR_FREE, ast_channel::channel_forward, ast_channel::dialed_causes, ast_channel::endpoint_forward, NULL, stasis_forward_cancel(), and ast_channel::topic.

Referenced by ast_channel_destructor(), and ast_dummy_channel_destructor().

◆ ast_channel_internal_copy_linkedid()

void ast_channel_internal_copy_linkedid ( struct ast_channel dest,
struct ast_channel source 
)

Copy the full linkedid channel id structure from one channel to another.

Parameters
destDestination to copy linkedid to
sourceSource channel to copy linkedid from

Definition at line 1344 of file channel_internal_api.c.

1345{
1346 if (dest->linkedid.creation_time == source->linkedid.creation_time
1348 && !strcmp(dest->linkedid.unique_id, source->linkedid.unique_id)) {
1349 return;
1350 }
1351 dest->linkedid = source->linkedid;
1354}
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER

References ast_channel_publish_snapshot(), AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER, ast_channel_snapshot_invalidate_segment(), ast_channel_id::creation_time, ast_channel_id::creation_unique, ast_channel::linkedid, and ast_channel_id::unique_id.

Referenced by ast_bridge_channel_update_linkedids().

◆ ast_channel_internal_errno()

enum ast_channel_error ast_channel_internal_errno ( void  )

Definition at line 1529 of file channel_internal_api.c.

1530{
1531 enum ast_channel_error *error_code = ast_threadstorage_get(&channel_errno, sizeof(*error_code));
1532 if (!error_code) {
1534 }
1535
1536 return *error_code;
1537}
ast_channel_error
Definition channel.h:4903
@ AST_CHANNEL_ERROR_UNKNOWN
Definition channel.h:4905
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.

References AST_CHANNEL_ERROR_UNKNOWN, and ast_threadstorage_get().

Referenced by ast_channel_errno().

◆ ast_channel_internal_errno_set()

void ast_channel_internal_errno_set ( enum ast_channel_error  error)

Definition at line 1519 of file channel_internal_api.c.

1520{
1521 enum ast_channel_error *error_code = ast_threadstorage_get(&channel_errno, sizeof(*error_code));
1522 if (!error_code) {
1523 return;
1524 }
1525
1526 *error_code = error;
1527}
int error(const char *format,...)

References ast_threadstorage_get(), and error().

Referenced by __ast_channel_alloc_ap().

◆ ast_channel_internal_fd_clear()

void ast_channel_internal_fd_clear ( struct ast_channel chan,
int  which 
)

Definition at line 1041 of file channel_internal_api.c.

1042{
1043 if (which >= AST_VECTOR_SIZE(&chan->fds)) {
1044 return;
1045 }
1046
1047 AST_VECTOR_REPLACE(&chan->fds, which, -1);
1048}

References AST_VECTOR_REPLACE, and AST_VECTOR_SIZE.

Referenced by handle_negotiated_sdp().

◆ ast_channel_internal_fd_clear_all()

void ast_channel_internal_fd_clear_all ( struct ast_channel chan)

Definition at line 1049 of file channel_internal_api.c.

1050{
1052}
#define AST_VECTOR_RESET(vec, cleanup)
Reset vector.
Definition vector.h:636
#define AST_VECTOR_ELEM_CLEANUP_NOOP(elem)
Vector element cleanup that does nothing.
Definition vector.h:582

References AST_VECTOR_ELEM_CLEANUP_NOOP, and AST_VECTOR_RESET.

Referenced by __ast_channel_alloc_ap(), __ast_dummy_channel_alloc(), and channel_do_masquerade().

◆ ast_channel_internal_fd_set()

void ast_channel_internal_fd_set ( struct ast_channel chan,
int  which,
int  value 
)

Definition at line 1028 of file channel_internal_api.c.

1029{
1030 int pos;
1031
1032 /* This ensures that if the vector has to grow with unused positions they will be
1033 * initialized to -1.
1034 */
1035 for (pos = AST_VECTOR_SIZE(&chan->fds); pos < which; pos++) {
1036 AST_VECTOR_REPLACE(&chan->fds, pos, -1);
1037 }
1038
1039 AST_VECTOR_REPLACE(&chan->fds, which, value);
1040}

References AST_VECTOR_REPLACE, AST_VECTOR_SIZE, and value.

Referenced by ast_channel_set_fd(), handle_negotiated_sdp(), start_rtp(), swap_subs(), and unistim_new().

◆ ast_channel_internal_finalize()

void ast_channel_internal_finalize ( struct ast_channel chan)

Definition at line 1448 of file channel_internal_api.c.

1449{
1450 chan->finalized = 1;
1451}
unsigned int finalized

References ast_channel::finalized.

Referenced by __ast_channel_alloc_ap().

◆ ast_channel_internal_is_finalized()

int ast_channel_internal_is_finalized ( struct ast_channel chan)

Definition at line 1453 of file channel_internal_api.c.

1454{
1455 return chan->finalized;
1456}

References ast_channel::finalized.

Referenced by ast_channel_destructor().

◆ ast_channel_internal_oldest_linkedid()

struct ast_channel * ast_channel_internal_oldest_linkedid ( struct ast_channel a,
struct ast_channel b 
)

Determine which channel has an older linkedid.

Parameters
aFirst channel
bSecond channel
Returns
Returns an ast_channel structure that has oldest linkedid

Definition at line 1327 of file channel_internal_api.c.

1328{
1329 ast_assert(a->linkedid.creation_time != 0);
1330 ast_assert(b->linkedid.creation_time != 0);
1331
1332 if (a->linkedid.creation_time < b->linkedid.creation_time) {
1333 return a;
1334 }
1335 if (b->linkedid.creation_time < a->linkedid.creation_time) {
1336 return b;
1337 }
1338 if (a->linkedid.creation_unique < b->linkedid.creation_unique) {
1339 return a;
1340 }
1341 return b;
1342}
static struct test_val b
static struct test_val a

References a, ast_assert, and b.

Referenced by ast_bridge_channel_update_linkedids().

◆ ast_channel_internal_set_fake_ids()

void ast_channel_internal_set_fake_ids ( struct ast_channel chan,
const char *  uniqueid,
const char *  linkedid 
)

Set uniqueid and linkedid string value only (not time)

Parameters
chanThe channel to set the uniqueid to
uniqueidThe uniqueid to set
linkedidThe linkedid to set
Note
This is used only by ast_cel_fabricate_channel_from_event() to create a temporary fake channel - time values are invalid

Definition at line 1421 of file channel_internal_api.c.

1422{
1423 ast_copy_string(chan->uniqueid.unique_id, uniqueid, sizeof(chan->uniqueid.unique_id));
1424 ast_copy_string(chan->linkedid.unique_id, linkedid, sizeof(chan->linkedid.unique_id));
1425}

References ast_copy_string(), ast_channel::linkedid, ast_channel_id::unique_id, and ast_channel::uniqueid.

Referenced by ast_cel_fabricate_channel_from_event().

◆ ast_channel_internal_set_stream_topology()

void ast_channel_internal_set_stream_topology ( struct ast_channel chan,
struct ast_stream_topology topology 
)

Definition at line 525 of file channel_internal_api.c.

527{
529 chan->stream_topology = topology;
531}
static void channel_set_default_streams(struct ast_channel *chan)
void ast_stream_topology_free(struct ast_stream_topology *topology)
Unreference and destroy a stream topology.
Definition stream.c:746

References ast_stream_topology_free(), channel_set_default_streams(), and ast_channel::stream_topology.

Referenced by __ast_channel_alloc_ap(), ast_channel_internal_cleanup(), ast_channel_nativeformats_set(), and ast_channel_set_stream_topology().

◆ ast_channel_internal_set_stream_topology_change_source()

void ast_channel_internal_set_stream_topology_change_source ( struct ast_channel chan,
void *  change_source 
)

◆ ast_channel_internal_setup_topics()

int ast_channel_internal_setup_topics ( struct ast_channel chan)

Definition at line 1483 of file channel_internal_api.c.

1484{
1485 char *topic_name;
1486 int ret;
1487 ast_assert(chan->topic == NULL);
1488
1489 if (ast_strlen_zero(chan->uniqueid.unique_id)) {
1490 static int dummy_id;
1491 ret = ast_asprintf(&topic_name, "channel:dummy-%d", ast_atomic_fetchadd_int(&dummy_id, +1));
1492 } else {
1493 ret = ast_asprintf(&topic_name, "channel:%s", chan->uniqueid.unique_id);
1494 }
1495
1496 if (ret < 0) {
1497 return -1;
1498 }
1499
1500 chan->topic = stasis_topic_create(topic_name);
1501 ast_free(topic_name);
1502 if (!chan->topic) {
1503 return -1;
1504 }
1505
1508 if (!chan->channel_forward) {
1509 ao2_ref(chan->topic, -1);
1510 chan->topic = NULL;
1511 return -1;
1512 }
1513
1514 return 0;
1515}
#define ast_free(a)
Definition astmm.h:180
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
Definition astmm.h:267
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
Definition stasis.c:684

References ao2_ref, ast_asprintf, ast_assert, ast_atomic_fetchadd_int(), ast_channel_topic(), ast_channel_topic_all(), ast_free, ast_strlen_zero(), ast_channel::channel_forward, NULL, stasis_forward_all(), stasis_topic_create(), ast_channel::topic, ast_channel_id::unique_id, and ast_channel::uniqueid.

Referenced by __ast_channel_alloc_ap(), and __ast_dummy_channel_alloc().

◆ ast_channel_internal_swap_endpoint_forward()

void ast_channel_internal_swap_endpoint_forward ( struct ast_channel a,
struct ast_channel b 
)

Swap endpoint_forward between two channels.

Parameters
aFirst channel
bSecond channel
Note
This is used in masquerade to exchange endpoint details if one of the two or both the channels were created with endpoint

Definition at line 1394 of file channel_internal_api.c.

1395{
1396 struct stasis_forward *temp;
1397
1398 temp = a->endpoint_forward;
1399 a->endpoint_forward = b->endpoint_forward;
1400 b->endpoint_forward = temp;
1401}
Forwarding information.
Definition stasis.c:1598

References a, and b.

Referenced by channel_do_masquerade().

◆ ast_channel_internal_swap_endpoints()

void ast_channel_internal_swap_endpoints ( struct ast_channel a,
struct ast_channel b 
)

Swap endpoints between two channels.

Parameters
aFirst channel
bSecond channel
Note
This is used in masquerade to exchange endpoints

Definition at line 1412 of file channel_internal_api.c.

1413{
1414 struct ast_endpoint *endpoint;
1415
1416 endpoint = a->endpoint;
1417 a->endpoint = b->endpoint;
1418 b->endpoint = endpoint;
1419}

References a, and b.

Referenced by channel_do_masquerade().

◆ ast_channel_internal_swap_snapshots()

void ast_channel_internal_swap_snapshots ( struct ast_channel a,
struct ast_channel b 
)

Swap snapshots beteween two channels.

Parameters
aFirst channel
bSecond channel
Note
This is used in masquerade to exchange snapshots

Definition at line 1403 of file channel_internal_api.c.

1404{
1405 struct ast_channel_snapshot *snapshot;
1406
1407 snapshot = a->snapshot;
1408 a->snapshot = b->snapshot;
1409 b->snapshot = snapshot;
1410}
Structure representing a snapshot of channel state.

References a, and b.

Referenced by channel_do_masquerade().

◆ ast_channel_internal_swap_stream_topology()

void ast_channel_internal_swap_stream_topology ( struct ast_channel chan1,
struct ast_channel chan2 
)

Definition at line 1584 of file channel_internal_api.c.

1586{
1587 struct ast_stream_topology *tmp_topology;
1588
1589 ast_assert(chan1 != NULL && chan2 != NULL);
1590
1591 tmp_topology = chan1->stream_topology;
1592 chan1->stream_topology = chan2->stream_topology;
1593 chan2->stream_topology = tmp_topology;
1594
1597}

References ast_assert, channel_set_default_streams(), NULL, and ast_channel::stream_topology.

Referenced by channel_do_masquerade().

◆ ast_channel_internal_swap_topics()

void ast_channel_internal_swap_topics ( struct ast_channel a,
struct ast_channel b 
)

Swap topics beteween two channels.

Parameters
aFirst channel
bSecond channel
Note
This is used in masquerade to exchange topics for message routing

Definition at line 1380 of file channel_internal_api.c.

1381{
1382 struct stasis_topic *topic;
1383 struct stasis_forward *forward;
1384
1385 topic = a->topic;
1386 a->topic = b->topic;
1387 b->topic = topic;
1388
1389 forward = a->channel_forward;
1390 a->channel_forward = b->channel_forward;
1391 b->channel_forward = forward;
1392}

References a, and b.

Referenced by channel_do_masquerade().

◆ ast_channel_internal_swap_uniqueid_and_linkedid()

void ast_channel_internal_swap_uniqueid_and_linkedid ( struct ast_channel a,
struct ast_channel b 
)

Swap uniqueid and linkedid beteween two channels.

Parameters
aFirst channel
bSecond channel
Note
This is used in masquerade to exchange identities

Definition at line 1356 of file channel_internal_api.c.

1357{
1358 struct ast_channel_id temp;
1359
1360 /* This operation is used as part of masquerading and so does not invalidate the peer
1361 * segment. This is due to the masquerade process invalidating all segments.
1362 */
1363
1364 /*
1365 * Since unique ids can be a key in the channel storage backend,
1366 * ensure that neither channel is linked in or the keys will be
1367 * invalid.
1368 */
1369 ast_assert(!a->linked_in_container && !b->linked_in_container);
1370
1371 temp = a->uniqueid;
1372 a->uniqueid = b->uniqueid;
1373 b->uniqueid = temp;
1374
1375 temp = a->linkedid;
1376 a->linkedid = b->linkedid;
1377 b->linkedid = temp;
1378}
Channel UniqueId structure.

References a, ast_assert, and b.

Referenced by channel_do_masquerade().

◆ ast_channel_is_multistream()

int ast_channel_is_multistream ( struct ast_channel chan)

Determine if a channel is multi-stream capable.

Parameters
chanThe channel to test
Precondition
chan is locked
Return values
trueif the channel is multi-stream capable.

Definition at line 1599 of file channel_internal_api.c.

1600{
1601 return (chan && chan->tech && chan->tech->read_stream && chan->tech->write_stream);
1602}
int(*const write_stream)(struct ast_channel *chan, int stream_num, struct ast_frame *frame)
Write a frame on a specific stream, in standard format (see frame.h)
Definition channel.h:773
struct ast_frame *(*const read_stream)(struct ast_channel *chan)
Read a frame (or chain of frames from the same stream), in standard format (see frame....
Definition channel.h:767
const struct ast_channel_tech * tech

References ast_channel_tech::read_stream, ast_channel::tech, and ast_channel_tech::write_stream.

Referenced by ast_channel_nativeformats_set(), ast_channel_request_stream_topology_change(), ast_channel_set_stream_topology(), ast_channel_stream_topology_changed(), ast_channel_stream_topology_changed_externally(), ast_unreal_indicate(), ast_unreal_new_channels(), bridge_channel_write_frame(), bridge_handle_trip(), and stream_echo_write().

◆ ast_channel_is_t38_active()

int ast_channel_is_t38_active ( struct ast_channel chan)

This function will check if T.38 is active on the channel.

Parameters
chanChannel on which to check the unbridge_eval flag
Returns
Returns 0 if the flag is down or 1 if the flag is up.

Definition at line 913 of file channel_internal_api.c.

914{
915 int res;
916
917 ast_channel_lock(chan);
919 ast_channel_unlock(chan);
920 return res;
921}
#define ast_channel_lock(chan)
Definition channel.h:2982
#define ast_channel_unlock(chan)
Definition channel.h:2983
int ast_channel_is_t38_active_nolock(struct ast_channel *chan)
ast_channel_is_t38_active variant. Use this if the channel is already locked prior to calling.

References ast_channel_is_t38_active_nolock(), ast_channel_lock, and ast_channel_unlock.

Referenced by bridge_channel_internal_join().

◆ ast_channel_is_t38_active_nolock()

int ast_channel_is_t38_active_nolock ( struct ast_channel chan)

ast_channel_is_t38_active variant. Use this if the channel is already locked prior to calling.

Parameters
chanChannel on which to check the is_t38_active flag
Returns
Returns 0 if the flag is down or 1 if the flag is up.

Definition at line 908 of file channel_internal_api.c.

909{
910 return chan->is_t38_active;
911}

References ast_channel::is_t38_active.

Referenced by ast_channel_is_t38_active().

◆ ast_channel_jb()

struct ast_jb * ast_channel_jb ( struct ast_channel chan)

◆ ast_channel_jb_set()

void ast_channel_jb_set ( struct ast_channel chan,
struct ast_jb value 
)

Definition at line 807 of file channel_internal_api.c.

808{
809 chan->jb = *value;
810}

References ast_channel::jb, and value.

◆ ast_channel_lastcontext()

const char * ast_channel_lastcontext ( const struct ast_channel chan)

Definition at line 219 of file channel_internal_api.c.

220{
221 return chan->lastcontext;
222}

References ast_channel::lastcontext.

Referenced by func_channel_read().

◆ ast_channel_lastexten()

const char * ast_channel_lastexten ( const struct ast_channel chan)

Definition at line 236 of file channel_internal_api.c.

237{
238 return chan->lastexten;
239}

References ast_channel::lastexten.

Referenced by func_channel_read().

◆ ast_channel_linkedid()

const char * ast_channel_linkedid ( const struct ast_channel chan)

◆ ast_channel_masq()

struct ast_channel * ast_channel_masq ( const struct ast_channel chan)

Definition at line 472 of file channel_internal_api.c.

473{
474 return chan->masq;
475}
struct ast_channel * masq

References ast_channel::masq.

Referenced by ast_can_pickup(), ast_channel_log(), ast_hangup(), and ast_var_channels_table().

◆ ast_channel_masq_set()

void ast_channel_masq_set ( struct ast_channel chan,
struct ast_channel value 
)

Definition at line 476 of file channel_internal_api.c.

477{
478 chan->masq = value;
479}

References ast_channel::masq, and value.

Referenced by ast_channel_move(), and channel_do_masquerade().

◆ ast_channel_masqr()

struct ast_channel * ast_channel_masqr ( const struct ast_channel chan)

Definition at line 480 of file channel_internal_api.c.

481{
482 return chan->masqr;
483}
struct ast_channel * masqr

References ast_channel::masqr.

Referenced by ast_channel_log(), ast_hangup(), and ast_var_channels_table().

◆ ast_channel_masqr_set()

void ast_channel_masqr_set ( struct ast_channel chan,
struct ast_channel value 
)

Definition at line 484 of file channel_internal_api.c.

485{
486 chan->masqr = value;
487}

References ast_channel::masqr, and value.

Referenced by ast_channel_move(), and channel_do_masquerade().

◆ ast_channel_music_state()

void * ast_channel_music_state ( const struct ast_channel chan)

◆ ast_channel_music_state_set()

void ast_channel_music_state_set ( struct ast_channel chan,
void *  value 
)

Definition at line 433 of file channel_internal_api.c.

434{
435 chan->music_state = value;
436}

References ast_channel::music_state, and value.

Referenced by local_ast_moh_cleanup(), moh_alloc(), and moh_files_alloc().

◆ ast_channel_name_build()

void ast_channel_name_build ( struct ast_channel chan,
const char *  fmt,
  ... 
)

Definition at line 152 of file channel_internal_api.c.

153{
154 va_list ap;
156 va_start(ap, fmt);
157 ast_channel_name_build_va(chan, fmt, ap);
158 va_end(ap);
159}
void ast_channel_name_build_va(struct ast_channel *chan, const char *fmt, va_list ap)

References ast_assert, ast_channel_name_build_va(), and ast_channel::linked_in_container.

◆ ast_channel_name_build_va()

void ast_channel_name_build_va ( struct ast_channel chan,
const char *  fmt,
va_list  ap 
)

Definition at line 145 of file channel_internal_api.c.

146{
148 ast_string_field_build_va(chan, name, fmt, ap);
150}
static const char name[]
Definition format_mp3.c:68
#define ast_string_field_build_va(x, field, fmt, args)
Set a field to a complex (built) value.

References ast_assert, AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE, ast_channel_snapshot_invalidate_segment(), ast_string_field_build_va, ast_channel::linked_in_container, and name.

Referenced by __ast_channel_alloc_ap(), and ast_channel_name_build().

◆ ast_channel_name_set()

void ast_channel_name_set ( struct ast_channel chan,
const char *  value 
)

◆ ast_channel_named_callgroups()

struct ast_namedgroups * ast_channel_named_callgroups ( const struct ast_channel chan)

Definition at line 957 of file channel_internal_api.c.

958{
959 return chan->named_callgroups;
960}
struct ast_namedgroups * named_callgroups

References ast_channel::named_callgroups.

Referenced by find_channel_by_group(), and func_channel_read().

◆ ast_channel_named_callgroups_set()

void ast_channel_named_callgroups_set ( struct ast_channel chan,
struct ast_namedgroups *  value 
)

Definition at line 961 of file channel_internal_api.c.

962{
965}
struct ast_namedgroups * ast_ref_namedgroups(struct ast_namedgroups *groups)
Definition channel.c:7750
struct ast_namedgroups * ast_unref_namedgroups(struct ast_namedgroups *groups)
Definition channel.c:7744

References ast_ref_namedgroups(), ast_unref_namedgroups(), ast_channel::named_callgroups, and value.

Referenced by ast_channel_destructor(), chan_pjsip_new(), dahdi_new(), and func_channel_write_real().

◆ ast_channel_named_pickupgroups()

struct ast_namedgroups * ast_channel_named_pickupgroups ( const struct ast_channel chan)

Definition at line 966 of file channel_internal_api.c.

967{
968 return chan->named_pickupgroups;
969}
struct ast_namedgroups * named_pickupgroups

References ast_channel::named_pickupgroups.

Referenced by find_channel_by_group(), and func_channel_read().

◆ ast_channel_named_pickupgroups_set()

void ast_channel_named_pickupgroups_set ( struct ast_channel chan,
struct ast_namedgroups *  value 
)

◆ ast_channel_nativeformats()

struct ast_format_cap * ast_channel_nativeformats ( const struct ast_channel chan)

◆ ast_channel_nativeformats_set()

void ast_channel_nativeformats_set ( struct ast_channel chan,
struct ast_format_cap value 
)

Definition at line 544 of file channel_internal_api.c.

546{
547 SCOPE_ENTER(2, "%s: %sFormats: %s\n", S_OR(ast_channel_name(chan), "<initializing>"),
548 S_COR(ast_channel_is_multistream(chan), "Multistream", ""),
550
551 ast_assert(chan != NULL);
552
554
555 /* If chan->stream_topology is NULL, the channel is being destroyed
556 * and topology is destroyed.
557 */
558 if (!chan->stream_topology) {
559 SCOPE_EXIT_RTN("Channel is being initialized or destroyed\n");
560 }
561
562 if (!ast_channel_is_multistream(chan) || !value) {
563 struct ast_stream_topology *new_topology;
564
567 SCOPE_EXIT_RTN("New %stopology set\n", value ? "" : "empty ");
568 }
569 SCOPE_EXIT_RTN("Set native formats but not topology\n");
570}
#define ao2_replace(dst, src)
Replace one object reference with another cleaning up the original.
Definition astobj2.h:501
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
const char * ast_format_cap_get_names(const struct ast_format_cap *cap, struct ast_str **buf)
Get the names of codecs of a set of formats.
Definition format_cap.c:734
#define SCOPE_EXIT_RTN(...)
#define SCOPE_ENTER(level,...)
struct ast_stream_topology * ast_stream_topology_create_from_format_cap(struct ast_format_cap *cap)
A helper function that, given a format capabilities structure, creates a topology and separates the m...
Definition stream.c:851
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
Definition strings.h:80
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
Definition strings.h:87
#define ast_str_tmp(init_len, __expr)
Provides a temporary ast_str and returns a copy of its buffer.
Definition strings.h:1189

References ao2_replace, ast_assert, ast_channel_internal_set_stream_topology(), ast_channel_is_multistream(), ast_channel_name(), ast_format_cap_get_names(), ast_str_tmp, ast_stream_topology_create_from_format_cap(), ast_channel::nativeformats, NULL, S_COR, S_OR, SCOPE_ENTER, SCOPE_EXIT_RTN, ast_channel::stream_topology, and value.

Referenced by __ast_channel_alloc_ap(), ast_channel_destructor(), ast_iax2_new(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), ast_unreal_new_channels(), audiosocket_request(), chan_pjsip_new(), chan_pjsip_read_stream(), channel_do_masquerade(), console_new(), dahdi_new(), do_notify(), handle_eval_function(), handle_exec(), iax2_request(), jingle_interpret_content(), jingle_new(), jingle_read(), make_channel(), mbl_new(), multicast_rtp_request(), ooh323_new(), ooh323_rtp_read(), ooh323_set_read_format(), ooh323_set_write_format(), rec_request(), set_caps(), set_format(), socket_process_helper(), stasis_app_control_snoop(), unicast_rtp_request(), unistim_new(), unistim_rtp_read(), and webchan_request().

◆ ast_channel_oldwriteformat()

struct ast_format * ast_channel_oldwriteformat ( struct ast_channel chan)

Definition at line 711 of file channel_internal_api.c.

712{
713 return chan->oldwriteformat;
714}
struct ast_format * oldwriteformat

References ast_channel::oldwriteformat.

Referenced by ast_stopstream().

◆ ast_channel_outsmpl()

unsigned long ast_channel_outsmpl ( const struct ast_channel chan)

Definition at line 413 of file channel_internal_api.c.

414{
415 return chan->outsmpl;
416}
unsigned long outsmpl

References ast_channel::outsmpl.

◆ ast_channel_outsmpl_set()

void ast_channel_outsmpl_set ( struct ast_channel chan,
unsigned long  value 
)

Definition at line 417 of file channel_internal_api.c.

418{
419 chan->outsmpl = value;
420}

References ast_channel::outsmpl, and value.

◆ ast_channel_pbx()

struct ast_pbx * ast_channel_pbx ( const struct ast_channel chan)

◆ ast_channel_pbx_set()

void ast_channel_pbx_set ( struct ast_channel chan,
struct ast_pbx value 
)

◆ ast_channel_pickupgroup()

ast_group_t ast_channel_pickupgroup ( const struct ast_channel chan)

◆ ast_channel_pickupgroup_set()

void ast_channel_pickupgroup_set ( struct ast_channel chan,
ast_group_t  value 
)
Precondition
chan is locked

Definition at line 953 of file channel_internal_api.c.

954{
955 chan->pickupgroup = value;
956}

References ast_channel::pickupgroup, and value.

Referenced by chan_pjsip_new(), dahdi_new(), func_channel_write_real(), jingle_new(), and unistim_new().

◆ ast_channel_priority()

int ast_channel_priority ( const struct ast_channel chan)

◆ ast_channel_priority_set()

void ast_channel_priority_set ( struct ast_channel chan,
int  value 
)

◆ ast_channel_rawreadformat()

struct ast_format * ast_channel_rawreadformat ( struct ast_channel chan)

◆ ast_channel_rawwriteformat()

struct ast_format * ast_channel_rawwriteformat ( struct ast_channel chan)

◆ ast_channel_readformat()

struct ast_format * ast_channel_readformat ( struct ast_channel chan)

◆ ast_channel_readq()

struct ast_readq_list * ast_channel_readq ( struct ast_channel chan)

◆ ast_channel_readtrans()

struct ast_trans_pvt * ast_channel_readtrans ( const struct ast_channel chan)

◆ ast_channel_readtrans_set()

void ast_channel_readtrans_set ( struct ast_channel chan,
struct ast_trans_pvt value 
)

Definition at line 624 of file channel_internal_api.c.

625{
626 chan->readtrans = value;
627}

References ast_channel::readtrans, and value.

Referenced by ast_set_read_format_path(), and free_translation().

◆ ast_channel_redirecting()

struct ast_party_redirecting * ast_channel_redirecting ( struct ast_channel chan)

◆ ast_channel_redirecting_effective_from()

struct ast_party_id ast_channel_redirecting_effective_from ( struct ast_channel chan)

Definition at line 783 of file channel_internal_api.c.

784{
786}
struct ast_party_id priv_from
Who is redirecting the call (Sent to the party the call is redirected toward) - private representatio...
Definition channel.h:538
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
Definition channel.h:529

References ast_party_id_merge().

◆ ast_channel_redirecting_effective_orig()

struct ast_party_id ast_channel_redirecting_effective_orig ( struct ast_channel chan)

Definition at line 779 of file channel_internal_api.c.

780{
782}
struct ast_party_id orig
Who originally redirected the call (Sent to the party the call is redirected toward)
Definition channel.h:526
struct ast_party_id priv_orig
Who originally redirected the call (Sent to the party the call is redirected toward) - private repres...
Definition channel.h:535

References ast_party_id_merge().

◆ ast_channel_redirecting_effective_to()

struct ast_party_id ast_channel_redirecting_effective_to ( struct ast_channel chan)

Definition at line 787 of file channel_internal_api.c.

788{
789 return ast_party_id_merge(&chan->redirecting.to, &chan->redirecting.priv_to);
790}
struct ast_party_id priv_to
Call is redirecting to a new party (Sent to the caller) - private representation.
Definition channel.h:541
struct ast_party_id to
Call is redirecting to a new party (Sent to the caller)
Definition channel.h:532

References ast_party_id_merge().

◆ ast_channel_redirecting_set()

void ast_channel_redirecting_set ( struct ast_channel chan,
struct ast_party_redirecting value 
)

◆ ast_channel_rings()

int ast_channel_rings ( const struct ast_channel chan)

Definition at line 325 of file channel_internal_api.c.

326{
327 return chan->rings;
328}

References ast_channel::rings.

Referenced by __analog_handle_event(), ast_var_channels_table(), and serialize_showchan().

◆ ast_channel_rings_set()

void ast_channel_rings_set ( struct ast_channel chan,
int  value 
)

◆ ast_channel_sched()

struct ast_sched_context * ast_channel_sched ( const struct ast_channel chan)

◆ ast_channel_sched_set()

void ast_channel_sched_set ( struct ast_channel chan,
struct ast_sched_context value 
)

Definition at line 600 of file channel_internal_api.c.

601{
602 chan->sched = value;
603}

References ast_channel::sched, and value.

Referenced by __ast_channel_alloc_ap(), and ast_hangup().

◆ ast_channel_sending_dtmf_digit()

char ast_channel_sending_dtmf_digit ( const struct ast_channel chan)

Definition at line 259 of file channel_internal_api.c.

260{
261 return chan->sending_dtmf_digit;
262}

References ast_channel::sending_dtmf_digit.

Referenced by ast_senddigit_end(), bridge_channel_internal_join(), and channel_do_masquerade().

◆ ast_channel_sending_dtmf_digit_set()

void ast_channel_sending_dtmf_digit_set ( struct ast_channel chan,
char  value 
)

Definition at line 263 of file channel_internal_api.c.

264{
266}

References ast_channel::sending_dtmf_digit, and value.

Referenced by ast_senddigit_begin(), and ast_senddigit_end().

◆ ast_channel_sending_dtmf_tv()

struct timeval ast_channel_sending_dtmf_tv ( const struct ast_channel chan)

Definition at line 268 of file channel_internal_api.c.

269{
270 return chan->sending_dtmf_tv;
271}
struct timeval sending_dtmf_tv

Referenced by bridge_channel_internal_join(), and channel_do_masquerade().

◆ ast_channel_sending_dtmf_tv_set()

void ast_channel_sending_dtmf_tv_set ( struct ast_channel chan,
struct timeval  value 
)

Definition at line 272 of file channel_internal_api.c.

273{
274 chan->sending_dtmf_tv = value;
275}

References ast_channel::sending_dtmf_tv, and value.

Referenced by ast_senddigit_begin().

◆ ast_channel_set_is_t38_active()

void ast_channel_set_is_t38_active ( struct ast_channel chan,
int  is_t38_active 
)

Sets the is_t38_active flag.

Parameters
chanWhich channel is having its is_t38_active value set
is_t38_activeNon-zero if T.38 is active

Definition at line 928 of file channel_internal_api.c.

929{
930 ast_channel_lock(chan);
931 ast_channel_set_is_t38_active_nolock(chan, is_t38_active);
932 ast_channel_unlock(chan);
933}
void ast_channel_set_is_t38_active_nolock(struct ast_channel *chan, int is_t38_active)
Variant of ast_channel_set_is_t38_active. Use this if the channel is already locked prior to calling.

References ast_channel_lock, ast_channel_set_is_t38_active_nolock(), and ast_channel_unlock.

◆ ast_channel_set_is_t38_active_nolock()

void ast_channel_set_is_t38_active_nolock ( struct ast_channel chan,
int  is_t38_active 
)

Variant of ast_channel_set_is_t38_active. Use this if the channel is already locked prior to calling.

Parameters
chanWhich channel is having its is_t38_active value set
is_t38_activeNon-zero if T.38 is active

Definition at line 923 of file channel_internal_api.c.

924{
925 chan->is_t38_active = !!is_t38_active;
926}

References ast_channel::is_t38_active.

Referenced by ast_channel_set_is_t38_active(), and indicate_data_internal().

◆ ast_channel_set_oldwriteformat()

void ast_channel_set_oldwriteformat ( struct ast_channel chan,
struct ast_format format 
)

Definition at line 691 of file channel_internal_api.c.

692{
693 ao2_replace(chan->oldwriteformat, format);
694}

References ao2_replace, and ast_channel::oldwriteformat.

Referenced by ast_channel_destructor(), and openstream_internal().

◆ ast_channel_set_rawreadformat()

void ast_channel_set_rawreadformat ( struct ast_channel chan,
struct ast_format format 
)

◆ ast_channel_set_rawwriteformat()

void ast_channel_set_rawwriteformat ( struct ast_channel chan,
struct ast_format format 
)

◆ ast_channel_set_readformat()

void ast_channel_set_readformat ( struct ast_channel chan,
struct ast_format format 
)

◆ ast_channel_set_stream_topology()

struct ast_stream_topology * ast_channel_set_stream_topology ( struct ast_channel chan,
struct ast_stream_topology topology 
)

Set the topology of streams on a channel.

Parameters
chanThe channel to set the stream topology on
topologyThe stream topology to set
Precondition
chan is locked
Note
If topology is NULL a new empty topology will be created and returned.
Return values
non-NULLSuccess
NULLfailure

Definition at line 1547 of file channel_internal_api.c.

1549{
1550 struct ast_stream_topology *new_topology;
1551 SCOPE_ENTER(1, "%s: %s\n", ast_channel_name(chan),
1552 ast_str_tmp(256, ast_stream_topology_to_str(topology, &STR_TMP)));
1553
1554 ast_assert(chan != NULL);
1555
1556 /* A non-MULTISTREAM channel can't manipulate topology directly */
1558
1559 /* Unless the channel is being destroyed, we always want a topology on
1560 * it even if its empty.
1561 */
1562 if (!topology) {
1563 new_topology = ast_stream_topology_alloc();
1564 } else {
1565 new_topology = topology;
1566 }
1567
1568 if (new_topology) {
1569 ast_channel_internal_set_stream_topology(chan, new_topology);
1570 }
1571
1572 SCOPE_EXIT_RTN_VALUE(new_topology, "Used %s topology\n", topology ? "provided" : "empty");
1573}
#define SCOPE_EXIT_RTN_VALUE(__return_value,...)
struct ast_stream_topology * ast_stream_topology_alloc(void)
Create a stream topology.
Definition stream.c:652
const char * ast_stream_topology_to_str(const struct ast_stream_topology *topology, struct ast_str **buf)
Get a string representing the topology for debugging/display purposes.
Definition stream.c:939

References ast_assert, ast_channel_internal_set_stream_topology(), ast_channel_is_multistream(), ast_channel_name(), ast_str_tmp, ast_stream_topology_alloc(), ast_stream_topology_to_str(), NULL, SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.

Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), ast_unreal_indicate(), ast_unreal_new_channels(), chan_pjsip_new(), handle_negotiated_sdp(), make_channel(), and unreal_colp_stream_topology_request_change().

◆ ast_channel_set_unbridged()

void ast_channel_set_unbridged ( struct ast_channel chan,
int  value 
)

Sets the unbridged flag and queues a NULL frame on the channel to trigger a check by bridge_channel_wait.

Parameters
chanWhich channel is having its unbridged value set
valueWhat the unbridge value is being set to

Definition at line 901 of file channel_internal_api.c.

902{
903 ast_channel_lock(chan);
905 ast_channel_unlock(chan);
906}
void ast_channel_set_unbridged_nolock(struct ast_channel *chan, int value)
Variant of ast_channel_set_unbridged. Use this if the channel is already locked prior to calling.

References ast_channel_lock, ast_channel_set_unbridged_nolock(), ast_channel_unlock, and value.

Referenced by ast_bridge_setup_after_goto(), bridge_channel_wait(), and t38_change_state().

◆ ast_channel_set_unbridged_nolock()

void ast_channel_set_unbridged_nolock ( struct ast_channel chan,
int  value 
)

Variant of ast_channel_set_unbridged. Use this if the channel is already locked prior to calling.

Parameters
chanWhich channel is having its unbridged value set
valueWhat the unbridge value is being set to

Definition at line 895 of file channel_internal_api.c.

896{
897 chan->unbridged = !!value;
899}
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to a channel's frame queue.
Definition channel.c:1170
struct ast_frame ast_null_frame
Definition main/frame.c:79

References ast_null_frame, ast_queue_frame(), ast_channel::unbridged, and value.

Referenced by ast_audiohook_attach(), ast_audiohook_remove(), ast_channel_set_unbridged(), ast_framehook_attach(), ast_framehook_detach(), ast_framehook_list_fixup(), audio_audiohook_write_list(), chan_pjsip_read_stream(), dtmf_audiohook_write_list(), and set_caps().

◆ ast_channel_set_writeformat()

void ast_channel_set_writeformat ( struct ast_channel chan,
struct ast_format format 
)

◆ ast_channel_snapshot()

struct ast_channel_snapshot * ast_channel_snapshot ( const struct ast_channel chan)

Definition at line 1604 of file channel_internal_api.c.

1605{
1606 return chan->snapshot;
1607}
struct ast_channel_snapshot * snapshot

References ast_channel::snapshot.

◆ ast_channel_snapshot_segment_flags()

struct ast_flags * ast_channel_snapshot_segment_flags ( struct ast_channel chan)

◆ ast_channel_snapshot_set()

void ast_channel_snapshot_set ( struct ast_channel chan,
struct ast_channel_snapshot snapshot 
)

Definition at line 1609 of file channel_internal_api.c.

1610{
1611 ao2_cleanup(chan->snapshot);
1612 chan->snapshot = ao2_bump(snapshot);
1613}

References ao2_bump, ao2_cleanup, and ast_channel::snapshot.

Referenced by ast_channel_publish_final_snapshot(), and ast_channel_publish_snapshot().

◆ ast_channel_softhangup_internal_flag()

int ast_channel_softhangup_internal_flag ( struct ast_channel chan)

◆ ast_channel_softhangup_internal_flag_add()

void ast_channel_softhangup_internal_flag_add ( struct ast_channel chan,
int  value 
)

◆ ast_channel_softhangup_internal_flag_clear()

void ast_channel_softhangup_internal_flag_clear ( struct ast_channel chan,
int  value 
)

Definition at line 876 of file channel_internal_api.c.

877{
878 chan ->softhangup &= ~value;
879}

References ast_channel::softhangup.

Referenced by ast_channel_clear_softhangup().

◆ ast_channel_softhangup_internal_flag_set()

void ast_channel_softhangup_internal_flag_set ( struct ast_channel chan,
int  value 
)

Definition at line 868 of file channel_internal_api.c.

869{
870 chan->softhangup = value;
871}

References ast_channel::softhangup, and value.

Referenced by channel_do_masquerade().

◆ ast_channel_state()

enum ast_channel_state ast_channel_state ( const struct ast_channel chan)

Definition at line 656 of file channel_internal_api.c.

657{
658 return chan->state;
659}
enum ast_channel_state state

References ast_channel::state.

◆ ast_channel_state_set()

void ast_channel_state_set ( struct ast_channel chan,
enum ast_channel_state  value 
)

◆ ast_channel_stream()

struct ast_filestream * ast_channel_stream ( const struct ast_channel chan)

◆ ast_channel_stream_set()

void ast_channel_stream_set ( struct ast_channel chan,
struct ast_filestream value 
)

◆ ast_channel_streamid()

int ast_channel_streamid ( const struct ast_channel chan)

Definition at line 333 of file channel_internal_api.c.

334{
335 return chan->streamid;
336}

References ast_channel::streamid.

Referenced by filestream_close(), handle_speechrecognize(), and speech_background().

◆ ast_channel_streamid_set()

void ast_channel_streamid_set ( struct ast_channel chan,
int  value 
)

Definition at line 337 of file channel_internal_api.c.

338{
339 chan->streamid = value;
340}

References ast_channel::streamid, and value.

Referenced by __ast_channel_alloc_ap(), ast_readaudio_callback(), and filestream_close().

◆ ast_channel_tech()

const struct ast_channel_tech * ast_channel_tech ( const struct ast_channel chan)

Definition at line 636 of file channel_internal_api.c.

637{
638 return chan->tech;
639}

References ast_channel::tech.

◆ ast_channel_tech_hangupcause()

int ast_channel_tech_hangupcause ( const struct ast_channel chan)

◆ ast_channel_tech_hangupcause_set()

void ast_channel_tech_hangupcause_set ( struct ast_channel chan,
int  value 
)

◆ ast_channel_tech_pvt()

void * ast_channel_tech_pvt ( const struct ast_channel chan)

Definition at line 437 of file channel_internal_api.c.

438{
439 return chan->tech_pvt;
440}

References ast_channel::tech_pvt.

Referenced by __analog_ss_thread(), __dahdi_exception(), acf_channel_read(), analog_hangup(), analog_ss_thread(), announce_hangup(), aoc_framehook(), ast_channel_destructor(), ast_local_get_peer(), ast_local_lock_all(), ast_local_setup_bridge(), ast_local_setup_masquerade(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), ast_unreal_answer(), ast_unreal_channel_push_to_bridge(), ast_unreal_digit_begin(), ast_unreal_digit_end(), ast_unreal_fixup(), ast_unreal_indicate(), ast_unreal_queryoption(), ast_unreal_sendhtml(), ast_unreal_sendtext(), ast_unreal_setoption(), ast_unreal_write_stream(), audiosocket_call(), audiosocket_hangup(), audiosocket_read(), audiosocket_send_dtmf(), audiosocket_write(), chan_pjsip_answer(), chan_pjsip_call(), chan_pjsip_digit_begin(), chan_pjsip_digit_end(), chan_pjsip_fixup(), chan_pjsip_get_rtp_peer(), chan_pjsip_get_uniqueid(), chan_pjsip_get_vrtp_peer(), chan_pjsip_hangup(), chan_pjsip_indicate(), chan_pjsip_queryoption(), chan_pjsip_read_stream(), chan_pjsip_sendtext_data(), chan_pjsip_set_rtp_peer(), chan_pjsip_transfer(), chan_pjsip_write_stream(), chan_rtp_get_rtp_peer(), channel_do_masquerade(), channel_read_pjsip(), channel_read_rtcp(), channel_read_rtp(), channel_to_session(), cli_channelstats_print_body(), conf_announce_channel_push(), console_answer(), console_call(), console_fixup(), console_hangup(), console_indicate(), console_write(), dahdi_answer(), dahdi_call(), dahdi_callwait(), dahdi_digit_begin(), dahdi_digit_end(), dahdi_exception(), dahdi_fixup(), dahdi_func_read(), dahdi_func_write(), dahdi_handle_dtmf(), dahdi_handle_event(), dahdi_hangup(), dahdi_indicate(), dahdi_queryoption(), dahdi_read(), dahdi_sendtext(), dahdi_setoption(), dahdi_write(), dahdichan_helper(), func_read_header(), func_read_headers(), func_read_param(), func_response_read_header(), func_response_read_headers(), func_write_header(), func_write_param(), function_iaxpeer(), function_ooh323_read(), function_ooh323_write(), hangup(), iax2_answer(), iax2_call(), iax2_digit_begin(), iax2_digit_end(), iax2_fixup(), iax2_hangup(), iax2_indicate(), iax2_prov_app(), iax2_queryoption(), iax2_sendhtml(), iax2_sendimage(), iax2_sendtext(), iax2_setoption(), iax2_transfer(), iax2_write(), jingle_answer(), jingle_call(), jingle_digit_begin(), jingle_digit_end(), jingle_fixup(), jingle_get_rtp_peer(), jingle_hangup(), jingle_indicate(), jingle_read(), jingle_sendtext(), jingle_write(), load_stream_readqueue(), local_call(), local_hangup(), manager_optimize_away(), mbl_answer(), mbl_call(), mbl_digit_end(), mbl_fixup(), mbl_hangup(), mbl_read(), mbl_write(), media_hangup(), mock_channel_hangup(), mock_channel_indicate(), mock_channel_read(), mock_channel_write(), mock_channel_write_stream(), my_get_sigpvt_bridged_channel(), native_bridge_is_capable(), native_chan_changed(), native_start(), native_stop(), ooh323_answer(), ooh323_call(), ooh323_digit_begin(), ooh323_digit_end(), ooh323_fixup(), ooh323_get_codec(), ooh323_get_rtp_peer(), ooh323_get_vrtp_peer(), ooh323_hangup(), ooh323_indicate(), ooh323_queryoption(), ooh323_read(), ooh323_set_rtp_peer(), ooh323_write(), pjsip_acf_channel_read(), pjsip_acf_dtmf_mode_read(), pjsip_acf_dtmf_mode_write(), pjsip_acf_media_offer_read(), pjsip_acf_media_offer_write(), pjsip_acf_moh_passthrough_read(), pjsip_acf_moh_passthrough_write(), pjsip_acf_session_refresh_write(), pjsip_app_hangup_handler(), pjsip_transfer_handling_write(), polarity_read(), polarity_write(), push_notify_channel(), read_test(), rtp_call(), rtp_hangup(), rtp_read(), rtp_write(), send_direct_media_request(), sendtext_data_create(), snoop_fixup(), snoop_hangup(), snoop_read(), snoop_write(), stasis_app_channel_unreal_set_internal(), t38_framehook(), test_bridging_chan_hangup(), test_bridging_chan_indicate(), unistim_answer(), unistim_call(), unistim_fixup(), unistim_get_rtp_peer(), unistim_hangup(), unistim_indicate(), unistim_read(), unistim_set_rtp_peer(), unistim_ss(), unistim_write(), webchan_call(), webchan_hangup(), webchan_read(), webchan_send_dtmf_text(), and webchan_write().

◆ ast_channel_tech_pvt_set()

void ast_channel_tech_pvt_set ( struct ast_channel chan,
void *  value 
)

◆ ast_channel_tech_set()

void ast_channel_tech_set ( struct ast_channel chan,
const struct ast_channel_tech value 
)

◆ ast_channel_tenantid()

const char * ast_channel_tenantid ( const struct ast_channel chan)

Definition at line 173 of file channel_internal_api.c.

174{
175 /* It's ok for tenantid to be empty, so no need to assert */
176 return chan->linkedid.tenant_id;
177}

References ast_channel::linkedid, and ast_channel_id::tenant_id.

Referenced by channel_snapshot_base_create(), func_channel_read(), and handle_showchan().

◆ ast_channel_tenantid_set()

void ast_channel_tenantid_set ( struct ast_channel chan,
const char *  value 
)

◆ ast_channel_timer()

struct ast_timer * ast_channel_timer ( const struct ast_channel chan)

◆ ast_channel_timer_set()

void ast_channel_timer_set ( struct ast_channel chan,
struct ast_timer value 
)

Definition at line 608 of file channel_internal_api.c.

609{
610 chan->timer = value;
611}

References ast_channel::timer, and value.

Referenced by __ast_channel_alloc_ap(), and ast_channel_destructor().

◆ ast_channel_timingdata()

void * ast_channel_timingdata ( const struct ast_channel chan)

Definition at line 448 of file channel_internal_api.c.

449{
450 return chan->timingdata;
451}

References ast_channel::timingdata.

Referenced by __ast_read(), and ast_settimeout_full().

◆ ast_channel_timingdata_set()

void ast_channel_timingdata_set ( struct ast_channel chan,
void *  value 
)

Definition at line 452 of file channel_internal_api.c.

453{
454 chan->timingdata = value;
455}

References ast_channel::timingdata, and value.

Referenced by ast_settimeout_full().

◆ ast_channel_timingfd()

int ast_channel_timingfd ( const struct ast_channel chan)

◆ ast_channel_timingfd_set()

void ast_channel_timingfd_set ( struct ast_channel chan,
int  value 
)

Definition at line 345 of file channel_internal_api.c.

346{
347 chan->timingfd = value;
348}

References ast_channel::timingfd, and value.

Referenced by __ast_channel_alloc_ap(), and __ast_dummy_channel_alloc().

◆ ast_channel_timingfunc()

ast_timing_func_t ast_channel_timingfunc ( const struct ast_channel chan)

◆ ast_channel_timingfunc_set()

void ast_channel_timingfunc_set ( struct ast_channel chan,
ast_timing_func_t  value 
)

Definition at line 1102 of file channel_internal_api.c.

1103{
1104 chan->timingfunc = value;
1105}

References ast_channel::timingfunc, and value.

Referenced by ast_settimeout_full().

◆ ast_channel_topic()

struct stasis_topic * ast_channel_topic ( struct ast_channel chan)

◆ ast_channel_transfercapability()

unsigned short ast_channel_transfercapability ( const struct ast_channel chan)

◆ ast_channel_transfercapability_set()

void ast_channel_transfercapability_set ( struct ast_channel chan,
unsigned short  value 
)

◆ ast_channel_unbridged()

int ast_channel_unbridged ( struct ast_channel chan)

This function will check if the bridge needs to be re-evaluated due to external changes.

Parameters
chanChannel on which to check the unbridge_eval flag
Returns
Returns 0 if the flag is down or 1 if the flag is up.

Definition at line 886 of file channel_internal_api.c.

887{
888 int res;
889 ast_channel_lock(chan);
891 ast_channel_unlock(chan);
892 return res;
893}
int ast_channel_unbridged_nolock(struct ast_channel *chan)
ast_channel_unbridged variant. Use this if the channel is already locked prior to calling.

References ast_channel_lock, ast_channel_unbridged_nolock(), and ast_channel_unlock.

Referenced by ast_channel_is_leaving_bridge(), and bridge_channel_wait().

◆ ast_channel_unbridged_nolock()

int ast_channel_unbridged_nolock ( struct ast_channel chan)

ast_channel_unbridged variant. Use this if the channel is already locked prior to calling.

Parameters
chanChannel on which to check the unbridge flag
Returns
Returns 0 if the flag is down or 1 if the flag is up.

Definition at line 881 of file channel_internal_api.c.

882{
883 return chan->unbridged;
884}

References ast_channel::unbridged.

Referenced by ast_channel_unbridged().

◆ ast_channel_uniqueid()

const char * ast_channel_uniqueid ( const struct ast_channel chan)

Definition at line 161 of file channel_internal_api.c.

162{
163 ast_assert(chan->uniqueid.unique_id[0] != '\0');
164 return chan->uniqueid.unique_id;
165}

References ast_assert, ast_channel_id::unique_id, and ast_channel::uniqueid.

Referenced by __ast_change_name_nolink(), _create_event_DTMF_END(), _create_event_ERROR(), _create_event_MEDIA_BUFFERING_COMPLETED(), _create_event_MEDIA_START(), _create_event_nodata(), _create_event_STATUS(), action_confbridgelist_item(), action_dahdishowchannels(), app_exec(), app_subscribe_channel(), app_unsubscribe_channel(), apply_negotiated_sdp_stream(), aqm_exec(), ari_channels_handle_originate_with_id(), ari_channels_handle_snoop_channel(), ast_ari_channels_create(), ast_ari_create_per_call_websocket(), ast_attended_transfer_message_add_app(), ast_attended_transfer_message_add_link(), ast_attended_transfer_message_add_threeway(), ast_attended_transfer_message_create(), ast_blind_transfer_message_create(), ast_bridge_blob_create(), ast_bridge_publish_enter(), ast_bridge_set_single_src_video_mode(), ast_bridge_snapshot_create(), ast_bridge_transfer_blind(), ast_bridge_update_talker_src_video_mode(), ast_cel_publish_event(), ast_channel_log(), ast_channel_move(), ast_channel_publish_cached_blob(), ast_channel_publish_dial_internal(), ast_channel_publish_final_snapshot(), ast_channel_publish_snapshot(), ast_do_pickup(), ast_endpoint_add_channel(), ast_endpoint_remove_channel(), ast_str_retrieve_variable(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), ast_var_channels_table(), blind_transfer_bridge(), bridge_channel_depart(), bridge_channel_snapshot_pair_init(), bridge_moh_create(), bridge_stasis_push_peek(), build_conf(), by_uniqueid_cb(), call(), chan_pjsip_fixup(), chan_pjsip_indicate(), chan_pjsip_new(), chan_pjsip_session_end(), channel_replaced_cb(), channel_snapshot_base_create(), channelstorage_uniqueid_cb(), conf_rec_name(), conf_run(), conf_send_event_to_participants(), create_parked_subscription_full(), detect_callback(), fast_originate(), fax_session_new(), find_by_uniqueid(), find_conf_realtime(), forwards_create_channel(), func_channel_read(), generate_status(), handle_showchan(), internal_bridge_after_cb(), jingle_enable_video(), jingle_set_owner(), local_channel_optimization_blob(), local_optimization_started_cb(), manager_mute_mixmonitor(), manager_park(), manager_park_bridged(), manager_queues_status(), masq_match_cb(), meetme_menu_admin_extended(), meetmemute(), minivm_mwi_exec(), mixmonitor_exec(), moh_post_start(), moh_post_stop(), multicast_rtp_request(), notify_new_message(), notify_new_message(), pack_channel_into_message(), park_and_announce_app_exec(), park_common_setup2(), park_local_transfer(), parking_blind_transfer_park(), parking_park_bridge_channel(), play_on_channel(), publish_chanspy_message(), publish_local_bridge_message(), queue_exec(), queue_stasis_data_alloc(), record_file(), refer_blind_callback(), report_fax_status(), report_receive_fax_status(), report_send_fax_status(), rna(), rqm_exec(), serialize_showchan(), setup_env(), setup_mixmonitor(), sfu_topologies_on_join(), sfu_topologies_on_source_change(), softmix_bridge_stream_sources_update(), start_rtp(), stasis_app_bridge_playback_channel_add(), stasis_app_control_find_by_channel(), stasis_app_control_get_channel_id(), stasis_app_control_snoop(), stasis_app_exec(), stasis_app_subscribe_channel(), stop_mixmonitor_full(), talk_detect_audiohook_cb(), test_cel_generate_peer_str(), try_calling(), unicast_rtp_request(), unistim_set_owner(), vm_execmain(), wait_for_answer(), and wait_our_turn().

◆ ast_channel_varshead()

struct varshead * ast_channel_varshead ( struct ast_channel chan)

◆ ast_channel_varshead_set()

void ast_channel_varshead_set ( struct ast_channel chan,
struct varshead value 
)

Definition at line 839 of file channel_internal_api.c.

840{
841 chan->varshead = *value;
842}

References value, and ast_channel::varshead.

◆ ast_channel_visible_indication()

int ast_channel_visible_indication ( const struct ast_channel chan)

Definition at line 349 of file channel_internal_api.c.

350{
351 return chan->visible_indication;
352}

References ast_channel::visible_indication.

Referenced by channel_do_masquerade(), and pre_bridge_setup().

◆ ast_channel_visible_indication_set()

void ast_channel_visible_indication_set ( struct ast_channel chan,
int  value 
)

Definition at line 353 of file channel_internal_api.c.

354{
356}

References value, and ast_channel::visible_indication.

Referenced by dial_exec_full(), and indicate_data_internal().

◆ ast_channel_vstream()

struct ast_filestream * ast_channel_vstream ( const struct ast_channel chan)

Definition at line 496 of file channel_internal_api.c.

497{
498 return chan->vstream;
499}
struct ast_filestream * vstream

References ast_channel::vstream.

Referenced by ast_hangup(), ast_openvstream(), ast_stopstream(), and filehelper().

◆ ast_channel_vstream_set()

void ast_channel_vstream_set ( struct ast_channel chan,
struct ast_filestream value 
)

Definition at line 500 of file channel_internal_api.c.

501{
502 chan->vstream = value;
503}

References value, and ast_channel::vstream.

Referenced by ast_hangup(), ast_stopstream(), filehelper(), and filestream_close().

◆ ast_channel_vstreamid()

int ast_channel_vstreamid ( const struct ast_channel chan)

Definition at line 365 of file channel_internal_api.c.

366{
367 return chan->vstreamid;
368}

References ast_channel::vstreamid.

Referenced by filestream_close().

◆ ast_channel_vstreamid_set()

void ast_channel_vstreamid_set ( struct ast_channel chan,
int  value 
)

Definition at line 369 of file channel_internal_api.c.

370{
371 chan->vstreamid = value;
372}

References value, and ast_channel::vstreamid.

Referenced by __ast_channel_alloc_ap(), ast_readvideo_callback(), and filestream_close().

◆ ast_channel_whentohangup()

struct timeval * ast_channel_whentohangup ( struct ast_channel chan)

◆ ast_channel_whentohangup_set()

void ast_channel_whentohangup_set ( struct ast_channel chan,
struct timeval *  value 
)
Precondition
chan is locked

Definition at line 835 of file channel_internal_api.c.

836{
837 chan->whentohangup = *value;
838}

References value, and ast_channel::whentohangup.

Referenced by ast_channel_setwhentohangup_tv(), and dial_exec_full().

◆ ast_channel_writeformat()

struct ast_format * ast_channel_writeformat ( struct ast_channel chan)

◆ ast_channel_writetrans()

struct ast_trans_pvt * ast_channel_writetrans ( const struct ast_channel chan)

◆ ast_channel_writetrans_set()

void ast_channel_writetrans_set ( struct ast_channel chan,
struct ast_trans_pvt value 
)

Definition at line 632 of file channel_internal_api.c.

633{
634 chan->writetrans = value;
635}

References value, and ast_channel::writetrans.

Referenced by ast_set_write_format_path(), and free_translation().

◆ ast_channel_zone()

struct ast_tone_zone * ast_channel_zone ( const struct ast_channel chan)

◆ ast_channel_zone_set()

void ast_channel_zone_set ( struct ast_channel chan,
struct ast_tone_zone value 
)

Definition at line 616 of file channel_internal_api.c.

617{
618 chan->zone = value;
619}

References value, and ast_channel::zone.

Referenced by ast_channel_destructor(), chan_pjsip_new(), and func_channel_write_real().

◆ AST_THREADSTORAGE_CUSTOM_SCOPE()

AST_THREADSTORAGE_CUSTOM_SCOPE ( channel_errno  ,
NULL  ,
ast_free_ptr  ,
static   
)

◆ channel_set_default_streams()

static void channel_set_default_streams ( struct ast_channel chan)
static

Definition at line 509 of file channel_internal_api.c.

510{
511 enum ast_media_type type;
512
513 ast_assert(chan != NULL);
514
516 if (chan->stream_topology) {
517 chan->default_streams[type] =
519 } else {
520 chan->default_streams[type] = NULL;
521 }
522 }
523}
ast_media_type
Types of media.
Definition codec.h:30
@ AST_MEDIA_TYPE_UNKNOWN
Definition codec.h:31
struct ast_stream * ast_stream_topology_get_first_stream_by_type(const struct ast_stream_topology *topology, enum ast_media_type type)
Gets the first active stream of a specific type from the topology.
Definition stream.c:967

References ast_assert, AST_MEDIA_TYPE_END, AST_MEDIA_TYPE_UNKNOWN, ast_stream_topology_get_first_stream_by_type(), ast_channel::default_streams, NULL, ast_channel::stream_topology, and type.

Referenced by ast_channel_internal_set_stream_topology(), and ast_channel_internal_swap_stream_topology().

◆ collect_names_cb()

static int collect_names_cb ( void *  obj,
void *  arg,
int  flags 
)
static

Definition at line 1132 of file channel_internal_api.c.

1133{
1134 struct ast_control_pvt_cause_code *cause_code = obj;
1135 struct ast_str **str = arg;
1136
1137 ast_str_append(str, 0, "%s%s", (ast_str_strlen(*str) ? "," : ""), cause_code->chan_name);
1138
1139 return 0;
1140}
const char * str
Definition app_jack.c:150
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
Definition strings.h:1139
size_t attribute_pure ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
Definition strings.h:730

References ast_str_append(), ast_str_strlen(), ast_control_pvt_cause_code::chan_name, and str.

Referenced by ast_channel_dialed_causes_channels().

◆ DEFINE_STRINGFIELD_GETTER_FOR() [1/11]

DEFINE_STRINGFIELD_GETTER_FOR ( accountcode  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [2/11]

DEFINE_STRINGFIELD_GETTER_FOR ( call_forward  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [3/11]

DEFINE_STRINGFIELD_GETTER_FOR ( dialcontext  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [4/11]

DEFINE_STRINGFIELD_GETTER_FOR ( hangupsource  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [5/11]

DEFINE_STRINGFIELD_GETTER_FOR ( language  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [6/11]

DEFINE_STRINGFIELD_GETTER_FOR ( latest_musicclass  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [7/11]

DEFINE_STRINGFIELD_GETTER_FOR ( musicclass  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [8/11]

DEFINE_STRINGFIELD_GETTER_FOR ( name  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [9/11]

DEFINE_STRINGFIELD_GETTER_FOR ( parkinglot  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [10/11]

DEFINE_STRINGFIELD_GETTER_FOR ( peeraccount  )

◆ DEFINE_STRINGFIELD_GETTER_FOR() [11/11]

DEFINE_STRINGFIELD_GETTER_FOR ( userfield  )

◆ DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR() [1/5]

DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR ( accountcode  ,
,
,
AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE   
)

◆ DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR() [2/5]

DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR ( hangupsource  ,
,
,
AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP   
)

◆ DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR() [3/5]

DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR ( language  ,
,
,
AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE   
)

◆ DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR() [4/5]

DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR ( peeraccount  ,
,
,
AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER   
)

◆ DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR() [5/5]

DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR ( userfield  ,
,
,
AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE   
)

◆ DEFINE_STRINGFIELD_SETTERS_FOR() [1/5]

DEFINE_STRINGFIELD_SETTERS_FOR ( call_forward  ,
 
)

◆ DEFINE_STRINGFIELD_SETTERS_FOR() [2/5]

DEFINE_STRINGFIELD_SETTERS_FOR ( dialcontext  ,
 
)

◆ DEFINE_STRINGFIELD_SETTERS_FOR() [3/5]

DEFINE_STRINGFIELD_SETTERS_FOR ( latest_musicclass  ,
 
)

◆ DEFINE_STRINGFIELD_SETTERS_FOR() [4/5]

DEFINE_STRINGFIELD_SETTERS_FOR ( musicclass  ,
 
)

◆ DEFINE_STRINGFIELD_SETTERS_FOR() [5/5]

DEFINE_STRINGFIELD_SETTERS_FOR ( parkinglot  ,
 
)

◆ pvt_cause_cmp_fn()

static int pvt_cause_cmp_fn ( void *  obj,
void *  vstr,
int  flags 
)
static

Comparison function for pvt cause code frames.

Definition at line 1234 of file channel_internal_api.c.

1235{
1236 struct ast_control_pvt_cause_code *pc = obj;
1237 char *str = ast_tech_to_upper(ast_strdupa(vstr));
1238 char *pc_str = ast_tech_to_upper(ast_strdupa(pc->chan_name));
1239 return !strcmp(pc_str, str) ? CMP_MATCH | CMP_STOP : 0;
1240}
@ CMP_MATCH
Definition astobj2.h:1027
@ CMP_STOP
Definition astobj2.h:1028
char * ast_tech_to_upper(char *dev_str)
Convert the tech portion of a device string to upper case.
Definition strings.h:1236

References ast_strdupa, ast_tech_to_upper(), ast_control_pvt_cause_code::chan_name, CMP_MATCH, CMP_STOP, and str.

Referenced by __ast_channel_internal_alloc_with_initializers().

◆ pvt_cause_hash_fn()

static int pvt_cause_hash_fn ( const void *  vpc,
const int  flags 
)
static

Hash function for pvt cause code frames.

Definition at line 1227 of file channel_internal_api.c.

1228{
1229 const struct ast_control_pvt_cause_code *pc = vpc;
1231}
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
Definition strings.h:1259

References ast_str_hash(), ast_strdupa, ast_tech_to_upper(), and ast_control_pvt_cause_code::chan_name.

Referenced by __ast_channel_internal_alloc_with_initializers().

◆ remove_dialstatus_cb()

static int remove_dialstatus_cb ( void *  obj,
void *  arg,
int  flags 
)
static

Definition at line 1191 of file channel_internal_api.c.

1192{
1193 struct ast_control_pvt_cause_code *cause_code = obj;
1194 char *str = ast_tech_to_upper(ast_strdupa(arg));
1195 char *pc_str = ast_tech_to_upper(ast_strdupa(cause_code->chan_name));
1196
1197 if (cause_code->cause_extended) {
1198 return 0;
1199 }
1200 return !strcmp(pc_str, str) ? CMP_MATCH | CMP_STOP : 0;
1201}

References ast_strdupa, ast_tech_to_upper(), ast_control_pvt_cause_code::cause_extended, ast_control_pvt_cause_code::chan_name, CMP_MATCH, CMP_STOP, and str.

Referenced by ast_channel_dialed_causes_add().

Variable Documentation

◆ current_channel_storage_driver

const struct ast_channelstorage_driver* current_channel_storage_driver

◆ current_channel_storage_instance

struct ast_channelstorage_instance* current_channel_storage_instance

◆ uniqueint

int uniqueint
static

The monotonically increasing integer counter for channel uniqueids.

Definition at line 60 of file channel_internal_api.c.

Referenced by __ast_channel_internal_alloc_with_initializers().