Asterisk - The Open Source Telephony Project GIT-master-8f1982c
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
Public Member Functions | Data Fields
ast_channel Struct Reference

Main Channel structure associated with a channel. More...

#include <channel_private.h>

Collaboration diagram for ast_channel:
Collaboration graph
[legend]

Public Member Functions

 AST_DECLARE_STRING_FIELDS (AST_STRING_FIELD(name);AST_STRING_FIELD(language);AST_STRING_FIELD(musicclass);AST_STRING_FIELD(latest_musicclass);AST_STRING_FIELD(accountcode);AST_STRING_FIELD(peeraccount);AST_STRING_FIELD(userfield);AST_STRING_FIELD(call_forward);AST_STRING_FIELD(parkinglot);AST_STRING_FIELD(hangupsource);AST_STRING_FIELD(dialcontext);)
 
 AST_VECTOR (, int) fds
 

Data Fields

enum ast_channel_adsicpe adsicpe
 
int alertpipe [2]
 
int amaflags
 
struct timeval answertime
 
const char * appl
 
struct ast_audiohook_listaudiohooks
 
struct ast_autochan_list autochans
 
pthread_t blocker
 
int blocker_tid
 
const char * blockproc
 
struct ast_bridgebridge
 
struct ast_bridge_channelbridge_channel
 
struct ast_party_caller caller
 Channel Caller ID information. More...
 
ast_group_t callgroup
 
ast_callid callid
 
struct ast_cdrcdr
 
struct stasis_forwardchannel_forward
 
struct ast_party_connected_line connected
 Channel Connected Line ID information. More...
 
struct ast_party_connected_line connected_indicated
 Channel Connected Line ID information that was last indicated. More...
 
char context [AST_MAX_CONTEXT]
 
struct timeval creationtime
 
const char * data
 
struct ast_datastore_list datastores
 
struct ast_streamdefault_streams [AST_MEDIA_TYPE_END]
 
struct ast_party_dialed dialed
 Dialed/Called information. More...
 
struct ao2_containerdialed_causes
 
char dtmf_digit_to_emulate
 
struct timeval dtmf_tv
 
struct ast_frame dtmff
 
unsigned int emulate_dtmf_duration
 
struct stasis_forwardendpoint_forward
 
char exten [AST_MAX_EXTENSION]
 
int fdno
 
unsigned int fin
 
unsigned int finalized:1
 
struct ast_flags flags
 
unsigned int fout
 
struct ast_framehook_listframehooks
 
struct ast_generatorgenerator
 
void * generatordata
 
struct ast_hangup_handler_list hangup_handlers
 
int hangupcause
 
int hold_state
 
unsigned long insmpl
 
char is_t38_active
 
struct ast_jb jb
 
char lastcontext [AST_MAX_CONTEXT]
 
char lastexten [AST_MAX_EXTENSION]
 
int linked_in_container
 
struct ast_channel_id linkedid
 
struct ast_channelmasq
 
struct ast_channelmasqr
 
void * music_state
 
struct ast_namedgroups * named_callgroups
 
struct ast_namedgroups * named_pickupgroups
 
struct ast_format_capnativeformats
 
struct ast_formatoldwriteformat
 
unsigned long outsmpl
 
struct ast_pbxpbx
 
ast_group_t pickupgroup
 
int priority
 
struct ast_formatrawreadformat
 
struct ast_formatrawwriteformat
 
struct ast_formatreadformat
 
struct ast_readq_list readq
 
struct ast_trans_pvtreadtrans
 
struct ast_party_redirecting redirecting
 Redirecting/Diversion information. More...
 
int rings
 
struct ast_sched_contextsched
 
char sending_dtmf_digit
 
struct timeval sending_dtmf_tv
 
struct ast_channel_snapshotsnapshot
 
struct ast_flags snapshot_segment_flags
 
int softhangup
 
enum ast_channel_state state
 
struct ast_filestreamstream
 
struct ast_stream_topologystream_topology
 
void * stream_topology_change_source
 
int streamid
 
const struct ast_channel_techtech
 
void * tech_pvt
 
struct ast_timertimer
 
void * timingdata
 
