Sat Apr 26 2014 22:02:43

Asterisk developer's documentation


channel_internal_api.c File Reference

Channel Accessor API. More...

#include "asterisk.h"
#include <unistd.h>
#include <fcntl.h>
#include "asterisk/channel.h"
#include "asterisk/stringfields.h"
#include "asterisk/data.h"
#include "asterisk/indications.h"
#include "asterisk/channel_internal.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...

Defines

#define DATA_EXPORT_CHANNEL(MEMBER)
#define DEFINE_STRINGFIELD_GETTER_FOR(field)
#define DEFINE_STRINGFIELD_SETTERS_FOR(field)
#define DIALED_CAUSES_BUCKETS   37

Functions

struct ast_channel__ast_channel_internal_alloc (void(*destructor)(void *obj), 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)
int ast_channel_amaflags (const struct ast_channel *chan)
void ast_channel_amaflags_set (struct ast_channel *chan, int 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)
struct ast_callidast_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, struct 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)
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)
 Retreive 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)
 Retreive 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)
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)
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)
void ast_channel_internal_bridge_set (struct ast_channel *chan, struct ast_bridge *value)
struct ast_channelast_channel_internal_bridged_channel (const struct ast_channel *chan)
void ast_channel_internal_bridged_channel_set (struct ast_channel *chan, struct ast_channel *value)
void ast_channel_internal_cleanup (struct ast_channel *chan)
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_jbast_channel_jb (struct ast_channel *chan)
void ast_channel_jb_set (struct ast_channel *chan, struct ast_jb *value)
void ast_channel_linkedid_set (struct ast_channel *chan, const char *value)
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)
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)
unsigned short ast_channel_transfercapability (const struct ast_channel *chan)
void ast_channel_transfercapability_set (struct ast_channel *chan, unsigned short value)
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 (name)
 DEFINE_STRINGFIELD_GETTER_FOR (language)
 DEFINE_STRINGFIELD_GETTER_FOR (musicclass)
 DEFINE_STRINGFIELD_GETTER_FOR (accountcode)
 DEFINE_STRINGFIELD_GETTER_FOR (peeraccount)
 DEFINE_STRINGFIELD_GETTER_FOR (userfield)
 DEFINE_STRINGFIELD_GETTER_FOR (call_forward)
 DEFINE_STRINGFIELD_GETTER_FOR (uniqueid)
 DEFINE_STRINGFIELD_GETTER_FOR (linkedid)
 DEFINE_STRINGFIELD_GETTER_FOR (parkinglot)
 DEFINE_STRINGFIELD_GETTER_FOR (hangupsource)
 DEFINE_STRINGFIELD_GETTER_FOR (dialcontext)
 DEFINE_STRINGFIELD_SETTERS_FOR (name)
 DEFINE_STRINGFIELD_SETTERS_FOR (language)
 DEFINE_STRINGFIELD_SETTERS_FOR (musicclass)
 DEFINE_STRINGFIELD_SETTERS_FOR (accountcode)
 DEFINE_STRINGFIELD_SETTERS_FOR (peeraccount)
 DEFINE_STRINGFIELD_SETTERS_FOR (userfield)
 DEFINE_STRINGFIELD_SETTERS_FOR (call_forward)
 DEFINE_STRINGFIELD_SETTERS_FOR (uniqueid)
 DEFINE_STRINGFIELD_SETTERS_FOR (parkinglot)
 DEFINE_STRINGFIELD_SETTERS_FOR (hangupsource)
 DEFINE_STRINGFIELD_SETTERS_FOR (dialcontext)
static int pvt_cause_cmp_fn (void *obj, void *vstr, int flags)
static int pvt_cause_hash_fn (const void *vpc, const int flags)

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

#define DEFINE_STRINGFIELD_SETTERS_FOR (   field)

Definition at line 409 of file channel_internal_api.c.

#define DIALED_CAUSES_BUCKETS   37

Definition at line 1332 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 char *  file,
int  line,
const char *  function 
) [read]

Definition at line 1334 of file channel_internal_api.c.

References __ao2_alloc_debug(), ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc, ast_channel_unref, ast_string_field_init, ast_channel::dialed_causes, DIALED_CAUSES_BUCKETS, pvt_cause_cmp_fn(), and pvt_cause_hash_fn().

{
   struct ast_channel *tmp;
#if defined(REF_DEBUG)
   tmp = __ao2_alloc_debug(sizeof(*tmp), destructor,
      AO2_ALLOC_OPT_LOCK_MUTEX, "", file, line, function, 1);
#elif defined(__AST_DEBUG_MALLOC)
   tmp = __ao2_alloc_debug(sizeof(*tmp), destructor,
      AO2_ALLOC_OPT_LOCK_MUTEX, "", file, line, function, 0);
#else
   tmp = ao2_alloc(sizeof(*tmp), destructor);
#endif

   if ((ast_string_field_init(tmp, 128))) {
      return ast_channel_unref(tmp);
   }

   if (!(tmp->dialed_causes = ao2_container_alloc(DIALED_CAUSES_BUCKETS, pvt_cause_hash_fn, pvt_cause_cmp_fn))) {
           return ast_channel_unref(tmp);
   }

   return tmp;
}
enum ast_channel_adsicpe ast_channel_adsicpe ( const struct ast_channel chan)

Definition at line 854 of file channel_internal_api.c.

References ast_channel::adsicpe.

{
   return chan->adsicpe;
}
int ast_channel_alert_writable ( struct ast_channel chan)

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

{
   return chan->alertpipe[1] > -1;
}
int ast_channel_alert_write ( struct ast_channel chan)

Definition at line 1098 of file channel_internal_api.c.

References ast_channel::alertpipe, and ast_channel_alert_writable().

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

{
   char blah = 0x7F;
   return ast_channel_alert_writable(chan) && write(chan->alertpipe[1], &blah, sizeof(blah)) != sizeof(blah);
}
void ast_channel_audiohooks_set ( struct ast_channel chan,
struct ast_audiohook_list value 
)
pthread_t ast_channel_blocker ( const struct ast_channel chan)

Definition at line 1227 of file channel_internal_api.c.

References ast_channel::blocker.

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

{
   return chan->blocker;
}
void ast_channel_blocker_set ( struct ast_channel chan,
pthread_t  value 
)

Definition at line 1231 of file channel_internal_api.c.

References ast_channel::blocker, and value.

Referenced by __ast_read().

{
   chan->blocker = value;
}
const char* ast_channel_blockproc ( const struct ast_channel chan)

Definition at line 471 of file channel_internal_api.c.

References ast_channel::blockproc.

Referenced by ast_hangup(), handle_showchan(), and serialize_showchan().

{
   return chan->blockproc;
}
void ast_channel_blockproc_set ( struct ast_channel chan,
const char *  value 
)

Definition at line 475 of file channel_internal_api.c.

References ast_channel::blockproc, and value.

{
   chan->blockproc = value;
}
struct ast_party_caller* ast_channel_caller ( struct ast_channel chan) [read]

