Asterisk - The Open Source Telephony Project  GIT-master-44aef04
Data Structures | 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"

Go to the source code of this file.

Data Structures

struct  ast_channel
 Main Channel structure associated with a channel. More...
 
struct  ast_channel_id
 Channel UniqueId structure. More...
 

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)
 
static void __init_channel_errno (void)
 
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. More...
 
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. More...
 
void ast_channel_dialed_causes_clear (const struct ast_channel *chan)
 Clear all cause information from the channel. More...
 
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. More...
 
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)
 
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. More...
 
int ast_channel_fd_count (const struct ast_channel *chan)
 Retrieve the number of file decriptor positions present on the channel. More...
 
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. More...
 
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. More...
 
struct ast_stream_topologyast_channel_get_stream_topology (const struct ast_channel *chan)
 Retrieve the topology of streams on a channel. More...
 
void * ast_channel_get_stream_topology_change_source (struct ast_channel *chan)
 Retrieve the source that initiated the last stream topology change. More...
 
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. More...
 
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. More...
 
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. More...
 
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) More...
 
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. More...
 
void ast_channel_internal_swap_snapshots (struct ast_channel *a, struct ast_channel *b)
 Swap snapshots beteween two channels. More...
 
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. More...
 
void ast_channel_internal_swap_uniqueid_and_linkedid (struct ast_channel *a, struct ast_channel *b)
 Swap uniqueid and linkedid beteween two channels. More...
 
int ast_channel_is_multistream (struct ast_channel *chan)
 Determine if a channel is multi-stream capable. More...
 
int ast_channel_is_t38_active (struct ast_channel *chan)
 This function will check if T.38 is active on the channel. More...
 
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. More...
 
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_linkedid (const struct ast_channel *chan)
 
const char * ast_channel_macrocontext (const struct ast_channel *chan)
 
void ast_channel_macrocontext_set (struct ast_channel *chan, const char *value)
 
const char * ast_channel_macroexten (const struct ast_channel *chan)
 
void ast_channel_macroexten_set (struct ast_channel *chan, const char *value)
 
int ast_channel_macropriority (const struct ast_channel *chan)
 
void ast_channel_macropriority_set (struct ast_channel *chan, int value)
 
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)
 
struct ast_channel_monitorast_channel_monitor (const struct ast_channel *chan)
 
void ast_channel_monitor_set (struct ast_channel *chan, struct ast_channel_monitor *value)
 
void * ast_channel_music_state (const struct ast_channel *chan)
 
void ast_channel_music_state_set (struct ast_channel *chan, void *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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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)
 
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)
 
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. More...
 
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. More...
 