int timingfd
 
ast_timing_func_t timingfunc
 
struct stasis_topictopic
 
unsigned short transfercapability
 
char unbridged
 
struct ast_channel_id uniqueid
 
struct varshead varshead
 
int visible_indication
 
struct ast_filestreamvstream
 
int vstreamid
 
struct timeval whentohangup
 
struct ast_formatwriteformat
 
struct ast_trans_pvtwritetrans
 
char x
 
struct ast_tone_zonezone
 

Detailed Description

Main Channel structure associated with a channel.

Note
When adding fields to this structure, it is important to add the field 'in position' with like-aligned fields, so as to keep the compiler from having to add padding to align fields. The structure's fields are sorted in this order: pointers, structures, long, int/enum, short, char. This is especially important on 64-bit architectures, where mixing 4-byte and 8-byte fields causes 4 bytes of padding to be added before many 8-byte fields.
Examples
app_skel.c.

Definition at line 48 of file channel_private.h.

Member Function Documentation

◆ AST_DECLARE_STRING_FIELDS()

AST_DECLARE_STRING_FIELDS ( AST_STRING_FIELD(name);AST_STRING_FIELD(language);AST_STRING_FIELD(musicclass);AST_STRING_FIELD(latest_musicclass);AST_STRING_FIELD(accountcode);AST_STRING_FIELD(peeraccount);AST_STRING_FIELD(userfield);AST_STRING_FIELD(call_forward);AST_STRING_FIELD(parkinglot);AST_STRING_FIELD(hangupsource);AST_STRING_FIELD(dialcontext);  )

◆ AST_VECTOR()

AST_VECTOR ( int  )

File descriptors for channel – Drivers will poll on these file descriptors, so at least one must be non -1. See

Field Documentation

◆ adsicpe

enum ast_channel_adsicpe adsicpe

Whether or not ADSI is detected on CPE

Definition at line 156 of file channel_private.h.

Referenced by ast_channel_adsicpe(), and ast_channel_adsicpe_set().

◆ alertpipe

int alertpipe[2]

◆ amaflags

int amaflags

Set BEFORE PBX is started to determine AMA flags

Definition at line 155 of file channel_private.h.

Referenced by ast_channel_amaflags(), ast_channel_amaflags_set(), and ast_channel_yank().

◆ answertime

struct timeval answertime

The time the channel was answered

Definition at line 131 of file channel_private.h.

Referenced by ast_channel_answertime_set().

◆ appl

const char* appl

Current application

Definition at line 57 of file channel_private.h.

Referenced by ast_channel_appl(), and ast_channel_appl_set().

◆ audiohooks

struct ast_audiohook_list* audiohooks

Definition at line 67 of file channel_private.h.

Referenced by ast_channel_audiohooks(), and ast_channel_audiohooks_set().

◆ autochans

struct ast_autochan_list autochans

Autochans on the channel

Definition at line 137 of file channel_private.h.

Referenced by ast_channel_autochans().

◆ blocker

pthread_t blocker

If anyone is blocking, this is them

Definition at line 93 of file channel_private.h.

Referenced by ast_channel_blocker(), and ast_channel_blocker_set().

◆ blocker_tid

int blocker_tid

If anyone is blocking, this is their thread id

Definition at line 141 of file channel_private.h.

Referenced by ast_channel_blocker_tid(), and ast_channel_blocker_tid_set().

◆ blockproc

const char* blockproc

Procedure causing blocking

Definition at line 56 of file channel_private.h.

Referenced by ast_channel_blockproc(), and ast_channel_blockproc_set().

◆ bridge

struct ast_bridge* bridge

◆ bridge_channel

struct ast_bridge_channel* bridge_channel

◆ caller

struct ast_party_caller caller

Channel Caller ID information.

Note
The caller id information is the caller id of this channel when it is used to initiate a call.

Definition at line 107 of file channel_private.h.

Referenced by analog_send_callerid(), app_exec(), ast_call_forward(), ast_channel_caller(), ast_channel_caller_set(), and channel_do_masquerade().

◆ callgroup

ast_group_t callgroup

Call group for call pickups

Definition at line 126 of file channel_private.h.