Definition at line 947 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(), __oh323_new(), _macro_exec(), acf_isexten_exec(), action_agents(), action_confbridgelist_item(), action_coreshowchannels(), action_meetmelist(), action_status(), agentmonitoroutgoing_exec(), analog_ss_thread(), app_exec(), ast_app_dtget(), ast_bridge_call(), ast_cel_fabricate_channel_from_event(), ast_cel_report_event(), ast_channel_destructor(), ast_channel_set_caller(), ast_channel_set_caller_event(), ast_do_masquerade(), ast_do_pickup(), ast_dummy_channel_destructor(), ast_hangup(), ast_iax2_new(), ast_pbx_h_exten_run(), ast_set_callerid(), ast_setstate(), ast_str_retrieve_variable(), ast_var_channels_table(), background_detect_exec(), begin_dial_channel(), blacklist_read(), builtin_atxfer(), builtin_automixmonitor(), builtin_automonitor(), callerid_read(), callerid_write(), callerpres_read(), callerpres_write(), cb_events(), cc_generic_agent_init(), check_bridge(), collect_digits(), conf_run(), console_call(), console_transfer(), copy_message(), dahdi_handle_dtmf(), dahdi_handle_event(), dahdi_new(), dial_exec_full(), dial_transfer(), dial_trunk(), disa_exec(), do_forward(), do_immediate_setup(), fax_detect_framehook(), feature_request_and_dial(), find_matching_endwhile(), findmeexec(), forward_message(), get_pai(), get_rpid(), gosub_exec(), gosub_run(), gtalk_new(), handle_chanlist(), handle_cli_confbridge_list_item(), handle_cli_misdn_show_channels(), handle_gosub(), handle_setpriority(), handle_showchan(), isAnsweringMachine(), isexten_function_read(), jingle_new(), join_queue(), leave_voicemail(), local_call(), local_indicate(), manager_bridge_event(), manager_parking_status(), 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(), ospauth_exec(), osplookup_exec(), oss_call(), oss_new(), park_call_full(), parkandannounce_exec(), parked_call_exec(), parse_oli(), pbx_builtin_background(), pbx_builtin_waitexten(), pbx_parseable_goto(), phase_e_handler(), phone_new(), post_manager_event(), pri_dchannel(), pri_ss_thread(), print_bc_info(), privacy_exec(), process_ast_dsp(), process_sdp(), push_callinfo(), queue_exec(), readexten_exec(), release_chan(), report_new_callerid(), ring_entry(), run_externnotify(), send_callinfo(), send_join_event(), send_leave_event(), senddialevent(), serialize_showchan(), set_one_cid(), setcallerid_pres_exec(), setup_env(), setup_privacy_args(), sig_pri_call(), sig_pri_handle_subcmds(), sip_call(), sip_new(), sip_read(), skinny_new(), skinny_newcall(), sla_ring_station(), sms_exec(), socket_process_helper(), state_notify_build_xml(), try_calling(), unistim_new(), update_connectedline(), valid_exit(), vm_authenticate(), wait_for_answer(), waitstream_core(), write_metadata(), and zapateller_exec().

{
   return &chan->caller;
}
void ast_channel_caller_set ( struct ast_channel chan,
struct ast_party_caller value 
)

Definition at line 999 of file channel_internal_api.c.

References ast_channel::caller, and value.

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

{
   chan->caller = *value;
}
void ast_channel_callid_cleanup ( struct ast_channel chan)

Definition at line 1054 of file channel_internal_api.c.

References ast_callid_unref, and ast_channel::callid.

Referenced by ast_channel_destructor().

{
   if (chan->callid) {
      chan->callid = ast_callid_unref(chan->callid);
   }
}
void ast_channel_callid_set ( struct ast_channel chan,
struct ast_callid callid 
)

Definition at line 874 of file channel_internal_api.c.

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

Referenced by __ast_pbx_run(), agent_new(), ast_iax2_new(), ast_pbx_outgoing_app(), ast_pbx_outgoing_exten(), ast_request(), dahdi_new(), iax2_request(), jingle_new(), local_new(), parked_call_exec(), and sip_new().

{
   char call_identifier_from[AST_CALLID_BUFFER_LENGTH];
   char call_identifier_to[AST_CALLID_BUFFER_LENGTH];
   call_identifier_from[0] = '\0';
   ast_callid_strnprint(call_identifier_to, sizeof(call_identifier_to), callid);
   if (chan->callid) {
      ast_callid_strnprint(call_identifier_from, sizeof(call_identifier_from), chan->callid);
      ast_debug(3, "Channel Call ID changing from %s to %s\n", call_identifier_from, call_identifier_to);
      /* unbind if already set */
      ast_callid_unref(chan->callid);
   }

   chan->callid = ast_callid_ref(callid);

   ast_test_suite_event_notify("CallIDChange",
      "State: CallIDChange\r\n"
      "Channel: %s\r\n"
      "CallID: %s\r\n"
      "PriorCallID: %s",
      ast_channel_name(chan),
      call_identifier_to,
      call_identifier_from);

}
struct ast_party_connected_line* ast_channel_connected ( struct ast_channel chan) [read]
void ast_channel_connected_set ( struct ast_channel chan,
struct ast_party_connected_line value 
)

Definition at line 1003 of file channel_internal_api.c.

References ast_channel::connected, and value.

Referenced by ast_do_masquerade().

{
   chan->connected = *value;
}
const char* ast_channel_context ( const struct ast_channel chan)

Definition at line 488 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_coreshowchannels(), action_dialplan_exec(), action_status(), agent_new(), analog_ss_thread(), ast_app_exec_macro(), ast_async_goto(), ast_bridge_call(), ast_call_forward(), ast_cc_call_init(), ast_cdr_init(), ast_cdr_update(), ast_cel_report_event(), ast_channel_by_exten_cb(), ast_channel_log(), ast_pbx_h_exten_run(), ast_str_retrieve_variable(), ast_var_channels_table(), ast_waitstream_exten(), background_detect_exec(), bridge_exec(), cc_generic_agent_init(), cc_interfaces_datastore_init(), check_availability(), collect_digits(), common_exec(), conf_run(), console_transfer(), dahdi_handle_dtmf(), dial_exec_full(), dialout(), do_bridge_masquerade(), do_forward(), do_idle_thread(), do_immediate_setup(), expand_gosub_args(), extenspy_exec(), fax_detect_framehook(), feature_attended_transfer(), feature_blind_transfer(), find_matching_endwhile(), forward_message(), func_channel_read(), get_cid_name(), gosub_exec(), gosub_run(), goto_exten(), handle_chanlist(), handle_gosub(), handle_setpriority(), handle_showchan(), iax2_call(), iax_park(), launch_monitor_thread(), leave_voicemail(), local_call(), log_exec(), lua_pbx_exec(), manage_parked_call(), masq_park_call(), mgcp_ss(), minivm_greet_exec(), misdn_call(), misdn_hangup(), my_handle_dtmf(), onedigit_goto(), park_call_full(), parkandannounce_exec(), pbx_builtin_background(), pbx_builtin_goto(), pbx_builtin_setvar_multiple(), pbx_builtin_waitexten(), pbx_extension_helper(), pbx_parseable_goto(), pickup_exec(), pri_ss_thread(), print_bc_info(), process_ast_dsp(), process_sdp(), queue_transfer_fixup(), raise_exception(), readexten_exec(), real_ctx(), realtime_exec(), release_chan(), ring_entry(), serialize_showchan(), setsubstate(), setup_env(), sip_park(), sip_read(), skinny_dialer(), skinny_newcall(), try_calling(), vm_authenticate(), vm_execmain(), vmauthenticate(), and wait_for_answer().

{
   return chan->context;
}
void ast_channel_creationtime_set ( struct ast_channel chan,
struct timeval *  value 
)

Definition at line 1031 of file channel_internal_api.c.

References ast_channel::creationtime, and value.

Referenced by __ast_channel_alloc_ap().

{
   chan->creationtime = *value;
}
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]treeThe ast data tree.
[in]chanThe channel structure to add to tree.
[in]add_bridgedAdd the bridged channel to the structure.
Return values:
<0on error.
0on success.

Definition at line 269 of file channel_internal_api.c.

References ast_bridged_channel(), ast_cause2str(), ast_cdr_data_add_structure(), ast_cdr_flags2str(), ast_channel_amaflags(), ast_channel_cdr(), ast_channel_data_add_structure(), ast_channel_hangupcause(), 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_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_SOFTHANGUP_UNBRIDGE, ast_state2str(), ast_tone_zone_data_add_structure(), ast_transfercapability2str(), and channel_data_add_flags().

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

