Newer
Older
* Asterisk -- An open source telephony toolkit.
* Copyright (C) 2012, Digium, Inc.
* Mark Spencer <markster@digium.com>
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*! \file
*
* \brief 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
/*** MODULEINFO
<support_level>core</support_level>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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"
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*!
* \brief 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.
*/
struct ast_channel {
const struct ast_channel_tech *tech; /*!< Technology (point to channel driver) */
void *tech_pvt; /*!< Private data used by the technology driver */
void *music_state; /*!< Music State*/
void *generatordata; /*!< Current generator data if there is any */
struct ast_generator *generator; /*!< Current active data generator */
struct ast_channel * bridged_channel; /*!< Who are we bridged to, if we're bridged.
* Who is proxying for us, if we are proxied (i.e. chan_agent).
* Do not access directly, use ast_bridged_channel(chan) */
struct ast_channel *masq; /*!< Channel that will masquerade as us */
struct ast_channel *masqr; /*!< Who we are masquerading as */
const char *blockproc; /*!< Procedure causing blocking */
const char *appl; /*!< Current application */
const char *data; /*!< Data passed to current application */
struct ast_sched_context *sched; /*!< Schedule context */
struct ast_filestream *stream; /*!< Stream itself. */
struct ast_filestream *vstream; /*!< Video Stream itself. */
ast_timing_func_t timingfunc;
void *timingdata;
struct ast_pbx *pbx; /*!< PBX private structure for this channel */
struct ast_trans_pvt *writetrans; /*!< Write translation path */
struct ast_trans_pvt *readtrans; /*!< Read translation path */
struct ast_audiohook_list *audiohooks;
struct ast_framehook_list *framehooks;
struct ast_cdr *cdr; /*!< Call Detail Record */
struct ast_tone_zone *zone; /*!< Tone zone as set in indications.conf or
* in the CHANNEL dialplan function */
struct ast_channel_monitor *monitor; /*!< Channel monitoring */
Jonathan Rose
committed
struct ast_callid *callid; /*!< Bound call identifier pointer */
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#ifdef HAVE_EPOLL
struct ast_epoll_data *epfd_data[AST_MAX_FDS];
#endif
AST_DECLARE_STRING_FIELDS(
AST_STRING_FIELD(name); /*!< ASCII unique channel name */
AST_STRING_FIELD(language); /*!< Language requested for voice prompts */
AST_STRING_FIELD(musicclass); /*!< Default music class */
AST_STRING_FIELD(accountcode); /*!< Account code for billing */
AST_STRING_FIELD(peeraccount); /*!< Peer account code for billing */
AST_STRING_FIELD(userfield); /*!< Userfield for CEL billing */
AST_STRING_FIELD(call_forward); /*!< Where to forward to if asked to dial on this interface */
AST_STRING_FIELD(uniqueid); /*!< Unique Channel Identifier */
AST_STRING_FIELD(linkedid); /*!< Linked Channel Identifier -- gets propagated by linkage */
AST_STRING_FIELD(parkinglot); /*! Default parking lot, if empty, default parking lot */
AST_STRING_FIELD(hangupsource); /*! Who is responsible for hanging up this channel */
AST_STRING_FIELD(dialcontext); /*!< Dial: Extension context that we were called from */
);
struct timeval whentohangup; /*!< Non-zero, set to actual time when channel is to be hung up */
pthread_t blocker; /*!< If anyone is blocking, this is them */
/*!
* \brief Dialed/Called information.
* \note Set on incoming channels to indicate the originally dialed party.
* \note Dialed Number Identifier (DNID)
*/
struct ast_party_dialed dialed;
/*!
* \brief Channel Caller ID information.
* \note The caller id information is the caller id of this
* channel when it is used to initiate a call.
*/
struct ast_party_caller caller;
/*!
* \brief Channel Connected Line ID information.
* \note The connected line information identifies the channel
* connected/bridged to this channel.
*/
struct ast_party_connected_line connected;
/*! \brief Redirecting/Diversion information */
struct ast_party_redirecting redirecting;
struct ast_frame dtmff; /*!< DTMF frame */
struct varshead varshead; /*!< A linked list for channel variables. See \ref AstChanVar */
ast_group_t callgroup; /*!< Call group for call pickups */
ast_group_t pickupgroup; /*!< Pickup group - which calls groups can be picked up? */
struct ast_readq_list readq;
struct ast_jb jb; /*!< The jitterbuffer state */
struct timeval dtmf_tv; /*!< The time that an in process digit began, or the last digit ended */
Richard Mudgett
committed
struct ast_hangup_handler_list hangup_handlers;/*!< Hangup handlers on the channel. */
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
struct ast_datastore_list datastores; /*!< Data stores on the channel */
struct ast_autochan_list autochans; /*!< Autochans on the channel */
unsigned long insmpl; /*!< Track the read/written samples for monitor use */
unsigned long outsmpl; /*!< Track the read/written samples for monitor use */
int fds[AST_MAX_FDS]; /*!< File descriptors for channel -- Drivers will poll on
* these file descriptors, so at least one must be non -1.
* See \arg \ref AstFileDesc */
int softhangup; /*!< Whether or not we have been hung up... Do not set this value
* directly, use ast_softhangup() */
int fdno; /*!< Which fd had an event detected on */
int streamid; /*!< For streaming playback, the schedule ID */
int vstreamid; /*!< For streaming video playback, the schedule ID */
struct ast_format oldwriteformat; /*!< Original writer format */
int timingfd; /*!< Timing fd */
enum ast_channel_state state; /*!< State of line -- Don't write directly, use ast_setstate() */
int rings; /*!< Number of rings so far */
int priority; /*!< Dialplan: Current extension priority */
int macropriority; /*!< Macro: Current non-macro priority. See app_macro.c */
int amaflags; /*!< Set BEFORE PBX is started to determine AMA flags */
enum ast_channel_adsicpe adsicpe; /*!< Whether or not ADSI is detected on CPE */
unsigned int fin; /*!< Frames in counters. The high bit is a debug mask, so
* the counter is only in the remaining bits */
unsigned int fout; /*!< Frames out counters. The high bit is a debug mask, so
* the counter is only in the remaining bits */
int hangupcause; /*!< Why is the channel hanged up. See causes.h */
unsigned int finalized:1; /*!< Whether or not the channel has been successfully allocated */
struct ast_flags flags; /*!< channel flags of AST_FLAG_ type */
int alertpipe[2];
struct ast_format_cap *nativeformats; /*!< Kinds of data this channel can natively handle */
struct ast_format readformat; /*!< Requested read format (after translation) */
struct ast_format writeformat; /*!< Requested write format (after translation) */
struct ast_format rawreadformat; /*!< Raw read format (before translation) */
struct ast_format rawwriteformat; /*!< Raw write format (before translation) */
unsigned int emulate_dtmf_duration; /*!< Number of ms left to emulate DTMF for */
#ifdef HAVE_EPOLL
int epfd;
#endif
int visible_indication; /*!< Indication currently playing on the channel */
unsigned short transfercapability; /*!< ISDN Transfer Capability - AST_FLAG_DIGITAL is not enough */
struct ast_bridge *bridge; /*!< Bridge this channel is participating in */
struct ast_timer *timer; /*!< timer object that provided timingfd */
char context[AST_MAX_CONTEXT]; /*!< Dialplan: Current extension context */
char exten[AST_MAX_EXTENSION]; /*!< Dialplan: Current extension number */
char macrocontext[AST_MAX_CONTEXT]; /*!< Macro: Current non-macro context. See app_macro.c */
char macroexten[AST_MAX_EXTENSION]; /*!< Macro: Current non-macro extension. See app_macro.c */
char dtmf_digit_to_emulate; /*!< Digit being emulated */
};
/* AST_DATA definitions, which will probably have to be re-thought since the channel will be opaque */
#if 0 /* XXX AstData: ast_callerid no longer exists. (Equivalent code not readily apparent.) */
#define DATA_EXPORT_CALLERID(MEMBER) \
MEMBER(ast_callerid, cid_dnid, AST_DATA_STRING) \
MEMBER(ast_callerid, cid_num, AST_DATA_STRING) \
MEMBER(ast_callerid, cid_name, AST_DATA_STRING) \
MEMBER(ast_callerid, cid_ani, AST_DATA_STRING) \
MEMBER(ast_callerid, cid_pres, AST_DATA_INTEGER) \
MEMBER(ast_callerid, cid_ani2, AST_DATA_INTEGER) \
MEMBER(ast_callerid, cid_tag, AST_DATA_STRING)
AST_DATA_STRUCTURE(ast_callerid, DATA_EXPORT_CALLERID);
#endif
#define DATA_EXPORT_CHANNEL(MEMBER) \
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
MEMBER(ast_channel, blockproc, AST_DATA_STRING) \
MEMBER(ast_channel, appl, AST_DATA_STRING) \
MEMBER(ast_channel, data, AST_DATA_STRING) \
MEMBER(ast_channel, name, AST_DATA_STRING) \
MEMBER(ast_channel, language, AST_DATA_STRING) \
MEMBER(ast_channel, musicclass, AST_DATA_STRING) \
MEMBER(ast_channel, accountcode, AST_DATA_STRING) \
MEMBER(ast_channel, peeraccount, AST_DATA_STRING) \
MEMBER(ast_channel, userfield, AST_DATA_STRING) \
MEMBER(ast_channel, call_forward, AST_DATA_STRING) \
MEMBER(ast_channel, uniqueid, AST_DATA_STRING) \
MEMBER(ast_channel, linkedid, AST_DATA_STRING) \
MEMBER(ast_channel, parkinglot, AST_DATA_STRING) \
MEMBER(ast_channel, hangupsource, AST_DATA_STRING) \
MEMBER(ast_channel, dialcontext, AST_DATA_STRING) \
MEMBER(ast_channel, rings, AST_DATA_INTEGER) \
MEMBER(ast_channel, priority, AST_DATA_INTEGER) \
MEMBER(ast_channel, macropriority, AST_DATA_INTEGER) \
MEMBER(ast_channel, adsicpe, AST_DATA_INTEGER) \
MEMBER(ast_channel, fin, AST_DATA_UNSIGNED_INTEGER) \
MEMBER(ast_channel, fout, AST_DATA_UNSIGNED_INTEGER) \
MEMBER(ast_channel, emulate_dtmf_duration, AST_DATA_UNSIGNED_INTEGER) \
MEMBER(ast_channel, visible_indication, AST_DATA_INTEGER) \
MEMBER(ast_channel, context, AST_DATA_STRING) \
MEMBER(ast_channel, exten, AST_DATA_STRING) \
MEMBER(ast_channel, macrocontext, AST_DATA_STRING) \
MEMBER(ast_channel, macroexten, AST_DATA_STRING)
AST_DATA_STRUCTURE(ast_channel, DATA_EXPORT_CHANNEL);
static void channel_data_add_flags(struct ast_data *tree,
struct ast_channel *chan)
{
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));
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
}
int ast_channel_data_add_structure(struct ast_data *tree,
struct ast_channel *chan, int add_bridged)
{
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)
{
return ast_data_search_cmp_structure(tree, ast_channel, chan, structure_name);
}
/* ACCESSORS */
#define DEFINE_STRINGFIELD_SETTERS_FOR(field) \
void ast_channel_##field##_set(struct ast_channel *chan, const char *value) \
{ \
ast_string_field_set(chan, field, value); \
} \
\
void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) \
{ \
ast_string_field_build_va(chan, field, fmt, ap); \
} \
void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) \
{ \
va_list ap; \
va_start(ap, fmt); \
ast_channel_##field##_build_va(chan, fmt, ap); \
va_end(ap); \
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);
#define DEFINE_STRINGFIELD_GETTER_FOR(field) const char *ast_channel_##field(const struct ast_channel *chan) \
{ \
return chan->field; \
}
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);
void ast_channel_linkedid_set(struct ast_channel *chan, const char *value)
{
ast_assert(!ast_strlen_zero(value));
ast_string_field_set(chan, linkedid, value);
}
const char *ast_channel_appl(const struct ast_channel *chan)
{
}
void ast_channel_appl_set(struct ast_channel *chan, const char *value)
{
}
const char *ast_channel_blockproc(const struct ast_channel *chan)
{
}
void ast_channel_blockproc_set(struct ast_channel *chan, const char *value)
{
}
const char *ast_channel_data(const struct ast_channel *chan)
{
}
void ast_channel_data_set(struct ast_channel *chan, const char *value)
{
}
const char *ast_channel_context(const struct ast_channel *chan)
{
}
void ast_channel_context_set(struct ast_channel *chan, const char *value)
{
ast_copy_string(chan->context, value, sizeof(chan->context));
}
const char *ast_channel_exten(const struct ast_channel *chan)
{
}
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
{
ast_copy_string(chan->exten, value, sizeof(chan->exten));
}
const char *ast_channel_macrocontext(const struct ast_channel *chan)
{
}
void ast_channel_macrocontext_set(struct ast_channel *chan, const char *value)
{
ast_copy_string(chan->macrocontext, value, sizeof(chan->macrocontext));
}
const char *ast_channel_macroexten(const struct ast_channel *chan)
{
}
void ast_channel_macroexten_set(struct ast_channel *chan, const char *value)
{
ast_copy_string(chan->macroexten, value, sizeof(chan->macroexten));
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)
}
int ast_channel_amaflags(const struct ast_channel *chan)
{
}
void ast_channel_amaflags_set(struct ast_channel *chan, int value)
{
}
#ifdef HAVE_EPOLL
int ast_channel_epfd(const struct ast_channel *chan)
{
}
void ast_channel_epfd_set(struct ast_channel *chan, int value)
{
}
#endif
int ast_channel_fdno(const struct ast_channel *chan)
{
}
void ast_channel_fdno_set(struct ast_channel *chan, int value)
{
}
int ast_channel_hangupcause(const struct ast_channel *chan)
{
}
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
{
}
int ast_channel_macropriority(const struct ast_channel *chan)
{
}
void ast_channel_macropriority_set(struct ast_channel *chan, int value)
{
}
int ast_channel_priority(const struct ast_channel *chan)
{
}
void ast_channel_priority_set(struct ast_channel *chan, int value)
{
}
int ast_channel_rings(const struct ast_channel *chan)
{
}
void ast_channel_rings_set(struct ast_channel *chan, int value)
{
}
int ast_channel_streamid(const struct ast_channel *chan)
{
}
void ast_channel_streamid_set(struct ast_channel *chan, int value)
{
}
int ast_channel_timingfd(const struct ast_channel *chan)
{
}
void ast_channel_timingfd_set(struct ast_channel *chan, int value)
{
}
int ast_channel_visible_indication(const struct ast_channel *chan)
{
}
void ast_channel_visible_indication_set(struct ast_channel *chan, int value)
{
}
int ast_channel_vstreamid(const struct ast_channel *chan)
{
}
void ast_channel_vstreamid_set(struct ast_channel *chan, int value)
{
}
unsigned short ast_channel_transfercapability(const struct ast_channel *chan)
{
}
void ast_channel_transfercapability_set(struct ast_channel *chan, unsigned short 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)
{
}
unsigned int ast_channel_fin(const struct ast_channel *chan)
{
}
void ast_channel_fin_set(struct ast_channel *chan, unsigned int value)
{
}
unsigned int ast_channel_fout(const struct ast_channel *chan)
{
}
void ast_channel_fout_set(struct ast_channel *chan, unsigned int value)
{
}
unsigned long ast_channel_insmpl(const struct ast_channel *chan)
{
}
void ast_channel_insmpl_set(struct ast_channel *chan, unsigned long value)
{
}
unsigned long ast_channel_outsmpl(const struct ast_channel *chan)
{
}
void ast_channel_outsmpl_set(struct ast_channel *chan, unsigned long value)
{
}
void *ast_channel_generatordata(const struct ast_channel *chan)
{
}
void ast_channel_generatordata_set(struct ast_channel *chan, void *value)
{
}
void *ast_channel_music_state(const struct ast_channel *chan)
{
}
void ast_channel_music_state_set(struct ast_channel *chan, void *value)
{
}
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_timingdata(const struct ast_channel *chan)
{
}
void ast_channel_timingdata_set(struct ast_channel *chan, void *value)
{
}
struct ast_audiohook_list *ast_channel_audiohooks(const struct ast_channel *chan)
{
}
void ast_channel_audiohooks_set(struct ast_channel *chan, struct ast_audiohook_list *value)
{
}
struct ast_cdr *ast_channel_cdr(const struct ast_channel *chan)
{
}
void ast_channel_cdr_set(struct ast_channel *chan, struct ast_cdr *value)
{
}
struct ast_channel *ast_channel_masq(const struct ast_channel *chan)
{
}
void ast_channel_masq_set(struct ast_channel *chan, struct ast_channel *value)
{
}
struct ast_channel *ast_channel_masqr(const struct ast_channel *chan)
{
}
void ast_channel_masqr_set(struct ast_channel *chan, struct ast_channel *value)
{
}
struct ast_channel_monitor *ast_channel_monitor(const struct ast_channel *chan)
{
}
void ast_channel_monitor_set(struct ast_channel *chan, struct ast_channel_monitor *value)
{
}
struct ast_filestream *ast_channel_stream(const struct ast_channel *chan)
{
}
void ast_channel_stream_set(struct ast_channel *chan, struct ast_filestream *value)
{
}
struct ast_filestream *ast_channel_vstream(const struct ast_channel *chan)
{
}
void ast_channel_vstream_set(struct ast_channel *chan, struct ast_filestream *value)
{
}
struct ast_format_cap *ast_channel_nativeformats(const struct ast_channel *chan)
{
}
void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
{
}
struct ast_framehook_list *ast_channel_framehooks(const struct ast_channel *chan)
{
}
void ast_channel_framehooks_set(struct ast_channel *chan, struct ast_framehook_list *value)
{
}
struct ast_generator *ast_channel_generator(const struct ast_channel *chan)
{
}
void ast_channel_generator_set(struct ast_channel *chan, struct ast_generator *value)
{
}
struct ast_pbx *ast_channel_pbx(const struct ast_channel *chan)
{
}
void ast_channel_pbx_set(struct ast_channel *chan, struct ast_pbx *value)
{
}
struct ast_sched_context *ast_channel_sched(const struct ast_channel *chan)
{
}
void ast_channel_sched_set(struct ast_channel *chan, struct ast_sched_context *value)
{
}
struct ast_timer *ast_channel_timer(const struct ast_channel *chan)
{
}
void ast_channel_timer_set(struct ast_channel *chan, struct ast_timer *value)
{
}
struct ast_tone_zone *ast_channel_zone(const struct ast_channel *chan)
{
}
void ast_channel_zone_set(struct ast_channel *chan, struct ast_tone_zone *value)
{
}
struct ast_trans_pvt *ast_channel_readtrans(const struct ast_channel *chan)
{
}
void ast_channel_readtrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
{
}
struct ast_trans_pvt *ast_channel_writetrans(const struct ast_channel *chan)
{
}
void ast_channel_writetrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
{
}
const struct ast_channel_tech *ast_channel_tech(const struct ast_channel *chan)
{
}
void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
{
}
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)
{
}
enum ast_channel_state ast_channel_state(const struct ast_channel *chan)
{
Jonathan Rose
committed
struct ast_callid *ast_channel_callid(const struct ast_channel *chan)
{
if (chan->callid) {
ast_callid_ref(chan->callid);
return chan->callid;
}
return NULL;
}
void ast_channel_callid_set(struct ast_channel *chan, struct ast_callid *callid)
{
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);
Jonathan Rose
committed
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);
Jonathan Rose
committed
/* unbind if already set */
ast_callid_unref(chan->callid);
}
Jonathan Rose
committed
chan->callid = ast_callid_ref(callid);
ast_test_suite_event_notify("CallIDChange",
"State: CallIDChange\r\n"
"Channel: %s\r\n"
"CallID: %s\r\n"
Jonathan Rose
committed
"PriorCallID: %s",
ast_channel_name(chan),
call_identifier_to,
call_identifier_from);
Jonathan Rose
committed
}
void ast_channel_state_set(struct ast_channel *chan, enum ast_channel_state value)
{
struct ast_format *ast_channel_oldwriteformat(struct ast_channel *chan)
{
}
struct ast_format *ast_channel_rawreadformat(struct ast_channel *chan)
{
}
struct ast_format *ast_channel_rawwriteformat(struct ast_channel *chan)
{
}
struct ast_format *ast_channel_readformat(struct ast_channel *chan)
{
}
struct ast_format *ast_channel_writeformat(struct ast_channel *chan)
{
Richard Mudgett
committed
struct ast_hangup_handler_list *ast_channel_hangup_handlers(struct ast_channel *chan)
{
return &chan->hangup_handlers;
}
struct ast_datastore_list *ast_channel_datastores(struct ast_channel *chan)
{
}
struct ast_autochan_list *ast_channel_autochans(struct ast_channel *chan)
{
}
struct ast_readq_list *ast_channel_readq(struct ast_channel *chan)
{
}
struct ast_frame *ast_channel_dtmff(struct ast_channel *chan)
{
}
struct ast_jb *ast_channel_jb(struct ast_channel *chan)
{
}
struct ast_party_caller *ast_channel_caller(struct ast_channel *chan)
{
}
struct ast_party_connected_line *ast_channel_connected(struct ast_channel *chan)
{
}
struct ast_party_dialed *ast_channel_dialed(struct ast_channel *chan)
{
}
struct ast_party_redirecting *ast_channel_redirecting(struct ast_channel *chan)
{
}
struct timeval *ast_channel_dtmf_tv(struct ast_channel *chan)
{
}
struct timeval *ast_channel_whentohangup(struct ast_channel *chan)
{
}
struct varshead *ast_channel_varshead(struct ast_channel *chan)
{
void ast_channel_dtmff_set(struct ast_channel *chan, struct ast_frame *value)
{
}
void ast_channel_jb_set(struct ast_channel *chan, struct ast_jb *value)
{
void ast_channel_caller_set(struct ast_channel *chan, struct ast_party_caller *value)
{
}
void ast_channel_connected_set(struct ast_channel *chan, struct ast_party_connected_line *value)
{
}
void ast_channel_dialed_set(struct ast_channel *chan, struct ast_party_dialed *value)
{
}
void ast_channel_redirecting_set(struct ast_channel *chan, struct ast_party_redirecting *value)
{
}
void ast_channel_dtmf_tv_set(struct ast_channel *chan, struct timeval *value)
{
}
void ast_channel_whentohangup_set(struct ast_channel *chan, struct timeval *value)
{
}
void ast_channel_varshead_set(struct ast_channel *chan, struct varshead *value)
{
}
/* Evil softhangup accessors */
int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
}
void ast_channel_softhangup_internal_flag_set(struct ast_channel *chan, int value)
{
}
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)
{