Referenced by ast_channel_callgroup(), and ast_channel_callgroup_set().

◆ callid

ast_callid callid

◆ cdr

struct ast_cdr* cdr

Call Detail Record

Definition at line 69 of file channel_private.h.

Referenced by ast_channel_cdr(), ast_channel_cdr_set(), and manager_log().

◆ channel_forward

struct stasis_forward* channel_forward

Subscription for event forwarding to all channel topic

Definition at line 191 of file channel_private.h.

Referenced by ari_bridges_play_new(), ast_ari_bridges_record(), ast_channel_internal_cleanup(), and ast_channel_internal_setup_topics().

◆ connected

struct ast_party_connected_line connected

Channel Connected Line ID information.

Note
The connected line information identifies the channel connected/bridged to this channel.

Definition at line 114 of file channel_private.h.

Referenced by ast_channel_connected(), ast_channel_connected_set(), and channel_do_masquerade().

◆ connected_indicated

struct ast_party_connected_line connected_indicated

Channel Connected Line ID information that was last indicated.

Definition at line 119 of file channel_private.h.

Referenced by ast_channel_connected_indicated().

◆ context

char context[AST_MAX_CONTEXT]

Dialplan: Current extension context

Definition at line 180 of file channel_private.h.

Referenced by ast_channel_context(), ast_channel_context_set(), ast_channel_yank(), and readexten_exec().

◆ creationtime

struct timeval creationtime

The time of channel creation

Definition at line 130 of file channel_private.h.

Referenced by ast_channel_creationtime_set().

◆ data

const char* data

◆ datastores

struct ast_datastore_list datastores

Data stores on the channel

Definition at line 136 of file channel_private.h.

Referenced by ast_channel_datastores().

◆ default_streams

struct ast_stream* default_streams[AST_MEDIA_TYPE_END]

Default streams indexed by media type

Definition at line 195 of file channel_private.h.

Referenced by ast_channel_get_default_stream(), and channel_set_default_streams().

◆ dialed

struct ast_party_dialed dialed

Dialed/Called information.

Note
Set on incoming channels to indicate the originally dialed party.
Dialed Number Identifier (DNID)

Definition at line 100 of file channel_private.h.

Referenced by ast_channel_dialed(), ast_channel_dialed_set(), channel_do_masquerade(), jingle_request(), and pbx_outgoing_attempt().

◆ dialed_causes

struct ao2_container* dialed_causes

◆ dtmf_digit_to_emulate

char dtmf_digit_to_emulate

Digit being emulated

Definition at line 187 of file channel_private.h.

Referenced by ast_channel_dtmf_digit_to_emulate(), and ast_channel_dtmf_digit_to_emulate_set().

◆ dtmf_tv

struct timeval dtmf_tv

The time that an in process digit began, or the last digit ended

Definition at line 134 of file channel_private.h.

Referenced by ast_channel_dtmf_tv(), and ast_channel_dtmf_tv_set().

◆ dtmff

struct ast_frame dtmff

DTMF frame

Definition at line 124 of file channel_private.h.

Referenced by ast_channel_dtmff(), and ast_channel_dtmff_set().

◆ emulate_dtmf_duration

unsigned int emulate_dtmf_duration

Number of ms left to emulate DTMF for

Definition at line 170 of file channel_private.h.

Referenced by ast_channel_emulate_dtmf_duration(), and ast_channel_emulate_dtmf_duration_set().

◆ endpoint_forward

struct stasis_forward* endpoint_forward

Subscription for event forwarding to endpoint's topic

Definition at line 192 of file channel_private.h.

Referenced by ast_channel_forward_endpoint(), and ast_channel_internal_cleanup().

◆ exten

char exten[AST_MAX_EXTENSION]

◆ fdno

int fdno

Which fd had an event detected on

Definition at line 147 of file channel_private.h.

Referenced by ast_channel_fdno(), and ast_channel_fdno_set().

◆ fin

unsigned int fin

Frames in counters. The high bit is a debug mask, so the counter is only in the remaining bits

Definition at line 157 of file channel_private.h.

Referenced by ast_channel_fin(), and ast_channel_fin_set().