{
   struct ast_channel *bc;
   struct ast_data *data_bridged;
   struct ast_data *data_cdr;
   struct ast_data *data_flags;
   struct ast_data *data_zones;
   struct ast_data *enum_node;
   struct ast_data *data_softhangup;
#if 0 /* XXX AstData: ast_callerid no longer exists. (Equivalent code not readily apparent.) */
   struct ast_data *data_callerid;
   char value_str[100];
#endif

   if (!tree) {
      return -1;
   }

   ast_data_add_structure(ast_channel, tree, chan);

   if (add_bridged) {
      bc = ast_bridged_channel(chan);
      if (bc) {
         data_bridged = ast_data_add_node(tree, "bridged");
         if (!data_bridged) {
            return -1;
         }
         ast_channel_data_add_structure(data_bridged, bc, 0);
      }
   }

   ast_data_add_codec(tree, "oldwriteformat", ast_channel_oldwriteformat(chan));
   ast_data_add_codec(tree, "readformat", ast_channel_readformat(chan));
   ast_data_add_codec(tree, "writeformat", ast_channel_writeformat(chan));
   ast_data_add_codec(tree, "rawreadformat", ast_channel_rawreadformat(chan));
   ast_data_add_codec(tree, "rawwriteformat", ast_channel_rawwriteformat(chan));
   ast_data_add_codecs(tree, "nativeformats", ast_channel_nativeformats(chan));

   /* state */
   enum_node = ast_data_add_node(tree, "state");
   if (!enum_node) {
      return -1;
   }
   ast_data_add_str(enum_node, "text", ast_state2str(ast_channel_state(chan)));
   ast_data_add_int(enum_node, "value", ast_channel_state(chan));

   /* hangupcause */
   enum_node = ast_data_add_node(tree, "hangupcause");
   if (!enum_node) {
      return -1;
   }
   ast_data_add_str(enum_node, "text", ast_cause2str(ast_channel_hangupcause(chan)));
   ast_data_add_int(enum_node, "value", ast_channel_hangupcause(chan));

   /* amaflags */
   enum_node = ast_data_add_node(tree, "amaflags");
   if (!enum_node) {
      return -1;
   }
   ast_data_add_str(enum_node, "text", ast_cdr_flags2str(ast_channel_amaflags(chan)));
   ast_data_add_int(enum_node, "value", ast_channel_amaflags(chan));

   /* transfercapability */
   enum_node = ast_data_add_node(tree, "transfercapability");
   if (!enum_node) {
      return -1;
   }
   ast_data_add_str(enum_node, "text", ast_transfercapability2str(ast_channel_transfercapability(chan)));
   ast_data_add_int(enum_node, "value", ast_channel_transfercapability(chan));

   /* _softphangup */
   data_softhangup = ast_data_add_node(tree, "softhangup");
   if (!data_softhangup) {
      return -1;
   }
   ast_data_add_bool(data_softhangup, "dev", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_DEV);
   ast_data_add_bool(data_softhangup, "asyncgoto", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_ASYNCGOTO);
   ast_data_add_bool(data_softhangup, "shutdown", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_SHUTDOWN);
   ast_data_add_bool(data_softhangup, "timeout", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_TIMEOUT);
   ast_data_add_bool(data_softhangup, "appunload", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_APPUNLOAD);
   ast_data_add_bool(data_softhangup, "explicit", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_EXPLICIT);
   ast_data_add_bool(data_softhangup, "unbridge", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_UNBRIDGE);

   /* channel flags */
   data_flags = ast_data_add_node(tree, "flags");
   if (!data_flags) {
      return -1;
   }
   channel_data_add_flags(data_flags, chan);

   ast_data_add_uint(tree, "timetohangup", ast_channel_whentohangup(chan)->tv_sec);

#if 0 /* XXX AstData: ast_callerid no longer exists. (Equivalent code not readily apparent.) */
   /* callerid */
   data_callerid = ast_data_add_node(tree, "callerid");
   if (!data_callerid) {
      return -1;
   }
   ast_data_add_structure(ast_callerid, data_callerid, &(chan->cid));
   /* insert the callerid ton */
   enum_node = ast_data_add_node(data_callerid, "cid_ton");
   if (!enum_node) {
      return -1;
   }
   ast_data_add_int(enum_node, "value", chan->cid.cid_ton);
   snprintf(value_str, sizeof(value_str), "TON: %s/Plan: %s",
      party_number_ton2str(chan->cid.cid_ton),
      party_number_plan2str(chan->cid.cid_ton));
   ast_data_add_str(enum_node, "text", value_str);
#endif

   /* tone zone */
   if (ast_channel_zone(chan)) {
      data_zones = ast_data_add_node(tree, "zone");
      if (!data_zones) {
         return -1;
      }
      ast_tone_zone_data_add_structure(data_zones, ast_channel_zone(chan));
   }

   /* insert cdr */
   data_cdr = ast_data_add_node(tree, "cdr");
   if (!data_cdr) {
      return -1;
   }

   ast_cdr_data_add_structure(data_cdr, ast_channel_cdr(chan), 1);

   return 0;
}
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]treeThe search tree generated by the data api.
[in]chanThe channel to compare.
[in]structure_nameThe name of the node of the channel structure.
Return values:
0The structure matches.
1The structure doesn't matches.

Definition at line 401 of file channel_internal_api.c.

References ast_data_search_cmp_structure.

{
   return ast_data_search_cmp_structure(tree, ast_channel, chan, structure_name);
}
int ast_channel_dialed_causes_add ( const struct ast_channel chan,
const struct ast_control_pvt_cause_code cause_code,
int  datalen 
)

Add cause code information to the channel.

Since:
11

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

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

Definition at line 1295 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, OBJ_KEY, OBJ_NODATA, and OBJ_UNLINK.

Referenced by ast_channel_hangupcause_hash_set().

{
   struct ast_control_pvt_cause_code *ao2_cause_code;
   ao2_find(chan->dialed_causes, cause_code->chan_name, OBJ_KEY | OBJ_UNLINK | OBJ_NODATA);
   ao2_cause_code = ao2_alloc(datalen, NULL);

   if (ao2_cause_code) {
      memcpy(ao2_cause_code, cause_code, datalen);
      ao2_link(chan->dialed_causes, ao2_cause_code);
      ao2_ref(ao2_cause_code, -1);
      return 0;
   } else {
      return -1;
   }
}
struct ast_str* ast_channel_dialed_causes_channels ( const struct ast_channel chan) [read]

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

Since:
11

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

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

Definition at line 1277 of file channel_internal_api.c.

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

Referenced by hangupcause_keys_read().

{
   struct ast_str *chanlist = ast_str_create(128);

   if (!chanlist) {
      return NULL;
   }

   ao2_callback(chan->dialed_causes, 0, collect_names_cb, &chanlist);

   return chanlist;
}
void ast_channel_dialed_causes_clear ( const struct ast_channel chan)

Clear all cause information from the channel.

Since:
11

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

Parameters:
chanThe channel from which to clear information

Definition at line 1311 of file channel_internal_api.c.

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

Referenced by hangupcause_clear_exec().

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

Retreive a ref-counted cause code information structure.

Since:
11

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

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

Definition at line 1290 of file channel_internal_api.c.

References ao2_find, ast_channel::dialed_causes, and OBJ_KEY.

Referenced by hangupcause_read().

{
   return ao2_find(chan->dialed_causes, chan_name, OBJ_KEY);
}
void ast_channel_dialed_set ( struct ast_channel chan,
struct ast_party_dialed value 
)

Definition at line 1007 of file channel_internal_api.c.

References ast_channel::dialed, and value.

Referenced by ast_do_masquerade().

{
   chan->dialed = *value;
}
char ast_channel_dtmf_digit_to_emulate ( const struct ast_channel chan)

Definition at line 521 of file channel_internal_api.c.

References ast_channel::dtmf_digit_to_emulate.

Referenced by __ast_read().

{
   return chan->dtmf_digit_to_emulate;
}
void ast_channel_dtmf_digit_to_emulate_set ( struct ast_channel chan,
char  value 
)

Definition at line 525 of file channel_internal_api.c.

References ast_channel::dtmf_digit_to_emulate, and value.

Referenced by __ast_read().

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

Definition at line 979 of file channel_internal_api.c.

References ast_channel::dtmf_tv.

Referenced by __ast_read(), and should_skip_dtmf().

{
   return &chan->dtmf_tv;
}
void ast_channel_dtmf_tv_set ( struct ast_channel chan,
struct timeval *  value 
)

