channel_internal_api.c File Reference

Channel Accessor API. More...

#include "asterisk.h"
#include <unistd.h>
#include <fcntl.h>
#include "asterisk/paths.h"
#include "asterisk/channel.h"
#include "asterisk/channel_internal.h"
#include "asterisk/data.h"
#include "asterisk/endpoints.h"
#include "asterisk/indications.h"
#include "asterisk/stasis_cache_pattern.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_endpoints.h"
#include "asterisk/stringfields.h"
#include "asterisk/test.h"

Include dependency graph for channel_internal_api.c:

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

Defines

#define DATA_EXPORT_CHANNEL(MEMBER)
#define DEFINE_STRINGFIELD_GETTER_FOR(field)
#define DEFINE_STRINGFIELD_SETTERS_FOR(field, publish, 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)
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)
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)
int ast_channel_data_add_structure (struct ast_data *tree, struct ast_channel *chan, int add_bridged)
 Insert into an astdata tree, the channel structure.
int ast_channel_data_cmp_structure (const struct ast_data_search *tree, struct ast_channel *chan, const char *structure_name)
 Compare to channel structures using the data api.
void ast_channel_data_set (struct ast_channel *chan, const char *value)
struct ast_datastore_listast_channel_datastores (struct ast_channel *chan)
struct ast_party_dialedast_channel_dialed (struct ast_channel *chan)
int ast_channel_dialed_causes_add (const struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code, int datalen)
 Add cause code information to the channel.
struct ast_strast_channel_dialed_causes_channels (const struct ast_channel *chan)
 Retrieve a comma-separated list of channels for which dialed cause information is available.
void ast_channel_dialed_causes_clear (const struct ast_channel *chan)
 Clear all cause information from the channel.
struct ast_control_pvt_cause_codeast_channel_dialed_causes_find (const struct ast_channel *chan, const char *chan_name)
 Retrieve a ref-counted cause code information structure.
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_isset (const struct ast_channel *chan, int which)
int ast_channel_fdno (const struct ast_channel *chan)
void ast_channel_fdno_set (struct ast_channel *chan, int value)
unsigned int ast_channel_fin (const struct ast_channel *chan)
void ast_channel_fin_set (struct ast_channel *chan, unsigned int value)
struct ast_flagsast_channel_flags (struct ast_channel *chan)
int ast_channel_forward_endpoint (struct ast_channel *chan, struct ast_endpoint *endpoint)
 Forward channel stasis messages to the given endpoint.
unsigned int ast_channel_fout (const struct ast_channel *chan)
void ast_channel_fout_set (struct ast_channel *chan, unsigned int value)
struct ast_framehook_listast_channel_framehooks (const struct ast_channel *chan)
void ast_channel_framehooks_set (struct ast_channel *chan, struct ast_framehook_list *value)
struct ast_generatorast_channel_generator (const struct ast_channel *chan)
void ast_channel_generator_set (struct ast_channel *chan, struct ast_generator *value)
void * ast_channel_generatordata (const struct ast_channel *chan)
void ast_channel_generatordata_set (struct ast_channel *chan, void *value)
struct ast_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_read (struct ast_channel *chan)
int ast_channel_internal_alert_readable (struct ast_channel *chan)
int ast_channel_internal_alert_readfd (struct ast_channel *chan)
void ast_channel_internal_alertpipe_clear (struct ast_channel *chan)
void ast_channel_internal_alertpipe_close (struct ast_channel *chan)
int ast_channel_internal_alertpipe_init (struct ast_channel *chan)
void ast_channel_internal_alertpipe_swap (struct ast_channel *chan1, struct ast_channel *chan2)
 Swap the interal alertpipe between two channels.
struct ast_bridgeast_channel_internal_bridge (const struct ast_channel *chan)
struct ast_bridge_channelast_channel_internal_bridge_channel (const struct ast_channel *chan)
void ast_channel_internal_bridge_channel_set (struct ast_channel *chan, struct ast_bridge_channel *value)
void ast_channel_internal_bridge_set (struct ast_channel *chan, struct ast_bridge *value)
void ast_channel_internal_cleanup (struct ast_channel *chan)
void ast_channel_internal_copy_linkedid (struct ast_channel *dest, struct ast_channel *source)
 Copy the full linkedid channel id structure from one channel to another.
void ast_channel_internal_fd_clear (struct ast_channel *chan, int which)
void ast_channel_internal_fd_clear_all (struct ast_channel *chan)
void ast_channel_internal_fd_set (struct ast_channel *chan, int which, int value)
void ast_channel_internal_finalize (struct ast_channel *chan)
int ast_channel_internal_is_finalized (struct ast_channel *chan)
struct ast_channelast_channel_internal_oldest_linkedid (struct ast_channel *a, struct ast_channel *b)
 Determine which channel has an older linkedid.
void ast_channel_internal_set_fake_ids (struct ast_channel *chan, const char *uniqueid, const char *linkedid)
 Set uniqueid and linkedid string value only (not time).
int ast_channel_internal_setup_topics (struct ast_channel *chan)
void ast_channel_internal_swap_topics (struct ast_channel *a, struct ast_channel *b)
 Swap topics beteween two channels.
void ast_channel_internal_swap_uniqueid_and_linkedid (struct ast_channel *a, struct ast_channel *b)
 Swap uniqueid and linkedid beteween two channels.
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_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)
void ast_channel_set_unbridged (struct ast_channel *chan, int value)
 Sets the unbridged flag and queues a NULL frame on the channel to trigger a check by bridge_channel_wait.
void ast_channel_set_unbridged_nolock (struct ast_channel *chan, int value)
 Variant of ast_channel_set_unbridged. Use this if the channel is already locked prior to calling.
void ast_channel_set_writeformat (struct ast_channel *chan, struct ast_format *format)
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)
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.
struct stasis_topicast_channel_topic_cached (struct ast_channel *chan)
 A topic which publishes the events for a particular channel.
unsigned short ast_channel_transfercapability (const struct ast_channel *chan)
void ast_channel_transfercapability_set (struct ast_channel *chan, unsigned short value)
int ast_channel_unbridged (struct ast_channel *chan)
 This function will check if the bridge needs to be re-evaluated due to external changes.
int ast_channel_unbridged_nolock (struct ast_channel *chan)
 ast_channel_unbridged variant. Use this if the channel is already locked prior to calling.
const char * ast_channel_uniqueid (const struct ast_channel *chan)
struct varsheadast_channel_varshead (struct ast_channel *chan)
void ast_channel_varshead_set (struct ast_channel *chan, struct varshead *value)
int ast_channel_visible_indication (const struct ast_channel *chan)
void ast_channel_visible_indication_set (struct ast_channel *chan, int value)
struct ast_filestreamast_channel_vstream (const struct ast_channel *chan)
void ast_channel_vstream_set (struct ast_channel *chan, struct ast_filestream *value)
int ast_channel_vstreamid (const struct ast_channel *chan)
void ast_channel_vstreamid_set (struct ast_channel *chan, int value)
struct timeval * ast_channel_whentohangup (struct ast_channel *chan)
void ast_channel_whentohangup_set (struct ast_channel *chan, struct timeval *value)
struct ast_formatast_channel_writeformat (struct ast_channel *chan)
struct ast_trans_pvtast_channel_writetrans (const struct ast_channel *chan)
void ast_channel_writetrans_set (struct ast_channel *chan, struct ast_trans_pvt *value)
struct ast_tone_zoneast_channel_zone (const struct ast_channel *chan)
void ast_channel_zone_set (struct ast_channel *chan, struct ast_tone_zone *value)
 AST_DATA_STRUCTURE (ast_channel, DATA_EXPORT_CHANNEL)