◆ finalized

unsigned int finalized

Whether or not the channel has been successfully allocated

Definition at line 162 of file channel_private.h.

Referenced by ast_channel_internal_finalize(), and ast_channel_internal_is_finalized().

◆ flags

struct ast_flags flags

◆ fout

unsigned int fout

Frames out counters. The high bit is a debug mask, so the counter is only in the remaining bits

Definition at line 159 of file channel_private.h.

Referenced by ast_channel_fout(), and ast_channel_fout_set().

◆ framehooks

struct ast_framehook_list* framehooks

Definition at line 68 of file channel_private.h.

Referenced by ast_channel_framehooks(), and ast_channel_framehooks_set().

◆ generator

struct ast_generator* generator

Current active data generator

Definition at line 53 of file channel_private.h.

Referenced by ast_channel_generator(), and ast_channel_generator_set().

◆ generatordata

void* generatordata

Current generator data if there is any

Definition at line 52 of file channel_private.h.

Referenced by ast_activate_generator(), ast_channel_generatordata(), and ast_channel_generatordata_set().

◆ hangup_handlers

struct ast_hangup_handler_list hangup_handlers

Hangup handlers on the channel.

Definition at line 135 of file channel_private.h.

Referenced by ast_channel_hangup_handlers().

◆ hangupcause

int hangupcause

Why is the channel hanged up. See causes.h

Definition at line 161 of file channel_private.h.

Referenced by ast_channel_hangupcause(), and ast_channel_hangupcause_set().

◆ hold_state

int hold_state

Current Hold/Unhold state

Definition at line 172 of file channel_private.h.

Referenced by ast_channel_hold_state(), and ast_channel_hold_state_set().

◆ insmpl

unsigned long insmpl

Track the read/written samples for monitor use

Definition at line 138 of file channel_private.h.

Referenced by ast_channel_insmpl(), and ast_channel_insmpl_set().

◆ is_t38_active

char is_t38_active

non-zero if T.38 is active on this channel.

Definition at line 186 of file channel_private.h.

Referenced by ast_channel_is_t38_active_nolock(), and ast_channel_set_is_t38_active_nolock().

◆ jb

struct ast_jb jb

The jitterbuffer state

Definition at line 133 of file channel_private.h.

Referenced by ast_channel_jb(), ast_channel_jb_set(), and create_jb().

◆ lastcontext

char lastcontext[AST_MAX_CONTEXT]

Dialplan: Previous extension context

Definition at line 182 of file channel_private.h.

Referenced by ast_channel_context_set(), and ast_channel_lastcontext().

◆ lastexten

char lastexten[AST_MAX_EXTENSION]

Dialplan: Previous extension number

Definition at line 183 of file channel_private.h.

Referenced by ast_channel_exten_set(), and ast_channel_lastexten().

◆ linked_in_container

int linked_in_container

Whether this channel is linked in a storage container

Definition at line 198 of file channel_private.h.

Referenced by ast_channel_name_build(), ast_channel_name_build_va(), ast_channel_name_set(), delete_channel(), and insert_channel().

◆ linkedid

struct ast_channel_id linkedid

◆ masq

struct ast_channel* masq

Channel that will masquerade as us

Definition at line 54 of file channel_private.h.

Referenced by ast_channel_masq(), and ast_channel_masq_set().

◆ masqr

struct ast_channel* masqr

Who we are masquerading as

Definition at line 55 of file channel_private.h.

Referenced by ast_channel_masqr(), and ast_channel_masqr_set().

◆ music_state

void* music_state

Music State

Definition at line 51 of file channel_private.h.

Referenced by ast_channel_music_state(), and ast_channel_music_state_set().

◆ named_callgroups

struct ast_namedgroups* named_callgroups

Named call group for call pickups

Definition at line 128 of file channel_private.h.

Referenced by ast_channel_named_callgroups(), and ast_channel_named_callgroups_set().

◆ named_pickupgroups

struct ast_namedgroups* named_pickupgroups

Named pickup group - which call groups can be picked up?

Definition at line 129 of file channel_private.h.

Referenced by ast_channel_named_pickupgroups(), and ast_channel_named_pickupgroups_set().