Definition at line 1015 of file channel_internal_api.c.

References ast_channel::dtmf_tv, and value.

Referenced by __ast_read().

{
   chan->dtmf_tv = *value;
}
struct ast_frame* ast_channel_dtmff ( struct ast_channel chan) [read]

Definition at line 939 of file channel_internal_api.c.

References ast_channel::dtmff.

Referenced by __ast_read(), jingle_digit(), and queue_dtmf_readq().

{
   return &chan->dtmff;
}
void ast_channel_dtmff_set ( struct ast_channel chan,
struct ast_frame value 
)

Definition at line 991 of file channel_internal_api.c.

References ast_channel::dtmff, and value.

{
   chan->dtmff = *value;
}
unsigned int ast_channel_emulate_dtmf_duration ( const struct ast_channel chan)

Definition at line 646 of file channel_internal_api.c.

References ast_channel::emulate_dtmf_duration.

Referenced by __ast_read().

{
   return chan->emulate_dtmf_duration;
}
void ast_channel_emulate_dtmf_duration_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 650 of file channel_internal_api.c.

References ast_channel::emulate_dtmf_duration, and value.

Referenced by __ast_read().

const char* ast_channel_exten ( const struct ast_channel chan)

Definition at line 496 of file channel_internal_api.c.

References ast_channel::exten.

Referenced by __ast_goto_if_exists(), __ast_pbx_run(), _macro_exec(), _while_exec(), action_coreshowchannels(), action_dialplan_exec(), action_status(), agent_new(), ast_app_exec_macro(), ast_async_goto(), ast_bridge_call(), ast_cc_call_init(), ast_cdr_init(), ast_cdr_update(), ast_cel_report_event(), ast_channel_by_exten_cb(), ast_channel_log(), ast_pbx_h_exten_run(), ast_str_retrieve_variable(), ast_var_channels_table(), bridge_exec(), cb_events(), cc_generic_agent_init(), cc_interfaces_datastore_init(), dahdi_handle_dtmf(), dial_exec_full(), do_bridge_masquerade(), do_forward(), do_idle_thread(), do_immediate_setup(), dundi_exec(), dundi_helper(), expand_gosub_args(), fax_detect_framehook(), feature_request_and_dial(), find_matching_endwhile(), forward_message(), func_channel_read(), get_cid_name(), gosub_exec(), gosub_run(), handle_chanlist(), handle_cli_misdn_show_channels(), handle_frame(), handle_gosub(), handle_setpriority(), handle_showchan(), iax_park(), launch_monitor_thread(), leave_voicemail(), local_call(), log_exec(), lua_pbx_exec(), manage_parked_call(), masq_park_call(), misdn_bridge(), misdn_hangup(), misdn_update_redirecting(), misdn_write(), my_handle_dtmf(), ospauth_exec(), park_call_exec(), park_call_full(), parkandannounce_exec(), pbx_builtin_goto(), pbx_builtin_setvar_multiple(), pbx_builtin_waitexten(), pbx_extension_helper(), pbx_parseable_goto(), phase_e_handler(), print_bc_info(), process_ast_dsp(), process_sdp(), queue_transfer_fixup(), raise_exception(), realtime_exec(), release_chan(), ring_entry(), serialize_showchan(), setup_env(), setup_privacy_args(), sip_park(), sip_read(), skinny_newcall(), try_calling(), and wait_for_answer().

{
   return chan->exten;
}
int ast_channel_fd_isset ( const struct ast_channel chan,
int  which 
)

Definition at line 1211 of file channel_internal_api.c.

References ast_channel_fd().

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

{
   return ast_channel_fd(chan, which) > -1;
}
void ast_channel_fdno_set ( struct ast_channel chan,
int  value 
)
unsigned int ast_channel_fin ( const struct ast_channel chan)

Definition at line 654 of file channel_internal_api.c.

References ast_channel::fin.

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

{
   return chan->fin;
}
void ast_channel_fin_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 658 of file channel_internal_api.c.

References ast_channel::fin, and value.

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

{
   chan->fin = value;
}
struct ast_flags* ast_channel_flags ( struct ast_channel chan) [read]

Definition at line 1263 of file channel_internal_api.c.

References ast_channel::flags.

Referenced by __analog_ss_thread(), __ast_channel_masquerade(), __ast_pbx_run(), __ast_queue_frame(), __ast_read(), _macro_exec(), action_redirect(), agent_read(), analog_ss_thread(), ast_autoservice_start(), ast_autoservice_stop(), ast_bridge_call(), ast_bridge_end_dtmf(), ast_call(), ast_can_pickup(), ast_channel_bridge(), ast_channel_defer_dtmf(), ast_channel_destructor(), ast_channel_undefer_dtmf(), ast_deactivate_generator(), ast_do_masquerade(), ast_explicit_goto(), ast_hangup(), ast_iax2_new(), ast_indicate_data(), ast_pbx_h_exten_run(), ast_quiet_chan(), ast_raw_answer(), ast_readstring_full(), ast_sendtext(), ast_setstate(), ast_settimeout_full(), ast_softhangup_nolock(), ast_streamfile(), ast_transfer(), ast_var_channels_table(), ast_waitfor_nandfds(), ast_waitfordigit_full(), ast_write(), asyncgoto_exec(), bridge_channel_feature(), bridge_exec(), builtin_atxfer(), builtin_blindtransfer(), call_forward_inherit(), channel_data_add_flags(), channel_spy(), check_goto_on_transfer(), common_exec(), dahdi_new(), dahdi_read(), dial_exec_full(), disa_exec(), eivr_comm(), gosub_exec(), gosub_run(), handle_exec(), handle_gosub(), handle_showchan(), internal_deactivate_generator(), linear_alloc(), local_ast_moh_start(), local_ast_moh_stop(), local_new(), manage_parked_call(), park_call_full(), parkandannounce_exec(), pbx_builtin_background(), phone_read(), playtones_alloc(), remote_bridge_loop(), retrydial_exec(), return_exec(), serialize_showchan(), should_skip_dtmf(), sip_fixup(), sip_new(), sip_peer_hold(), start_spying(), startmon(), tonepair_alloc(), unistim_quiet_chan(), and waitstream_core().

{
   return &chan->flags;
}
unsigned int ast_channel_fout ( const struct ast_channel chan)

Definition at line 662 of file channel_internal_api.c.

References ast_channel::fout.

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

{
   return chan->fout;
}
void ast_channel_fout_set ( struct ast_channel chan,
unsigned int  value 
)

Definition at line 666 of file channel_internal_api.c.

References ast_channel::fout, and value.

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

{
   chan->fout = value;
}
void ast_channel_framehooks_set ( struct ast_channel chan,
struct ast_framehook_list value 
)

Definition at line 786 of file channel_internal_api.c.

References ast_channel::framehooks, and value.

Referenced by ast_framehook_attach(), and ast_framehook_list_destroy().

{
   chan->framehooks = value;
}
void ast_channel_generator_set ( struct ast_channel chan,
struct ast_generator value 
)
unsigned long ast_channel_insmpl ( const struct ast_channel chan)

Definition at line 670 of file channel_internal_api.c.

References ast_channel::insmpl.

Referenced by __ast_read(), and ast_write().

{
   return chan->insmpl;
}
void ast_channel_insmpl_set ( struct ast_channel chan,
unsigned long  value 
)

Definition at line 674 of file channel_internal_api.c.

References ast_channel::insmpl, and value.

Referenced by __ast_read().

{
   chan->insmpl = value;
}

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

{
   int flags;
   char blah;

   if (!ast_channel_internal_alert_readable(chan)) {
      return AST_ALERT_NOT_READABLE;
   }

   flags = fcntl(chan->alertpipe[0], F_GETFL);
   /* For some odd reason, the alertpipe occasionally loses nonblocking status,
    * which immediately causes a deadlock scenario.  Detect and prevent this. */
   if ((flags & O_NONBLOCK) == 0) {
      ast_log(LOG_ERROR, "Alertpipe on channel %s lost O_NONBLOCK?!!\n", ast_channel_name(chan));
      if (fcntl(chan->alertpipe[0], F_SETFL, flags | O_NONBLOCK) < 0) {
         ast_log(LOG_WARNING, "Unable to set alertpipe nonblocking! (%d: %s)\n", errno, strerror(errno));
         return AST_ALERT_READ_FATAL;
      }
   }
   if (read(chan->alertpipe[0], &blah, sizeof(blah)) < 0) {
      if (errno != EINTR && errno != EAGAIN) {
         ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
         return AST_ALERT_READ_FAIL;
      }
   }

   return AST_ALERT_READ_SUCCESS;
}