static void channel_data_add_flags (struct ast_data *tree, struct ast_channel *chan)
static int collect_names_cb (void *obj, void *arg, int flags)
 DEFINE_STRINGFIELD_GETTER_FOR (dialcontext)
 DEFINE_STRINGFIELD_GETTER_FOR (hangupsource)
 DEFINE_STRINGFIELD_GETTER_FOR (parkinglot)
 DEFINE_STRINGFIELD_GETTER_FOR (call_forward)
 DEFINE_STRINGFIELD_GETTER_FOR (userfield)
 DEFINE_STRINGFIELD_GETTER_FOR (peeraccount)
 DEFINE_STRINGFIELD_GETTER_FOR (accountcode)
 DEFINE_STRINGFIELD_GETTER_FOR (latest_musicclass)
 DEFINE_STRINGFIELD_GETTER_FOR (musicclass)
 DEFINE_STRINGFIELD_GETTER_FOR (language)
 DEFINE_STRINGFIELD_GETTER_FOR (name)
 DEFINE_STRINGFIELD_SETTERS_FOR (dialcontext, 0, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (hangupsource, 0, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (parkinglot, 0, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (call_forward, 0, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (userfield, 0, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (peeraccount, 1, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (accountcode, 1, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (latest_musicclass, 0, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (musicclass, 0, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (language, 1, 0)
 DEFINE_STRINGFIELD_SETTERS_FOR (name, 0, 1)
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 int uniqueint
 The monotonically increasing integer counter for channel uniqueids.


Detailed Description

Channel Accessor API.

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

Author:
Terry Wilson

Definition in file channel_internal_api.c.


Define Documentation

#define DATA_EXPORT_CHANNEL ( MEMBER   ) 

Definition at line 245 of file channel_internal_api.c.

#define DEFINE_STRINGFIELD_GETTER_FOR ( field   ) 

Value:

const char *ast_channel_##field(const struct ast_channel *chan) \
{ \
   return chan->field; \
}

Definition at line 471 of file channel_internal_api.c.

#define DEFINE_STRINGFIELD_SETTERS_FOR ( field,
publish,
assert_on_null   ) 

Definition at line 437 of file channel_internal_api.c.

#define DIALED_CAUSES_BUCKETS   37

Definition at line 1437 of file channel_internal_api.c.

Referenced by __ast_channel_internal_alloc().


Function Documentation

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 
) [read]

Definition at line 1439 of file channel_internal_api.c.

References __ao2_alloc_debug(), ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc, ast_atomic_fetchadd_int(), ast_channel_unref, ast_config_AST_SYSTEM_NAME, ast_copy_string(), ast_string_field_init, ast_strlen_zero, 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_assigned_ids::uniqueid, and ast_channel::uniqueid.

01440 {
01441    struct ast_channel *tmp;
01442 #if defined(REF_DEBUG)
01443    tmp = __ao2_alloc_debug(sizeof(*tmp), destructor,
01444       AO2_ALLOC_OPT_LOCK_MUTEX, "", file, line, function, 1);
01445 #elif defined(__AST_DEBUG_MALLOC)
01446    tmp = __ao2_alloc_debug(sizeof(*tmp), destructor,
01447       AO2_ALLOC_OPT_LOCK_MUTEX, "", file, line, function, 0);
01448 #else
01449    tmp = ao2_alloc(sizeof(*tmp), destructor);
01450 #endif
01451 
01452    if ((ast_string_field_init(tmp, 128))) {
01453       return ast_channel_unref(tmp);
01454    }
01455 
01456    if (!(tmp->dialed_causes = ao2_container_alloc(DIALED_CAUSES_BUCKETS, pvt_cause_hash_fn, pvt_cause_cmp_fn))) {
01457       return ast_channel_unref(tmp);
01458    }
01459 
01460    /* set the creation time in the uniqueid */
01461    tmp->uniqueid.creation_time = time(NULL);
01462    tmp->uniqueid.creation_unique = ast_atomic_fetchadd_int(&uniqueint, 1);
01463 
01464    /* use provided id or default to historical {system-}time.# format */
01465    if (assignedids && !ast_strlen_zero(assignedids->uniqueid)) {
01466       ast_copy_string(tmp->uniqueid.unique_id, assignedids->uniqueid, sizeof(tmp->uniqueid.unique_id));
01467    } else if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
01468       snprintf(tmp->uniqueid.unique_id, sizeof(tmp->uniqueid.unique_id), "%li.%d",
01469          (long)(tmp->uniqueid.creation_time),
01470          tmp->uniqueid.creation_unique);
01471    } else {
01472       snprintf(tmp->uniqueid.unique_id, sizeof(tmp->uniqueid.unique_id), "%s-%li.%d",
01473          ast_config_AST_SYSTEM_NAME,
01474          (long)(tmp->uniqueid.creation_time),
01475          tmp->uniqueid.creation_unique);
01476    }
01477 
01478    /* copy linked id from parent channel if known */
01479    if (requestor) {
01480       tmp->linkedid = requestor->linkedid;
01481    } else {
01482       tmp->linkedid = tmp->uniqueid;
01483    }
01484 
01485    return tmp;
01486 }

enum ast_channel_adsicpe ast_channel_adsicpe ( const struct ast_channel chan  ) 

Definition at line 905 of file channel_internal_api.c.

References ast_channel::adsicpe.

00906 {
00907    return chan->adsicpe;
00908 }

void ast_channel_adsicpe_set ( struct ast_channel chan,
enum ast_channel_adsicpe  value 
)

int ast_channel_alert_writable ( struct ast_channel chan  ) 

Definition at line 1237 of file channel_internal_api.c.

References ast_channel::alertpipe.

Referenced by __ast_queue_frame(), ast_channel_alert_write(), and ast_channel_internal_alertpipe_close().

01238 {
01239    return chan->alertpipe[1] > -1;
01240 }

int ast_channel_alert_write ( struct ast_channel chan  ) 

Definition at line 1202 of file channel_internal_api.c.

References ast_channel::alertpipe, and ast_channel_alert_writable().

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

01203 {
01204    char blah = 0x7F;
01205    return ast_channel_alert_writable(chan) && write(chan->alertpipe[1], &blah, sizeof(blah)) != sizeof(blah);
01206 }

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  )  [read]

Definition at line 1105 of file channel_internal_api.c.

Referenced by ast_channel_get_up_time(), and ospfinished_exec().

01106 {
01107    return chan->answertime;
01108 }

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

Definition at line 1110 of file channel_internal_api.c.

References ast_channel::answertime.

Referenced by ast_raw_answer().

01111 {
01112    chan->answertime = *value;
01113 }

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_list* ast_channel_audiohooks ( const struct ast_channel chan  )  [read]

void ast_channel_audiohooks_set ( struct ast_channel chan,
struct ast_audiohook_list value 
)

Definition at line 773 of file channel_internal_api.c.

References ast_channel::audiohooks.

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

00774 {
00775    chan->audiohooks = value;
00776 }

struct ast_autochan_list* ast_channel_autochans ( struct ast_channel chan  )  [read]

Definition at line 996 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().

00997 {
00998    return &chan->autochans;
00999 }

pthread_t ast_channel_blocker ( const struct ast_channel chan  ) 

Definition at line 1331 of file channel_internal_api.c.

References ast_channel::blocker.

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

01332 {
01333    return chan->blocker;
01334 }

void ast_channel_blocker_set ( struct ast_channel chan,
pthread_t  value 
)

Definition at line 1335 of file channel_internal_api.c.

References ast_channel::blocker.

Referenced by __ast_read().

01336 {
01337    chan->blocker = value;
01338 }

const char* ast_channel_blockproc ( const struct ast_channel chan  ) 

Definition at line 508 of file channel_internal_api.c.

References ast_channel::blockproc.

Referenced by ast_hangup(), and serialize_showchan().

00509 {
00510    return chan->blockproc;
00511 }

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

Definition at line 512 of file channel_internal_api.c.

References ast_channel::blockproc.

00513 {
00514    chan->blockproc = value;
00515 }

struct ast_party_caller* ast_channel_caller ( struct ast_channel chan  )  [read]

Definition at line 1012 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_confbridgelist_item(), action_meetmelist(), agent_request_exec(), analog_ss_thread(), app_exec(), ast_app_dtget(), ast_bridge_setup_after_goto(), ast_cel_fabricate_channel_from_event(), ast_channel_destructor(), ast_channel_set_caller(), ast_channel_set_caller_event(), ast_channel_snapshot_create(), 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(), callerpres_read(), callerpres_write(), cb_events(), cc_generic_agent_init(), chan_pjsip_cng_tone_detected(), chan_pjsip_new(), channel_do_masquerade(), 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(), 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_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(), setcallerid_pres_exec(), 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_connectedline(), update_initial_connected_line(), valid_exit(), vm_authenticate(), wait_for_answer(), waitstream_core(), write_metadata(), and zapateller_exec().

01013 {
01014    return &chan->caller;
01015 }

void ast_channel_caller_set ( struct ast_channel chan,
struct ast_party_caller value 
)

Definition at line 1068 of file channel_internal_api.c.

References ast_channel::caller.

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

01069 {
01070    chan->caller = *value;
01071 }

ast_group_t ast_channel_callgroup ( const struct ast_channel chan  ) 

void ast_channel_callgroup_set ( struct ast_channel chan,
ast_group_t  value 
)

Precondition:
chan is locked

Definition at line 1170 of file channel_internal_api.c.

References ast_channel::callgroup.

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

01171 {
01172    chan->callgroup = value;
01173 }

ast_callid ast_channel_callid ( const struct ast_channel chan  ) 

void ast_channel_callid_cleanup ( struct ast_channel chan  ) 

Definition at line 1160 of file channel_internal_api.c.

References ast_channel::callid.

Referenced by ast_channel_destructor().

01161 {
01162    chan->callid = 0;
01163 }

void ast_channel_callid_set ( struct ast_channel chan,
ast_callid  value 
)

Precondition:
chan is locked

Definition at line 921 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_request(), ast_unreal_channel_push_to_bridge(), ast_unreal_new_channels(), common_recall_channel_setup(), dahdi_new(), iax2_request(), jingle_new(), and sip_new().

00922 {
00923    char call_identifier_from[AST_CALLID_BUFFER_LENGTH];
00924    char call_identifier_to[AST_CALLID_BUFFER_LENGTH];
00925    call_identifier_from[0] = '\0';
00926    ast_callid_strnprint(call_identifier_to, sizeof(call_identifier_to), callid);
00927    if (chan->callid) {
00928       ast_callid_strnprint(call_identifier_from, sizeof(call_identifier_from), chan->callid);
00929       ast_debug(3, "Channel Call ID changing from %s to %s\n", call_identifier_from, call_identifier_to);
00930    }
00931 
00932    chan->callid = callid;
00933 
00934    ast_test_suite_event_notify("CallIDChange",
00935       "State: CallIDChange\r\n"
00936       "Channel: %s\r\n"
00937       "CallID: %s\r\n"
00938       "PriorCallID: %s",
00939       ast_channel_name(chan),
00940       call_identifier_to,
00941       call_identifier_from);
00942 }

struct ast_cdr* ast_channel_cdr ( const struct ast_channel chan  )  [read]

Definition at line 777 of file channel_internal_api.c.

References ast_channel::cdr.

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

00778 {
00779    return chan->cdr;
00780 }

void ast_channel_cdr_set ( struct ast_channel chan,
struct ast_cdr value 
)

Definition at line 781 of file channel_internal_api.c.

References ast_channel::cdr.

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

00782 {
00783    chan->cdr = value;
00784 }

struct ast_party_connected_line* ast_channel_connected ( struct ast_channel chan  )  [read]

struct ast_party_id ast_channel_connected_effective_id ( struct ast_channel chan  )  [read]

struct ast_party_connected_line* ast_channel_connected_indicated ( struct ast_channel chan  )  [read]

void ast_channel_connected_set ( struct ast_channel chan,
struct ast_party_connected_line value 
)

Definition at line 1072 of file channel_internal_api.c.

References ast_channel::connected.

Referenced by channel_do_masquerade().

01073 {
01074    chan->connected = *value;
01075 }

const char* ast_channel_context ( const struct ast_channel chan  ) 

Definition at line 525 of file channel_internal_api.c.

References ast_channel::context.

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_snapshot_create(), 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(), bridge_exec(), cc_generic_agent_init(), cc_interfaces_datastore_init(), chan_pjsip_cng_tone_detected(), 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(), 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().

00526 {
00527    return chan->context;
00528 }

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

struct timeval ast_channel_creationtime ( struct ast_channel chan  )  [read]

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

Definition at line 1100 of file channel_internal_api.c.

References ast_channel::creationtime.

Referenced by __ast_channel_alloc_ap().

01101 {
01102    chan->creationtime = *value;
01103 }

const char* ast_channel_data ( const struct ast_channel chan  ) 

int ast_channel_data_add_structure ( struct ast_data tree,
struct ast_channel chan,
int  add_bridged 
)

Insert into an astdata tree, the channel structure.

Parameters:
[in] tree The ast data tree.
[in] chan The channel structure to add to tree.
[in] add_bridged Add the bridged channel to the structure.
Return values:
<0 on error.
0 on success.

Definition at line 298 of file channel_internal_api.c.

References ast_cause2str(), ast_channel_amaflags(), ast_channel_amaflags2string(), ast_channel_bridge_peer(), ast_channel_cleanup, ast_channel_data_add_structure(), ast_channel_hangupcause(), ast_channel_linkedid(), ast_channel_nativeformats(), ast_channel_oldwriteformat(), ast_channel_rawreadformat(), ast_channel_rawwriteformat(), ast_channel_readformat(), ast_channel_softhangup_internal_flag(), ast_channel_transfercapability(), ast_channel_uniqueid(), ast_channel_whentohangup(), ast_channel_writeformat(), ast_channel_zone(), ast_data_add_bool(), ast_data_add_codec(), ast_data_add_codecs(), ast_data_add_int(), ast_data_add_node(), ast_data_add_str(), ast_data_add_structure, ast_data_add_uint(), AST_SOFTHANGUP_APPUNLOAD, AST_SOFTHANGUP_ASYNCGOTO, AST_SOFTHANGUP_DEV, AST_SOFTHANGUP_EXPLICIT, AST_SOFTHANGUP_SHUTDOWN, AST_SOFTHANGUP_TIMEOUT, ast_state2str(), ast_tone_zone_data_add_structure(), ast_transfercapability2str(), bc, channel_data_add_flags(), and RAII_VAR.

Referenced by ast_channel_data_add_structure(), data_channels_provider_handler(), queues_data_provider_get_helper(), and user_add_provider_cb().

00300 {
00301    struct ast_data *data_bridged;
00302    struct ast_data *data_cdr;
00303    struct ast_data *data_flags;
00304    struct ast_data *data_zones;
00305    struct ast_data *enum_node;
00306    struct ast_data *data_softhangup;
00307 #if 0 /* XXX AstData: ast_callerid no longer exists. (Equivalent code not readily apparent.) */
00308    struct ast_data *data_callerid;
00309    char value_str[100];
00310 #endif
00311 
00312    if (!tree) {
00313       return -1;
00314    }
00315 
00316    ast_data_add_structure(ast_channel, tree, chan);
00317 
00318    if (add_bridged) {
00319       RAII_VAR(struct ast_channel *, bc, ast_channel_bridge_peer(chan), ast_channel_cleanup);
00320       if (bc) {
00321          data_bridged = ast_data_add_node(tree, "bridged");
00322          if (!data_bridged) {
00323             return -1;
00324          }
00325          ast_channel_data_add_structure(data_bridged, bc, 0);
00326       }
00327    }
00328 
00329    ast_data_add_str(tree, "uniqueid", ast_channel_uniqueid(chan));
00330    ast_data_add_str(tree, "linkedid", ast_channel_linkedid(chan));
00331 
00332    ast_data_add_codec(tree, "oldwriteformat", ast_channel_oldwriteformat(chan));
00333    ast_data_add_codec(tree, "readformat", ast_channel_readformat(chan));
00334    ast_data_add_codec(tree, "writeformat", ast_channel_writeformat(chan));
00335    ast_data_add_codec(tree, "rawreadformat", ast_channel_rawreadformat(chan));
00336    ast_data_add_codec(tree, "rawwriteformat", ast_channel_rawwriteformat(chan));
00337    ast_data_add_codecs(tree, "nativeformats", ast_channel_nativeformats(chan));
00338 
00339    /* state */
00340    enum_node = ast_data_add_node(tree, "state");
00341    if (!enum_node) {
00342       return -1;
00343    }
00344    ast_data_add_str(enum_node, "text", ast_state2str(ast_channel_state(chan)));
00345    ast_data_add_int(enum_node, "value", ast_channel_state(chan));
00346 
00347    /* hangupcause */
00348    enum_node = ast_data_add_node(tree, "hangupcause");
00349    if (!enum_node) {
00350       return -1;
00351    }
00352    ast_data_add_str(enum_node, "text", ast_cause2str(ast_channel_hangupcause(chan)));
00353    ast_data_add_int(enum_node, "value", ast_channel_hangupcause(chan));
00354 
00355    /* amaflags */
00356    enum_node = ast_data_add_node(tree, "amaflags");
00357    if (!enum_node) {
00358       return -1;
00359    }
00360    ast_data_add_str(enum_node, "text", ast_channel_amaflags2string(ast_channel_amaflags(chan)));
00361    ast_data_add_int(enum_node, "value", ast_channel_amaflags(chan));
00362 
00363    /* transfercapability */
00364    enum_node = ast_data_add_node(tree, "transfercapability");
00365    if (!enum_node) {
00366       return -1;
00367    }
00368    ast_data_add_str(enum_node, "text", ast_transfercapability2str(ast_channel_transfercapability(chan)));
00369    ast_data_add_int(enum_node, "value", ast_channel_transfercapability(chan));
00370 
00371    /* _softphangup */
00372    data_softhangup = ast_data_add_node(tree, "softhangup");
00373    if (!data_softhangup) {
00374       return -1;
00375    }
00376    ast_data_add_bool(data_softhangup, "dev", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_DEV);
00377    ast_data_add_bool(data_softhangup, "asyncgoto", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_ASYNCGOTO);
00378    ast_data_add_bool(data_softhangup, "shutdown", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_SHUTDOWN);
00379    ast_data_add_bool(data_softhangup, "timeout", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_TIMEOUT);
00380    ast_data_add_bool(data_softhangup, "appunload", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_APPUNLOAD);
00381    ast_data_add_bool(data_softhangup, "explicit", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_EXPLICIT);
00382 
00383    /* channel flags */
00384    data_flags = ast_data_add_node(tree, "flags");
00385    if (!data_flags) {
00386       return -1;
00387    }
00388    channel_data_add_flags(data_flags, chan);
00389 
00390    ast_data_add_uint(tree, "timetohangup", ast_channel_whentohangup(chan)->tv_sec);
00391 
00392 #if 0 /* XXX AstData: ast_callerid no longer exists. (Equivalent code not readily apparent.) */
00393    /* callerid */
00394    data_callerid = ast_data_add_node(tree, "callerid");
00395    if (!data_callerid) {
00396       return -1;
00397    }
00398    ast_data_add_structure(ast_callerid, data_callerid, &(chan->cid));
00399    /* insert the callerid ton */
00400    enum_node = ast_data_add_node(data_callerid, "cid_ton");
00401    if (!enum_node) {
00402       return -1;
00403    }
00404    ast_data_add_int(enum_node, "value", chan->cid.cid_ton);
00405    snprintf(value_str, sizeof(value_str), "TON: %s/Plan: %s",
00406       party_number_ton2str(chan->cid.cid_ton),
00407       party_number_plan2str(chan->cid.cid_ton));
00408    ast_data_add_str(enum_node, "text", value_str);
00409 #endif
00410 
00411    /* tone zone */
00412    if (ast_channel_zone(chan)) {
00413       data_zones = ast_data_add_node(tree, "zone");
00414       if (!data_zones) {
00415          return -1;
00416       }
00417       ast_tone_zone_data_add_structure(data_zones, ast_channel_zone(chan));
00418    }
00419 
00420    /* insert cdr */
00421    data_cdr = ast_data_add_node(tree, "cdr");
00422    if (!data_cdr) {
00423       return -1;
00424    }
00425 
00426    return 0;
00427 }

int ast_channel_data_cmp_structure ( const struct ast_data_search tree,
struct ast_channel chan,
const char *  structure_name 
)

Compare to channel structures using the data api.

Parameters:
[in] tree The search tree generated by the data api.
[in] chan The channel to compare.
[in] structure_name The name of the node of the channel structure.
Return values:
0 The structure matches.
1 The structure doesn't matches.

Definition at line 429 of file channel_internal_api.c.

References ast_data_search_cmp_structure.

00431 {
00432    return ast_data_search_cmp_structure(tree, ast_channel, chan, structure_name);
00433 }

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

struct ast_datastore_list* ast_channel_datastores ( struct ast_channel chan  )  [read]

struct ast_party_dialed* ast_channel_dialed ( struct ast_channel chan  )  [read]

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:
chan The channel on which to add information
cause_code The cause information to be added to the channel
datalen The total length of the structure since its length is variable
Return values:
0 on success
-1 on error

Definition at line 1400 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().

01401 {
01402    struct ast_control_pvt_cause_code *ao2_cause_code;
01403    ao2_find(chan->dialed_causes, cause_code->chan_name, OBJ_KEY | OBJ_UNLINK | OBJ_NODATA);
01404    ao2_cause_code = ao2_alloc(datalen, NULL);
01405 
01406    if (ao2_cause_code) {
01407       memcpy(ao2_cause_code, cause_code, datalen);
01408       ao2_link(chan->dialed_causes, ao2_cause_code);
01409       ao2_ref(ao2_cause_code, -1);
01410       return 0;
01411    } else {
01412       return -1;
01413    }
01414 }

struct ast_str* ast_channel_dialed_causes_channels ( const struct ast_channel chan  )  [read]

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:
chan The channel from which to retrieve information
Return values:
NULL on allocation failure
Pointer to an ast_str object containing the desired information which must be freed

Definition at line 1382 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().

01383 {
01384    struct ast_str *chanlist = ast_str_create(128);
01385 
01386    if (!chanlist) {
01387       return NULL;
01388    }
01389 
01390    ao2_callback(chan->dialed_causes, 0, collect_names_cb, &chanlist);
01391 
01392    return chanlist;
01393 }

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:
chan The channel from which to clear information

Definition at line 1416 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().

01417 {
01418    ao2_callback(chan->dialed_causes, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);
01419 }

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

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:
chan The channel from which to retrieve information
chan_name The name of the channel about which to retrieve information
Return values:
NULL on search failure
Pointer to a ref-counted ast_control_pvt_cause_code object containing the desired information

Definition at line 1395 of file channel_internal_api.c.

References ao2_find, ast_channel::dialed_causes, and OBJ_KEY.

Referenced by hangupcause_read().

01396 {
01397    return ao2_find(chan->dialed_causes, chan_name, OBJ_KEY);
01398 }

void ast_channel_dialed_set ( struct ast_channel chan,
struct ast_party_dialed value 
)

Definition at line 1076 of file channel_internal_api.c.

References ast_channel::dialed.

Referenced by channel_do_masquerade().

01077 {
01078    chan->dialed = *value;
01079 }

char ast_channel_dtmf_digit_to_emulate ( const struct ast_channel chan  ) 

Definition at line 558 of file channel_internal_api.c.

References ast_channel::dtmf_digit_to_emulate.

Referenced by __ast_read().

00559 {
00560    return chan->dtmf_digit_to_emulate;
00561 }

void ast_channel_dtmf_digit_to_emulate_set ( struct ast_channel chan,
char  value 
)

Definition at line 562 of file channel_internal_api.c.

References ast_channel::dtmf_digit_to_emulate.

Referenced by __ast_read().

00563 {
00564    chan->dtmf_digit_to_emulate = value;
00565 }

struct timeval* ast_channel_dtmf_tv ( struct ast_channel chan  )  [read]

Definition at line 1048 of file channel_internal_api.c.

References ast_channel::dtmf_tv.

Referenced by __ast_read(), and should_skip_dtmf().

01049 {
01050    return &chan->dtmf_tv;
01051 }

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

Definition at line 1084 of file channel_internal_api.c.

References ast_channel::dtmf_tv.

Referenced by __ast_read().

01085 {
01086    chan->dtmf_tv = *value;
01087 }

struct ast_frame* ast_channel_dtmff ( struct ast_channel chan  )  [read]

Definition at line 1004 of file channel_internal_api.c.

References ast_channel::dtmff.

Referenced by __ast_read(), and queue_dtmf_readq().

01005 {
01006    return &chan->dtmff;
01007 }

void ast_channel_dtmff_set ( struct ast_channel chan,
struct ast_frame value 
)

Definition at line 1060 of file channel_internal_api.c.

References ast_channel::dtmff.

01061 {
01062    chan->dtmff = *value;
01063 }

unsigned int ast_channel_emulate_dtmf_duration ( const struct ast_channel chan  ) 

Definition at line 697 of file channel_internal_api.c.

References ast_channel::emulate_dtmf_duration.

Referenced by __ast_read().

00698 {
00699    return chan->emulate_dtmf_duration;
00700 }

void ast_channel_emulate_dtmf_duration_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 701 of file channel_internal_api.c.

References ast_channel::emulate_dtmf_duration.

Referenced by __ast_read().

00702 {
00703    chan->emulate_dtmf_duration = value;
00704 }

const char* ast_channel_exten ( const struct ast_channel chan  ) 

Definition at line 533 of file channel_internal_api.c.

References ast_channel::exten.

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_snapshot_create(), 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(), dahdi_handle_dtmf(), dial_exec_full(), do_forward(), do_immediate_setup(), dundi_exec(), dundi_helper(), expand_gosub_args(), fax_detect_framehook(), 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_frame_ownerless(), 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().

00534 {
00535    return chan->exten;
00536 }

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_isset ( const struct ast_channel chan,
int  which 
)

Definition at line 1315 of file channel_internal_api.c.

References ast_channel_fd().

Referenced by __ast_read(), ast_channel_set_fd(), ast_poll_channel_add(), and ast_poll_channel_del().

01316 {
01317    return ast_channel_fd(chan, which) > -1;
01318 }

int ast_channel_fdno ( const struct ast_channel chan  ) 

void ast_channel_fdno_set ( struct ast_channel chan,
int  value 
)

Definition at line 613 of file channel_internal_api.c.

References ast_channel::fdno.

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

00614 {
00615    chan->fdno = value;
00616 }

unsigned int ast_channel_fin ( const struct ast_channel chan  ) 

Definition at line 705 of file channel_internal_api.c.

References ast_channel::fin.

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

00706 {
00707    return chan->fin;
00708 }

void ast_channel_fin_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 709 of file channel_internal_api.c.

References ast_channel::fin.

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

00710 {
00711    chan->fin = value;
00712 }

struct ast_flags* ast_channel_flags ( struct ast_channel chan  )  [read]

Definition at line 1368 of file channel_internal_api.c.

References ast_channel::flags.

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_autoservice_start(), ast_autoservice_stop(), ast_bridge_channel_playfile(), ast_bridge_impart(), ast_bridge_join(), ast_bridge_setup_after_goto(), ast_call(), ast_call_forward(), ast_can_pickup(), ast_channel_defer_dtmf(), ast_channel_destructor(), ast_channel_end_dtmf(), ast_channel_move(), ast_channel_publish_snapshot(), ast_channel_snapshot_create(), ast_channel_stage_snapshot(), ast_channel_stage_snapshot_done(), ast_channel_undefer_dtmf(), ast_explicit_goto(), ast_hangup(), ast_iax2_new(), ast_indicate_data(), ast_pbx_h_exten_run(), ast_raw_answer(), ast_readstring_full(), ast_sendtext(), ast_setstate(), ast_settimeout_full(), ast_softhangup_nolock(), ast_streamfile(), AST_TEST_DEFINE(), ast_transfer(), ast_unreal_new_channels(), ast_var_channels_table(), ast_waitfor_nandfds(), ast_waitfordigit_full(), ast_write(), bridge_channel_handle_control(), bridge_channel_internal_join(), bridge_channel_internal_pull(), bridge_reconfigured_connected_line_update(), call_forward_inherit(), channel_data_add_flags(), channel_do_masquerade(), channel_spy(), common_exec(), dahdi_new(), dahdi_read(), deactivate_generator_nolock(), dial_exec_full(), disa_exec(), 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(), sip_fixup(), sip_new(), sip_peer_hold(), tonepair_alloc(), and waitstream_core().

01369 {
01370    return &chan->flags;
01371 }

int ast_channel_forward_endpoint ( struct ast_channel chan,
struct ast_endpoint endpoint 
)

Forward channel stasis messages to the given endpoint.

Since:
12
Parameters:
chan The channel to forward from
endpoint The endpoint to forward to
Return values:
0 Success
non-zero Failure

Definition at line 1589 of file channel_internal_api.c.

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

Referenced by ast_endpoint_add_channel().

01591 {
01592    ast_assert(chan != NULL);
01593    ast_assert(endpoint != NULL);
01594 
01595    chan->endpoint_forward =
01596       stasis_forward_all(ast_channel_topic(chan),
01597          ast_endpoint_topic(endpoint));
01598    if (!chan->endpoint_forward) {
01599       return -1;
01600    }
01601 
01602    chan->endpoint_cache_forward = stasis_forward_all(ast_channel_topic_cached(chan),
01603       ast_endpoint_topic(endpoint));
01604    if (!chan->endpoint_cache_forward) {
01605       chan->endpoint_forward = stasis_forward_cancel(chan->endpoint_forward);
01606       return -1;
01607    }
01608 
01609    return 0;
01610 }

unsigned int ast_channel_fout ( const struct ast_channel chan  ) 

Definition at line 713 of file channel_internal_api.c.

References ast_channel::fout.

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

00714 {
00715    return chan->fout;
00716 }

void ast_channel_fout_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 717 of file channel_internal_api.c.

References ast_channel::fout.

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

00718 {
00719    chan->fout = value;
00720 }

struct ast_framehook_list* ast_channel_framehooks ( const struct ast_channel chan  )  [read]

void ast_channel_framehooks_set ( struct ast_channel chan,
struct ast_framehook_list value 
)

Definition at line 837 of file channel_internal_api.c.

References ast_channel::framehooks.

Referenced by ast_framehook_attach(), and ast_framehook_list_destroy().

00838 {
00839    chan->framehooks = value;
00840 }

struct ast_generator* ast_channel_generator ( const struct ast_channel chan  )  [read]

void ast_channel_generator_set ( struct ast_channel chan,
struct ast_generator value 
)

Definition at line 845 of file channel_internal_api.c.

References ast_channel::generator.

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

00846 {
00847    chan->generator = value;
00848 }

void* ast_channel_generatordata ( const struct ast_channel chan  ) 

void ast_channel_generatordata_set ( struct ast_channel chan,
void *  value 
)

struct ast_hangup_handler_list* ast_channel_hangup_handlers ( struct ast_channel chan  )  [read]

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  ) 

Definition at line 673 of file channel_internal_api.c.

References ast_channel::hold_state.

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

00674 {
00675    return chan->hold_state;
00676 }

void ast_channel_hold_state_set ( struct ast_channel chan,
int  value 
)

Definition at line 677 of file channel_internal_api.c.

References ast_channel::hold_state.

Referenced by __ast_channel_alloc_ap(), ast_dummy_channel_alloc(), and ast_indicate_data().

00678 {
00679    chan->hold_state = value;
00680 }

unsigned long ast_channel_insmpl ( const struct ast_channel chan  ) 

Definition at line 721 of file channel_internal_api.c.

References ast_channel::insmpl.

Referenced by __ast_read(), and ast_write().

00722 {
00723    return chan->insmpl;
00724 }

void ast_channel_insmpl_set ( struct ast_channel chan,
unsigned long  value 
)

Definition at line 725 of file channel_internal_api.c.

References ast_channel::insmpl.

Referenced by __ast_read(), and ast_monitor_start().

00726 {
00727    chan->insmpl = value;
00728 }

ast_alert_status_t ast_channel_internal_alert_read ( struct ast_channel chan  ) 

Definition at line 1208 of file channel_internal_api.c.

References ast_channel::alertpipe, AST_ALERT_NOT_READABLE, AST_ALERT_READ_FAIL, AST_ALERT_READ_FATAL, AST_ALERT_READ_SUCCESS, ast_channel_internal_alert_readable(), ast_channel_name(), ast_log, errno, LOG_ERROR, and LOG_WARNING.

Referenced by __ast_read().

01209 {
01210    int flags;
01211    char blah;
01212 
01213    if (!ast_channel_internal_alert_readable(chan)) {
01214       return AST_ALERT_NOT_READABLE;
01215    }
01216 
01217    flags = fcntl(chan->alertpipe[0], F_GETFL);
01218    /* For some odd reason, the alertpipe occasionally loses nonblocking status,
01219     * which immediately causes a deadlock scenario.  Detect and prevent this. */
01220    if ((flags & O_NONBLOCK) == 0) {
01221       ast_log(LOG_ERROR, "Alertpipe on channel %s lost O_NONBLOCK?!!\n", ast_channel_name(chan));
01222       if (fcntl(chan->alertpipe[0], F_SETFL, flags | O_NONBLOCK) < 0) {
01223          ast_log(LOG_WARNING, "Unable to set alertpipe nonblocking! (%d: %s)\n", errno, strerror(errno));
01224          return AST_ALERT_READ_FATAL;
01225       }
01226    }
01227    if (read(chan->alertpipe[0], &blah, sizeof(blah)) < 0) {
01228       if (errno != EINTR && errno != EAGAIN) {
01229          ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
01230          return AST_ALERT_READ_FAIL;
01231       }
01232    }
01233 
01234    return AST_ALERT_READ_SUCCESS;
01235 }

int ast_channel_internal_alert_readable ( struct ast_channel chan  ) 

Definition at line 1242 of file channel_internal_api.c.

References ast_channel::alertpipe.

Referenced by ast_channel_internal_alert_read(), and ast_channel_internal_alertpipe_close().

01243 {
01244    return chan->alertpipe[0] > -1;
01245 }

int ast_channel_internal_alert_readfd ( struct ast_channel chan  ) 

Definition at line 1282 of file channel_internal_api.c.

References ast_channel::alertpipe.

Referenced by __ast_channel_alloc_ap().

01283 {
01284    return chan->alertpipe[0];
01285 }

void ast_channel_internal_alertpipe_clear ( struct ast_channel chan  ) 

Definition at line 1247 of file channel_internal_api.c.

References ast_channel::alertpipe.

Referenced by __ast_channel_alloc_ap(), and ast_dummy_channel_alloc().

01248 {
01249    chan->alertpipe[0] = chan->alertpipe[1] = -1;
01250 }

void ast_channel_internal_alertpipe_close ( struct ast_channel chan  ) 

Definition at line 1252 of file channel_internal_api.c.

References ast_channel::alertpipe, ast_channel_alert_writable(), and ast_channel_internal_alert_readable().

Referenced by ast_channel_destructor().

01253 {
01254    if (ast_channel_internal_alert_readable(chan)) {
01255       close(chan->alertpipe[0]);
01256    }
01257    if (ast_channel_alert_writable(chan)) {
01258       close(chan->alertpipe[1]);
01259    }
01260 }

int ast_channel_internal_alertpipe_init ( struct ast_channel chan  ) 

Definition at line 1262 of file channel_internal_api.c.

References ast_channel::alertpipe, ast_log, errno, and LOG_WARNING.

Referenced by __ast_channel_alloc_ap().

01263 {
01264    if (pipe(chan->alertpipe)) {
01265       ast_log(LOG_WARNING, "Channel allocation failed: Can't create alert pipe! Try increasing max file descriptors with ulimit -n\n");
01266       return -1;
01267    } else {
01268       int flags = fcntl(chan->alertpipe[0], F_GETFL);
01269       if (fcntl(chan->alertpipe[0], F_SETFL, flags | O_NONBLOCK) < 0) {
01270          ast_log(LOG_WARNING, "Channel allocation failed: Unable to set alertpipe nonblocking! (%d: %s)\n", errno, strerror(errno));
01271          return -1;
01272       }
01273       flags = fcntl(chan->alertpipe[1], F_GETFL);
01274       if (fcntl(chan->alertpipe[1], F_SETFL, flags | O_NONBLOCK) < 0) {
01275          ast_log(LOG_WARNING, "Channel allocation failed: Unable to set alertpipe nonblocking! (%d: %s)\n", errno, strerror(errno));
01276          return -1;
01277       }
01278    }
01279    return 0;
01280 }

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

References ast_channel::alertpipe, ARRAY_LEN, and SWAP.

Referenced by channel_do_masquerade().

01288 {
01289    int i;
01290    for (i = 0; i < ARRAY_LEN(chan1->alertpipe); i++) {
01291       SWAP(chan1->alertpipe[i], chan2->alertpipe[i]);
01292    }
01293 }

struct ast_bridge* ast_channel_internal_bridge ( const struct ast_channel chan  )  [read]

struct ast_bridge_channel* ast_channel_internal_bridge_channel ( const struct ast_channel chan  )  [read]

void ast_channel_internal_bridge_channel_set ( struct ast_channel chan,
struct ast_bridge_channel value 
)

Definition at line 1363 of file channel_internal_api.c.

References ast_channel::bridge_channel.

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

01364 {
01365    chan->bridge_channel = value;
01366 }

void ast_channel_internal_bridge_set ( struct ast_channel chan,
struct ast_bridge value 
)

Precondition:
chan is locked

Definition at line 1353 of file channel_internal_api.c.

References ast_channel_publish_snapshot(), and ast_channel::bridge.

Referenced by bridge_channel_change_bridge(), and bridge_channel_internal_join().

01354 {
01355    chan->bridge = value;
01356    ast_channel_publish_snapshot(chan);
01357 }

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.

Parameters:
dest Destination to copy linkedid to
source Source channel to copy linkedid from
Returns:
void

Definition at line 1505 of file channel_internal_api.c.

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

01506 {
01507    if (dest->linkedid.creation_time == source->linkedid.creation_time
01508       && dest->linkedid.creation_unique == source->linkedid.creation_unique
01509       && !strcmp(dest->linkedid.unique_id, source->linkedid.unique_id)) {
01510       return;
01511    }
01512    dest->linkedid = source->linkedid;
01513    ast_channel_publish_snapshot(dest);
01514 }

void ast_channel_internal_fd_clear ( struct ast_channel chan,
int  which 
)

Definition at line 1300 of file channel_internal_api.c.

References ast_channel_internal_fd_set().

Referenced by ast_channel_internal_fd_clear_all().

01301 {
01302    ast_channel_internal_fd_set(chan, which, -1);
01303 }

void ast_channel_internal_fd_clear_all ( struct ast_channel chan  ) 

Definition at line 1304 of file channel_internal_api.c.

References ast_channel_internal_fd_clear(), and AST_MAX_FDS.

Referenced by __ast_channel_alloc_ap(), and ast_dummy_channel_alloc().

01305 {
01306    int i;
01307    for (i = 0; i < AST_MAX_FDS; i++) {
01308       ast_channel_internal_fd_clear(chan, i);
01309    }
01310 }

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

Definition at line 1296 of file channel_internal_api.c.

References ast_channel::fds.

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

01297 {
01298    chan->fds[which] = value;
01299 }

void ast_channel_internal_finalize ( struct ast_channel chan  ) 

Definition at line 1561 of file channel_internal_api.c.

References ast_channel::finalized.

Referenced by __ast_channel_alloc_ap().

01562 {
01563    chan->finalized = 1;
01564 }

int ast_channel_internal_is_finalized ( struct ast_channel chan  ) 

Definition at line 1566 of file channel_internal_api.c.

References ast_channel::finalized.

Referenced by ast_channel_destructor().

01567 {
01568    return chan->finalized;
01569 }

struct ast_channel* ast_channel_internal_oldest_linkedid ( struct ast_channel a,
struct ast_channel b 
) [read]

Determine which channel has an older linkedid.

Parameters:
a First channel
b Second channel
Returns:
Returns an ast_channel structure that has oldest linkedid

Definition at line 1488 of file channel_internal_api.c.

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

Referenced by ast_bridge_channel_update_linkedids().

01489 {
01490    ast_assert(a->linkedid.creation_time != 0);
01491    ast_assert(b->linkedid.creation_time != 0);
01492 
01493    if (a->linkedid.creation_time < b->linkedid.creation_time) {
01494       return a;
01495    }
01496    if (b->linkedid.creation_time < a->linkedid.creation_time) {
01497       return b;
01498    }
01499    if (a->linkedid.creation_unique < b->linkedid.creation_unique) {
01500       return a;
01501    }
01502    return b;
01503 }

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:
chan The channel to set the uniqueid to
uniqueid The uniqueid to set
linkedid The 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 1538 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().

01539 {
01540    ast_copy_string(chan->uniqueid.unique_id, uniqueid, sizeof(chan->uniqueid.unique_id));
01541    ast_copy_string(chan->linkedid.unique_id, linkedid, sizeof(chan->linkedid.unique_id));
01542 }

int ast_channel_internal_setup_topics ( struct ast_channel chan  ) 

Definition at line 1612 of file channel_internal_api.c.

References ast_assert, ast_channel_cache_all(), ast_strlen_zero, NULL, stasis_cp_single_create(), ast_channel::topics, ast_channel_id::unique_id, and ast_channel::uniqueid.

Referenced by __ast_channel_alloc_ap(), and ast_dummy_channel_alloc().

01613 {
01614    const char *topic_name = chan->uniqueid.unique_id;
01615    ast_assert(chan->topics == NULL);
01616 
01617    if (ast_strlen_zero(topic_name)) {
01618       topic_name = "<dummy-channel>";
01619    }
01620 
01621    chan->topics = stasis_cp_single_create(
01622       ast_channel_cache_all(), topic_name);
01623    if (!chan->topics) {
01624       return -1;
01625    }
01626 
01627    return 0;
01628 }

void ast_channel_internal_swap_topics ( struct ast_channel a,
struct ast_channel b 
)

Swap topics beteween two channels.

Parameters:
a First channel
b Second channel
Returns:
void
Note:
This is used in masquerade to exchange topics for message routing

Definition at line 1529 of file channel_internal_api.c.

References ast_channel::topics.

Referenced by channel_do_masquerade().

01530 {
01531    struct stasis_cp_single *temp;
01532 
01533    temp = a->topics;
01534    a->topics = b->topics;
01535    b->topics = temp;
01536 }

void ast_channel_internal_swap_uniqueid_and_linkedid ( struct ast_channel a,
struct ast_channel b 
)

Swap uniqueid and linkedid beteween two channels.

Parameters:
a First channel
b Second channel
Returns:
void
Note:
This is used in masquerade to exchange identities

Definition at line 1516 of file channel_internal_api.c.

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

Referenced by channel_do_masquerade().

01517 {
01518    struct ast_channel_id temp;
01519 
01520    temp = a->uniqueid;
01521    a->uniqueid = b->uniqueid;
01522    b->uniqueid = temp;
01523 
01524    temp = a->linkedid;
01525    a->linkedid = b->linkedid;
01526    b->linkedid = temp;
01527 }

struct ast_jb* ast_channel_jb ( struct ast_channel chan  )  [read]

void ast_channel_jb_set ( struct ast_channel chan,
struct ast_jb value 
)

Definition at line 1064 of file channel_internal_api.c.

References ast_channel::jb.

01065 {
01066    chan->jb = *value;
01067 }

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 
)

Definition at line 545 of file channel_internal_api.c.

References ast_copy_string(), and ast_channel::macrocontext.

Referenced by _macro_exec().

00546 {
00547    ast_copy_string(chan->macrocontext, value, sizeof(chan->macrocontext));
00548 }

const char* ast_channel_macroexten ( const struct ast_channel chan  ) 

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

Definition at line 553 of file channel_internal_api.c.

References ast_copy_string(), and ast_channel::macroexten.

Referenced by _macro_exec().

00554 {
00555    ast_copy_string(chan->macroexten, value, sizeof(chan->macroexten));
00556 }

int ast_channel_macropriority ( const struct ast_channel chan  ) 

Definition at line 625 of file channel_internal_api.c.

References ast_channel::macropriority.

Referenced by ast_channel_log(), and ast_var_channels_table().

00626 {
00627    return chan->macropriority;
00628 }

void ast_channel_macropriority_set ( struct ast_channel chan,
int  value 
)

Definition at line 629 of file channel_internal_api.c.

References ast_channel::macropriority.

Referenced by _macro_exec().

00630 {
00631    chan->macropriority = value;
00632 }

struct ast_channel* ast_channel_masq ( const struct ast_channel chan  )  [read]

Definition at line 785 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().

00786 {
00787    return chan->masq;
00788 }

void ast_channel_masq_set ( struct ast_channel chan,
struct ast_channel value 
)

Definition at line 789 of file channel_internal_api.c.

References ast_channel::masq.

Referenced by ast_channel_move(), and channel_do_masquerade().

00790 {
00791    chan->masq = value;
00792 }

struct ast_channel* ast_channel_masqr ( const struct ast_channel chan  )  [read]

Definition at line 793 of file channel_internal_api.c.

References ast_channel::masqr.

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

00794 {
00795    return chan->masqr;
00796 }

void ast_channel_masqr_set ( struct ast_channel chan,
struct ast_channel value 
)

Definition at line 797 of file channel_internal_api.c.

References ast_channel::masqr.

Referenced by ast_channel_move(), and channel_do_masquerade().

00798 {
00799    chan->masqr = value;
00800 }

struct ast_channel_monitor* ast_channel_monitor ( const struct ast_channel chan  )  [read]

void ast_channel_monitor_set ( struct ast_channel chan,
struct ast_channel_monitor value 
)

Definition at line 805 of file channel_internal_api.c.

References ast_channel::monitor.

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

00806 {
00807    chan->monitor = value;
00808 }

void* ast_channel_music_state ( const struct ast_channel chan  ) 

void ast_channel_music_state_set ( struct ast_channel chan,
void *  value 
)

Definition at line 749 of file channel_internal_api.c.

References ast_channel::music_state.

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

00750 {
00751    chan->music_state = value;
00752 }

struct ast_namedgroups* ast_channel_named_callgroups ( const struct ast_channel chan  )  [read]

Definition at line 1182 of file channel_internal_api.c.

References ast_channel::named_callgroups.

Referenced by find_channel_by_group(), and func_channel_read().

01183 {
01184    return chan->named_callgroups;
01185 }

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  )  [read]

Definition at line 1191 of file channel_internal_api.c.

References ast_channel::named_pickupgroups.

Referenced by find_channel_by_group(), and func_channel_read().

01192 {
01193    return chan->named_pickupgroups;
01194 }

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

struct ast_format_cap* ast_channel_nativeformats ( const struct ast_channel chan  )  [read]

void ast_channel_nativeformats_set ( struct ast_channel chan,
struct ast_format_cap value 
)

struct ast_format* ast_channel_oldwriteformat ( struct ast_channel chan  )  [read]

Definition at line 968 of file channel_internal_api.c.

References ast_channel::oldwriteformat.

Referenced by ast_channel_data_add_structure(), and ast_stopstream().

00969 {
00970    return chan->oldwriteformat;
00971 }

unsigned long ast_channel_outsmpl ( const struct ast_channel chan  ) 

Definition at line 729 of file channel_internal_api.c.

References ast_channel::outsmpl.

Referenced by __ast_read(), and ast_write().

00730 {
00731    return chan->outsmpl;
00732 }

void ast_channel_outsmpl_set ( struct ast_channel chan,
unsigned long  value 
)

Definition at line 733 of file channel_internal_api.c.

References ast_channel::outsmpl.

Referenced by ast_monitor_start(), and ast_write().

00734 {
00735    chan->outsmpl = value;
00736 }

struct ast_pbx* ast_channel_pbx ( const struct ast_channel chan  )  [read]

void ast_channel_pbx_set ( struct ast_channel chan,
struct ast_pbx value 
)

Definition at line 853 of file channel_internal_api.c.

References ast_channel::pbx.

Referenced by __ast_pbx_run(), action_dialplan_exec(), bridge_after_cb(), control_add_channel_to_bridge(), and handle_gosub().

00854 {
00855    chan->pbx = value;
00856 }

ast_group_t ast_channel_pickupgroup ( const struct ast_channel chan  ) 

void ast_channel_pickupgroup_set ( struct ast_channel chan,
ast_group_t  value 
)

Precondition:
chan is locked

Definition at line 1178 of file channel_internal_api.c.

References ast_channel::pickupgroup.

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

01179 {
01180    chan->pickupgroup = value;
01181 }

int ast_channel_priority ( const struct ast_channel chan  ) 

void ast_channel_priority_set ( struct ast_channel chan,
int  value 
)

struct ast_format* ast_channel_rawreadformat ( struct ast_channel chan  )  [read]

struct ast_format* ast_channel_rawwriteformat ( struct ast_channel chan  )  [read]

struct ast_format* ast_channel_readformat ( struct ast_channel chan  )  [read]

struct ast_readq_list* ast_channel_readq ( struct ast_channel chan  )  [read]

struct ast_trans_pvt* ast_channel_readtrans ( const struct ast_channel chan  )  [read]

void ast_channel_readtrans_set ( struct ast_channel chan,
struct ast_trans_pvt value 
)

Definition at line 885 of file channel_internal_api.c.

References ast_channel::readtrans.

Referenced by ast_set_read_format_path(), and free_translation().

00886 {
00887    chan->readtrans = value;
00888 }

struct ast_party_redirecting* ast_channel_redirecting ( struct ast_channel chan  )  [read]

struct ast_party_id ast_channel_redirecting_effective_from ( struct ast_channel chan  )  [read]

Definition at line 1040 of file channel_internal_api.c.

References ast_party_id_merge().

Referenced by add_diversion(), and misdn_copy_redirecting_from_ast().

01041 {
01042    return ast_party_id_merge(&chan->redirecting.from, &chan->redirecting.priv_from);
01043 }

struct ast_party_id ast_channel_redirecting_effective_orig ( struct ast_channel chan  )  [read]

Definition at line 1036 of file channel_internal_api.c.

References ast_party_id_merge().

01037 {
01038    return ast_party_id_merge(&chan->redirecting.orig, &chan->redirecting.priv_orig);
01039 }

struct ast_party_id ast_channel_redirecting_effective_to ( struct ast_channel chan  )  [read]

Definition at line 1044 of file channel_internal_api.c.

References ast_party_id_merge().

Referenced by misdn_copy_redirecting_from_ast().

01045 {
01046    return ast_party_id_merge(&chan->redirecting.to, &chan->redirecting.priv_to);
01047 }

void ast_channel_redirecting_set ( struct ast_channel chan,
struct ast_party_redirecting value 
)

Definition at line 1080 of file channel_internal_api.c.

References ast_channel::redirecting.

Referenced by channel_do_masquerade().

01081 {
01082    chan->redirecting = *value;
01083 }

int ast_channel_rings ( const struct ast_channel chan  ) 

Definition at line 641 of file channel_internal_api.c.

References ast_channel::rings.

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

00642 {
00643    return chan->rings;
00644 }

void ast_channel_rings_set ( struct ast_channel chan,
int  value 
)

struct ast_sched_context* ast_channel_sched ( const struct ast_channel chan  )  [read]

void ast_channel_sched_set ( struct ast_channel chan,
struct ast_sched_context value 
)

Definition at line 861 of file channel_internal_api.c.

References ast_channel::sched.

Referenced by __ast_channel_alloc_ap(), and ast_hangup().

00862 {
00863    chan->sched = value;
00864 }

char ast_channel_sending_dtmf_digit ( const struct ast_channel chan  ) 

Definition at line 567 of file channel_internal_api.c.

References ast_channel::sending_dtmf_digit.

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

00568 {
00569    return chan->sending_dtmf_digit;
00570 }

void ast_channel_sending_dtmf_digit_set ( struct ast_channel chan,
char  value 
)

Definition at line 571 of file channel_internal_api.c.

References ast_channel::sending_dtmf_digit.

Referenced by ast_senddigit_begin(), and ast_senddigit_end().

00572 {
00573    chan->sending_dtmf_digit = value;
00574 }

struct timeval ast_channel_sending_dtmf_tv ( const struct ast_channel chan  )  [read]

Definition at line 576 of file channel_internal_api.c.

Referenced by bridge_channel_internal_join(), and channel_do_masquerade().

00577 {
00578    return chan->sending_dtmf_tv;
00579 }

void ast_channel_sending_dtmf_tv_set ( struct ast_channel chan,
struct timeval  value 
)

Definition at line 580 of file channel_internal_api.c.

References ast_channel::sending_dtmf_tv.

Referenced by ast_senddigit_begin().

00581 {
00582    chan->sending_dtmf_tv = value;
00583 }

void ast_channel_set_oldwriteformat ( struct ast_channel chan,
struct ast_format format 
)

Definition at line 948 of file channel_internal_api.c.

References ao2_replace, and ast_channel::oldwriteformat.

Referenced by ast_channel_destructor(), and ast_openstream_full().

00949 {
00950    ao2_replace(chan->oldwriteformat, format);
00951 }

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 
)

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:
chan Which channel is having its unbridged value set
value What the unbridge value is being set to

Definition at line 1153 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(), and bridge_channel_wait().

01154 {
01155    ast_channel_lock(chan);
01156    ast_channel_set_unbridged_nolock(chan, value);
01157    ast_channel_unlock(chan);
01158 }

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:
chan Which channel is having its unbridged value set
value What the unbridge value is being set to

Definition at line 1147 of file channel_internal_api.c.

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

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

01148 {
01149    chan->unbridged = value;
01150    ast_queue_frame(chan, &ast_null_frame);
01151 }

void ast_channel_set_writeformat ( struct ast_channel chan,
struct ast_format format 
)

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 
)