◆ nativeformats

struct ast_format_cap* nativeformats

Kinds of data this channel can natively handle

Definition at line 165 of file channel_private.h.

Referenced by ast_channel_nativeformats(), and ast_channel_nativeformats_set().

◆ oldwriteformat

struct ast_format* oldwriteformat

Original writer format

Definition at line 150 of file channel_private.h.

Referenced by ast_channel_oldwriteformat(), and ast_channel_set_oldwriteformat().

◆ outsmpl

unsigned long outsmpl

Track the read/written samples for monitor use

Definition at line 139 of file channel_private.h.

Referenced by ast_channel_outsmpl(), and ast_channel_outsmpl_set().

◆ pbx

struct ast_pbx* pbx

PBX private structure for this channel

Definition at line 64 of file channel_private.h.

Referenced by ast_channel_pbx(), and ast_channel_pbx_set().

◆ pickupgroup

ast_group_t pickupgroup

Pickup group - which calls groups can be picked up?

Definition at line 127 of file channel_private.h.

Referenced by ast_channel_pickupgroup(), and ast_channel_pickupgroup_set().

◆ priority

int priority

Dialplan: Current extension priority

Definition at line 154 of file channel_private.h.

Referenced by ast_channel_priority(), ast_channel_priority_set(), and ast_channel_yank().

◆ rawreadformat

struct ast_format* rawreadformat

Raw read format (before translation)

Definition at line 168 of file channel_private.h.

Referenced by ast_channel_rawreadformat(), and ast_channel_set_rawreadformat().

◆ rawwriteformat

struct ast_format* rawwriteformat

Raw write format (after translation)

Definition at line 169 of file channel_private.h.

Referenced by ast_channel_rawwriteformat(), and ast_channel_set_rawwriteformat().

◆ readformat

struct ast_format* readformat

Requested read format (after translation)

Definition at line 166 of file channel_private.h.

Referenced by ast_channel_readformat(), ast_channel_set_readformat(), and ast_channel_yank().

◆ readq

struct ast_readq_list readq

Definition at line 132 of file channel_private.h.

Referenced by ast_channel_readq().

◆ readtrans

struct ast_trans_pvt* readtrans

Read translation path

Definition at line 66 of file channel_private.h.

Referenced by ast_channel_readtrans(), and ast_channel_readtrans_set().

◆ redirecting

struct ast_party_redirecting redirecting

Redirecting/Diversion information.

Definition at line 122 of file channel_private.h.

Referenced by ast_channel_redirecting(), ast_channel_redirecting_set(), channel_do_masquerade(), and my_get_callerid().

◆ rings

int rings

Number of rings so far

Definition at line 153 of file channel_private.h.

Referenced by ast_channel_rings(), and ast_channel_rings_set().

◆ sched

Schedule context

Definition at line 59 of file channel_private.h.

Referenced by ast_channel_sched(), and ast_channel_sched_set().

◆ sending_dtmf_digit

char sending_dtmf_digit

Digit this channel is currently sending out. (zero if not sending)

Definition at line 188 of file channel_private.h.

Referenced by ast_channel_sending_dtmf_digit(), and ast_channel_sending_dtmf_digit_set().

◆ sending_dtmf_tv

struct timeval sending_dtmf_tv

The time this channel started sending the current digit. (Invalid if sending_dtmf_digit is zero.)

Definition at line 189 of file channel_private.h.

Referenced by ast_channel_sending_dtmf_tv_set().

◆ snapshot

struct ast_channel_snapshot* snapshot

◆ snapshot_segment_flags

struct ast_flags snapshot_segment_flags

Flags regarding the segments of the snapshot

Definition at line 197 of file channel_private.h.

Referenced by __ast_channel_internal_alloc_with_initializers(), and ast_channel_snapshot_segment_flags().

◆ softhangup

int softhangup

◆ state

State of line – Don't write directly, use ast_setstate()

Definition at line 152 of file channel_private.h.

Referenced by ast_channel_state(), ast_channel_state_set(), and bridge_channel_internal_push_full().

◆ stream

struct ast_filestream* stream