Definition at line 1138 of file channel_internal_api.c.

References ast_channel::alertpipe.

Referenced by ast_channel_internal_alert_read(), and ast_channel_internal_alertpipe_close().

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

Definition at line 1178 of file channel_internal_api.c.

References ast_channel::alertpipe.

Referenced by __ast_channel_alloc_ap().

{
   return chan->alertpipe[0];
}

Definition at line 1143 of file channel_internal_api.c.

References ast_channel::alertpipe.

Referenced by __ast_channel_alloc_ap(), and ast_dummy_channel_alloc().

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

Definition at line 1158 of file channel_internal_api.c.

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

Referenced by __ast_channel_alloc_ap().

{
   if (pipe(chan->alertpipe)) {
      ast_log(LOG_WARNING, "Channel allocation failed: Can't create alert pipe! Try increasing max file descriptors with ulimit -n\n");
      return -1;
   } else {
      int flags = fcntl(chan->alertpipe[0], F_GETFL);
      if (fcntl(chan->alertpipe[0], F_SETFL, flags | O_NONBLOCK) < 0) {
         ast_log(LOG_WARNING, "Channel allocation failed: Unable to set alertpipe nonblocking! (%d: %s)\n", errno, strerror(errno));
         return -1;
      }
      flags = fcntl(chan->alertpipe[1], F_GETFL);
      if (fcntl(chan->alertpipe[1], F_SETFL, flags | O_NONBLOCK) < 0) {
         ast_log(LOG_WARNING, "Channel allocation failed: Unable to set alertpipe nonblocking! (%d: %s)\n", errno, strerror(errno));
         return -1;
      }
   }
   return 0;
}
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 1183 of file channel_internal_api.c.

References ast_channel::alertpipe, ARRAY_LEN, and SWAP.

Referenced by ast_do_masquerade().

{
   int i;
   for (i = 0; i < ARRAY_LEN(chan1->alertpipe); i++) {
      SWAP(chan1->alertpipe[i], chan2->alertpipe[i]);
   }
}
struct ast_bridge* ast_channel_internal_bridge ( const struct ast_channel chan) [read]

Definition at line 1245 of file channel_internal_api.c.

References ast_channel::bridge.

Referenced by bridge_call(), and multiplexed_thread_function().

{
   return chan->bridge;
}
void ast_channel_internal_bridge_set ( struct ast_channel chan,
struct ast_bridge value 
)

Definition at line 1249 of file channel_internal_api.c.

References ast_channel::bridge, and value.

Referenced by alloc_playback_chan(), and bridge_channel_join().

{
   chan->bridge = value;
}
void ast_channel_internal_bridged_channel_set ( struct ast_channel chan,
struct ast_channel value 
)
void ast_channel_internal_cleanup ( struct ast_channel chan)

Definition at line 1358 of file channel_internal_api.c.

References ao2_t_ref, ast_string_field_free_memory, and ast_channel::dialed_causes.

Referenced by ast_channel_destructor(), and ast_dummy_channel_destructor().

{
   if (chan->dialed_causes) {
      ao2_t_ref(chan->dialed_causes, -1,
         "done with dialed causes since the channel is going away");
      chan->dialed_causes = NULL;
   }

   ast_string_field_free_memory(chan);
}
void ast_channel_internal_fd_clear ( struct ast_channel chan,
int  which 
)

Definition at line 1196 of file channel_internal_api.c.

References ast_channel_internal_fd_set().

Referenced by ast_channel_internal_fd_clear_all().

{
   ast_channel_internal_fd_set(chan, which, -1);
}

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

{
   int i;
   for (i = 0; i < AST_MAX_FDS; i++) {
      ast_channel_internal_fd_clear(chan, i);
   }
}
void ast_channel_internal_fd_set ( struct ast_channel chan,
int  which,
int  value 
)
void ast_channel_internal_finalize ( struct ast_channel chan)

Definition at line 1369 of file channel_internal_api.c.

References ast_channel::finalized.

Referenced by __ast_channel_alloc_ap().

{
   chan->finalized = 1;
}

Definition at line 1374 of file channel_internal_api.c.

References ast_channel::finalized.

Referenced by ast_channel_destructor().

{
   return chan->finalized;
}
void ast_channel_jb_set ( struct ast_channel chan,
struct ast_jb value 
)

Definition at line 995 of file channel_internal_api.c.

References ast_channel::jb, and value.

{
   chan->jb = *value;
}
void ast_channel_macrocontext_set ( struct ast_channel chan,
const char *  value 
)

Definition at line 508 of file channel_internal_api.c.

References ast_copy_string(), and ast_channel::macrocontext.

Referenced by _macro_exec(), and masq_park_call().

{
   ast_copy_string(chan->macrocontext, value, sizeof(chan->macrocontext));
}
void ast_channel_macroexten_set ( struct ast_channel chan,
const char *  value 
)

Definition at line 516 of file channel_internal_api.c.

References ast_copy_string(), and ast_channel::macroexten.

Referenced by _macro_exec(), and masq_park_call().

{
   ast_copy_string(chan->macroexten, value, sizeof(chan->macroexten));
}
int ast_channel_macropriority ( const struct ast_channel chan)
void ast_channel_macropriority_set ( struct ast_channel chan,
int  value 
)

Definition at line 586 of file channel_internal_api.c.

References ast_channel::macropriority, and value.

Referenced by _macro_exec(), and masq_park_call().

{
   chan->macropriority = value;
}
void ast_channel_masq_set ( struct ast_channel chan,
struct ast_channel value 
)

Definition at line 738 of file channel_internal_api.c.

References ast_channel::masq, and value.

Referenced by __ast_channel_masquerade(), and ast_do_masquerade().

{
   chan->masq = value;
}
void ast_channel_masqr_set ( struct ast_channel chan,
struct ast_channel value 
)

Definition at line 746 of file channel_internal_api.c.

References ast_channel::masqr, and value.

Referenced by __ast_channel_masquerade(), and ast_do_masquerade().

{
   chan->masqr = value;
}
void ast_channel_monitor_set ( struct ast_channel chan,
struct ast_channel_monitor value 
)

Definition at line 754 of file channel_internal_api.c.

References ast_channel::monitor, and value.

Referenced by ast_do_masquerade(), ast_monitor_start(), ast_monitor_stop(), and check_bridge().

{
   chan->monitor = value;
}
void ast_channel_music_state_set ( struct ast_channel chan,
void *  value 
)

Definition at line 698 of file channel_internal_api.c.

References ast_channel::music_state, and value.

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

{
   chan->music_state = value;
}
struct ast_namedgroups* ast_channel_named_callgroups ( const struct ast_channel chan) [read]

Definition at line 1078 of file channel_internal_api.c.

References ast_channel::named_callgroups.

Referenced by find_channel_by_group(), and func_channel_read().

{
   return chan->named_callgroups;
}
struct ast_namedgroups* ast_channel_named_pickupgroups ( const struct ast_channel chan) [read]

Definition at line 1087 of file channel_internal_api.c.

References ast_channel::named_pickupgroups.

Referenced by find_channel_by_group(), and func_channel_read().

{
   return chan->named_pickupgroups;
}
struct ast_format_cap* ast_channel_nativeformats ( const struct ast_channel chan) [read]

Definition at line 774 of file channel_internal_api.c.

References ast_channel::nativeformats.

Referenced by __ast_read(), __oh323_new(), __oh323_update_info(), agent_call(), agent_new(), alsa_new(), ast_bridge_update_talker_src_video_mode(), ast_channel_bridge(), ast_channel_data_add_structure(), ast_channel_destructor(), ast_channel_make_compatible_helper(), ast_do_masquerade(), ast_generic_bridge(), ast_iax2_new(), ast_openvstream(), ast_sendtext(), ast_streamfile(), ast_write(), begin_dial_channel(), bridge_request(), builtin_atxfer(), chanavail_exec(), console_new(), create_addr(), dahdi_new(), dial_exec_full(), dial_transfer(), do_forward(), do_notify(), echo_exec(), findmeexec(), free_translation(), func_channel_read(), gtalk_new(), gtalk_rtp_read(), gtalk_write(), handle_showchan(), iax2_bridge(), iax2_call(), iax2_request(), jingle_interpret_content(), jingle_new(), jingle_read(), jingle_rtp_read(), jingle_write(), local_new(), login_exec(), mgcp_new(), mgcp_rtp_read(), mgcp_write(), misdn_new(), multicast_rtp_request(), multiplexed_bridge_join(), nbs_new(), oh323_rtp_read(), oh323_write(), oss_new(), phone_new(), process_sdp(), rec_request(), ring_entry(), serialize_showchan(), set_format(), setup_rtp_connection(), show_channels_cb(), simple_bridge_join(), sip_new(), sip_rtp_read(), sip_show_channel(), sip_write(), skinny_new(), skinny_rtp_read(), skinny_write(), socket_process_helper(), speech_create(), start_rtp(), unistim_new(), unistim_rtp_read(), unistim_write(), and wait_for_answer().

{
   return chan->nativeformats;
}
void ast_channel_nativeformats_set ( struct ast_channel chan,
struct ast_format_cap value 
)

Definition at line 778 of file channel_internal_api.c.

References ast_channel::nativeformats, and value.

Referenced by __ast_channel_alloc_ap(), and ast_channel_destructor().

{
   chan->nativeformats = value;
}
struct ast_format* ast_channel_oldwriteformat ( struct ast_channel chan) [read]
unsigned long ast_channel_outsmpl ( const struct ast_channel chan)

Definition at line 678 of file channel_internal_api.c.

References ast_channel::outsmpl.

Referenced by __ast_read(), and ast_write().

{
   return chan->outsmpl;
}
void ast_channel_outsmpl_set ( struct ast_channel chan,
unsigned long  value 
)

Definition at line 682 of file channel_internal_api.c.

References ast_channel::outsmpl, and value.

Referenced by ast_write().

{
   chan->outsmpl = value;
}
void ast_channel_pbx_set ( struct ast_channel chan,
struct ast_pbx value 
)

Definition at line 802 of file channel_internal_api.c.

References ast_channel::pbx, and value.

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

{
   chan->pbx = value;
}
struct ast_format* ast_channel_readformat ( struct ast_channel chan) [read]

Definition at line 915 of file channel_internal_api.c.

References ast_channel::readformat.

Referenced by __ast_play_and_record(), __oh323_new(), __oh323_update_info(), adsi_transmit_message_full(), agent_new(), alsa_new(), ast_async_goto(), ast_channel_bridge(), ast_channel_data_add_structure(), ast_channel_make_compatible_helper(), ast_do_masquerade(), ast_iax2_new(), ast_set_read_format(), ast_set_read_format_by_id(), ast_set_read_format_from_cap(), background_detect_exec(), bridge_channel_join(), bridge_make_compatible(), bridge_request(), builtin_atxfer(), check_goto_on_transfer(), console_new(), dahdi_new(), dictate_exec(), do_bridge_masquerade(), do_notify(), do_waiting(), eagi_exec(), fax_detect_framehook(), fax_gateway_framehook(), func_channel_read(), generic_fax_exec(), gtalk_new(), gtalk_rtp_read(), gtalk_show_channels(), gtalk_write(), handle_recordfile(), handle_showchan(), handle_speechrecognize(), iax2_request(), iax_park(), ices_exec(), isAnsweringMachine(), jingle_new(), jingle_read(), jingle_rtp_read(), jingle_show_channels(), jingle_write(), local_new(), login_exec(), masq_park_call(), measurenoise(), mgcp_new(), mgcp_rtp_read(), mgcp_write(), misdn_new(), multicast_rtp_request(), multiplexed_bridge_join(), nbs_new(), oh323_rtp_read(), oh323_write(), oss_new(), process_sdp(), rec_request(), record_exec(), send_start_rtp(), serialize_showchan(), setup_rtp_connection(), simple_bridge_join(), sip_new(), sip_park(), sip_rtp_read(), sip_write(), skinny_new(), skinny_rtp_read(), skinny_write(), socket_process_helper(), speech_background(), start_rtp(), transmit_audio(), unistim_new(), unistim_rtp_read(), and unistim_write().

{
   return &chan->readformat;
}
void ast_channel_readtrans_set ( struct ast_channel chan,
struct ast_trans_pvt value 
)

Definition at line 834 of file channel_internal_api.c.

References ast_channel::readtrans, and value.

Referenced by free_translation().

{
   chan->readtrans = value;
}

Definition at line 967 of file channel_internal_api.c.

References ast_party_id_merge().

Referenced by sig_pri_redirecting_update().

void ast_channel_redirecting_set ( struct ast_channel chan,
struct ast_party_redirecting value 
)

Definition at line 1011 of file channel_internal_api.c.

References ast_channel::redirecting, and value.

Referenced by ast_do_masquerade().

{
   chan->redirecting = *value;
}
int ast_channel_rings ( const struct ast_channel chan)

Definition at line 598 of file channel_internal_api.c.

References ast_channel::rings.

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

{
   return chan->rings;
}
void ast_channel_sched_set ( struct ast_channel chan,
struct ast_sched_context value 
)

Definition at line 810 of file channel_internal_api.c.

References ast_channel::sched, and value.

Referenced by __ast_channel_alloc_ap(), and ast_hangup().

{
   chan->sched = value;
}
char ast_channel_sending_dtmf_digit ( const struct ast_channel chan)

Definition at line 530 of file channel_internal_api.c.

References ast_channel::sending_dtmf_digit.

Referenced by ast_bridge_call(), ast_do_masquerade(), and ast_senddigit_end().

{
   return chan->sending_dtmf_digit;
}
void ast_channel_sending_dtmf_digit_set ( struct ast_channel chan,
char  value 
)

Definition at line 534 of file channel_internal_api.c.

References ast_channel::sending_dtmf_digit, and value.

Referenced by ast_senddigit_begin(), and ast_senddigit_end().

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

Definition at line 539 of file channel_internal_api.c.

Referenced by ast_bridge_call(), and ast_do_masquerade().

{
   return chan->sending_dtmf_tv;
}
void ast_channel_sending_dtmf_tv_set ( struct ast_channel chan,
struct timeval  value 
)

Definition at line 543 of file channel_internal_api.c.

References ast_channel::sending_dtmf_tv, and value.

Referenced by ast_senddigit_begin().

{
   chan->sending_dtmf_tv = value;
}
void ast_channel_softhangup_internal_flag_clear ( struct ast_channel chan,
int  value 
)

Definition at line 1049 of file channel_internal_api.c.

References ast_channel::softhangup.

Referenced by ast_channel_clear_softhangup().

{
   chan ->softhangup &= ~value;
}
void ast_channel_softhangup_internal_flag_set ( struct ast_channel chan,
int  value 
)

Definition at line 1041 of file channel_internal_api.c.

References ast_channel::softhangup, and value.

Referenced by ast_do_masquerade().

{
   chan->softhangup = value;
}
enum ast_channel_state ast_channel_state ( const struct ast_channel chan)

Definition at line 862 of file channel_internal_api.c.

References ast_channel::state.

{
   return chan->state;
}
void ast_channel_state_set ( struct ast_channel chan,
enum ast_channel_state  value 
)
int ast_channel_streamid ( const struct ast_channel chan)

Definition at line 606 of file channel_internal_api.c.

References ast_channel::streamid.

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

{
   return chan->streamid;
}
void ast_channel_streamid_set ( struct ast_channel chan,
int  value 
)

Definition at line 610 of file channel_internal_api.c.

References ast_channel::streamid, and value.

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

{
   chan->streamid = value;
}
struct ast_channel_tech* ast_channel_tech ( const struct ast_channel chan) [read]

Definition at line 846 of file channel_internal_api.c.

References ast_channel::tech.

Referenced by __ast_channel_masquerade(), __ast_read(), acf_channel_read(), agent_indicate(), agent_read(), analog_ss_thread(), ast_bridged_channel(), ast_call(), ast_channel_bridge(), ast_channel_early_bridge(), ast_channel_make_compatible_helper(), ast_channel_queryoption(), ast_channel_sendhtml(), ast_channel_setoption(), ast_channel_supports_html(), ast_do_masquerade(), ast_hangup(), ast_indicate_data(), ast_jb_do_usecheck(), ast_pre_call(), ast_raw_answer(), ast_rtp_dtmf_compatible(), ast_rtp_instance_bridge(), 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(), conf_run(), dahdi_accept_r2_call_exec(), dahdi_pri_cc_agent_init(), dahdi_send_callrerouting_facility_exec(), dahdi_setoption(), dahdiras_exec(), destroy_conference_bridge(), flash_exec(), func_channel_read(), func_channel_write_real(), func_header_read(), function_iaxpeer(), function_sipchaninfo_read(), handle_request_bye(), handle_showchan(), iax2_bridge(), iax2_prov_app(), misdn_facility_exec(), misdn_set_opt_exec(), my_get_sigpvt_bridged_channel(), park_call_full(), play_sound_helper(), remote_bridge_loop(), sendtext_exec(), serialize_showchan(), setup_env(), sip_acf_channel_read(), sip_cc_agent_init(), sip_dtmfmode(), sip_hangup(), sipinfo_send(), softhangup_exec(), transfer_exec(), try_calling(), and update_bridge_vars().

{
   return chan->tech;
}
void* ast_channel_tech_pvt ( const struct ast_channel chan)

Definition at line 702 of file channel_internal_api.c.

References ast_channel::tech_pvt.

Referenced by __analog_ss_thread(), __dahdi_exception(), acf_channel_read(), agent_bridgedchannel(), agent_call(), agent_digit_begin(), agent_digit_end(), agent_fixup(), agent_get_base_channel(), agent_hangup(), agent_indicate(), agent_read(), agent_sendhtml(), agent_sendtext(), agent_start_monitoring(), agent_write(), alsa_fixup(), analog_hangup(), analog_ss_thread(), ast_channel_destructor(), ast_do_masquerade(), ast_generic_bridge(), ast_rtp_instance_bridge(), ast_udptl_bridge(), bridge_bridgedchannel(), bridge_call(), bridge_hangup(), bridge_write(), channel_to_session(), console_answer(), console_call(), console_fixup(), console_hangup(), console_indicate(), console_write(), dahdi_accept_r2_call_exec(), dahdi_answer(), dahdi_bridge(), 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_pri_cc_agent_init(), dahdi_queryoption(), dahdi_r2_get_channel_category(), dahdi_read(), dahdi_send_callrerouting_facility_exec(), dahdi_send_keypad_facility_exec(), dahdi_sendtext(), dahdi_setoption(), dahdi_write(), dialog_unlink_all(), func_header_read(), function_iaxpeer(), function_sipchaninfo_read(), get_video_desc(), gtalk_answer(), gtalk_call(), gtalk_digit_begin(), gtalk_digit_end(), gtalk_fixup(), gtalk_get_codec(), gtalk_get_rtp_peer(), gtalk_hangup(), gtalk_read(), gtalk_sendtext(), gtalk_set_rtp_peer(), gtalk_write(), handle_enbloc_call_message(), handle_offhook_message(), handle_request_bye(), handle_soft_key_event_message(), handle_stimulus_message(), handle_transfer_button(), iax2_answer(), iax2_bridge(), 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(), jingle_digit_begin(), jingle_digit_end(), jingle_fixup(), jingle_get_codec(), jingle_get_rtp_peer(), jingle_hangup(), jingle_indicate(), jingle_read(), jingle_sendtext(), jingle_set_rtp_peer(), jingle_write(), local_answer(), local_bridge_loop(), local_bridgedchannel(), local_call(), local_digit_begin(), local_digit_end(), local_fixup(), local_hangup(), local_indicate(), local_queryoption(), local_sendhtml(), local_sendtext(), local_setoption(), local_write(), manager_optimize_away(), 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(), multicast_rtp_call(), multicast_rtp_hangup(), multicast_rtp_write(), my_get_sigpvt_bridged_channel(), nbs_call(), nbs_hangup(), nbs_xread(), nbs_xwrite(), oh323_answer(), oh323_call(), oh323_digit_begin(), oh323_digit_end(), oh323_fixup(), oh323_get_rtp_peer(), oh323_hangup(), oh323_indicate(), oh323_read(), oh323_set_rtp_peer(), oh323_update_info(), oh323_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(), pri_ss_thread(), remote_bridge_loop(), sig_pri_hangup(), sig_ss7_hangup(), 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_udptl_peer(), sip_get_vrtp_peer(), sip_hangup(), sip_indicate(), sip_park_thread(), sip_queryoption(), sip_read(), sip_senddigit_begin(), sip_senddigit_end(), sip_sendhtml(), sip_sendtext(), sip_set_rtp_peer(), sip_set_udptl_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(), 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().

{
   return chan->tech_pvt;
}
struct ast_timer* ast_channel_timer ( const struct ast_channel chan) [read]
void ast_channel_timer_set ( struct ast_channel chan,
struct ast_timer value 
)

Definition at line 818 of file channel_internal_api.c.

References ast_channel::timer, and value.

Referenced by __ast_channel_alloc_ap(), and ast_channel_destructor().

{
   chan->timer = value;
}
void* ast_channel_timingdata ( const struct ast_channel chan)

Definition at line 710 of file channel_internal_api.c.

References ast_channel::timingdata.

Referenced by __ast_read(), and ast_settimeout_full().

{
   return chan->timingdata;
}
void ast_channel_timingdata_set ( struct ast_channel chan,
void *  value 
)

Definition at line 714 of file channel_internal_api.c.

References ast_channel::timingdata, and value.

Referenced by ast_settimeout_full().

{
   chan->timingdata = value;
}
void ast_channel_timingfd_set ( struct ast_channel chan,
int  value 
)

Definition at line 618 of file channel_internal_api.c.

References ast_channel::timingfd, and value.

Referenced by __ast_channel_alloc_ap(), and ast_dummy_channel_alloc().

{
   chan->timingfd = value;
}
void ast_channel_timingfunc_set ( struct ast_channel chan,
ast_timing_func_t  value 
)

Definition at line 1240 of file channel_internal_api.c.

References ast_channel::timingfunc, and value.

Referenced by ast_settimeout_full().

{
   chan->timingfunc = value;
}
void ast_channel_varshead_set ( struct ast_channel chan,
struct varshead value 
)

Definition at line 1023 of file channel_internal_api.c.

References value, and ast_channel::varshead.

{
   chan->varshead = *value;
}
int ast_channel_visible_indication ( const struct ast_channel chan)

Definition at line 622 of file channel_internal_api.c.

References ast_channel::visible_indication.

Referenced by ast_bridge_call(), and ast_do_masquerade().

{
   return chan->visible_indication;
}
void ast_channel_visible_indication_set ( struct ast_channel chan,
int  value 
)
struct ast_filestream* ast_channel_vstream ( const struct ast_channel chan) [read]

Definition at line 766 of file channel_internal_api.c.

References ast_channel::vstream.

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

{
   return chan->vstream;
}
void ast_channel_vstream_set ( struct ast_channel chan,
struct ast_filestream value 
)

Definition at line 770 of file channel_internal_api.c.

References value, and ast_channel::vstream.

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

{
   chan->vstream = value;
}
int ast_channel_vstreamid ( const struct ast_channel chan)

Definition at line 630 of file channel_internal_api.c.

References ast_channel::vstreamid.

Referenced by filestream_close().

{
   return chan->vstreamid;
}
void ast_channel_vstreamid_set ( struct ast_channel chan,
int  value 
)

Definition at line 634 of file channel_internal_api.c.

References value, and ast_channel::vstreamid.

Referenced by ast_readvideo_callback(), and filestream_close().

{
   chan->vstreamid = value;
}
void ast_channel_whentohangup_set ( struct ast_channel chan,
struct timeval *  value 
)

Definition at line 1019 of file channel_internal_api.c.

References value, and ast_channel::whentohangup.

Referenced by ast_channel_setwhentohangup_tv(), and dial_exec_full().

{
   chan->whentohangup = *value;
}
struct ast_format* ast_channel_writeformat ( struct ast_channel chan) [read]

Definition at line 919 of file channel_internal_api.c.

References ast_channel::writeformat.

Referenced by __oh323_new(), __oh323_update_info(), adsi_transmit_message_full(), agent_new(), agent_write(), alsa_new(), ast_async_goto(), ast_channel_bridge(), ast_channel_data_add_structure(), ast_channel_make_compatible_helper(), ast_channel_start_silence_generator(), ast_do_masquerade(), ast_iax2_new(), ast_openstream_full(), ast_read_generator_actions(), ast_set_write_format(), ast_set_write_format_by_id(), ast_set_write_format_from_cap(), ast_streamfile(), ast_write(), bridge_channel_join(), bridge_make_compatible(), bridge_request(), builtin_atxfer(), chanspy_exec(), check_goto_on_transfer(), console_new(), dahdi_new(), dahdiscan_exec(), do_bridge_masquerade(), do_notify(), extenspy_exec(), filehelper(), func_channel_read(), generator_force(), generic_fax_exec(), gtalk_new(), gtalk_rtp_read(), gtalk_show_channels(), gtalk_write(), handle_showchan(), iax2_request(), iax_park(), jingle_new(), jingle_read(), jingle_rtp_read(), jingle_show_channels(), jingle_write(), linear_alloc(), local_new(), login_exec(), masq_park_call(), mgcp_new(), mgcp_rtp_read(), mgcp_write(), misdn_new(), moh_alloc(), moh_files_alloc(), moh_files_write_format_change(), mp3_exec(), multicast_rtp_request(), multiplexed_bridge_join(), nbs_new(), NBScat_exec(), oh323_rtp_read(), oh323_write(), oss_new(), playtones_alloc(), process_sdp(), rec_request(), send_waveform_to_channel(), serialize_showchan(), setup_rtp_connection(), simple_bridge_join(), sip_new(), sip_park(), sip_rtp_read(), sip_write(), skinny_new(), skinny_rtp_read(), skinny_write(), socket_process_helper(), start_rtp(), tonepair_alloc(), transmit_audio(), unistim_new(), unistim_rtp_read(), and unistim_write().

{
   return &chan->writeformat;
}
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 842 of file channel_internal_api.c.

References value, and ast_channel::writetrans.

Referenced by free_translation().

{
   chan->writetrans = value;
}
void ast_channel_zone_set ( struct ast_channel chan,
struct ast_tone_zone value 
)

Definition at line 826 of file channel_internal_api.c.

References value, and ast_channel::zone.

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

{
   chan->zone = value;
}
static void channel_data_add_flags ( struct ast_data tree,
struct ast_channel chan 
) [static]

Definition at line 246 of file channel_internal_api.c.

References ast_channel_flags(), ast_data_add_bool(), AST_FLAG_BLOCKING, AST_FLAG_BRIDGE_HANGUP_DONT, AST_FLAG_BRIDGE_HANGUP_RUN, 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_NBRIDGE, AST_FLAG_OUTGOING, AST_FLAG_SPYING, AST_FLAG_WRITE_INT, AST_FLAG_ZOMBIE, and ast_test_flag.

Referenced by ast_channel_data_add_structure().

{
   ast_data_add_bool(tree, "DEFER_DTMF", ast_test_flag(ast_channel_flags(chan), AST_FLAG_DEFER_DTMF));
   ast_data_add_bool(tree, "WRITE_INT", ast_test_flag(ast_channel_flags(chan), AST_FLAG_WRITE_INT));
   ast_data_add_bool(tree, "BLOCKING", ast_test_flag(ast_channel_flags(chan), AST_FLAG_BLOCKING));
   ast_data_add_bool(tree, "ZOMBIE", ast_test_flag(ast_channel_flags(chan), AST_FLAG_ZOMBIE));
   ast_data_add_bool(tree, "EXCEPTION", ast_test_flag(ast_channel_flags(chan), AST_FLAG_EXCEPTION));
   ast_data_add_bool(tree, "MOH", ast_test_flag(ast_channel_flags(chan), AST_FLAG_MOH));
   ast_data_add_bool(tree, "SPYING", ast_test_flag(ast_channel_flags(chan), AST_FLAG_SPYING));
   ast_data_add_bool(tree, "NBRIDGE", ast_test_flag(ast_channel_flags(chan), AST_FLAG_NBRIDGE));
   ast_data_add_bool(tree, "IN_AUTOLOOP", ast_test_flag(ast_channel_flags(chan), AST_FLAG_IN_AUTOLOOP));
   ast_data_add_bool(tree, "OUTGOING", ast_test_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING));
   ast_data_add_bool(tree, "IN_DTMF", ast_test_flag(ast_channel_flags(chan), AST_FLAG_IN_DTMF));
   ast_data_add_bool(tree, "EMULATE_DTMF", ast_test_flag(ast_channel_flags(chan), AST_FLAG_EMULATE_DTMF));
   ast_data_add_bool(tree, "END_DTMF_ONLY", ast_test_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY));
   ast_data_add_bool(tree, "MASQ_NOSTREAM", ast_test_flag(ast_channel_flags(chan), AST_FLAG_MASQ_NOSTREAM));
   ast_data_add_bool(tree, "BRIDGE_HANGUP_RUN", ast_test_flag(ast_channel_flags(chan), AST_FLAG_BRIDGE_HANGUP_RUN));
   ast_data_add_bool(tree, "BRIDGE_HANGUP_DONT", ast_test_flag(ast_channel_flags(chan), AST_FLAG_BRIDGE_HANGUP_DONT));
   ast_data_add_bool(tree, "DISABLE_WORKAROUNDS", ast_test_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_WORKAROUNDS));
   ast_data_add_bool(tree, "DISABLE_DEVSTATE_CACHE", ast_test_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_DEVSTATE_CACHE));
}
static int collect_names_cb ( void *  obj,
void *  arg,
int  flags 
) [static]

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

                                                             {
   struct ast_control_pvt_cause_code *cause_code = obj;
   struct ast_str **str = arg;

   ast_str_append(str, 0, "%s%s", (ast_str_strlen(*str) ? "," : ""), cause_code->chan_name);

   return 0;
}
DEFINE_STRINGFIELD_GETTER_FOR ( peeraccount  )
DEFINE_STRINGFIELD_GETTER_FOR ( call_forward  )
DEFINE_STRINGFIELD_GETTER_FOR ( hangupsource  )
DEFINE_STRINGFIELD_SETTERS_FOR ( peeraccount  )
DEFINE_STRINGFIELD_SETTERS_FOR ( call_forward  )
DEFINE_STRINGFIELD_SETTERS_FOR ( hangupsource  )
static int pvt_cause_cmp_fn ( void *  obj,
void *  vstr,
int  flags 
) [static]

Definition at line 1324 of file channel_internal_api.c.

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

Referenced by __ast_channel_internal_alloc().

{
   struct ast_control_pvt_cause_code *pc = obj;
   char *str = ast_tech_to_upper(ast_strdupa(vstr));
   char *pc_str = ast_tech_to_upper(ast_strdupa(pc->chan_name));
   return !strcmp(pc_str, str) ? CMP_MATCH | CMP_STOP : 0;
}
static int pvt_cause_hash_fn ( const void *  vpc,
const int  flags 
) [static]

Definition at line 1317 of file channel_internal_api.c.

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

Referenced by __ast_channel_internal_alloc().

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