int ast_channel_unbridged_nolock (struct ast_channel *chan)
 ast_channel_unbridged variant. Use this if the channel is already locked prior to calling. More...
 
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)
 
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 (name)
 
 DEFINE_STRINGFIELD_GETTER_FOR (language)
 
 DEFINE_STRINGFIELD_GETTER_FOR (musicclass)
 
 DEFINE_STRINGFIELD_GETTER_FOR (latest_musicclass)
 
 DEFINE_STRINGFIELD_GETTER_FOR (accountcode)
 
 DEFINE_STRINGFIELD_GETTER_FOR (peeraccount)
 
 DEFINE_STRINGFIELD_GETTER_FOR (userfield)
 
 DEFINE_STRINGFIELD_GETTER_FOR (call_forward)
 
 DEFINE_STRINGFIELD_GETTER_FOR (parkinglot)
 
 DEFINE_STRINGFIELD_GETTER_FOR (hangupsource)
 
 DEFINE_STRINGFIELD_GETTER_FOR (dialcontext)
 
 DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR (name, 0, 1, AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE)
 
 DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR (language, 1, 0, AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE)
 
 DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR (accountcode, 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_AND_INVALIDATE_FOR (hangupsource, 0, 0, AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (musicclass, 0)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (latest_musicclass, 0)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (call_forward, 0)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (parkinglot, 0)
 
 DEFINE_STRINGFIELD_SETTERS_FOR (dialcontext, 0)
 
static int pvt_cause_cmp_fn (void *obj, void *vstr, int flags)
 
static int pvt_cause_hash_fn (const void *vpc, const int flags)
 

Variables

static struct ast_threadstorage channel_errno = { .once = PTHREAD_ONCE_INIT , .key_init = __init_channel_errno , .custom_init = NULL , }
 
static int uniqueint
 The monotonically increasing integer counter for channel uniqueids. More...
 

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 288 of file channel_internal_api.c.

◆ DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR

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

Definition at line 252 of file channel_internal_api.c.

◆ DEFINE_STRINGFIELD_SETTERS_FOR

#define DEFINE_STRINGFIELD_SETTERS_FOR (   field,
  assert_on_null 
)

Definition at line 232 of file channel_internal_api.c.

◆ DIALED_CAUSES_BUCKETS

#define DIALED_CAUSES_BUCKETS   37

Definition at line 1329 of file channel_internal_api.c.

Referenced by __ast_channel_internal_alloc().

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 1331 of file channel_internal_api.c.

References __ao2_alloc(), AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ast_atomic_fetchadd_int(), ast_channel_unref, ast_config_AST_SYSTEM_NAME, ast_copy_string(), AST_FLAGS_ALL, 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, NULL, pvt_cause_cmp_fn(), pvt_cause_hash_fn(), tmp(), ast_channel_id::unique_id, ast_channel::uniqueid, and ast_assigned_ids::uniqueid.

Referenced by __ast_channel_alloc_ap(), and __ast_dummy_channel_alloc().

1332 {
1333  struct ast_channel *tmp;
1334 
1335  tmp = __ao2_alloc(sizeof(*tmp), destructor,
1336  AO2_ALLOC_OPT_LOCK_MUTEX, "", file, line, function);
1337 
1338  if (!tmp) {
1339  return NULL;
1340  }
1341 
1342  if ((ast_string_field_init(tmp, 128))) {
1343  return ast_channel_unref(tmp);
1344  }
1345 
1348  if (!tmp->dialed_causes) {
1349  return ast_channel_unref(tmp);
1350  }
1351 
1352  /* set the creation time in the uniqueid */
1353  tmp->uniqueid.creation_time = time(NULL);
1355 
1356  /* use provided id or default to historical {system-}time.# format */
1357  if (assignedids && !ast_strlen_zero(assignedids->uniqueid)) {
1358  ast_copy_string(tmp->uniqueid.unique_id, assignedids->uniqueid, sizeof(tmp->uniqueid.unique_id));
1360  snprintf(tmp->uniqueid.unique_id, sizeof(tmp->uniqueid.unique_id), "%li.%d",
1361  (long)(tmp->uniqueid.creation_time),
1362  tmp->uniqueid.creation_unique);
1363  } else {
1364  snprintf(tmp->uniqueid.unique_id, sizeof(tmp->uniqueid.unique_id), "%s-%li.%d",
1366  (long)(tmp->uniqueid.creation_time),
1367  tmp->uniqueid.creation_unique);
1368  }
1369 
1370  /* copy linked id from parent channel if known */
1371  if (requestor) {
1372  tmp->linkedid = requestor->linkedid;
1373  } else {
1374  tmp->linkedid = tmp->uniqueid;
1375  }
1376 
1377  AST_VECTOR_INIT(&tmp->fds, AST_MAX_FDS);
1378 
1379  /* Force all channel snapshot segments to be created on first use, so we don't have to check if
1380  * an old snapshot exists.
1381  */
1382  ast_set_flag(&tmp->snapshot_segment_flags, AST_FLAGS_ALL);
1383 
1384  return tmp;
1385 }
static int pvt_cause_hash_fn(const void *vpc, const int flags)
Main Channel structure associated with a channel.
struct ast_channel_id linkedid
#define ast_channel_unref(c)
Decrease channel reference count.
Definition: channel.h:2938
#define ast_set_flag(p, flag)
Definition: utils.h:70
static int tmp()
Definition: bt_open.c:389
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:765
char unique_id[AST_MAX_UNIQUEID]
const char * uniqueid
Definition: channel.h:606
#define NULL
Definition: resample.c:96
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:755
const char * ast_config_AST_SYSTEM_NAME
Definition: options.c:170
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
Definition: vector.h:113
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
Definition: stringfields.h:353
struct ao2_container * dialed_causes
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Definition: astobj2.h:1310
#define ast_strlen_zero(a)
Definition: muted.c:73
#define AST_MAX_FDS
Definition: channel.h:195
#define AST_FLAGS_ALL
Definition: utils.h:196
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401
struct ast_channel_id uniqueid
static int pvt_cause_cmp_fn(void *obj, void *vstr, int flags)
#define DIALED_CAUSES_BUCKETS
static int uniqueint
The monotonically increasing integer counter for channel uniqueids.

◆ __init_channel_errno()

static void __init_channel_errno ( void  )
static

Definition at line 1561 of file channel_internal_api.c.

1564 {

◆ ast_channel_adsicpe()

enum ast_channel_adsicpe ast_channel_adsicpe ( const struct ast_channel chan)

Definition at line 781 of file channel_internal_api.c.

782 {
783  return chan->adsicpe;
784 }

◆ 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 1125 of file channel_internal_api.c.

References ast_alertpipe_writable().

Referenced by __ast_queue_frame().

1126 {
1127  return ast_alertpipe_writable(chan->alertpipe);
1128 }
int ast_alertpipe_writable(int alert_pipe[2])
Determine if the alert pipe is writable.
Definition: alertpipe.h:127

◆ ast_channel_alert_write()

int ast_channel_alert_write ( struct ast_channel chan)

Definition at line 1110 of file channel_internal_api.c.

References ast_alertpipe_write().

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

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

◆ ast_channel_amaflags()

enum ama_flags ast_channel_amaflags ( const struct ast_channel chan)

Definition at line 406 of file channel_internal_api.c.

Referenced by ast_channel_log(), ast_channel_snapshot_create(), ast_channel_yank(), ast_var_channels_table(), and func_channel_read().

407 {
408  return chan->amaflags;
409 }

◆ ast_channel_amaflags_set()

void ast_channel_amaflags_set ( struct ast_channel chan,
enum ama_flags  value 
)
Precondition
chan is locked

Definition at line 411 of file channel_internal_api.c.

References ast_channel_publish_snapshot(), and value.

Referenced by __ast_channel_alloc_ap(), ast_cel_fabricate_channel_from_event(), ast_iax2_new(), AST_TEST_DEFINE(), cdr_write(), dahdi_new(), func_channel_write_real(), mgcp_new(), ooh323_new(), pbx_builtin_setamaflags(), sip_new(), and skinny_new().

412 {
413  if (chan->amaflags == value) {
414  return;
415  }
416  chan->amaflags = value;
418 }
int value
Definition: syslog.c:37
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.

◆ ast_channel_answertime()

struct timeval ast_channel_answertime ( struct ast_channel chan)

Definition at line 986 of file channel_internal_api.c.

Referenced by ast_channel_get_up_time_ms(), ospfinished_exec(), and set_channel_answer_time().

987 {
988  return chan->answertime;
989 }
struct timeval answertime

◆ ast_channel_answertime_set()

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

Definition at line 991 of file channel_internal_api.c.

References ast_channel::answertime, and value.

Referenced by set_channel_answer_time().

992 {
993  chan->answertime = *value;
994 }
struct timeval answertime
int value
Definition: syslog.c:37

◆ 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 
)

Definition at line 321 of file channel_internal_api.c.

References ast_channel::appl, AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN, ast_channel_snapshot_invalidate_segment(), and value.

Referenced by ast_cel_fabricate_channel_from_event(), AST_TEST_DEFINE(), begin_dial_prerun(), dial_exec_full(), do_forward(), pbx_exec(), realtime_exec(), and ring_entry().

322 {
323  chan->appl = value;
325 }
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.
int value
Definition: syslog.c:37
const char * appl

◆ 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 585 of file channel_internal_api.c.

References ast_channel::audiohooks, and value.

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

586 {
587  chan->audiohooks = value;
588 }
int value
Definition: syslog.c:37
struct ast_audiohook_list * audiohooks

◆ ast_channel_autochans()

struct ast_autochan_list* ast_channel_autochans ( struct ast_channel chan)

Definition at line 872 of file channel_internal_api.c.

References ast_channel::autochans.

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

873 {
874  return &chan->autochans;
875 }
struct ast_autochan_list autochans

◆ ast_channel_blocker()

pthread_t ast_channel_blocker ( const struct ast_channel chan)

Definition at line 1213 of file channel_internal_api.c.

References ast_channel::blocker.

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

1214 {
1215  return chan->blocker;
1216 }

◆ ast_channel_blocker_set()

void ast_channel_blocker_set ( struct ast_channel chan,
pthread_t  value 
)

Definition at line 1217 of file channel_internal_api.c.

References ast_channel::blocker, and value.

1218 {
1219  chan->blocker = value;
1220 }
int value
Definition: syslog.c:37

◆ ast_channel_blocker_tid()

int ast_channel_blocker_tid ( const struct ast_channel chan)

Definition at line 1222 of file channel_internal_api.c.

References ast_channel::blocker_tid.

Referenced by ast_hangup().

1223 {
1224  return chan->blocker_tid;
1225 }

◆ ast_channel_blocker_tid_set()

void ast_channel_blocker_tid_set ( struct ast_channel chan,
int  value 
)

Definition at line 1226 of file channel_internal_api.c.

References ast_channel::blocker_tid, and value.

1227 {
1228  chan->blocker_tid = value;
1229 }
int value
Definition: syslog.c:37

◆ ast_channel_blockproc()

const char* ast_channel_blockproc ( const struct ast_channel chan)

Definition at line 326 of file channel_internal_api.c.

References ast_channel::blockproc.

Referenced by ast_hangup(), and serialize_showchan().

327 {
328  return chan->blockproc;
329 }
const char * blockproc

◆ ast_channel_blockproc_set()

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

Definition at line 330 of file channel_internal_api.c.

References ast_channel::blockproc, and value.

331 {
332  chan->blockproc = value;
333 }
const char * blockproc
int value
Definition: syslog.c:37

◆ ast_channel_caller()

struct ast_party_caller* ast_channel_caller ( struct ast_channel chan)

Definition at line 888 of file channel_internal_api.c.

References ast_channel::caller.

Referenced by __analog_handle_event(), __analog_ss_thread(), __ast_channel_alloc_ap(), __ast_goto_if_exists(), __ast_pbx_run(), _macro_exec(), acf_isexten_exec(), 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(), cb_events(), 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(), disa_exec(), do_forward(), do_immediate_setup(), fax_detect_framehook(), find_matching_endwhile(), findmeexec(), forward_message(), get_pai(), get_rpid(), gosub_exec(), gosub_run(), handle_cli_confbridge_list_item(), handle_cli_misdn_show_channels(), handle_gosub(), handle_setpriority(), handle_showchan(), incoming_in_dialog_request(), isAnsweringMachine(), isexten_function_read(), leave_voicemail(), local_call(), manager_queues_status(), meetme_show_cmd(), mgcp_hangup(), mgcp_new(), mgcp_ss(), minivm_greet_exec(), minivm_notify_exec(), misdn_call(), misdn_hangup(), misdn_new(), misdn_update_caller_id(), misdn_write(), my_handle_dtmf(), onModeChanged(), ooh323_rtp_read(), ospauth_exec(), osplookup_exec(), oss_call(), oss_new(), park_local_transfer(), parse_oli(), pbx_builtin_background(), pbx_builtin_waitexten(), pbx_outgoing_attempt(), pbx_parseable_goto(), phone_new(), print_bc_info(), privacy_exec(), process_ast_dsp(), process_sdp(), push_callinfo(), queue_connected_line_update(), queue_exec(), readexten_exec(), recalling_enter(), release_chan(), ring_entry(), run_externnotify(), send_callinfo(), serialize_showchan(), setup_env(), setup_privacy_args(), sip_call(), sip_new(), sip_read(), skinny_new(), skinny_newcall(), sla_ring_station(), sms_exec(), socket_process_helper(), start_automixmonitor(), start_automonitor(), state_notify_build_xml(), try_calling(), unistim_new(), unreal_colp_redirect_indicate(), update_connected_line_from_peer(), update_connectedline(), update_initial_connected_line(), valid_exit(), vm_allocate_dh(), vm_authenticate(), wait_for_answer(), waitstream_core(), write_metadata(), and zapateller_exec().

889 {
890  return &chan->caller;
891 }
struct ast_party_caller caller
Channel Caller ID information.

◆ ast_channel_caller_set()

void ast_channel_caller_set ( struct ast_channel chan,
struct ast_party_caller value 
)

Definition at line 944 of file channel_internal_api.c.

References AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER, ast_channel_snapshot_invalidate_segment(), ast_channel::caller, and value.

Referenced by channel_do_masquerade(), dial_trunk(), and sla_ring_station().

945 {
946  chan->caller = *value;
948 }
struct ast_party_caller caller
Channel Caller ID information.
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.
int value
Definition: syslog.c:37

◆ 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 1078 of file channel_internal_api.c.

References ast_channel::callgroup, and value.

Referenced by chan_pjsip_new(), dahdi_new(), func_channel_write_real(), jingle_new(), mgcp_new(), read_config(), sip_new(), skinny_new(), and unistim_new().

1079 {
1080  chan->callgroup = value;
1081 }
int value
Definition: syslog.c:37
ast_group_t callgroup

◆ 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 1068 of file channel_internal_api.c.

References ast_channel::callid.

Referenced by ast_channel_destructor().

1069 {
1070  chan->callid = 0;
1071 }

◆ ast_channel_callid_set()

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

Definition at line 797 of file channel_internal_api.c.

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(), request_channel(), and sip_new().

798 {
799  char call_identifier_from[AST_CALLID_BUFFER_LENGTH];
800  char call_identifier_to[AST_CALLID_BUFFER_LENGTH];
801  call_identifier_from[0] = '\0';
802  ast_callid_strnprint(call_identifier_to, sizeof(call_identifier_to), callid);
803  if (chan->callid) {
804  ast_callid_strnprint(call_identifier_from, sizeof(call_identifier_from), chan->callid);
805  ast_debug(3, "Channel Call ID changing from %s to %s\n", call_identifier_from, call_identifier_to);
806  }
807 
808  chan->callid = callid;
809 
810  ast_test_suite_event_notify("CallIDChange",
811  "State: CallIDChange\r\n"
812  "Channel: %s\r\n"
813  "CallID: %s\r\n"
814  "PriorCallID: %s",
815  ast_channel_name(chan),
816  call_identifier_to,
817  call_identifier_from);
818 }
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:444
#define ast_test_suite_event_notify(s, f,...)
Definition: test.h:196
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:1939
const char * ast_channel_name(const struct ast_channel *chan)
#define AST_CALLID_BUFFER_LENGTH
Definition: logger.h:46

◆ ast_channel_cdr()

struct ast_cdr* ast_channel_cdr ( const struct ast_channel chan)

Definition at line 589 of file channel_internal_api.c.

References ast_channel::cdr.

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

590 {
591  return chan->cdr;
592 }
struct ast_cdr * cdr

◆ ast_channel_cdr_set()

void ast_channel_cdr_set ( struct ast_channel chan,
struct ast_cdr value 
)

Definition at line 593 of file channel_internal_api.c.

References ast_channel::cdr, and value.

Referenced by ast_channel_destructor(), ast_dummy_channel_destructor(), custom_log(), load_values_config(), manager_log(), and syslog_log().

594 {
595  chan->cdr = value;
596 }
struct ast_cdr * cdr
int value
Definition: syslog.c:37

◆ ast_channel_connected()

struct ast_party_connected_line* ast_channel_connected ( struct ast_channel chan)

Definition at line 892 of file channel_internal_api.c.

References ast_channel::connected.

Referenced by __ast_channel_alloc_ap(), __ast_read(), __ast_request_and_dial(), action_meetmelist(), after_bridge_move_channel(), agent_login_channel_config(), analog_call(), ari_channels_handle_originate_with_id(), ast_ari_channels_dial(), ast_call_forward(), ast_channel_connected_line_macro(), ast_channel_connected_line_sub(), ast_channel_destructor(), ast_channel_set_connected_line(), ast_do_pickup(), ast_dummy_channel_destructor(), ast_unreal_call_setup(), attended_transfer_properties_alloc(), begin_dial_prerun(), channel_do_masquerade(), channel_snapshot_connected_create(), connectedline_read(), connectedline_write(), copy_caller_data(), dahdi_call(), dial_exec_full(), do_forward(), findmeexec(), handle_showchan(), iax2_call(), indicate_connected_line(), launch_monitor_thread(), manager_queues_status(), mgcp_call(), ooh323_call(), ooh323_indicate(), park_local_transfer(), pbx_outgoing_attempt(), phone_call(), push_callinfo(), recalling_enter(), retransfer_enter(), ring_entry(), send_callerid_screen(), send_callinfo(), serialize_showchan(), skinny_newcall(), state_notify_build_xml(), try_calling(), unistim_indicate(), unreal_colp_redirect_indicate(), update_config(), update_connectedline(), and wait_for_answer().

893 {
894  return &chan->connected;
895 }
struct ast_party_connected_line connected
Channel Connected Line ID information.

◆ ast_channel_connected_effective_id()

struct ast_party_id ast_channel_connected_effective_id ( struct ast_channel chan)

Definition at line 900 of file channel_internal_api.c.

References ast_party_id_merge().

Referenced by add_rpid(), caller_id_outgoing_request(), caller_id_outgoing_response(), generate_status(), handle_showchan(), initreqprep(), is_colp_update_allowed(), misdn_call(), misdn_get_connected_line(), push_callinfo(), send_callinfo(), set_from_header(), setsubstate(), and update_connectedline().

901 {
902  return ast_party_id_merge(&chan->connected.id, &chan->connected.priv);
903 }
struct ast_party_connected_line connected
Channel Connected Line ID information.
struct ast_party_id id
Connected party ID.
Definition: channel.h:459
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:469

◆ ast_channel_connected_indicated()

struct ast_party_connected_line* ast_channel_connected_indicated ( struct ast_channel chan)

Definition at line 896 of file channel_internal_api.c.

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().

897 {
898  return &chan->connected_indicated;
899 }
struct ast_party_connected_line connected_indicated
Channel Connected Line ID information that was last indicated.

◆ ast_channel_connected_set()

void ast_channel_connected_set ( struct ast_channel chan,
struct ast_party_connected_line value 
)

Definition at line 949 of file channel_internal_api.c.

References AST_CHANNEL_SNAPSHOT_INVALIDATE_CONNECTED, ast_channel_snapshot_invalidate_segment(), ast_channel::connected, and value.

Referenced by channel_do_masquerade().

950 {
951  chan->connected = *value;
953 }
struct ast_party_connected_line connected
Channel Connected Line ID information.
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.
int value
Definition: syslog.c:37

◆ ast_channel_context()

const char* ast_channel_context ( const struct ast_channel chan)

Definition at line 344 of file channel_internal_api.c.

Referenced by __analog_ss_thread(), __ast_goto_if_exists(), __ast_pbx_run(), _macro_exec(), _while_exec(), acf_isexten_exec(), action_blind_transfer(), action_bridge(), action_dialplan_exec(), analog_ss_thread(), ast_app_exec_macro(), ast_bridge_setup_after_goto(), ast_call_forward(), ast_cc_call_init(), ast_channel_by_exten_cb(), 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(), cc_generic_agent_init(), cc_interfaces_datastore_init(), chan_pjsip_cng_tone_detected(), channel_snapshot_dialplan_create(), collect_digits(), common_exec(), conf_run(), console_transfer(), dahdi_handle_dtmf(), dial_exec_full(), dialout(), do_forward(), do_immediate_setup(), expand_gosub_args(), extenspy_exec(), fax_detect_framehook(), feature_blind_transfer(), find_matching_endwhile(), forward_message(), func_channel_read(), func_channel_write_real(), get_cid_name(), get_transfer_context(), gosub_exec(), gosub_run(), goto_exten(), handle_call_forward(), handle_gosub(), handle_setpriority(), handle_showchan(), iax2_call(), launch_monitor_thread(), leave_voicemail(), log_exec(), lua_pbx_exec(), mgcp_ss(), minivm_greet_exec(), misdn_call(), misdn_hangup(), 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_parseable_goto(), pickup_exec(), print_bc_info(), process_ast_dsp(), process_sdp(), raise_exception(), readexten_exec(), realtime_exec(), release_chan(), ring_entry(), serialize_showchan(), setsubstate(), setup_env(), setup_peer_after_bridge_goto(), sip_read(), skinny_dialer(), skinny_newcall(), try_calling(), vm_authenticate(), vm_execmain(), vmauthenticate(), and wait_for_answer().

345 {
346  return chan->context;
347 }

◆ ast_channel_context_set()

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

Definition at line 348 of file channel_internal_api.c.

References AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN, ast_channel_snapshot_invalidate_segment(), and ast_copy_string().

Referenced by __ast_channel_alloc_ap(), __ast_request_and_dial(), _macro_exec(), action_dialplan_exec(), alsa_new(), 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(), dahdi_new(), dial_exec_full(), dialout(), do_notify(), forward_message(), generic_recall(), gosub_exec(), gosub_run(), handle_gosub(), handle_setcontext(), iax2_call(), jingle_new(), leave_voicemail(), mgcp_new(), minivm_greet_exec(), my_distinctive_ring(), nbs_new(), ooh323_new(), pbx_builtin_background(), pbx_extension_helper(), pbx_outgoing_exec(), phone_new(), read_config(), return_exec(), setsubstate(), sip_new(), and skinny_new().

349 {
350  ast_copy_string(chan->context, value, sizeof(chan->context));
352 }
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.
int value
Definition: syslog.c:37
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401

◆ 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 
)