◆ stream_topology

struct ast_stream_topology* stream_topology

◆ stream_topology_change_source

void* stream_topology_change_source

Source that initiated a stream topology change

Definition at line 194 of file channel_private.h.

Referenced by ast_channel_get_stream_topology_change_source(), and ast_channel_internal_set_stream_topology_change_source().

◆ streamid

int streamid

For streaming playback, the schedule ID

Definition at line 148 of file channel_private.h.

Referenced by ast_channel_streamid(), and ast_channel_streamid_set().

◆ tech

const struct ast_channel_tech* tech

◆ tech_pvt

void* tech_pvt

Private data used by the technology driver

Definition at line 50 of file channel_private.h.

Referenced by ast_channel_tech_pvt(), ast_channel_tech_pvt_set(), and native_bridge_join().

◆ timer

struct ast_timer* timer

timer object that provided timingfd

Definition at line 178 of file channel_private.h.

Referenced by ast_channel_timer(), and ast_channel_timer_set().

◆ timingdata

void* timingdata

Definition at line 63 of file channel_private.h.

Referenced by ast_channel_timingdata(), and ast_channel_timingdata_set().

◆ timingfd

int timingfd

Timing fd

Definition at line 151 of file channel_private.h.

Referenced by ast_channel_timingfd(), and ast_channel_timingfd_set().

◆ timingfunc

ast_timing_func_t timingfunc

Definition at line 62 of file channel_private.h.

Referenced by ast_channel_timingfunc(), and ast_channel_timingfunc_set().

◆ topic

struct stasis_topic* topic

Topic for this channel

Definition at line 190 of file channel_private.h.

Referenced by ast_channel_internal_cleanup(), ast_channel_internal_setup_topics(), and ast_channel_topic().

◆ transfercapability

unsigned short transfercapability

ISDN Transfer Capability - AST_FLAG_DIGITAL is not enough

Definition at line 174 of file channel_private.h.

Referenced by ast_channel_transfercapability(), and ast_channel_transfercapability_set().

◆ unbridged

char unbridged

non-zero if the bridge core needs to re-evaluate the current bridging technology which is in use by this channel's bridge.

Definition at line 184 of file channel_private.h.

Referenced by ast_channel_set_unbridged_nolock(), and ast_channel_unbridged_nolock().

◆ uniqueid

struct ast_channel_id uniqueid

◆ varshead

A linked list for channel variables. See Asterisk Dialplan Variables

Definition at line 125 of file channel_private.h.

Referenced by ast_channel_varshead(), ast_channel_varshead_set(), and shared_write().

◆ visible_indication

int visible_indication

Indication currently playing on the channel

Definition at line 171 of file channel_private.h.

Referenced by ast_channel_visible_indication(), and ast_channel_visible_indication_set().

◆ vstream

struct ast_filestream* vstream

Video Stream itself.

Definition at line 61 of file channel_private.h.

Referenced by ast_channel_vstream(), and ast_channel_vstream_set().

◆ vstreamid

int vstreamid

For streaming video playback, the schedule ID

Definition at line 149 of file channel_private.h.

Referenced by ast_channel_vstreamid(), and ast_channel_vstreamid_set().

◆ whentohangup

struct timeval whentohangup

Non-zero, set to actual time when channel is to be hung up

Definition at line 92 of file channel_private.h.

Referenced by ast_channel_whentohangup(), and ast_channel_whentohangup_set().

◆ writeformat

struct ast_format* writeformat

Requested write format (before translation)

Definition at line 167 of file channel_private.h.

Referenced by ast_channel_set_writeformat(), ast_channel_writeformat(), and ast_channel_yank().

◆ writetrans

struct ast_trans_pvt* writetrans

Write translation path

Definition at line 65 of file channel_private.h.

Referenced by ast_channel_writetrans(), and ast_channel_writetrans_set().

◆ x

char x

◆ zone

struct ast_tone_zone* zone

Tone zone as set in indications.conf or in the CHANNEL dialplan function

Definition at line 70 of file channel_private.h.

Referenced by ast_channel_zone(), and ast_channel_zone_set().


The documentation for this struct was generated from the following files: