Asterisk - The Open Source Telephony Project GIT-master-7805f28
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
channel_private.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2024, Sangoma Technologies Corporation
5 *
6 * George Joseph <gjoseph@sangoma.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19#ifndef CHANNEL_PRIVATE_H_
20#define CHANNEL_PRIVATE_H_
21
22#if defined(__cplusplus) || defined(c_plusplus)
23extern "C" {
24#endif
25
26/*!
27 * \brief Channel UniqueId structure
28 * \note channel creation time used for determining LinkedId Propagation
29 */
31 time_t creation_time; /*!< Creation time */
32 int creation_unique; /*!< sub-second unique value */
33 char unique_id[AST_MAX_UNIQUEID]; /*!< Unique Identifier */
34 char tenant_id[AST_MAX_TENANT_ID]; /*!< Multi-tenant identifier */
35};
36
37/*!
38 * \brief Main Channel structure associated with a channel.
39 *
40 * \note When adding fields to this structure, it is important to add the field
41 * 'in position' with like-aligned fields, so as to keep the compiler from
42 * having to add padding to align fields. The structure's fields are sorted
43 * in this order: pointers, structures, long, int/enum, short, char. This
44 * is especially important on 64-bit architectures, where mixing 4-byte
45 * and 8-byte fields causes 4 bytes of padding to be added before many
46 * 8-byte fields.
47 */
49 const struct ast_channel_tech *tech; /*!< Technology (point to channel driver) */
50 void *tech_pvt; /*!< Private data used by the technology driver */
51 void *music_state; /*!< Music State*/
52 void *generatordata; /*!< Current generator data if there is any */
53 struct ast_generator *generator; /*!< Current active data generator */
54 struct ast_channel *masq; /*!< Channel that will masquerade as us */
55 struct ast_channel *masqr; /*!< Who we are masquerading as */
56 const char *blockproc; /*!< Procedure causing blocking */
57 const char *appl; /*!< Current application */
58 const char *data; /*!< Data passed to current application */
59 struct ast_sched_context *sched; /*!< Schedule context */
60 struct ast_filestream *stream; /*!< Stream itself. */
61 struct ast_filestream *vstream; /*!< Video Stream itself. */
64 struct ast_pbx *pbx; /*!< PBX private structure for this channel */
65 struct ast_trans_pvt *writetrans; /*!< Write translation path */
66 struct ast_trans_pvt *readtrans; /*!< Read translation path */
69 struct ast_cdr *cdr; /*!< Call Detail Record */
70 struct ast_tone_zone *zone; /*!< Tone zone as set in indications.conf or
71 * in the CHANNEL dialplan function */
72 ast_callid callid; /*!< Bound call identifier pointer */
73 struct ao2_container *dialed_causes; /*!< Contains tech-specific and Asterisk cause data from dialed channels */
74
76 AST_STRING_FIELD(name); /*!< ASCII unique channel name */
77 AST_STRING_FIELD(language); /*!< Language requested for voice prompts */
78 AST_STRING_FIELD(musicclass); /*!< Default music class */
79 AST_STRING_FIELD(latest_musicclass); /*!< Latest active music class */
80 AST_STRING_FIELD(accountcode); /*!< Account code for billing */
81 AST_STRING_FIELD(peeraccount); /*!< Peer account code for billing */
82 AST_STRING_FIELD(userfield); /*!< Userfield for CEL billing */
83 AST_STRING_FIELD(call_forward); /*!< Where to forward to if asked to dial on this interface */
84 AST_STRING_FIELD(parkinglot); /*! Default parking lot, if empty, default parking lot */
85 AST_STRING_FIELD(hangupsource); /*! Who is responsible for hanging up this channel */
86 AST_STRING_FIELD(dialcontext); /*!< Dial: Extension context that we were called from */
87 );
88
89 struct ast_channel_id uniqueid; /*!< Unique Channel Identifier - can be specified on creation */
90 struct ast_channel_id linkedid; /*!< Linked Channel Identifier - oldest propagated when bridged */
91
92 struct timeval whentohangup; /*!< Non-zero, set to actual time when channel is to be hung up */
93 pthread_t blocker; /*!< If anyone is blocking, this is them */
94
95 /*!
96 * \brief Dialed/Called information.
97 * \note Set on incoming channels to indicate the originally dialed party.
98 * \note Dialed Number Identifier (DNID)
99 */
101
102 /*!
103 * \brief Channel Caller ID information.
104 * \note The caller id information is the caller id of this
105 * channel when it is used to initiate a call.
106 */
108
109 /*!
110 * \brief Channel Connected Line ID information.
111 * \note The connected line information identifies the channel
112 * connected/bridged to this channel.
113 */
115
116 /*!
117 * \brief Channel Connected Line ID information that was last indicated.
118 */
120
121 /*! \brief Redirecting/Diversion information */
123
124 struct ast_frame dtmff; /*!< DTMF frame */
125 struct varshead varshead; /*!< A linked list for channel variables. See \ref AstChanVar */
126 ast_group_t callgroup; /*!< Call group for call pickups */
127 ast_group_t pickupgroup; /*!< Pickup group - which calls groups can be picked up? */
128 struct ast_namedgroups *named_callgroups; /*!< Named call group for call pickups */
129 struct ast_namedgroups *named_pickupgroups; /*!< Named pickup group - which call groups can be picked up? */
130 struct timeval creationtime; /*!< The time of channel creation */
131 struct timeval answertime; /*!< The time the channel was answered */
133 struct ast_jb jb; /*!< The jitterbuffer state */
134 struct timeval dtmf_tv; /*!< The time that an in process digit began, or the last digit ended */
135 struct ast_hangup_handler_list hangup_handlers;/*!< Hangup handlers on the channel. */
136 struct ast_datastore_list datastores; /*!< Data stores on the channel */
137 struct ast_autochan_list autochans; /*!< Autochans on the channel */
138 unsigned long insmpl; /*!< Track the read/written samples for monitor use */
139 unsigned long outsmpl; /*!< Track the read/written samples for monitor use */
140
141 int blocker_tid; /*!< If anyone is blocking, this is their thread id */
142 AST_VECTOR(, int) fds; /*!< File descriptors for channel -- Drivers will poll on
143 * these file descriptors, so at least one must be non -1.
144 * See \arg \ref AstFileDesc */
145 int softhangup; /*!< Whether or not we have been hung up... Do not set this value
146 * directly, use ast_softhangup() */
147 int fdno; /*!< Which fd had an event detected on */
148 int streamid; /*!< For streaming playback, the schedule ID */
149 int vstreamid; /*!< For streaming video playback, the schedule ID */
150 struct ast_format *oldwriteformat; /*!< Original writer format */
151 int timingfd; /*!< Timing fd */
152 enum ast_channel_state state; /*!< State of line -- Don't write directly, use ast_setstate() */
153 int rings; /*!< Number of rings so far */
154 int priority; /*!< Dialplan: Current extension priority */
155 int amaflags; /*!< Set BEFORE PBX is started to determine AMA flags */
156 enum ast_channel_adsicpe adsicpe; /*!< Whether or not ADSI is detected on CPE */
157 unsigned int fin; /*!< Frames in counters. The high bit is a debug mask, so
158 * the counter is only in the remaining bits */
159 unsigned int fout; /*!< Frames out counters. The high bit is a debug mask, so
160 * the counter is only in the remaining bits */
161 int hangupcause; /*!< Why is the channel hanged up. See causes.h */
162 unsigned int finalized:1; /*!< Whether or not the channel has been successfully allocated */
163 struct ast_flags flags; /*!< channel flags of AST_FLAG_ type */
164 int alertpipe[2];
165 struct ast_format_cap *nativeformats; /*!< Kinds of data this channel can natively handle */
166 struct ast_format *readformat; /*!< Requested read format (after translation) */
167 struct ast_format *writeformat; /*!< Requested write format (before translation) */
168 struct ast_format *rawreadformat; /*!< Raw read format (before translation) */
169 struct ast_format *rawwriteformat; /*!< Raw write format (after translation) */
170 unsigned int emulate_dtmf_duration; /*!< Number of ms left to emulate DTMF for */
171 int visible_indication; /*!< Indication currently playing on the channel */
172 int hold_state; /*!< Current Hold/Unhold state */
173
174 unsigned short transfercapability; /*!< ISDN Transfer Capability - AST_FLAG_DIGITAL is not enough */
175
176 struct ast_bridge *bridge; /*!< Bridge this channel is participating in */
177 struct ast_bridge_channel *bridge_channel;/*!< The bridge_channel this channel is linked with. */
178 struct ast_timer *timer; /*!< timer object that provided timingfd */
179
180 char context[AST_MAX_CONTEXT]; /*!< Dialplan: Current extension context */
181 char exten[AST_MAX_EXTENSION]; /*!< Dialplan: Current extension number */
182 char lastcontext[AST_MAX_CONTEXT]; /*!< Dialplan: Previous extension context */
183 char lastexten[AST_MAX_EXTENSION]; /*!< Dialplan: Previous extension number */
184 char unbridged; /*!< non-zero if the bridge core needs to re-evaluate the current
185 bridging technology which is in use by this channel's bridge. */
186 char is_t38_active; /*!< non-zero if T.38 is active on this channel. */
187 char dtmf_digit_to_emulate; /*!< Digit being emulated */
188 char sending_dtmf_digit; /*!< Digit this channel is currently sending out. (zero if not sending) */
189 struct timeval sending_dtmf_tv; /*!< The time this channel started sending the current digit. (Invalid if sending_dtmf_digit is zero.) */
190 struct stasis_topic *topic; /*!< Topic for this channel */
191 struct stasis_forward *channel_forward; /*!< Subscription for event forwarding to all channel topic */
192 struct stasis_forward *endpoint_forward; /*!< Subscription for event forwarding to endpoint's topic */
193 struct ast_stream_topology *stream_topology; /*!< Stream topology */
194 void *stream_topology_change_source; /*!< Source that initiated a stream topology change */
195 struct ast_stream *default_streams[AST_MEDIA_TYPE_END]; /*!< Default streams indexed by media type */
196 struct ast_channel_snapshot *snapshot; /*!< The current up to date snapshot of the channel */
197 struct ast_flags snapshot_segment_flags; /*!< Flags regarding the segments of the snapshot */
198 int linked_in_container; /*!< Whether this channel is linked in a storage container */
199};
200
201#if defined(__cplusplus) || defined(c_plusplus)
202}
203#endif
204
205#endif /* CHANNEL_PRIVATE_H_ */
static char dialcontext[AST_MAX_CONTEXT]
static char language[MAX_LANGUAGE]
Definition: chan_iax2.c:348
static char accountcode[AST_MAX_ACCOUNT_CODE]
Definition: chan_iax2.c:497
int(* ast_timing_func_t)(const void *data)
Definition: channel.h:919
unsigned long long ast_group_t
Definition: channel.h:215
ast_channel_adsicpe
Definition: channel.h:888
#define AST_MAX_TENANT_ID
Definition: channel.h:149
#define AST_MAX_UNIQUEID
Definition: channel.h:170
#define AST_MAX_CONTEXT
Definition: channel.h:135
#define AST_MAX_EXTENSION
Definition: channel.h:134
ast_channel_state
ast_channel states
Definition: channelstate.h:35
@ AST_MEDIA_TYPE_END
Definition: codec.h:36
static const char name[]
Definition: format_mp3.c:68
unsigned int ast_callid
#define AST_STRING_FIELD(name)
Declare a string field.
Definition: stringfields.h:303
Generic container type.
Structure that contains information regarding a channel in a bridge.
Structure that contains information about a bridge.
Definition: bridge.h:353
Responsible for call detail data.
Definition: cdr.h:279
Channel UniqueId structure.
char unique_id[AST_MAX_UNIQUEID]
char tenant_id[AST_MAX_TENANT_ID]
Structure representing a snapshot of channel state.
Structure to describe a channel "technology", ie a channel driver See for examples:
Definition: channel.h:648
Main Channel structure associated with a channel.
struct ast_filestream * stream
struct ast_cdr * cdr
struct ast_stream * default_streams[AST_MEDIA_TYPE_END]
pthread_t blocker
struct ast_channel_id uniqueid
struct stasis_topic * topic
const char * appl
struct ast_bridge_channel * bridge_channel
struct ast_framehook_list * framehooks
char lastexten[AST_MAX_EXTENSION]
struct timeval creationtime
struct ast_frame dtmff
char lastcontext[AST_MAX_CONTEXT]
struct ast_sched_context * sched
struct ast_channel_snapshot * snapshot
struct ast_datastore_list datastores
unsigned long outsmpl
struct ast_tone_zone * zone
struct ao2_container * dialed_causes
ast_timing_func_t timingfunc
enum ast_channel_adsicpe adsicpe
struct ast_format * rawwriteformat
struct ast_generator * generator
struct ast_bridge * bridge
struct timeval sending_dtmf_tv
struct ast_party_connected_line connected
Channel Connected Line ID information.
struct ast_trans_pvt * writetrans
ast_callid callid
struct timeval whentohangup
unsigned short transfercapability
char dtmf_digit_to_emulate
unsigned int emulate_dtmf_duration
void * stream_topology_change_source
struct ast_readq_list readq
struct ast_format * rawreadformat
char exten[AST_MAX_EXTENSION]
struct timeval dtmf_tv
void * music_state
struct ast_party_connected_line connected_indicated
Channel Connected Line ID information that was last indicated.
const char * data
struct ast_namedgroups * named_pickupgroups
struct stasis_forward * endpoint_forward
struct ast_flags snapshot_segment_flags
unsigned long insmpl
struct ast_trans_pvt * readtrans
struct ast_namedgroups * named_callgroups
struct ast_hangup_handler_list hangup_handlers
struct ast_timer * timer
unsigned int fin
const struct ast_channel_tech * tech
struct ast_format * writeformat
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);)
struct ast_channel_id linkedid
enum ast_channel_state state
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
struct ast_channel * masqr
ast_group_t pickupgroup
struct ast_party_dialed dialed
Dialed/Called information.
void * generatordata
char context[AST_MAX_CONTEXT]
struct ast_jb jb
struct ast_filestream * vstream
struct timeval answertime
struct ast_format * readformat
void * timingdata
struct ast_audiohook_list * audiohooks
struct ast_format * oldwriteformat
struct stasis_forward * channel_forward
struct ast_channel * masq
struct ast_format_cap * nativeformats
AST_VECTOR(, int) fds
const char * blockproc
struct ast_pbx * pbx
struct ast_flags flags
ast_group_t callgroup
char sending_dtmf_digit
unsigned int fout
struct ast_autochan_list autochans
struct ast_stream_topology * stream_topology
unsigned int finalized
struct ast_party_caller caller
Channel Caller ID information.
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
Definition: mod_format.h:101
Structure used to handle boolean flags.
Definition: utils.h:199
Format capabilities structure, holds formats + preference order + etc.
Definition: format_cap.c:54
Definition of a media format.
Definition: format.c:43
Data structure associated with a single frame of data.
General jitterbuffer state.
Definition: abstract_jb.h:141
Caller Party information.
Definition: channel.h:420
Connected Line/Party information.
Definition: channel.h:458
Dialed/Called Party information.
Definition: channel.h:380
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
Definition: channel.h:524
Definition: pbx.h:215
A set of tones for a given locale.
Definition: indications.h:74
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
Definition: translate.h:213
Forwarding information.
Definition: stasis.c:1558