Definition at line 980 of file channel_internal_api.c.

References AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE, ast_channel_snapshot_invalidate_segment(), ast_channel::creationtime, and value.

Referenced by __ast_channel_alloc_ap().

981 {
982  chan->creationtime = *value;
984 }
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.
int value
Definition: syslog.c:37
struct timeval creationtime

◆ 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 
)

Definition at line 338 of file channel_internal_api.c.

References AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN, ast_channel_snapshot_invalidate_segment(), ast_channel::data, and value.

Referenced by ast_cel_fabricate_channel_from_event(), AST_TEST_DEFINE(), begin_dial_prerun(), dial_exec_full(), do_forward(), pbx_exec(), realtime_exec(), retrydial_exec(), and ring_entry().

339 {
340  chan->data = value;
342 }
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.
const char * data
int value
Definition: syslog.c:37

◆ 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 1292 of file channel_internal_api.c.

References ao2_alloc, ao2_find, ao2_link, ao2_ref, ast_control_pvt_cause_code::chan_name, ast_channel::dialed_causes, NULL, OBJ_KEY, OBJ_NODATA, and OBJ_UNLINK.

Referenced by ast_channel_hangupcause_hash_set().

1293 {
1294  struct ast_control_pvt_cause_code *ao2_cause_code;
1295  ao2_find(chan->dialed_causes, cause_code->chan_name, OBJ_KEY | OBJ_UNLINK | OBJ_NODATA);
1296  ao2_cause_code = ao2_alloc(datalen, NULL);
1297 
1298  if (ao2_cause_code) {
1299  memcpy(ao2_cause_code, cause_code, datalen);
1300  ao2_link(chan->dialed_causes, ao2_cause_code);
1301  ao2_ref(ao2_cause_code, -1);
1302  return 0;
1303  } else {
1304  return -1;
1305  }
1306 }
char chan_name[AST_CHANNEL_NAME]
#define OBJ_KEY
Definition: astobj2.h:1155
#define NULL
Definition: resample.c:96
#define ao2_ref(o, delta)
Definition: astobj2.h:464
struct ao2_container * dialed_causes
#define ao2_alloc(data_size, destructor_fn)
Definition: astobj2.h:411
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756
#define ao2_link(container, obj)
Definition: astobj2.h:1549

◆ 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 1274 of file channel_internal_api.c.

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

Referenced by hangupcause_keys_read().

1275 {
1276  struct ast_str *chanlist = ast_str_create(128);
1277 
1278  if (!chanlist) {
1279  return NULL;
1280  }
1281 
1282  ao2_callback(chan->dialed_causes, 0, collect_names_cb, &chanlist);
1283 
1284  return chanlist;
1285 }
static int collect_names_cb(void *obj, void *arg, int flags)
#define ao2_callback(c, flags, cb_fn, arg)
Definition: astobj2.h:1716
#define NULL
Definition: resample.c:96
List of channel drivers.
Definition: app_dial.c:795
struct ao2_container * dialed_causes
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
#define ast_str_create(init_len)
Create a malloc&#39;ed dynamic length string.
Definition: strings.h:620

◆ 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 1308 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().

1309 {
1311 }
#define ao2_callback(c, flags, cb_fn, arg)
Definition: astobj2.h:1716
#define NULL
Definition: resample.c:96
struct ao2_container * dialed_causes

◆ 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 1287 of file channel_internal_api.c.

References ao2_find, ast_channel::dialed_causes, and OBJ_KEY.

Referenced by hangupcause_read().

1288 {
1289  return ao2_find(chan->dialed_causes, chan_name, OBJ_KEY);
1290 }
#define OBJ_KEY
Definition: astobj2.h:1155
struct ao2_container * dialed_causes
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756

◆ ast_channel_dialed_set()

void ast_channel_dialed_set ( struct ast_channel chan,
struct ast_party_dialed value 
)

Definition at line 954 of file channel_internal_api.c.

References AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER, ast_channel_snapshot_invalidate_segment(), ast_channel::dialed, and value.

Referenced by channel_do_masquerade().

955 {
956  chan->dialed = *value;
958 }
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.
int value
Definition: syslog.c:37
struct ast_party_dialed dialed
Dialed/Called information.

◆ ast_channel_dtmf_digit_to_emulate()

char ast_channel_dtmf_digit_to_emulate ( const struct ast_channel chan)

Definition at line 379 of file channel_internal_api.c.

Referenced by __ast_read().

380 {
381  return chan->dtmf_digit_to_emulate;
382 }

◆ ast_channel_dtmf_digit_to_emulate_set()

void ast_channel_dtmf_digit_to_emulate_set ( struct ast_channel chan,
char  value 
)

Definition at line 383 of file channel_internal_api.c.

References value.

Referenced by __ast_read().

384 {
385  chan->dtmf_digit_to_emulate = value;
386 }
int value
Definition: syslog.c:37

◆ ast_channel_dtmf_tv()

struct timeval* ast_channel_dtmf_tv ( struct ast_channel chan)

Definition at line 924 of file channel_internal_api.c.

References ast_channel::dtmf_tv.

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

925 {
926  return &chan->dtmf_tv;
927 }
struct timeval dtmf_tv

◆ ast_channel_dtmf_tv_set()

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

Definition at line 964 of file channel_internal_api.c.

References ast_channel::dtmf_tv, and value.

Referenced by __ast_read().

965 {
966  chan->dtmf_tv = *value;
967 }
int value
Definition: syslog.c:37
struct timeval dtmf_tv

◆ ast_channel_dtmff()

struct ast_frame* ast_channel_dtmff ( struct ast_channel chan)

Definition at line 880 of file channel_internal_api.c.

References ast_channel::dtmff.

Referenced by __ast_read(), and queue_dtmf_readq().

881 {
882  return &chan->dtmff;
883 }
struct ast_frame dtmff

◆ ast_channel_dtmff_set()

void ast_channel_dtmff_set ( struct ast_channel chan,
struct ast_frame value 
)

Definition at line 936 of file channel_internal_api.c.

References ast_channel::dtmff, and value.

937 {
938  chan->dtmff = *value;
939 }
int value
Definition: syslog.c:37
struct ast_frame dtmff

◆ ast_channel_emulate_dtmf_duration()

unsigned int ast_channel_emulate_dtmf_duration ( const struct ast_channel chan)

Definition at line 509 of file channel_internal_api.c.

Referenced by __ast_read().

510 {
511  return chan->emulate_dtmf_duration;
512 }

◆ ast_channel_emulate_dtmf_duration_set()

void ast_channel_emulate_dtmf_duration_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 513 of file channel_internal_api.c.

References value.

Referenced by __ast_read().

514 {
515  chan->emulate_dtmf_duration = value;
516 }
int value
Definition: syslog.c:37

◆ ast_channel_exten()

const char* ast_channel_exten ( const struct ast_channel chan)

Definition at line 353 of file channel_internal_api.c.

Referenced by __ast_goto_if_exists(), __ast_pbx_run(), _macro_exec(), _while_exec(), action_bridge(), action_dialplan_exec(), ast_app_exec_macro(), ast_bridge_setup_after_goto(), ast_cc_call_init(), ast_channel_by_exten_cb(), ast_channel_log(), ast_channel_yank(), ast_pbx_h_exten_run(), ast_str_retrieve_variable(), AST_TEST_DEFINE(), ast_var_channels_table(), bridge_exec(), cb_events(), cc_generic_agent_init(), cc_interfaces_datastore_init(), chan_pjsip_cng_tone_detected(), channel_snapshot_dialplan_create(), dahdi_handle_dtmf(), dial_exec_full(), do_forward(), do_immediate_setup(), dundi_exec(), dundi_helper(), expand_gosub_args(), fax_detect_framehook(), feature_blind_transfer(), find_matching_endwhile(), forward_message(), func_channel_read(), func_channel_write_real(), get_cid_name(), gosub_exec(), gosub_run(), handle_cli_misdn_show_channels(), handle_frame(), handle_gosub(), handle_setpriority(), handle_showchan(), launch_monitor_thread(), leave_voicemail(), log_exec(), lua_pbx_exec(), misdn_hangup(), misdn_update_redirecting(), misdn_write(), my_handle_dtmf(), onModeChanged(), ooh323_rtp_read(), ospauth_exec(), pbx_builtin_goto(), pbx_builtin_setvar_multiple(), pbx_builtin_waitexten(), pbx_extension_helper(), pbx_parseable_goto(), print_bc_info(), process_ast_dsp(), process_sdp(), raise_exception(), realtime_exec(), release_chan(), ring_entry(), serialize_showchan(), setup_env(), setup_peer_after_bridge_goto(), setup_privacy_args(), sip_read(), skinny_newcall(), try_calling(), and wait_for_answer().

354 {
355  return chan->exten;
356 }

◆ ast_channel_exten_set()

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

Definition at line 357 of file channel_internal_api.c.

References AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN, ast_channel_snapshot_invalidate_segment(), and ast_copy_string().

Referenced by __analog_ss_thread(), __ast_channel_alloc_ap(), __ast_request_and_dial(), _macro_exec(), action_dialplan_exec(), alsa_new(), 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(), cb_events(), dahdi_new(), dial_exec_full(), dialout(), do_immediate_setup(), do_monitor_headset(), do_notify(), forward_message(), generic_recall(), gosub_exec(), gosub_run(), handle_gosub(), handle_response_cmgr(), handle_setextension(), jingle_new(), leave_voicemail(), mgcp_new(), mgcp_ss(), minivm_greet_exec(), misdn_call(), misdn_digit_end(), misdn_new(), misdn_overlap_dial_task(), nbs_new(), ooh323_new(), pbx_builtin_background(), pbx_extension_helper(), pbx_outgoing_exec(), phone_new(), read_config(), return_exec(), ring_entry(), select_entry(), set_ext_pri(), setsubstate(), sip_new(), skinny_new(), unistim_ss(), and wait_for_answer().

358 {
359  ast_copy_string(chan->exten, value, sizeof(chan->exten));
361 }
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.
int value
Definition: syslog.c:37
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401

◆ ast_channel_fd()

int ast_channel_fd ( const struct ast_channel chan,
int  which 
)

Definition at line 1186 of file channel_internal_api.c.

References AST_VECTOR_GET, and AST_VECTOR_SIZE.

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

1187 {
1188  return (which >= AST_VECTOR_SIZE(&chan->fds)) ? -1 : AST_VECTOR_GET(&chan->fds, which);
1189 }
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.
Definition: vector.h:682
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
Definition: vector.h:611

◆ 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 1200 of file channel_internal_api.c.

References ast_channel_fd_isset(), AST_EXTENDED_FDS, and AST_VECTOR_REPLACE.

Referenced by AST_TEST_DEFINE().

1201 {
1202  int pos = AST_EXTENDED_FDS;
1203 
1204  while (ast_channel_fd_isset(chan, pos)) {
1205  pos += 1;
1206  }
1207 
1208  AST_VECTOR_REPLACE(&chan->fds, pos, value);
1209 
1210  return pos;
1211 }
int value
Definition: syslog.c:37
#define AST_EXTENDED_FDS
Definition: channel.h:196
#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:284
int ast_channel_fd_isset(const struct ast_channel *chan, int which)

◆ 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 1195 of file channel_internal_api.c.

References AST_VECTOR_SIZE.

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

1196 {
1197  return AST_VECTOR_SIZE(&chan->fds);
1198 }
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
Definition: vector.h:611

◆ ast_channel_fd_isset()

int ast_channel_fd_isset ( const struct ast_channel chan,
int  which 
)

Definition at line 1190 of file channel_internal_api.c.

References ast_channel_fd().

Referenced by __ast_read(), and ast_channel_fd_add().

1191 {
1192  return ast_channel_fd(chan, which) > -1;
1193 }
int ast_channel_fd(const struct ast_channel *chan, int which)

◆ 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 423 of file channel_internal_api.c.

References value.

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

424 {
425  chan->fdno = value;
426 }
int value
Definition: syslog.c:37

◆ ast_channel_fin()

unsigned int ast_channel_fin ( const struct ast_channel chan)

Definition at line 517 of file channel_internal_api.c.

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

518 {
519  return chan->fin;
520 }

◆ ast_channel_fin_set()

void ast_channel_fin_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 521 of file channel_internal_api.c.

References value.

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

522 {
523  chan->fin = value;
524 }
int value
Definition: syslog.c:37

◆ ast_channel_flags()

struct ast_flags* ast_channel_flags ( struct ast_channel chan)

Definition at line 1260 of file channel_internal_api.c.

Referenced by __analog_ss_thread(), __ast_pbx_run(), __ast_queue_frame(), __ast_read(), __ast_request_and_dial(), _macro_exec(), 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_transfer_protocol(), ast_unreal_new_channels(), ast_var_channels_table(), ast_waitfor_nandfds(), ast_waitfordigit_full(), ast_write_stream(), bridge_channel_handle_control(), 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(), phone_read(), playtones_alloc(), retrydial_exec(), return_exec(), serialize_showchan(), should_skip_dtmf(), should_trigger_dtmf_emulating(), sip_fixup(), sip_new(), sip_peer_hold(), tonepair_alloc(), and waitstream_core().

1261 {
1262  return &chan->flags;
1263 }

◆ 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 1511 of file channel_internal_api.c.

References ast_assert, ast_channel_topic(), ast_endpoint_topic(), NULL, and stasis_forward_all().

Referenced by ast_endpoint_add_channel().

1513 {
1514  ast_assert(chan != NULL);
1515  ast_assert(endpoint != NULL);
1516 
1517  chan->endpoint_forward =
1519  ast_endpoint_topic(endpoint));
1520  if (!chan->endpoint_forward) {
1521  return -1;
1522  }
1523 
1524  return 0;
1525 }
struct stasis_topic * ast_endpoint_topic(struct ast_endpoint *endpoint)
Returns the topic for a specific endpoint.
#define ast_assert(a)
Definition: utils.h:650
#define NULL
Definition: resample.c:96
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
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:1577

◆ ast_channel_fout()

unsigned int ast_channel_fout ( const struct ast_channel chan)

Definition at line 525 of file channel_internal_api.c.

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

526 {
527  return chan->fout;
528 }

◆ ast_channel_fout_set()

void ast_channel_fout_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 529 of file channel_internal_api.c.

References value.

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

530 {
531  chan->fout = value;
532 }
int value
Definition: syslog.c:37

◆ 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 709 of file channel_internal_api.c.

References ast_channel::framehooks, and value.

Referenced by ast_framehook_attach(), and ast_framehook_list_destroy().

710 {
711  chan->framehooks = value;
712 }
int value
Definition: syslog.c:37
struct ast_framehook_list * framehooks

◆ 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 717 of file channel_internal_api.c.

References ast_channel::generator, and value.

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

718 {
719  chan->generator = value;
720 }
struct ast_generator * generator
int value
Definition: syslog.c:37

◆ 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
channelThe 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 1619 of file channel_internal_api.c.

References ast_assert, AST_MEDIA_TYPE_END, NULL, and type.

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

1621 {
1622  ast_assert(chan != NULL);
1624 
1625  return chan->default_streams[type];
1626 }
static const char type[]
Definition: chan_ooh323.c:109
#define ast_assert(a)
Definition: utils.h:650
#define NULL
Definition: resample.c:96

◆ ast_channel_get_stream_topology()

struct ast_stream_topology* ast_channel_get_stream_topology ( const struct ast_channel chan)

Retrieve the topology of streams on a channel.

Parameters
chanThe channel to get the stream topology of
Precondition
chan is locked
Return values
non-NULLsuccess
NULLfailure

Definition at line 1583 of file channel_internal_api.c.

References ast_assert, and NULL.

Referenced by __ast_read(), ast_bridge_channel_stream_map(), ast_channel_request_stream_topology_change(), AST_TEST_DEFINE(), ast_unreal_indicate(), ast_write_stream(), dial_exec_full(), do_forward(), handle_showchan(), map_source_to_destinations(), native_rtp_bridge_join(), native_rtp_stream_topology_changed(), sfu_topologies_on_join(), sfu_topologies_on_source_change(), simple_bridge_join(), simple_bridge_stream_topology_changed(), softmix_bridge_stream_sources_update(), softmix_bridge_stream_topology_changed(), stream_echo_exec(), stream_echo_write(), and stream_echo_write_error().

1585 {
1586  ast_assert(chan != NULL);
1587 
1588  return chan->stream_topology;
1589 }
#define ast_assert(a)
Definition: utils.h:650
#define NULL
Definition: resample.c:96

◆ 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 672 of file channel_internal_api.c.

Referenced by native_rtp_stream_topology_changed(), and simple_bridge_stream_topology_changed().

673 {
674  return chan->stream_topology_change_source;
675 }

◆ 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 
)

Definition at line 431 of file channel_internal_api.c.

References AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP, ast_channel_snapshot_invalidate_segment(), and value.

Referenced by __ast_read(), __ast_request_and_dial(), __attempt_transmit(), agent_run(), ast_ari_channels_hangup(), ast_channel_softhangup_withcause_locked(), ast_do_pickup(), AST_TEST_DEFINE(), ast_unreal_call_setup(), ast_unreal_hangup(), call_pickup_incoming_request(), cb_events(), channel_set_cause(), check_rtp_timeout(), console_new(), dahdi_indicate(), dial_exec_full(), disa_exec(), eivr_comm(), handle_call_outgoing(), handle_clear_alarms(), handle_request_invite(), handle_response(), handle_response_invite(), hangupcalls(), hanguptree(), iax2_call(), indicate_busy(), indicate_congestion(), jingle_indicate(), mbl_queue_hangup(), misdn_call(), onCallCleared(), pbx_builtin_hangup(), pbx_start_incoming_request(), receive_dtmf_digits(), refer_incoming_invite_request(), retrans_pkt(), rfc3326_use_reason_header(), ring_entry(), rtp_check_timeout(), send_cause2ast(), session_inv_on_media_update(), set_hangup_source_and_cause(), sip_call(), sip_pickup_thread(), socket_process_helper(), use_reason_header(), wait_for_answer(), and wait_for_winner().

432 {
433  chan->hangupcause = value;
435 }
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.
int value
Definition: syslog.c:37

◆ ast_channel_hold_state()

int ast_channel_hold_state ( const struct ast_channel chan)

Definition at line 485 of file channel_internal_api.c.

Referenced by ast_parse_device_state(), bridge_channel_internal_join(), channel_do_masquerade(), func_channel_read(), and softmix_bridge_join().

486 {
487  return chan->hold_state;
488 }

◆ ast_channel_hold_state_set()

void ast_channel_hold_state_set ( struct ast_channel chan,
int  value 
)

Definition at line 489 of file channel_internal_api.c.

References value.

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

490 {
491  chan->hold_state = value;
492 }
int value
Definition: syslog.c:37

◆ ast_channel_insmpl()

unsigned long ast_channel_insmpl ( const struct ast_channel chan)

Definition at line 533 of file channel_internal_api.c.

References ast_channel::insmpl.

Referenced by __ast_read(), and ast_write_stream().

534 {
535  return chan->insmpl;
536 }
unsigned long insmpl

◆ ast_channel_insmpl_set()

void ast_channel_insmpl_set ( struct ast_channel chan,
unsigned long  value 
)

Definition at line 537 of file channel_internal_api.c.

References ast_channel::insmpl, and value.

Referenced by __ast_read(), and ast_monitor_start().

538 {
539  chan->insmpl = value;
540 }
int value
Definition: syslog.c:37
unsigned long insmpl

◆ ast_channel_internal_alert_flush()

ast_alert_status_t ast_channel_internal_alert_flush ( struct ast_channel chan)

Definition at line 1115 of file channel_internal_api.c.

References ast_alertpipe_flush().

Referenced by chan_cleanup().

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

◆ ast_channel_internal_alert_read()

ast_alert_status_t ast_channel_internal_alert_read ( struct ast_channel chan)

Definition at line 1120 of file channel_internal_api.c.

References ast_alertpipe_read().

Referenced by __ast_queue_frame(), and __ast_read().

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

◆ ast_channel_internal_alert_readable()

int ast_channel_internal_alert_readable ( struct ast_channel chan)

Definition at line 1130 of file channel_internal_api.c.

References ast_alertpipe_readable().

1131 {
1132  return ast_alertpipe_readable(chan->alertpipe);
1133 }
int ast_alertpipe_readable(int alert_pipe[2])
Determine if the alert pipe is readable.
Definition: alertpipe.h:112

◆ ast_channel_internal_alert_readfd()

int ast_channel_internal_alert_readfd ( struct ast_channel chan)

Definition at line 1150 of file channel_internal_api.c.

References ast_alertpipe_readfd().

Referenced by __ast_channel_alloc_ap().

1151 {
1152  return ast_alertpipe_readfd(chan->alertpipe);
1153 }
int ast_alertpipe_readfd(int alert_pipe[2])
Get the alert pipe&#39;s read file descriptor.
Definition: alertpipe.h:143

◆ ast_channel_internal_alertpipe_clear()

void ast_channel_internal_alertpipe_clear ( struct ast_channel chan)

Definition at line 1135 of file channel_internal_api.c.

References ast_alertpipe_clear().

Referenced by __ast_channel_alloc_ap(), and __ast_dummy_channel_alloc().

1136 {
1137  ast_alertpipe_clear(chan->alertpipe);
1138 }
void ast_alertpipe_clear(int alert_pipe[2])
Sets the alert pipe file descriptors to default values.
Definition: alertpipe.h:97

◆ ast_channel_internal_alertpipe_close()

void ast_channel_internal_alertpipe_close ( struct ast_channel chan)

Definition at line 1140 of file channel_internal_api.c.

References ast_alertpipe_close().

Referenced by ast_channel_destructor().

1141 {
1142  ast_alertpipe_close(chan->alertpipe);
1143 }
void ast_alertpipe_close(int alert_pipe[2])
Close an alert pipe.
Definition: alertpipe.c:79

◆ ast_channel_internal_alertpipe_init()

int ast_channel_internal_alertpipe_init ( struct ast_channel chan)

Definition at line 1145 of file channel_internal_api.c.

References ast_alertpipe_init().

Referenced by __ast_channel_alloc_ap().

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

◆ 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 1155 of file channel_internal_api.c.

References ast_alertpipe_swap().

Referenced by channel_do_masquerade().

1156 {
1157  ast_alertpipe_swap(chan1->alertpipe, chan2->alertpipe);
1158 }
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:158

◆ ast_channel_internal_bridge()

struct ast_bridge* ast_channel_internal_bridge ( const struct ast_channel chan)

Definition at line 1240 of file channel_internal_api.c.

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

1241 {
1242  return chan->bridge;
1243 }

◆ 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 
)

Definition at line 1255 of file channel_internal_api.c.

References value.

Referenced by ast_bridge_depart(), ast_bridge_join(), bridge_channel_ind_thread(), and bridge_impart_internal().

1256 {
1257  chan->bridge_channel = value;
1258 }
int value
Definition: syslog.c:37

◆ ast_channel_internal_bridge_set()

void ast_channel_internal_bridge_set ( struct ast_channel chan,
struct ast_bridge value 
)
Precondition
chan is locked

Definition at line 1244 of file channel_internal_api.c.

References ast_channel_publish_snapshot(), AST_CHANNEL_SNAPSHOT_INVALIDATE_BRIDGE, ast_channel_snapshot_invalidate_segment(), and value.

Referenced by bridge_channel_change_bridge(), and bridge_channel_internal_join().

1245 {
1246  chan->bridge = value;
1249 }
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.
int value
Definition: syslog.c:37
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.

◆ ast_channel_internal_cleanup()

void ast_channel_internal_cleanup ( struct ast_channel chan)

Definition at line 1471 of file channel_internal_api.c.

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

Referenced by ast_channel_destructor(), and ast_dummy_channel_destructor().

1472 {
1473  if (chan->dialed_causes) {
1474  ao2_t_ref(chan->dialed_causes, -1,
1475  "done with dialed causes since the channel is going away");
1476  chan->dialed_causes = NULL;
1477  }
1478 
1480 
1481  chan->channel_forward = stasis_forward_cancel(chan->channel_forward);
1482  chan->endpoint_forward = stasis_forward_cancel(chan->endpoint_forward);
1483 
1484  ao2_cleanup(chan->topic);
1485  chan->topic = NULL;
1486 
1488 
1489  AST_VECTOR_FREE(&chan->fds);
1490 }
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:463
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
Definition: vector.h:174
#define NULL
Definition: resample.c:96
struct ao2_container * dialed_causes
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
Definition: stasis.c:1547
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
Definition: stringfields.h:368
void ast_channel_internal_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)

◆ 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
Returns
void

Definition at line 1404 of file channel_internal_api.c.

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().

1405 {
1406  if (dest->linkedid.creation_time == source->linkedid.creation_time
1407  && dest->linkedid.creation_unique == source->linkedid.creation_unique
1408  && !strcmp(dest->linkedid.unique_id, source->linkedid.unique_id)) {
1409  return;
1410  }
1411  dest->linkedid = source->linkedid;
1414 }
struct ast_channel_id linkedid
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.
char unique_id[AST_MAX_UNIQUEID]
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.

◆ ast_channel_internal_errno()

enum ast_channel_error ast_channel_internal_errno ( void  )

Definition at line 1573 of file channel_internal_api.c.

References AST_CHANNEL_ERROR_UNKNOWN, ast_threadstorage_get(), and channel_errno.

Referenced by ast_channel_errno().

1574 {
1575  enum ast_channel_error *error_code = ast_threadstorage_get(&channel_errno, sizeof(*error_code));
1576  if (!error_code) {
1578  }
1579 
1580  return *error_code;
1581 }
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
static struct ast_threadstorage channel_errno
ast_channel_error
Definition: channel.h:4977

◆ ast_channel_internal_errno_set()

void ast_channel_internal_errno_set ( enum ast_channel_error  error)

Definition at line 1563 of file channel_internal_api.c.

References ast_threadstorage_get(), channel_errno, and error().

Referenced by __ast_channel_alloc_ap().

1564 {
1565  enum ast_channel_error *error_code = ast_threadstorage_get(&channel_errno, sizeof(*error_code));
1566  if (!error_code) {
1567  return;
1568  }
1569 
1570  *error_code = error;
1571 }
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
static struct ast_threadstorage channel_errno
ast_channel_error
Definition: channel.h:4977
int error(const char *format,...)
Definition: utils/frame.c:999

◆ ast_channel_internal_fd_clear()

void ast_channel_internal_fd_clear ( struct ast_channel chan,
int  which 
)

Definition at line 1174 of file channel_internal_api.c.

References AST_VECTOR_REPLACE, and AST_VECTOR_SIZE.

Referenced by handle_negotiated_sdp().

1175 {
1176  if (which >= AST_VECTOR_SIZE(&chan->fds)) {
1177  return;
1178  }
1179 
1180  AST_VECTOR_REPLACE(&chan->fds, which, -1);
1181 }
#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:284
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
Definition: vector.h:611

◆ ast_channel_internal_fd_clear_all()

void ast_channel_internal_fd_clear_all ( struct ast_channel chan)

Definition at line 1182 of file channel_internal_api.c.

References AST_VECTOR_ELEM_CLEANUP_NOOP, and AST_VECTOR_RESET.

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

1183 {
1185 }
#define AST_VECTOR_ELEM_CLEANUP_NOOP(elem)
Vector element cleanup that does nothing.
Definition: vector.h:573
#define AST_VECTOR_RESET(vec, cleanup)
Reset vector.
Definition: vector.h:627

◆ ast_channel_internal_fd_set()

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

Definition at line 1161 of file channel_internal_api.c.

References AST_VECTOR_REPLACE, and AST_VECTOR_SIZE.

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

1162 {
1163  int pos;
1164 
1165  /* This ensures that if the vector has to grow with unused positions they will be
1166  * initialized to -1.
1167  */
1168  for (pos = AST_VECTOR_SIZE(&chan->fds); pos < which; pos++) {
1169  AST_VECTOR_REPLACE(&chan->fds, pos, -1);
1170  }
1171 
1172  AST_VECTOR_REPLACE(&chan->fds, which, value);
1173 }
int value
Definition: syslog.c:37
#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:284
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
Definition: vector.h:611

◆ ast_channel_internal_finalize()

void ast_channel_internal_finalize ( struct ast_channel chan)

Definition at line 1492 of file channel_internal_api.c.

Referenced by __ast_channel_alloc_ap().

1493 {
1494  chan->finalized = 1;
1495 }

◆ ast_channel_internal_is_finalized()

int ast_channel_internal_is_finalized ( struct ast_channel chan)

Definition at line 1497 of file channel_internal_api.c.

Referenced by ast_channel_destructor().

1498 {
1499  return chan->finalized;
1500 }

◆ 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 1387 of file channel_internal_api.c.

References a, ast_assert, b, ast_channel_id::creation_time, ast_channel_id::creation_unique, and ast_channel::linkedid.

Referenced by ast_bridge_channel_update_linkedids().

1388 {
1391 
1393  return a;
1394  }
1396  return b;
1397  }
1399  return a;
1400  }
1401  return b;
1402 }
struct ast_channel_id linkedid
#define ast_assert(a)
Definition: utils.h:650
static struct test_val b
static struct test_val a

◆ 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
Returns
void
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 1465 of file channel_internal_api.c.

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

Referenced by ast_cel_fabricate_channel_from_event().

1466 {
1467  ast_copy_string(chan->uniqueid.unique_id, uniqueid, sizeof(chan->uniqueid.unique_id));
1468  ast_copy_string(chan->linkedid.unique_id, linkedid, sizeof(chan->linkedid.unique_id));
1469 }
struct ast_channel_id linkedid
char unique_id[AST_MAX_UNIQUEID]
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401
struct ast_channel_id uniqueid

◆ 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 658 of file channel_internal_api.c.

References ast_stream_topology_free(), and channel_set_default_streams().

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

660 {
661  ast_stream_topology_free(chan->stream_topology);
662  chan->stream_topology = topology;
664 }
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:743

◆ ast_channel_internal_set_stream_topology_change_source()

void ast_channel_internal_set_stream_topology_change_source ( struct ast_channel chan,
void *  change_source 
)

Definition at line 666 of file channel_internal_api.c.

Referenced by ast_channel_request_stream_topology_change(), and ast_channel_stream_topology_changed_externally().

668 {
669  chan->stream_topology_change_source = change_source;
670 }

◆ ast_channel_internal_setup_topics()

int ast_channel_internal_setup_topics ( struct ast_channel chan)

Definition at line 1527 of file channel_internal_api.c.

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

Referenced by __ast_channel_alloc_ap(), and __ast_dummy_channel_alloc().

1528 {
1529  char *topic_name;
1530  int ret;
1531  ast_assert(chan->topic == NULL);
1532 
1533  if (ast_strlen_zero(chan->uniqueid.unique_id)) {
1534  static int dummy_id;
1535  ret = ast_asprintf(&topic_name, "channel:dummy-%d", ast_atomic_fetchadd_int(&dummy_id, +1));
1536  } else {
1537  ret = ast_asprintf(&topic_name, "channel:%s", chan->uniqueid.unique_id);
1538  }
1539 
1540  if (ret < 0) {
1541  return -1;
1542  }
1543 
1544  chan->topic = stasis_topic_create(topic_name);
1545  ast_free(topic_name);
1546  if (!chan->topic) {
1547  return -1;
1548  }
1549 
1550  chan->channel_forward = stasis_forward_all(ast_channel_topic(chan),
1552  if (!chan->channel_forward) {
1553  ao2_ref(chan->topic, -1);
1554  chan->topic = NULL;
1555  return -1;
1556  }
1557 
1558  return 0;
1559 }
char unique_id[AST_MAX_UNIQUEID]
#define ast_assert(a)
Definition: utils.h:650
#define NULL
Definition: resample.c:96
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:755
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
Definition: astmm.h:269
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
#define ao2_ref(o, delta)
Definition: astobj2.h:464
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
Definition: stasis.c:617
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
#define ast_strlen_zero(a)
Definition: muted.c:73
#define ast_free(a)
Definition: astmm.h:182
struct ast_channel_id uniqueid
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:1577

◆ 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
Returns
void
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 1447 of file channel_internal_api.c.

Referenced by channel_do_masquerade().

1448 {
1449  struct stasis_forward *temp;
1450 
1451  temp = a->endpoint_forward;
1452  a->endpoint_forward = b->endpoint_forward;
1453  b->endpoint_forward = temp;
1454 }
Forwarding information.
Definition: stasis.c:1530

◆ 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
Returns
void
Note
This is used in masquerade to exchange snapshots

Definition at line 1456 of file channel_internal_api.c.

Referenced by channel_do_masquerade().

1457 {
1458  struct ast_channel_snapshot *snapshot;
1459 
1460  snapshot = a->snapshot;
1461  a->snapshot = b->snapshot;
1462  b->snapshot = snapshot;
1463 }
Structure representing a snapshot of channel state.

◆ ast_channel_internal_swap_stream_topology()

void ast_channel_internal_swap_stream_topology ( struct ast_channel chan1,
struct ast_channel chan2 
)

Definition at line 1628 of file channel_internal_api.c.

References ast_assert, channel_set_default_streams(), and NULL.

Referenced by channel_do_masquerade().

1630 {
1631  struct ast_stream_topology *tmp_topology;
1632 
1633  ast_assert(chan1 != NULL && chan2 != NULL);
1634 
1635  tmp_topology = chan1->stream_topology;
1636  chan1->stream_topology = chan2->stream_topology;
1637  chan2->stream_topology = tmp_topology;
1638 
1641 }
static void channel_set_default_streams(struct ast_channel *chan)
#define ast_assert(a)
Definition: utils.h:650
#define NULL
Definition: resample.c:96

◆ 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
Returns
void
Note
This is used in masquerade to exchange topics for message routing

Definition at line 1433 of file channel_internal_api.c.

Referenced by channel_do_masquerade().

1434 {
1435  struct stasis_topic *topic;
1436  struct stasis_forward *forward;
1437 
1438  topic = a->topic;
1439  a->topic = b->topic;
1440  b->topic = topic;
1441 
1442  forward = a->channel_forward;
1443  a->channel_forward = b->channel_forward;
1444  b->channel_forward = forward;
1445 }
Forwarding information.
Definition: stasis.c:1530

◆ 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
Returns
void
Note
This is used in masquerade to exchange identities

Definition at line 1416 of file channel_internal_api.c.

References ast_channel::linkedid, and ast_channel::uniqueid.

Referenced by channel_do_masquerade().

1417 {
1418  struct ast_channel_id temp;
1419 
1420  /* This operation is used as part of masquerading and so does not invalidate the peer
1421  * segment. This is due to the masquerade process invalidating all segments.
1422  */
1423 
1424  temp = a->uniqueid;
1425  a->uniqueid = b->uniqueid;
1426  b->uniqueid = temp;
1427 
1428  temp = a->linkedid;
1429  a->linkedid = b->linkedid;
1430  b->linkedid = temp;
1431 }
struct ast_channel_id linkedid
Channel UniqueId structure.
struct ast_channel_id uniqueid

◆ ast_channel_is_multistream()

int ast_channel_is_multistream ( struct ast_channel chan)

Determine if a channel is multi-stream capable.

Parameters
channelThe channel to test
Precondition
chan is locked
Returns
Returns true if the channel is multi-stream capable.

Definition at line 1643 of file channel_internal_api.c.

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().

1644 {
1645  return (chan && chan->tech && chan->tech->read_stream && chan->tech->write_stream);
1646 }
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.h), with stream num.
Definition: channel.h:748
const struct ast_channel_tech * tech
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:754

◆ 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 1046 of file channel_internal_api.c.

References ast_channel_is_t38_active_nolock(), ast_channel_lock, and ast_channel_unlock.

Referenced by bridge_channel_internal_join().

1047 {
1048  int res;
1049 
1050  ast_channel_lock(chan);
1052  ast_channel_unlock(chan);
1053  return res;
1054 }
#define ast_channel_lock(chan)
Definition: channel.h:2902
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...
#define ast_channel_unlock(chan)
Definition: channel.h:2903

◆ 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 1041 of file channel_internal_api.c.

Referenced by ast_channel_is_t38_active().

1042 {
1043  return chan->is_t38_active;
1044 }

◆ 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 940 of file channel_internal_api.c.

References ast_channel::jb, and value.

941 {
942  chan->jb = *value;
943 }
int value
Definition: syslog.c:37
struct ast_jb jb

◆ ast_channel_linkedid()

const char* ast_channel_linkedid ( const struct ast_channel chan)

Definition at line 311 of file channel_internal_api.c.

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

Referenced by ast_channel_log(), AST_TEST_DEFINE(), channel_snapshot_peer_create(), func_channel_read(), func_mchan_read(), func_mchan_write(), handle_showchan(), and serialize_showchan().

312 {
313  ast_assert(chan->linkedid.unique_id[0] != '\0');
314  return chan->linkedid.unique_id;
315 }
struct ast_channel_id linkedid
char unique_id[AST_MAX_UNIQUEID]
#define ast_assert(a)
Definition: utils.h:650

◆ ast_channel_macrocontext()

const char* ast_channel_macrocontext ( const struct ast_channel chan)

◆ ast_channel_macrocontext_set()

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

Definition at line 366 of file channel_internal_api.c.

References ast_copy_string().

Referenced by _macro_exec().

367 {
368  ast_copy_string(chan->macrocontext, value, sizeof(chan->macrocontext));
369 }
int value
Definition: syslog.c:37
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401

◆ ast_channel_macroexten()

const char* ast_channel_macroexten ( const struct ast_channel chan)

◆ ast_channel_macroexten_set()

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

Definition at line 374 of file channel_internal_api.c.

References ast_copy_string().

Referenced by _macro_exec().

375 {
376  ast_copy_string(chan->macroexten, value, sizeof(chan->macroexten));
377 }
int value
Definition: syslog.c:37
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401

◆ ast_channel_macropriority()

int ast_channel_macropriority ( const struct ast_channel chan)

Definition at line 436 of file channel_internal_api.c.

Referenced by ast_channel_log(), and ast_var_channels_table().

437 {
438  return chan->macropriority;
439 }

◆ ast_channel_macropriority_set()

void ast_channel_macropriority_set ( struct ast_channel chan,
int  value 
)

Definition at line 440 of file channel_internal_api.c.

References value.

Referenced by _macro_exec().

441 {
442  chan->macropriority = value;
443 }
int value
Definition: syslog.c:37

◆ ast_channel_masq()

struct ast_channel* ast_channel_masq ( const struct ast_channel chan)

Definition at line 597 of file channel_internal_api.c.

References ast_channel::masq.

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

598 {
599  return chan->masq;
600 }
struct ast_channel * masq

◆ ast_channel_masq_set()

void ast_channel_masq_set ( struct ast_channel chan,
struct ast_channel value 
)

Definition at line 601 of file channel_internal_api.c.

References ast_channel::masq, and value.

Referenced by ast_channel_move(), and channel_do_masquerade().

602 {
603  chan->masq = value;
604 }
struct ast_channel * masq
int value
Definition: syslog.c:37

◆ ast_channel_masqr()

struct ast_channel* ast_channel_masqr ( const struct ast_channel chan)

Definition at line 605 of file channel_internal_api.c.

References ast_channel::masqr.

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

606 {
607  return chan->masqr;
608 }
struct ast_channel * masqr

◆ ast_channel_masqr_set()

void ast_channel_masqr_set ( struct ast_channel chan,
struct ast_channel value 
)

Definition at line 609 of file channel_internal_api.c.

References ast_channel::masqr, and value.

Referenced by ast_channel_move(), and channel_do_masquerade().

610 {
611  chan->masqr = value;
612 }
struct ast_channel * masqr
int value
Definition: syslog.c:37

◆ ast_channel_monitor()

struct ast_channel_monitor* ast_channel_monitor ( const struct ast_channel chan)

◆ ast_channel_monitor_set()

void ast_channel_monitor_set ( struct ast_channel chan,
struct ast_channel_monitor value 
)

Definition at line 617 of file channel_internal_api.c.

References ast_channel::monitor, and value.

Referenced by ast_monitor_start(), ast_monitor_stop(), and channel_do_masquerade().

618 {
619  chan->monitor = value;
620 }
int value
Definition: syslog.c:37
struct ast_channel_monitor * monitor

◆ 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 561 of file channel_internal_api.c.

References ast_channel::music_state, and value.

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

562 {
563  chan->music_state = value;
564 }
int value
Definition: syslog.c:37

◆ ast_channel_named_callgroups()

struct ast_namedgroups* ast_channel_named_callgroups ( const struct ast_channel chan)

Definition at line 1090 of file channel_internal_api.c.

References ast_channel::named_callgroups.

Referenced by find_channel_by_group(), and func_channel_read().

1091 {
1092  return chan->named_callgroups;
1093 }
struct ast_namedgroups * named_callgroups

◆ ast_channel_named_callgroups_set()

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

Definition at line 1094 of file channel_internal_api.c.

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

Referenced by ast_channel_destructor(), chan_pjsip_new(), dahdi_new(), func_channel_write_real(), read_config(), sip_new(), and skinny_new().

1095 {
1098 }
int value
Definition: syslog.c:37
struct ast_namedgroups * ast_ref_namedgroups(struct ast_namedgroups *groups)
Definition: channel.c:7737
struct ast_namedgroups * named_callgroups
struct ast_namedgroups * ast_unref_namedgroups(struct ast_namedgroups *groups)
Definition: channel.c:7731

◆ ast_channel_named_pickupgroups()

struct ast_namedgroups* ast_channel_named_pickupgroups ( const struct ast_channel chan)

Definition at line 1099 of file channel_internal_api.c.

References ast_channel::named_pickupgroups.

Referenced by find_channel_by_group(), and func_channel_read().

1100 {
1101  return chan->named_pickupgroups;
1102 }
struct ast_namedgroups * named_pickupgroups

◆ ast_channel_named_pickupgroups_set()

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

Definition at line 1103 of file channel_internal_api.c.

References ast_ref_namedgroups(), ast_unref_namedgroups(), and ast_channel::named_pickupgroups.

Referenced by ast_channel_destructor(), chan_pjsip_new(), dahdi_new(), func_channel_write_real(), read_config(), sip_new(), and skinny_new().

1104 {
1107 }
int value
Definition: syslog.c:37
struct ast_namedgroups * named_pickupgroups
struct ast_namedgroups * ast_ref_namedgroups(struct ast_namedgroups *groups)
Definition: channel.c:7737
struct ast_namedgroups * ast_unref_namedgroups(struct ast_namedgroups *groups)
Definition: channel.c:7731

◆ 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 677 of file channel_internal_api.c.

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(), NULL, S_COR, S_OR, SCOPE_ENTER, and SCOPE_EXIT_RTN.

Referenced by __ast_channel_alloc_ap(), alsa_new(), ast_channel_destructor(), ast_iax2_new(), 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(), iax2_request(), jingle_interpret_content(), jingle_new(), jingle_read(), make_channel(), mbl_new(), mgcp_new(), mgcp_rtp_read(), misdn_new(), multicast_rtp_request(), nbs_new(), ooh323_new(), ooh323_rtp_read(), ooh323_set_read_format(), ooh323_set_write_format(), oss_new(), phone_new(), process_sdp(), rec_request(), set_caps(), set_format(), sip_new(), sip_rtp_read(), skinny_new(), skinny_rtp_read(), socket_process_helper(), stasis_app_control_snoop(), unicast_rtp_request(), unistim_new(), unistim_rtp_read(), and vmsayname_exec().

679 {
680  SCOPE_ENTER(2, "%s: %sFormats: %s\n", S_OR(ast_channel_name(chan), "<initializing>"),
681  S_COR(ast_channel_is_multistream(chan), "Multistream", ""),
682  ast_str_tmp(128, ast_format_cap_get_names(value, &STR_TMP)));
683 
684  ast_assert(chan != NULL);
685 
686  ao2_replace(chan->nativeformats, value);
687 
688  /* If chan->stream_topology is NULL, the channel is being destroyed
689  * and topology is destroyed.
690  */
691  if (!chan->stream_topology) {
692  SCOPE_EXIT_RTN("Channel is being initialized or destroyed\n");
693  }
694 
695  if (!ast_channel_is_multistream(chan) || !value) {
696  struct ast_stream_topology *new_topology;
697 
698  new_topology = ast_stream_topology_create_from_format_cap(value);
699  ast_channel_internal_set_stream_topology(chan, new_topology);
700  SCOPE_EXIT_RTN("New %stopology set\n", value ? "" : "empty ");
701  }
702  SCOPE_EXIT_RTN("Set native formats but not topology\n");
703 }
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:848
#define ast_assert(a)
Definition: utils.h:650
#define NULL
Definition: resample.c:96
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
#define ast_str_tmp(init_len, __expr)
Definition: strings.h:1136
#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:85
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:736
#define SCOPE_EXIT_RTN(...)
Definition: logger.h:905
#define SCOPE_ENTER(level,...)
Definition: logger.h:890
#define ao2_replace(dst, src)
Definition: astobj2.h:517
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Definition: strings.h:79
const char * ast_channel_name(const struct ast_channel *chan)
void ast_channel_internal_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)

◆ ast_channel_oldwriteformat()

struct ast_format* ast_channel_oldwriteformat ( struct ast_channel chan)

Definition at line 844 of file channel_internal_api.c.

Referenced by ast_stopstream().

845 {
846  return chan->oldwriteformat;
847 }

◆ ast_channel_outsmpl()

unsigned long ast_channel_outsmpl ( const struct ast_channel chan)

Definition at line 541 of file channel_internal_api.c.

References ast_channel::outsmpl.

Referenced by __ast_read(), and ast_write_stream().

542 {
543  return chan->outsmpl;
544 }
unsigned long outsmpl

◆ ast_channel_outsmpl_set()

void ast_channel_outsmpl_set ( struct ast_channel chan,
unsigned long  value 
)

Definition at line 545 of file channel_internal_api.c.

References ast_channel::outsmpl, and value.

Referenced by ast_monitor_start(), and ast_write_stream().

546 {
547  chan->outsmpl = value;
548 }
unsigned long outsmpl
int value
Definition: syslog.c:37

◆ 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 
)

Definition at line 725 of file channel_internal_api.c.

References ast_channel::pbx, and value.

Referenced by __ast_pbx_run(), action_dialplan_exec(), control_swap_channel_in_bridge(), handle_gosub(), and internal_bridge_after_cb().

726 {
727  chan->pbx = value;
728 }
int value
Definition: syslog.c:37
struct ast_pbx * pbx

◆ 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 1086 of file channel_internal_api.c.

References ast_channel::pickupgroup, and value.

Referenced by chan_pjsip_new(), dahdi_new(), func_channel_write_real(), jingle_new(), mgcp_new(), read_config(), sip_new(), skinny_new(), and unistim_new().

1087 {
1088  chan->pickupgroup = value;
1089 }
int value
Definition: syslog.c:37
ast_group_t pickupgroup

◆ 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 757 of file channel_internal_api.c.

References ast_channel::readtrans, and value.

Referenced by ast_set_read_format_path(), and free_translation().

758 {
759  chan->readtrans = value;
760 }
int value
Definition: syslog.c:37
struct ast_trans_pvt * readtrans

◆ 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 916 of file channel_internal_api.c.

References ast_party_id_merge().

Referenced by add_diversion(), and misdn_copy_redirecting_from_ast().

917 {
919 }
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
Definition: channel.h:528
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:537
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
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