Definition at line 1128 of file channel_internal_api.c.

References ast_channel::softhangup.

Referenced by ast_channel_clear_softhangup().

01129 {
01130    chan ->softhangup &= ~value;
01131 }

void ast_channel_softhangup_internal_flag_set ( struct ast_channel chan,
int  value 
)

Definition at line 1120 of file channel_internal_api.c.

References ast_channel::softhangup.

Referenced by channel_do_masquerade().

01121 {
01122    chan->softhangup = value;
01123 }

enum ast_channel_state ast_channel_state ( const struct ast_channel chan  ) 

Definition at line 913 of file channel_internal_api.c.

References ast_channel::state.

00914 {
00915    return chan->state;
00916 }

void ast_channel_state_set ( struct ast_channel chan,
enum ast_channel_state  value 
)

Definition at line 944 of file channel_internal_api.c.

References ast_channel::state.

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

00945 {
00946    chan->state = value;
00947 }

struct ast_filestream* ast_channel_stream ( const struct ast_channel chan  )  [read]

void ast_channel_stream_set ( struct ast_channel chan,
struct ast_filestream value 
)

int ast_channel_streamid ( const struct ast_channel chan  ) 

Definition at line 649 of file channel_internal_api.c.

References ast_channel::streamid.

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

00650 {
00651    return chan->streamid;
00652 }

void ast_channel_streamid_set ( struct ast_channel chan,
int  value 
)

Definition at line 653 of file channel_internal_api.c.

References ast_channel::streamid.

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

00654 {
00655    chan->streamid = value;
00656 }

struct ast_channel_tech* ast_channel_tech ( const struct ast_channel chan  )  [read]

Definition at line 897 of file channel_internal_api.c.

References ast_channel::tech.

Referenced by __ast_read(), acf_channel_read(), analog_ss_thread(), ast_call(), ast_channel_early_bridge(), ast_channel_queryoption(), ast_channel_sendhtml(), ast_channel_setoption(), ast_channel_snapshot_create(), ast_channel_supports_html(), ast_hangup(), ast_indicate_data(), ast_jb_do_usecheck(), ast_pre_call(), ast_raw_answer(), 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_sendtext(), ast_supports_images(), ast_transfer(), ast_var_channel_types_table(), ast_var_channels_table(), ast_write(), ast_write_video(), channel_do_masquerade(), channel_sanitizer(), conf_run(), dahdi_setoption(), dahdiras_exec(), flash_exec(), func_channel_read(), func_channel_write_real(), func_header_read(), function_iaxpeer(), function_ooh323_read(), function_ooh323_write(), generate_status(), handle_request_bye(), handle_showchan(), iax2_prov_app(), misdn_facility_exec(), misdn_set_opt_exec(), my_get_sigpvt_bridged_channel(), native_bridge_is_capable(), native_rtp_bridge_get(), pjsip_acf_channel_read(), pjsip_acf_media_offer_read(), pjsip_acf_media_offer_write(), sendtext_exec(), serialize_showchan(), setup_env(), sip_acf_channel_read(), sip_cc_agent_init(), sip_dtmfmode(), sipinfo_send(), softhangup_exec(), t38_masq(), transfer_exec(), and try_calling().

00898 {
00899    return chan->tech;
00900 }

void* ast_channel_tech_pvt ( const struct ast_channel chan  ) 

Definition at line 753 of file channel_internal_api.c.

References ast_channel::tech_pvt.

Referenced by __analog_ss_thread(), __dahdi_exception(), acf_channel_read(), alsa_fixup(), analog_hangup(), analog_ss_thread(), announce_hangup(), ast_channel_destructor(), ast_local_get_peer(), ast_local_setup_bridge(), ast_local_setup_masquerade(), 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(), chan_pjsip_answer(), chan_pjsip_call(), chan_pjsip_digit_begin(), chan_pjsip_digit_end(), chan_pjsip_fixup(), chan_pjsip_get_codec(), 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(), chan_pjsip_sendtext(), chan_pjsip_set_rtp_peer(), chan_pjsip_transfer(), chan_pjsip_write(), channel_do_masquerade(), channel_read_pjsip(), channel_read_rtcp(), channel_read_rtp(), channel_to_session(), conf_announce_channel_depart(), 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(), dialog_unlink_all(), func_header_read(), func_read_header(), func_write_header(), function_iaxpeer(), function_ooh323_read(), function_ooh323_write(), get_video_desc(), handle_callforward_button(), 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_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(), 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(), 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_media_offer_read(), pjsip_acf_media_offer_write(), read_pjsip(), rtp_call(), rtp_hangup(), rtp_read(), rtp_write(), 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_codec(), 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(), 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().

00754 {
00755    return chan->tech_pvt;
00756 }

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_timer* ast_channel_timer ( const struct ast_channel chan  )  [read]

Definition at line 865 of file channel_internal_api.c.

References ast_channel::timer.

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

00866 {
00867    return chan->timer;
00868 }

void ast_channel_timer_set ( struct ast_channel chan,
struct ast_timer value 
)

Definition at line 869 of file channel_internal_api.c.

References ast_channel::timer.

Referenced by __ast_channel_alloc_ap(), and ast_channel_destructor().

00870 {
00871    chan->timer = value;
00872 }

void* ast_channel_timingdata ( const struct ast_channel chan  ) 

Definition at line 761 of file channel_internal_api.c.

References ast_channel::timingdata.

Referenced by __ast_read(), and ast_settimeout_full().

00762 {
00763    return chan->timingdata;
00764 }

void ast_channel_timingdata_set ( struct ast_channel chan,
void *  value 
)

Definition at line 765 of file channel_internal_api.c.

References ast_channel::timingdata.

Referenced by ast_settimeout_full().

00766 {
00767    chan->timingdata = value;
00768 }

int ast_channel_timingfd ( const struct ast_channel chan  ) 

void ast_channel_timingfd_set ( struct ast_channel chan,
int  value 
)

Definition at line 661 of file channel_internal_api.c.

References ast_channel::timingfd.

Referenced by __ast_channel_alloc_ap(), and ast_dummy_channel_alloc().

00662 {
00663    chan->timingfd = value;
00664 }

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 
)

Definition at line 1344 of file channel_internal_api.c.

References ast_channel::timingfunc.

Referenced by ast_settimeout_full().

01345 {
01346    chan->timingfunc = value;
01347 }

struct stasis_topic* ast_channel_topic ( struct ast_channel chan  )  [read]

struct stasis_topic* ast_channel_topic_cached ( struct ast_channel chan  )  [read]

A topic which publishes the events for a particular channel.

Since:
12 ast_channel_snapshot messages are replaced with stasis_cache_update
If the given chan is NULL, ast_channel_topic_all_cached() is returned.

Parameters:
chan Channel, or NULL.
Return values:
Topic for channel's events.
ast_channel_topic_all() if chan is NULL.

Definition at line 1580 of file channel_internal_api.c.

References ast_channel_topic_all_cached(), stasis_cp_single_topic_cached(), and ast_channel::topics.

Referenced by ast_channel_forward_endpoint(), and forwards_create_channel().

01581 {
01582    if (!chan) {
01583       return ast_channel_topic_all_cached();
01584    }
01585 
01586    return stasis_cp_single_topic_cached(chan->topics);
01587 }

unsigned short ast_channel_transfercapability ( const struct ast_channel chan  ) 

void ast_channel_transfercapability_set ( struct ast_channel chan,
unsigned short  value 
)

Definition at line 693 of file channel_internal_api.c.

References ast_channel::transfercapability.

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

00694 {
00695    chan->transfercapability = value;
00696 }

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:
chan Channel 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 1138 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().

01139 {
01140    int res;
01141    ast_channel_lock(chan);
01142    res = ast_channel_unbridged_nolock(chan);
01143    ast_channel_unlock(chan);
01144    return res;
01145 }

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:
chan Channel 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 1133 of file channel_internal_api.c.

References ast_channel::unbridged.

Referenced by ast_channel_unbridged().

01134 {
01135    return chan->unbridged;
01136 }

const char* ast_channel_uniqueid ( const struct ast_channel chan  ) 

Definition at line 488 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_dahdishowchannels(), aoc_publish_blob(), app_exec(), app_subscribe_channel(), app_unsubscribe_channel(), aqm_exec(), ari_channels_handle_originate_with_id(), ari_channels_handle_snoop_channel(), 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_snapshot_create(), ast_bridge_transfer_blind(), ast_cel_publish_event(), ast_channel_by_uniqueid_cb(), ast_channel_data_add_structure(), ast_channel_log(), ast_channel_publish_cached_blob(), ast_channel_publish_dial_internal(), ast_channel_snapshot_create(), 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_after_cb(), 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(), conf_rec_name(), conf_run(), 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(), jingle_enable_video(), jingle_set_owner(), local_channel_optimization_blob(), local_optimization_started_cb(), manager_park(), manager_park_bridged(), manager_queues_status(), masq_match_cb(), meetme_menu_admin_extended(), meetmemute(), mgcp_set_owner(), minivm_mwi_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(), sip_set_owner(), skinny_set_owner(), 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(), talk_detect_audiohook_cb(), test_cel_generate_peer_str(), try_calling(), unicast_rtp_request(), unistim_set_owner(), vm_execmain(), and wait_our_turn().

00489 {
00490    ast_assert(chan->uniqueid.unique_id[0] != '\0');
00491    return chan->uniqueid.unique_id;
00492 }

struct varshead* ast_channel_varshead ( struct ast_channel chan  )  [read]

void ast_channel_varshead_set ( struct ast_channel chan,
struct varshead value 
)

Definition at line 1092 of file channel_internal_api.c.

References ast_channel::varshead.

01093 {
01094    chan->varshead = *value;
01095 }

int ast_channel_visible_indication ( const struct ast_channel chan  ) 

Definition at line 665 of file channel_internal_api.c.

References ast_channel::visible_indication.

Referenced by channel_do_masquerade(), and pre_bridge_setup().

00666 {
00667    return chan->visible_indication;
00668 }

void ast_channel_visible_indication_set ( struct ast_channel chan,
int  value 
)

Definition at line 669 of file channel_internal_api.c.

References ast_channel::visible_indication.

Referenced by ast_indicate_data(), and dial_exec_full().

00670 {
00671    chan->visible_indication = value;
00672 }

struct ast_filestream* ast_channel_vstream ( const struct ast_channel chan  )  [read]

Definition at line 817 of file channel_internal_api.c.

References ast_channel::vstream.

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

00818 {
00819    return chan->vstream;
00820 }

void ast_channel_vstream_set ( struct ast_channel chan,
struct ast_filestream value 
)

Definition at line 821 of file channel_internal_api.c.

References ast_channel::vstream.

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

00822 {
00823    chan->vstream = value;
00824 }

int ast_channel_vstreamid ( const struct ast_channel chan  ) 

Definition at line 681 of file channel_internal_api.c.

References ast_channel::vstreamid.

Referenced by filestream_close().

00682 {
00683    return chan->vstreamid;
00684 }

void ast_channel_vstreamid_set ( struct ast_channel chan,
int  value 
)

Definition at line 685 of file channel_internal_api.c.

References ast_channel::vstreamid.

Referenced by ast_readvideo_callback(), and filestream_close().

00686 {
00687    chan->vstreamid = value;
00688 }

struct timeval* ast_channel_whentohangup ( struct ast_channel chan  )  [read]

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

Precondition:
chan is locked

Definition at line 1088 of file channel_internal_api.c.

References ast_channel::whentohangup.

Referenced by ast_channel_setwhentohangup_tv(), and dial_exec_full().

01089 {
01090    chan->whentohangup = *value;
01091 }

struct ast_format* ast_channel_writeformat ( struct ast_channel chan  )  [read]

struct ast_trans_pvt* ast_channel_writetrans ( const struct ast_channel chan  )  [read]

void ast_channel_writetrans_set ( struct ast_channel chan,
struct ast_trans_pvt value 
)

Definition at line 893 of file channel_internal_api.c.

References ast_channel::writetrans.

Referenced by free_translation().

00894 {
00895    chan->writetrans = value;
00896 }

struct ast_tone_zone* ast_channel_zone ( const struct ast_channel chan  )  [read]

void ast_channel_zone_set ( struct ast_channel chan,
struct ast_tone_zone value 
)

Definition at line 877 of file channel_internal_api.c.

References ast_channel::zone.

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

00878 {
00879    chan->zone = value;
00880 }

AST_DATA_STRUCTURE ( ast_channel  ,
DATA_EXPORT_CHANNEL   
)

static void channel_data_add_flags ( struct ast_data tree,
struct ast_channel chan 
) [static]

Definition at line 274 of file channel_internal_api.c.

References ast_channel_flags(), ast_data_add_bool(), AST_FLAG_BLOCKING, AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT, AST_FLAG_BRIDGE_HANGUP_RUN, AST_FLAG_DEAD, AST_FLAG_DEFER_DTMF, AST_FLAG_DISABLE_DEVSTATE_CACHE, AST_FLAG_DISABLE_WORKAROUNDS, AST_FLAG_EMULATE_DTMF, AST_FLAG_END_DTMF_ONLY, AST_FLAG_EXCEPTION, AST_FLAG_IN_AUTOLOOP, AST_FLAG_IN_DTMF, AST_FLAG_MASQ_NOSTREAM, AST_FLAG_MOH, AST_FLAG_ORIGINATED, AST_FLAG_OUTGOING, AST_FLAG_SPYING, AST_FLAG_WRITE_INT, AST_FLAG_ZOMBIE, and ast_test_flag.

Referenced by ast_channel_data_add_structure().

00276 {
00277    ast_data_add_bool(tree, "DEFER_DTMF", ast_test_flag(ast_channel_flags(chan), AST_FLAG_DEFER_DTMF));
00278    ast_data_add_bool(tree, "WRITE_INT", ast_test_flag(ast_channel_flags(chan), AST_FLAG_WRITE_INT));
00279    ast_data_add_bool(tree, "BLOCKING", ast_test_flag(ast_channel_flags(chan), AST_FLAG_BLOCKING));
00280    ast_data_add_bool(tree, "ZOMBIE", ast_test_flag(ast_channel_flags(chan), AST_FLAG_ZOMBIE));
00281    ast_data_add_bool(tree, "EXCEPTION", ast_test_flag(ast_channel_flags(chan), AST_FLAG_EXCEPTION));
00282    ast_data_add_bool(tree, "MOH", ast_test_flag(ast_channel_flags(chan), AST_FLAG_MOH));
00283    ast_data_add_bool(tree, "SPYING", ast_test_flag(ast_channel_flags(chan), AST_FLAG_SPYING));
00284    ast_data_add_bool(tree, "IN_AUTOLOOP", ast_test_flag(ast_channel_flags(chan), AST_FLAG_IN_AUTOLOOP));
00285    ast_data_add_bool(tree, "OUTGOING", ast_test_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING));
00286    ast_data_add_bool(tree, "IN_DTMF", ast_test_flag(ast_channel_flags(chan), AST_FLAG_IN_DTMF));
00287    ast_data_add_bool(tree, "EMULATE_DTMF", ast_test_flag(ast_channel_flags(chan), AST_FLAG_EMULATE_DTMF));
00288    ast_data_add_bool(tree, "END_DTMF_ONLY", ast_test_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY));
00289    ast_data_add_bool(tree, "MASQ_NOSTREAM", ast_test_flag(ast_channel_flags(chan), AST_FLAG_MASQ_NOSTREAM));
00290    ast_data_add_bool(tree, "BRIDGE_HANGUP_RUN", ast_test_flag(ast_channel_flags(chan), AST_FLAG_BRIDGE_HANGUP_RUN));
00291    ast_data_add_bool(tree, "DISABLE_WORKAROUNDS", ast_test_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_WORKAROUNDS));
00292    ast_data_add_bool(tree, "DISABLE_DEVSTATE_CACHE", ast_test_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_DEVSTATE_CACHE));
00293    ast_data_add_bool(tree, "BRIDGE_DUAL_REDIRECT_WAIT", ast_test_flag(ast_channel_flags(chan), AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT));
00294    ast_data_add_bool(tree, "ORIGINATED", ast_test_flag(ast_channel_flags(chan), AST_FLAG_ORIGINATED));
00295    ast_data_add_bool(tree, "DEAD", ast_test_flag(ast_channel_flags(chan), AST_FLAG_DEAD));
00296 }

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

Definition at line 1373 of file channel_internal_api.c.

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

Referenced by ast_channel_dialed_causes_channels().

01373                                                              {
01374    struct ast_control_pvt_cause_code *cause_code = obj;
01375    struct ast_str **str = arg;
01376 
01377    ast_str_append(str, 0, "%s%s", (ast_str_strlen(*str) ? "," : ""), cause_code->chan_name);
01378 
01379    return 0;
01380 }

DEFINE_STRINGFIELD_GETTER_FOR ( dialcontext   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( hangupsource   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( parkinglot   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( call_forward   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( userfield   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( peeraccount   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( accountcode   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( latest_musicclass   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( musicclass   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( language   ) 

DEFINE_STRINGFIELD_GETTER_FOR ( name   ) 

DEFINE_STRINGFIELD_SETTERS_FOR ( dialcontext  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( hangupsource  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( parkinglot  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( call_forward  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( userfield  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( peeraccount  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( accountcode  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( latest_musicclass  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( musicclass  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( language  ,
,
 
)

DEFINE_STRINGFIELD_SETTERS_FOR ( name  ,
,
 
)

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

Definition at line 1429 of file channel_internal_api.c.

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

Referenced by __ast_channel_internal_alloc().

01430 {
01431    struct ast_control_pvt_cause_code *pc = obj;
01432    char *str = ast_tech_to_upper(ast_strdupa(vstr));
01433    char *pc_str = ast_tech_to_upper(ast_strdupa(pc->chan_name));
01434    return !strcmp(pc_str, str) ? CMP_MATCH | CMP_STOP : 0;
01435 }

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

Definition at line 1422 of file channel_internal_api.c.

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

Referenced by __ast_channel_internal_alloc().

01423 {
01424    const struct ast_control_pvt_cause_code *pc = vpc;
01425    return ast_str_hash(ast_tech_to_upper(ast_strdupa(pc->chan_name)));
01426 }


Variable Documentation

int uniqueint [static]

The monotonically increasing integer counter for channel uniqueids.

Definition at line 228 of file channel_internal_api.c.


Generated on Thu Apr 16 06:30:10 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6