◆ ast_channel_redirecting_effective_orig()

struct ast_party_id ast_channel_redirecting_effective_orig ( struct ast_channel chan)

Definition at line 912 of file channel_internal_api.c.

References ast_party_id_merge().

913 {
915 }
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:534
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
struct ast_party_id orig
Who originally redirected the call (Sent to the party the call is redirected toward) ...
Definition: channel.h:525
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

◆ ast_channel_redirecting_effective_to()

struct ast_party_id ast_channel_redirecting_effective_to ( struct ast_channel chan)

Definition at line 920 of file channel_internal_api.c.

References ast_party_id_merge().

Referenced by misdn_copy_redirecting_from_ast().

921 {
922  return ast_party_id_merge(&chan->redirecting.to, &chan->redirecting.priv_to);
923 }
struct ast_party_id priv_to
Call is redirecting to a new party (Sent to the caller) - private representation. ...
Definition: channel.h:540
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
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 to
Call is redirecting to a new party (Sent to the caller)
Definition: channel.h:531

◆ ast_channel_redirecting_set()

void ast_channel_redirecting_set ( struct ast_channel chan,
struct ast_party_redirecting value 
)

Definition at line 959 of file channel_internal_api.c.

References AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER, ast_channel_snapshot_invalidate_segment(), ast_channel::redirecting, and value.

Referenced by channel_do_masquerade().

960 {
961  chan->redirecting = *value;
963 }
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.
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
int value
Definition: syslog.c:37

◆ ast_channel_rings()

int ast_channel_rings ( const struct ast_channel chan)

Definition at line 453 of file channel_internal_api.c.

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

454 {
455  return chan->rings;
456 }

◆ 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 733 of file channel_internal_api.c.

References ast_channel::sched, and value.

Referenced by __ast_channel_alloc_ap(), and ast_hangup().

734 {
735  chan->sched = value;
736 }
struct ast_sched_context * sched
int value
Definition: syslog.c:37

◆ ast_channel_sending_dtmf_digit()

char ast_channel_sending_dtmf_digit ( const struct ast_channel chan)

Definition at line 388 of file channel_internal_api.c.

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

389 {
390  return chan->sending_dtmf_digit;
391 }

◆ ast_channel_sending_dtmf_digit_set()

void ast_channel_sending_dtmf_digit_set ( struct ast_channel chan,
char  value 
)

Definition at line 392 of file channel_internal_api.c.

References value.

Referenced by ast_senddigit_begin(), and ast_senddigit_end().

393 {
394  chan->sending_dtmf_digit = value;
395 }
int value
Definition: syslog.c:37

◆ ast_channel_sending_dtmf_tv()

struct timeval ast_channel_sending_dtmf_tv ( const struct ast_channel chan)

Definition at line 397 of file channel_internal_api.c.

Referenced by bridge_channel_internal_join(), and channel_do_masquerade().

398 {
399  return chan->sending_dtmf_tv;
400 }

◆ ast_channel_sending_dtmf_tv_set()

void ast_channel_sending_dtmf_tv_set ( struct ast_channel chan,
struct timeval  value 
)

Definition at line 401 of file channel_internal_api.c.

References value.

Referenced by ast_senddigit_begin().

402 {
403  chan->sending_dtmf_tv = value;
404 }
int value
Definition: syslog.c:37

◆ 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 1061 of file channel_internal_api.c.

References ast_channel_lock, ast_channel_set_is_t38_active_nolock(), and ast_channel_unlock.

1062 {
1063  ast_channel_lock(chan);
1064  ast_channel_set_is_t38_active_nolock(chan, is_t38_active);
1065  ast_channel_unlock(chan);
1066 }
#define ast_channel_lock(chan)
Definition: channel.h:2902
#define ast_channel_unlock(chan)
Definition: channel.h:2903
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...

◆ 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 1056 of file channel_internal_api.c.

Referenced by ast_channel_set_is_t38_active(), and indicate_data_internal().

1057 {
1058  chan->is_t38_active = !!is_t38_active;
1059 }

◆ ast_channel_set_oldwriteformat()

void ast_channel_set_oldwriteformat ( struct ast_channel chan,
struct ast_format format 
)

Definition at line 824 of file channel_internal_api.c.

References ao2_replace.

Referenced by ast_channel_destructor(), and ast_openstream_full().

825 {
826  ao2_replace(chan->oldwriteformat, format);
827 }
#define ao2_replace(dst, src)
Definition: astobj2.h:517

◆ 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 1591 of file channel_internal_api.c.

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_unreal_indicate(), ast_unreal_new_channels(), chan_pjsip_new(), handle_negotiated_sdp(), make_channel(), and unreal_colp_stream_topology_request_change().

1593 {
1594  struct ast_stream_topology *new_topology;
1595  SCOPE_ENTER(1, "%s: %s\n", ast_channel_name(chan),
1596  ast_str_tmp(256, ast_stream_topology_to_str(topology, &STR_TMP)));
1597 
1598  ast_assert(chan != NULL);
1599 
1600  /* A non-MULTISTREAM channel can't manipulate topology directly */
1602 
1603  /* Unless the channel is being destroyed, we always want a topology on
1604  * it even if its empty.
1605  */
1606  if (!topology) {
1607  new_topology = ast_stream_topology_alloc();
1608  } else {
1609  new_topology = topology;
1610  }
1611 
1612  if (new_topology) {
1613  ast_channel_internal_set_stream_topology(chan, new_topology);
1614  }
1615 
1616  SCOPE_EXIT_RTN_VALUE(new_topology, "Used %s topology\n", topology ? "provided" : "empty");
1617 }
#define ast_assert(a)
Definition: utils.h:650
#define NULL
Definition: resample.c:96
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
#define ast_str_tmp(init_len, __expr)
Definition: strings.h:1136
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:936
struct ast_stream_topology * ast_stream_topology_alloc(void)
Create a stream topology.
Definition: stream.c:650
#define SCOPE_ENTER(level,...)
Definition: logger.h:890
#define SCOPE_EXIT_RTN_VALUE(__return_value,...)
Definition: logger.h:909
const char * ast_channel_name(const struct ast_channel *chan)
void ast_channel_internal_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)

◆ 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 1034 of file channel_internal_api.c.

References ast_channel_lock, ast_channel_set_unbridged_nolock(), and ast_channel_unlock.

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

1035 {
1036  ast_channel_lock(chan);
1038  ast_channel_unlock(chan);
1039 }
#define ast_channel_lock(chan)
Definition: channel.h:2902
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...
int value
Definition: syslog.c:37
#define ast_channel_unlock(chan)
Definition: channel.h:2903

◆ 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 1028 of file channel_internal_api.c.

References ast_null_frame, ast_queue_frame(), 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().

1029 {
1030  chan->unbridged = !!value;
1032 }
int value
Definition: syslog.c:37
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to a channel&#39;s frame queue.
Definition: channel.c:1135
struct ast_frame ast_null_frame
Definition: main/frame.c:79

◆ 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 1648 of file channel_internal_api.c.

Referenced by aoc_publish_blob(), ast_channel_blob_create(), ast_channel_snapshot_create(), and channel_snapshot_update_create().

1649 {
1650  return chan->snapshot;
1651 }

◆ ast_channel_snapshot_segment_flags()

struct ast_flags* ast_channel_snapshot_segment_flags ( struct ast_channel chan)

Definition at line 1659 of file channel_internal_api.c.

Referenced by ast_channel_publish_snapshot(), ast_channel_snapshot_create(), ast_channel_snapshot_invalidate_segment(), and channel_do_masquerade().

1660 {
1661  return &chan->snapshot_segment_flags;
1662 }

◆ ast_channel_snapshot_set()

void ast_channel_snapshot_set ( struct ast_channel chan,
struct ast_channel_snapshot snapshot 
)

Definition at line 1653 of file channel_internal_api.c.

References ao2_bump, and ao2_cleanup.

Referenced by ast_channel_publish_final_snapshot(), and ast_channel_publish_snapshot().

1654 {
1655  ao2_cleanup(chan->snapshot);
1656  chan->snapshot = ao2_bump(snapshot);
1657 }
#define ao2_bump(obj)
Definition: astobj2.h:491
#define ao2_cleanup(obj)
Definition: astobj2.h:1958

◆ 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 1009 of file channel_internal_api.c.

Referenced by ast_channel_clear_softhangup().

1010 {
1011  chan ->softhangup &= ~value;
1012 }
int value
Definition: syslog.c:37

◆ ast_channel_softhangup_internal_flag_set()

void ast_channel_softhangup_internal_flag_set ( struct ast_channel chan,
int  value 
)

Definition at line 1001 of file channel_internal_api.c.

References value.

Referenced by channel_do_masquerade().

1002 {
1003  chan->softhangup = value;
1004 }
int value
Definition: syslog.c:37

◆ ast_channel_state()

enum ast_channel_state ast_channel_state ( const struct ast_channel chan)

Definition at line 789 of file channel_internal_api.c.

790 {
791  return chan->state;
792 }

◆ ast_channel_state_set()

void ast_channel_state_set ( struct ast_channel chan,
enum ast_channel_state  value 
)

Definition at line 820 of file channel_internal_api.c.

References value.

Referenced by __ast_channel_alloc_ap(), ast_setstate(), AST_TEST_DEFINE(), and channel_do_masquerade().

821 {
822  chan->state = value;
823 }
int value
Definition: syslog.c:37

◆ 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 461 of file channel_internal_api.c.

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

462 {
463  return chan->streamid;
464 }

◆ ast_channel_streamid_set()

void ast_channel_streamid_set ( struct ast_channel chan,
int  value 
)

Definition at line 465 of file channel_internal_api.c.

References value.

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

466 {
467  chan->streamid = value;
468 }
int value
Definition: syslog.c:37

◆ ast_channel_tech()

const struct ast_channel_tech* ast_channel_tech ( const struct ast_channel chan)

Definition at line 769 of file channel_internal_api.c.

References ast_channel::tech.

Referenced by __ast_read(), acf_channel_read(), action_dahdishowchannels(), analog_ss_thread(), ast_ari_channels_rtpstatistics(), ast_call(), ast_channel_early_bridge(), ast_channel_queryoption(), ast_channel_request_stream_topology_change(), ast_channel_sendhtml(), ast_channel_setoption(), ast_channel_snapshot_create(), ast_channel_stream_topology_changed(), ast_channel_supports_html(), ast_hangup(), ast_jb_do_usecheck(), ast_pre_call(), ast_raw_answer_with_stream_topology(), ast_rtp_dtmf_compatible(), ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), ast_rtp_instance_make_compatible(), ast_send_image(), ast_senddigit(), ast_senddigit_begin(), ast_senddigit_end(), ast_senddigit_external(), ast_sendtext_data(), ast_supports_images(), ast_transfer_protocol(), ast_var_channel_types_table(), ast_var_channels_table(), ast_write_stream(), ast_write_video(), channel_do_masquerade(), channel_sanitizer(), channel_snapshot_base_create(), conf_run(), dahdi_setoption(), dahdiras_exec(), destroy_all_channels(), flash_exec(), func_channel_read(), func_channel_write_real(), func_header_read(), func_headers_read2(), function_iaxpeer(), function_ooh323_read(), function_ooh323_write(), generate_status(), handle_request_bye(), handle_showchan(), iax2_key_rotate(), iax2_prov_app(), indicate_data_internal(), misdn_facility_exec(), misdn_set_opt_exec(), my_get_sigpvt_bridged_channel(), native_bridge_is_capable(), 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(), push_notify_channel(), reload(), rtp_glue_data_get(), sendtext_exec(), serialize_showchan(), setup_env(), sip_acf_channel_read(), sip_cc_agent_init(), sip_dtmfmode(), sipinfo_send(), softhangup_exec(), t38_masq(), tech_write(), transfer_exec(), and try_calling().

770 {
771  return chan->tech;
772 }
const struct ast_channel_tech * tech

◆ ast_channel_tech_pvt()

void* ast_channel_tech_pvt ( const struct ast_channel chan)

Definition at line 565 of file channel_internal_api.c.

References ast_channel::tech_pvt.

Referenced by __analog_ss_thread(), __dahdi_exception(), acf_channel_read(), action_dahdishowchannels(), alsa_fixup(), analog_hangup(), analog_ss_thread(), announce_hangup(), ast_channel_destructor(), ast_local_get_peer(), ast_local_lock_all(), ast_local_setup_bridge(), ast_local_setup_masquerade(), 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_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(), 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(), destroy_all_channels(), dialog_unlink_all(), func_header_read(), func_headers_read2(), func_read_header(), func_write_header(), function_iaxpeer(), function_ooh323_read(), function_ooh323_write(), get_video_desc(), handle_callforward_button(), handle_clear_alarms(), handle_enbloc_call_message(), handle_offhook_message(), handle_request_bye(), handle_soft_key_event_message(), handle_stimulus_message(), handle_transfer_button(), hangup(), iax2_answer(), iax2_call(), iax2_digit_begin(), iax2_digit_end(), iax2_fixup(), iax2_hangup(), iax2_indicate(), iax2_key_rotate(), 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(), mgcp_answer(), mgcp_call(), mgcp_fixup(), mgcp_get_codec(), mgcp_get_rtp_peer(), mgcp_hangup(), mgcp_indicate(), mgcp_read(), mgcp_senddigit_begin(), mgcp_senddigit_end(), mgcp_set_rtp_peer(), mgcp_ss(), mgcp_write(), 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(), nbs_call(), nbs_hangup(), nbs_xwrite(), 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(), oss_answer(), oss_call(), oss_fixup(), oss_hangup(), oss_indicate(), oss_read(), oss_write(), phone_answer(), phone_call(), phone_digit_end(), phone_exception(), phone_fixup(), phone_hangup(), phone_indicate(), phone_read(), phone_send_text(), phone_setup(), phone_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(), push_notify_channel(), read_test(), rtp_call(), rtp_hangup(), rtp_read(), rtp_write(), send_direct_media_request(), sendtext_data_create(), sip_acf_channel_read(), sip_allow_anyrtp_remote(), sip_answer(), sip_call(), sip_cc_agent_init(), sip_dtmfmode(), sip_fixup(), sip_get_callid(), sip_get_rtp_peer(), sip_get_trtp_peer(), sip_get_vrtp_peer(), sip_hangup(), sip_indicate(), sip_queryoption(), sip_read(), sip_senddigit_begin(), sip_senddigit_end(), sip_sendhtml(), sip_sendtext(), sip_set_rtp_peer(), sip_setoption(), sip_transfer(), sip_write(), sipinfo_send(), skinny_answer(), skinny_call(), skinny_fixup(), skinny_get_rtp_peer(), skinny_get_vrtp_peer(), skinny_hangup(), skinny_indicate(), skinny_newcall(), skinny_read(), skinny_request(), skinny_set_rtp_peer(), skinny_write(), 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(), and unistim_write().

566 {
567  return chan->tech_pvt;
568 }

◆ 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 
)

Definition at line 773 of file channel_internal_api.c.

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

Referenced by __ast_channel_alloc_ap(), alsa_new(), ast_iax2_new(), AST_TEST_DEFINE(), ast_unreal_new_channels(), audiosocket_request(), chan_pjsip_new(), channel_do_masquerade(), console_new(), create_msg_q_chan(), dahdi_new(), do_notify(), jingle_new(), make_channel(), mbl_new(), mgcp_new(), misdn_new(), multicast_rtp_request(), nbs_new(), ooh323_new(), oss_new(), phone_new(), rec_request(), sip_acf_channel_read(), sip_new(), skinny_new(), stasis_app_control_snoop(), test_vm_api_create_mock_channel(), unicast_rtp_request(), unistim_new(), and vmsayname_exec().

774 {
775  if (value->read_stream || value->write_stream) {
776  ast_assert(value->read_stream && value->write_stream);
777  }
778 
779  chan->tech = value;
780 }
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.h), with stream num.
Definition: channel.h:748
#define ast_assert(a)
Definition: utils.h:650
int value
Definition: syslog.c:37
const struct ast_channel_tech * tech
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:754

◆ ast_channel_timer()

struct ast_timer* ast_channel_timer ( const struct ast_channel chan)

Definition at line 737 of file channel_internal_api.c.

Referenced by __ast_channel_alloc_ap(), __ast_queue_frame(), __ast_read(), ast_channel_destructor(), ast_deactivate_generator(), and ast_settimeout_full().

738 {
739  return chan->timer;
740 }

◆ ast_channel_timer_set()

void ast_channel_timer_set ( struct ast_channel chan,
struct ast_timer value 
)

Definition at line 741 of file channel_internal_api.c.

References value.

Referenced by __ast_channel_alloc_ap(), and ast_channel_destructor().

742 {
743  chan->timer = value;
744 }
int value
Definition: syslog.c:37

◆ ast_channel_timingdata()

void* ast_channel_timingdata ( const struct ast_channel chan)

Definition at line 573 of file channel_internal_api.c.

References ast_channel::timingdata.

Referenced by __ast_read(), and ast_settimeout_full().

574 {
575  return chan->timingdata;
576 }

◆ ast_channel_timingdata_set()

void ast_channel_timingdata_set ( struct ast_channel chan,
void *  value 
)

Definition at line 577 of file channel_internal_api.c.

References ast_channel::timingdata, and value.

Referenced by ast_settimeout_full().

578 {
579  chan->timingdata = value;
580 }
int value
Definition: syslog.c:37

◆ ast_channel_timingfd()

int ast_channel_timingfd ( const struct ast_channel chan)

Definition at line 469 of file channel_internal_api.c.

Referenced by __ast_channel_alloc_ap(), __ast_queue_frame(), __ast_read(), add_sdp(), ast_readaudio_callback(), ast_settimeout_full(), and channel_do_masquerade().

470 {
471  return chan->timingfd;
472 }

◆ ast_channel_timingfd_set()

void ast_channel_timingfd_set ( struct ast_channel chan,
int  value 
)

Definition at line 473 of file channel_internal_api.c.

References value.

Referenced by __ast_channel_alloc_ap(), and __ast_dummy_channel_alloc().

474 {
475  chan->timingfd = value;
476 }
int value
Definition: syslog.c:37

◆ 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 1235 of file channel_internal_api.c.

References ast_channel::timingfunc, and value.

Referenced by ast_settimeout_full().

1236 {
1237  chan->timingfunc = value;
1238 }
ast_timing_func_t timingfunc
int value
Definition: syslog.c:37

◆ ast_channel_topic()

struct stasis_topic* ast_channel_topic ( struct ast_channel chan)

A topic which publishes the events for a particular channel.

Since
12 If the given chan is NULL, ast_channel_topic_all() is returned.
Parameters
chanChannel, or NULL.
Return values
Topicfor channel's events.
ast_channel_topic_all()if chan is NULL.

Definition at line 1502 of file channel_internal_api.c.

References ast_channel_topic_all().

Referenced by ari_bridges_play_new(), ast_ari_bridges_record(), ast_channel_forward_endpoint(), ast_channel_internal_setup_topics(), ast_channel_publish_blob(), ast_channel_publish_cached_blob(), ast_channel_publish_final_snapshot(), ast_channel_publish_snapshot(), ast_monitor_start(), ast_monitor_stop(), ast_multi_object_blob_single_channel_publish(), AST_TEST_DEFINE(), forwards_create_channel(), local_optimization_finished_cb(), local_optimization_started_cb(), manager_mute_mixmonitor(), meetme_stasis_generate_msg(), mixmonitor_exec(), moh_post_start(), moh_post_stop(), phase_e_handler(), publish_chanspy_message(), publish_local_bridge_message(), publish_message_for_channel_topics(), queue_publish_multi_channel_blob(), report_fax_status(), report_receive_fax_status(), report_send_fax_status(), send_call_pickup_stasis_message(), send_conf_stasis(), stasis_app_control_publish(), stop_mixmonitor_full(), and talk_detect_audiohook_cb().

1503 {
1504  if (!chan) {
1505  return ast_channel_topic_all();
1506  }
1507 
1508  return chan->topic;
1509 }
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.

◆ ast_channel_transfercapability()

unsigned short ast_channel_transfercapability ( const struct ast_channel chan)

Definition at line 501 of file channel_internal_api.c.

Referenced by ast_ari_channels_dial(), ast_var_channels_table(), begin_dial_prerun(), dahdi_call(), dial_exec_full(), func_channel_read(), misdn_call(), and ooh323_call().

502 {
503  return chan->transfercapability;
504 }

◆ ast_channel_transfercapability_set()

void ast_channel_transfercapability_set ( struct ast_channel chan,
unsigned short  value 
)

Definition at line 505 of file channel_internal_api.c.

References value.

Referenced by ast_ari_channels_dial(), begin_dial_prerun(), cb_events(), dial_exec_full(), and func_channel_write_real().

506 {
507  chan->transfercapability = value;
508 }
int value
Definition: syslog.c:37

◆ 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 1019 of file channel_internal_api.c.

References ast_channel_lock, ast_channel_unbridged_nolock(), and ast_channel_unlock.

Referenced by ast_channel_is_leaving_bridge(), and bridge_channel_wait().

1020 {
1021  int res;
1022  ast_channel_lock(chan);
1023  res = ast_channel_unbridged_nolock(chan);
1024  ast_channel_unlock(chan);
1025  return res;
1026 }
#define ast_channel_lock(chan)
Definition: channel.h:2902
int ast_channel_unbridged_nolock(struct ast_channel *chan)
ast_channel_unbridged variant. Use this if the channel is already locked prior to calling...
#define ast_channel_unlock(chan)
Definition: channel.h:2903

◆ 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 1014 of file channel_internal_api.c.

Referenced by ast_channel_unbridged().

1015 {
1016  return chan->unbridged;
1017 }

◆ ast_channel_uniqueid()

const char* ast_channel_uniqueid ( const struct ast_channel chan)

Definition at line 305 of file channel_internal_api.c.

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

Referenced by __ast_change_name_nolink(), 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_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_by_uniqueid_cb(), ast_channel_log(), ast_channel_move(), ast_channel_publish_cached_blob(), ast_channel_publish_dial_internal(), ast_do_pickup(), ast_endpoint_add_channel(), ast_monitor_start(), ast_monitor_stop(), ast_str_retrieve_variable(), 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(), call(), chan_pjsip_fixup(), chan_pjsip_indicate(), chan_pjsip_new(), chan_pjsip_session_end(), channel_replaced_cb(), channel_snapshot_base_create(), conf_rec_name(), conf_run(), conf_send_event_to_participants(), create_parked_subscription_full(), 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(), mgcp_set_owner(), minivm_mwi_exec(), mixmonitor_exec(), moh_post_start(), moh_post_stop(), multicast_rtp_request(), notify_new_message(), pack_channel_into_message(), park_and_announce_app_exec(), park_common_setup(), park_local_transfer(), parking_blind_transfer_park(), parking_park_bridge_channel(), phase_e_handler(), 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(), sip_set_owner(), skinny_set_owner(), 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().

306 {
307  ast_assert(chan->uniqueid.unique_id[0] != '\0');
308  return chan->uniqueid.unique_id;
309 }
char unique_id[AST_MAX_UNIQUEID]
#define ast_assert(a)
Definition: utils.h:650
struct ast_channel_id uniqueid

◆ 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 972 of file channel_internal_api.c.

References value, and ast_channel::varshead.

973 {
974  chan->varshead = *value;
975 }
int value
Definition: syslog.c:37
struct varshead varshead

◆ ast_channel_visible_indication()

int ast_channel_visible_indication ( const struct ast_channel chan)

Definition at line 477 of file channel_internal_api.c.

Referenced by channel_do_masquerade(), and pre_bridge_setup().

478 {
479  return chan->visible_indication;
480 }

◆ ast_channel_visible_indication_set()

void ast_channel_visible_indication_set ( struct ast_channel chan,
int  value 
)

Definition at line 481 of file channel_internal_api.c.

References value.

Referenced by dial_exec_full(), and indicate_data_internal().

482 {
483  chan->visible_indication = value;
484 }
int value
Definition: syslog.c:37

◆ ast_channel_vstream()

struct ast_filestream* ast_channel_vstream ( const struct ast_channel chan)

Definition at line 629 of file channel_internal_api.c.

References ast_channel::vstream.

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

630 {
631  return chan->vstream;
632 }
struct ast_filestream * vstream

◆ ast_channel_vstream_set()

void ast_channel_vstream_set ( struct ast_channel chan,
struct ast_filestream value 
)

Definition at line 633 of file channel_internal_api.c.

References value, and