2 *Asterisk -- An open source telephony toolkit.
4 *Copyright (C) 2012, Digium, Inc.
6 *Mark Spencer <markster@digium.com>
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.
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.
21 *\brief Channel Accessor API
23 *This file is intended to be the only file that ever accesses the
24 *internals of an ast_channel. All other files should use the
25 *accessor functions defined here.
32 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
34 #include "asterisk/channel.h"
35 #include "asterisk/stringfields.h"
36 #include "asterisk/data.h"
37 #include "asterisk/indications.h"
39 /* AST_DATA definitions, which will probably have to be re-thought since the channel will be opaque */
41 #if 0 /* XXX AstData: ast_callerid no longer exists. (Equivalent code not readily apparent.) */
42 #define DATA_EXPORT_CALLERID(MEMBER) \
43 MEMBER(ast_callerid, cid_dnid, AST_DATA_STRING) \
44 MEMBER(ast_callerid, cid_num, AST_DATA_STRING) \
45 MEMBER(ast_callerid, cid_name, AST_DATA_STRING) \
46 MEMBER(ast_callerid, cid_ani, AST_DATA_STRING) \
47 MEMBER(ast_callerid, cid_pres, AST_DATA_INTEGER) \
48 MEMBER(ast_callerid, cid_ani2, AST_DATA_INTEGER) \
49 MEMBER(ast_callerid, cid_tag, AST_DATA_STRING)
51 AST_DATA_STRUCTURE(ast_callerid, DATA_EXPORT_CALLERID);
54 #define DATA_EXPORT_CHANNEL(MEMBER) \
55 MEMBER(ast_channel, __do_not_use_blockproc, AST_DATA_STRING) \
56 MEMBER(ast_channel, __do_not_use_appl, AST_DATA_STRING) \
57 MEMBER(ast_channel, __do_not_use_data, AST_DATA_STRING) \
58 MEMBER(ast_channel, __do_not_use_name, AST_DATA_STRING) \
59 MEMBER(ast_channel, __do_not_use_language, AST_DATA_STRING) \
60 MEMBER(ast_channel, __do_not_use_musicclass, AST_DATA_STRING) \
61 MEMBER(ast_channel, __do_not_use_accountcode, AST_DATA_STRING) \
62 MEMBER(ast_channel, __do_not_use_peeraccount, AST_DATA_STRING) \
63 MEMBER(ast_channel, __do_not_use_userfield, AST_DATA_STRING) \
64 MEMBER(ast_channel, __do_not_use_call_forward, AST_DATA_STRING) \
65 MEMBER(ast_channel, __do_not_use_uniqueid, AST_DATA_STRING) \
66 MEMBER(ast_channel, __do_not_use_linkedid, AST_DATA_STRING) \
67 MEMBER(ast_channel, __do_not_use_parkinglot, AST_DATA_STRING) \
68 MEMBER(ast_channel, __do_not_use_hangupsource, AST_DATA_STRING) \
69 MEMBER(ast_channel, __do_not_use_dialcontext, AST_DATA_STRING) \
70 MEMBER(ast_channel, __do_not_use_rings, AST_DATA_INTEGER) \
71 MEMBER(ast_channel, __do_not_use_priority, AST_DATA_INTEGER) \
72 MEMBER(ast_channel, __do_not_use_macropriority, AST_DATA_INTEGER) \
73 MEMBER(ast_channel, __do_not_use_adsicpe, AST_DATA_INTEGER) \
74 MEMBER(ast_channel, __do_not_use_fin, AST_DATA_UNSIGNED_INTEGER) \
75 MEMBER(ast_channel, __do_not_use_fout, AST_DATA_UNSIGNED_INTEGER) \
76 MEMBER(ast_channel, __do_not_use_emulate_dtmf_duration, AST_DATA_UNSIGNED_INTEGER) \
77 MEMBER(ast_channel, __do_not_use_visible_indication, AST_DATA_INTEGER) \
78 MEMBER(ast_channel, __do_not_use_context, AST_DATA_STRING) \
79 MEMBER(ast_channel, __do_not_use_exten, AST_DATA_STRING) \
80 MEMBER(ast_channel, __do_not_use_macrocontext, AST_DATA_STRING) \
81 MEMBER(ast_channel, __do_not_use_macroexten, AST_DATA_STRING)
83 AST_DATA_STRUCTURE(ast_channel, DATA_EXPORT_CHANNEL);
85 static void channel_data_add_flags(struct ast_data *tree,
86 struct ast_channel *chan)
88 ast_data_add_bool(tree, "DEFER_DTMF", ast_test_flag(chan, AST_FLAG_DEFER_DTMF));
89 ast_data_add_bool(tree, "WRITE_INT", ast_test_flag(chan, AST_FLAG_WRITE_INT));
90 ast_data_add_bool(tree, "BLOCKING", ast_test_flag(chan, AST_FLAG_BLOCKING));
91 ast_data_add_bool(tree, "ZOMBIE", ast_test_flag(chan, AST_FLAG_ZOMBIE));
92 ast_data_add_bool(tree, "EXCEPTION", ast_test_flag(chan, AST_FLAG_EXCEPTION));
93 ast_data_add_bool(tree, "MOH", ast_test_flag(chan, AST_FLAG_MOH));
94 ast_data_add_bool(tree, "SPYING", ast_test_flag(chan, AST_FLAG_SPYING));
95 ast_data_add_bool(tree, "NBRIDGE", ast_test_flag(chan, AST_FLAG_NBRIDGE));
96 ast_data_add_bool(tree, "IN_AUTOLOOP", ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP));
97 ast_data_add_bool(tree, "OUTGOING", ast_test_flag(chan, AST_FLAG_OUTGOING));
98 ast_data_add_bool(tree, "IN_DTMF", ast_test_flag(chan, AST_FLAG_IN_DTMF));
99 ast_data_add_bool(tree, "EMULATE_DTMF", ast_test_flag(chan, AST_FLAG_EMULATE_DTMF));
100 ast_data_add_bool(tree, "END_DTMF_ONLY", ast_test_flag(chan, AST_FLAG_END_DTMF_ONLY));
101 ast_data_add_bool(tree, "ANSWERED_ELSEWHERE", ast_test_flag(chan, AST_FLAG_ANSWERED_ELSEWHERE));
102 ast_data_add_bool(tree, "MASQ_NOSTREAM", ast_test_flag(chan, AST_FLAG_MASQ_NOSTREAM));
103 ast_data_add_bool(tree, "BRIDGE_HANGUP_RUN", ast_test_flag(chan, AST_FLAG_BRIDGE_HANGUP_RUN));
104 ast_data_add_bool(tree, "BRIDGE_HANGUP_DONT", ast_test_flag(chan, AST_FLAG_BRIDGE_HANGUP_DONT));
105 ast_data_add_bool(tree, "DISABLE_WORKAROUNDS", ast_test_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS));
108 int ast_channel_data_add_structure(struct ast_data *tree,
109 struct ast_channel *chan, int add_bridged)
111 struct ast_channel *bc;
112 struct ast_data *data_bridged;
113 struct ast_data *data_cdr;
114 struct ast_data *data_flags;
115 struct ast_data *data_zones;
116 struct ast_data *enum_node;
117 struct ast_data *data_softhangup;
118 #if 0 /* XXX AstData: ast_callerid no longer exists. (Equivalent code not readily apparent.) */
119 struct ast_data *data_callerid;
127 ast_data_add_structure(ast_channel, tree, chan);
130 bc = ast_bridged_channel(chan);
132 data_bridged = ast_data_add_node(tree, "bridged");
136 ast_channel_data_add_structure(data_bridged, bc, 0);
140 ast_data_add_codec(tree, "oldwriteformat", &chan->oldwriteformat);
141 ast_data_add_codec(tree, "readformat", &chan->readformat);
142 ast_data_add_codec(tree, "writeformat", &chan->writeformat);
143 ast_data_add_codec(tree, "rawreadformat", &chan->rawreadformat);
144 ast_data_add_codec(tree, "rawwriteformat", &chan->rawwriteformat);
145 ast_data_add_codecs(tree, "nativeformats", ast_channel_nativeformats(chan));
148 enum_node = ast_data_add_node(tree, "state");
152 ast_data_add_str(enum_node, "text", ast_state2str(ast_channel_state(chan)));
153 ast_data_add_int(enum_node, "value", ast_channel_state(chan));
156 enum_node = ast_data_add_node(tree, "hangupcause");
160 ast_data_add_str(enum_node, "text", ast_cause2str(ast_channel_hangupcause(chan)));
161 ast_data_add_int(enum_node, "value", ast_channel_hangupcause(chan));
164 enum_node = ast_data_add_node(tree, "amaflags");
168 ast_data_add_str(enum_node, "text", ast_cdr_flags2str(ast_channel_amaflags(chan)));
169 ast_data_add_int(enum_node, "value", ast_channel_amaflags(chan));
171 /* transfercapability */
172 enum_node = ast_data_add_node(tree, "transfercapability");
176 ast_data_add_str(enum_node, "text", ast_transfercapability2str(ast_channel_transfercapability(chan)));
177 ast_data_add_int(enum_node, "value", ast_channel_transfercapability(chan));
180 data_softhangup = ast_data_add_node(tree, "softhangup");
181 if (!data_softhangup) {
184 ast_data_add_bool(data_softhangup, "dev", chan->_softhangup & AST_SOFTHANGUP_DEV);
185 ast_data_add_bool(data_softhangup, "asyncgoto", chan->_softhangup & AST_SOFTHANGUP_ASYNCGOTO);
186 ast_data_add_bool(data_softhangup, "shutdown", chan->_softhangup & AST_SOFTHANGUP_SHUTDOWN);
187 ast_data_add_bool(data_softhangup, "timeout", chan->_softhangup & AST_SOFTHANGUP_TIMEOUT);
188 ast_data_add_bool(data_softhangup, "appunload", chan->_softhangup & AST_SOFTHANGUP_APPUNLOAD);
189 ast_data_add_bool(data_softhangup, "explicit", chan->_softhangup & AST_SOFTHANGUP_EXPLICIT);
190 ast_data_add_bool(data_softhangup, "unbridge", chan->_softhangup & AST_SOFTHANGUP_UNBRIDGE);
193 data_flags = ast_data_add_node(tree, "flags");
197 channel_data_add_flags(data_flags, chan);
199 ast_data_add_uint(tree, "timetohangup", chan->whentohangup.tv_sec);
201 #if 0 /* XXX AstData: ast_callerid no longer exists. (Equivalent code not readily apparent.) */
203 data_callerid = ast_data_add_node(tree, "callerid");
204 if (!data_callerid) {
207 ast_data_add_structure(ast_callerid, data_callerid, &(chan->cid));
208 /* insert the callerid ton */
209 enum_node = ast_data_add_node(data_callerid, "cid_ton");
213 ast_data_add_int(enum_node, "value", chan->cid.cid_ton);
214 snprintf(value_str, sizeof(value_str), "TON: %s/Plan: %s",
215 party_number_ton2str(chan->cid.cid_ton),
216 party_number_plan2str(chan->cid.cid_ton));
217 ast_data_add_str(enum_node, "text", value_str);
221 if (ast_channel_zone(chan)) {
222 data_zones = ast_data_add_node(tree, "zone");
226 ast_tone_zone_data_add_structure(data_zones, ast_channel_zone(chan));
230 data_cdr = ast_data_add_node(tree, "cdr");
235 ast_cdr_data_add_structure(data_cdr, ast_channel_cdr(chan), 1);
240 int ast_channel_data_cmp_structure(const struct ast_data_search *tree,
241 struct ast_channel *chan, const char *structure_name)
243 return ast_data_search_cmp_structure(tree, ast_channel, chan, structure_name);
248 #define DEFINE_STRINGFIELD_SETTERS_FOR(field) \
249 void ast_channel_##field##_set(struct ast_channel *chan, const char *value) \
251 ast_string_field_set(chan, __do_not_use_##field, value); \
254 void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) \
256 ast_string_field_build_va(chan, __do_not_use_##field, fmt, ap); \
258 void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) \
262 ast_channel_##field##_build_va(chan, fmt, ap); \
266 DEFINE_STRINGFIELD_SETTERS_FOR(name)
267 DEFINE_STRINGFIELD_SETTERS_FOR(language)
268 DEFINE_STRINGFIELD_SETTERS_FOR(musicclass)
269 DEFINE_STRINGFIELD_SETTERS_FOR(accountcode)
270 DEFINE_STRINGFIELD_SETTERS_FOR(peeraccount)
271 DEFINE_STRINGFIELD_SETTERS_FOR(userfield)
272 DEFINE_STRINGFIELD_SETTERS_FOR(call_forward)
273 DEFINE_STRINGFIELD_SETTERS_FOR(uniqueid)
274 DEFINE_STRINGFIELD_SETTERS_FOR(linkedid)
275 DEFINE_STRINGFIELD_SETTERS_FOR(parkinglot)
276 DEFINE_STRINGFIELD_SETTERS_FOR(hangupsource)
277 DEFINE_STRINGFIELD_SETTERS_FOR(dialcontext)
279 #define DEFINE_STRINGFIELD_GETTER_FOR(field) const char *ast_channel_##field(const struct ast_channel *chan) \
281 return chan->__do_not_use_##field; \
284 DEFINE_STRINGFIELD_GETTER_FOR(name)
285 DEFINE_STRINGFIELD_GETTER_FOR(language)
286 DEFINE_STRINGFIELD_GETTER_FOR(musicclass)
287 DEFINE_STRINGFIELD_GETTER_FOR(accountcode)
288 DEFINE_STRINGFIELD_GETTER_FOR(peeraccount)
289 DEFINE_STRINGFIELD_GETTER_FOR(userfield)
290 DEFINE_STRINGFIELD_GETTER_FOR(call_forward)
291 DEFINE_STRINGFIELD_GETTER_FOR(uniqueid)
292 DEFINE_STRINGFIELD_GETTER_FOR(linkedid)
293 DEFINE_STRINGFIELD_GETTER_FOR(parkinglot)
294 DEFINE_STRINGFIELD_GETTER_FOR(hangupsource)
295 DEFINE_STRINGFIELD_GETTER_FOR(dialcontext)
297 const char *ast_channel_appl(const struct ast_channel *chan)
299 return chan->__do_not_use_appl;
301 void ast_channel_appl_set(struct ast_channel *chan, const char *value)
303 chan->__do_not_use_appl = value;
305 const char *ast_channel_blockproc(const struct ast_channel *chan)
307 return chan->__do_not_use_blockproc;
309 void ast_channel_blockproc_set(struct ast_channel *chan, const char *value)
311 chan->__do_not_use_blockproc = value;
313 const char *ast_channel_data(const struct ast_channel *chan)
315 return chan->__do_not_use_data;
317 void ast_channel_data_set(struct ast_channel *chan, const char *value)
319 chan->__do_not_use_data = value;
323 const char *ast_channel_context(const struct ast_channel *chan)
325 return chan->__do_not_use_context;
327 void ast_channel_context_set(struct ast_channel *chan, const char *value)
329 ast_copy_string(chan->__do_not_use_context, value, sizeof(chan->__do_not_use_context));
331 const char *ast_channel_exten(const struct ast_channel *chan)
333 return chan->__do_not_use_exten;
335 void ast_channel_exten_set(struct ast_channel *chan, const char *value)
337 ast_copy_string(chan->__do_not_use_exten, value, sizeof(chan->__do_not_use_exten));
339 const char *ast_channel_macrocontext(const struct ast_channel *chan)
341 return chan->__do_not_use_macrocontext;
343 void ast_channel_macrocontext_set(struct ast_channel *chan, const char *value)
345 ast_copy_string(chan->__do_not_use_macrocontext, value, sizeof(chan->__do_not_use_macrocontext));
347 const char *ast_channel_macroexten(const struct ast_channel *chan)
349 return chan->__do_not_use_macroexten;
351 void ast_channel_macroexten_set(struct ast_channel *chan, const char *value)
353 ast_copy_string(chan->__do_not_use_macroexten, value, sizeof(chan->__do_not_use_macroexten));
357 char ast_channel_dtmf_digit_to_emulate(const struct ast_channel *chan)
359 return chan->__do_not_use_dtmf_digit_to_emulate;
361 void ast_channel_dtmf_digit_to_emulate_set(struct ast_channel *chan, char value)
363 chan->__do_not_use_dtmf_digit_to_emulate = value;
365 int ast_channel_amaflags(const struct ast_channel *chan)
367 return chan->__do_not_use_amaflags;
369 void ast_channel_amaflags_set(struct ast_channel *chan, int value)
371 chan->__do_not_use_amaflags = value;
374 int ast_channel_epfd(const struct ast_channel *chan)
376 return chan->__do_not_use_epfd;
378 void ast_channel_epfd_set(struct ast_channel *chan, int value)
380 chan->__do_not_use_epfd = value;
383 int ast_channel_fdno(const struct ast_channel *chan)
385 return chan->__do_not_use_fdno;
387 void ast_channel_fdno_set(struct ast_channel *chan, int value)
389 chan->__do_not_use_fdno = value;
391 int ast_channel_hangupcause(const struct ast_channel *chan)
393 return chan->__do_not_use_hangupcause;
395 void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
397 chan->__do_not_use_hangupcause = value;
399 int ast_channel_macropriority(const struct ast_channel *chan)
401 return chan->__do_not_use_macropriority;
403 void ast_channel_macropriority_set(struct ast_channel *chan, int value)
405 chan->__do_not_use_macropriority = value;
407 int ast_channel_priority(const struct ast_channel *chan)
409 return chan->__do_not_use_priority;
411 void ast_channel_priority_set(struct ast_channel *chan, int value)
413 chan->__do_not_use_priority = value;
415 int ast_channel_rings(const struct ast_channel *chan)
417 return chan->__do_not_use_rings;
419 void ast_channel_rings_set(struct ast_channel *chan, int value)
421 chan->__do_not_use_rings = value;
423 int ast_channel_streamid(const struct ast_channel *chan)
425 return chan->__do_not_use_streamid;
427 void ast_channel_streamid_set(struct ast_channel *chan, int value)
429 chan->__do_not_use_streamid = value;
431 int ast_channel_timingfd(const struct ast_channel *chan)
433 return chan->__do_not_use_timingfd;
435 void ast_channel_timingfd_set(struct ast_channel *chan, int value)
437 chan->__do_not_use_timingfd = value;
439 int ast_channel_visible_indication(const struct ast_channel *chan)
441 return chan->__do_not_use_visible_indication;
443 void ast_channel_visible_indication_set(struct ast_channel *chan, int value)
445 chan->__do_not_use_visible_indication = value;
447 int ast_channel_vstreamid(const struct ast_channel *chan)
449 return chan->__do_not_use_vstreamid;
451 void ast_channel_vstreamid_set(struct ast_channel *chan, int value)
453 chan->__do_not_use_vstreamid = value;
455 unsigned short ast_channel_transfercapability(const struct ast_channel *chan)
457 return chan->__do_not_use_transfercapability;
459 void ast_channel_transfercapability_set(struct ast_channel *chan, unsigned short value)
461 chan->__do_not_use_transfercapability = value;
463 unsigned int ast_channel_emulate_dtmf_duration(const struct ast_channel *chan)
465 return chan->__do_not_use_emulate_dtmf_duration;
467 void ast_channel_emulate_dtmf_duration_set(struct ast_channel *chan, unsigned int value)
469 chan->__do_not_use_emulate_dtmf_duration = value;
471 unsigned int ast_channel_fin(const struct ast_channel *chan)
473 return chan->__do_not_use_fin;
475 void ast_channel_fin_set(struct ast_channel *chan, unsigned int value)
477 chan->__do_not_use_fin = value;
479 unsigned int ast_channel_fout(const struct ast_channel *chan)
481 return chan->__do_not_use_fout;
483 void ast_channel_fout_set(struct ast_channel *chan, unsigned int value)
485 chan->__do_not_use_fout = value;
487 unsigned long ast_channel_insmpl(const struct ast_channel *chan)
489 return chan->__do_not_use_insmpl;
491 void ast_channel_insmpl_set(struct ast_channel *chan, unsigned long value)
493 chan->__do_not_use_insmpl = value;
495 unsigned long ast_channel_outsmpl(const struct ast_channel *chan)
497 return chan->__do_not_use_outsmpl;
499 void ast_channel_outsmpl_set(struct ast_channel *chan, unsigned long value)
501 chan->__do_not_use_outsmpl = value;
503 void *ast_channel_generatordata(const struct ast_channel *chan)
505 return chan->__do_not_use_generatordata;
507 void ast_channel_generatordata_set(struct ast_channel *chan, void *value)
509 chan->__do_not_use_generatordata = value;
511 void *ast_channel_music_state(const struct ast_channel *chan)
513 return chan->__do_not_use_music_state;
515 void ast_channel_music_state_set(struct ast_channel *chan, void *value)
517 chan->__do_not_use_music_state = value;
519 void *ast_channel_tech_pvt(const struct ast_channel *chan)
521 return chan->__do_not_use_tech_pvt;
523 void ast_channel_tech_pvt_set(struct ast_channel *chan, void *value)
525 chan->__do_not_use_tech_pvt = value;
527 void *ast_channel_timingdata(const struct ast_channel *chan)
529 return chan->__do_not_use_timingdata;
531 void ast_channel_timingdata_set(struct ast_channel *chan, void *value)
533 chan->__do_not_use_timingdata = value;
535 struct ast_audiohook_list *ast_channel_audiohooks(const struct ast_channel *chan)
537 return chan->__do_not_use_audiohooks;
539 void ast_channel_audiohooks_set(struct ast_channel *chan, struct ast_audiohook_list *value)
541 chan->__do_not_use_audiohooks = value;
543 struct ast_cdr *ast_channel_cdr(const struct ast_channel *chan)
545 return chan->__do_not_use_cdr;
547 void ast_channel_cdr_set(struct ast_channel *chan, struct ast_cdr *value)
549 chan->__do_not_use_cdr = value;
551 struct ast_channel *ast_channel_masq(const struct ast_channel *chan)
553 return chan->__do_not_use_masq;
555 void ast_channel_masq_set(struct ast_channel *chan, struct ast_channel *value)
557 chan->__do_not_use_masq = value;
559 struct ast_channel *ast_channel_masqr(const struct ast_channel *chan)
561 return chan->__do_not_use_masqr;
563 void ast_channel_masqr_set(struct ast_channel *chan, struct ast_channel *value)
565 chan->__do_not_use_masqr = value;
567 struct ast_channel_monitor *ast_channel_monitor(const struct ast_channel *chan)
569 return chan->__do_not_use_monitor;
571 void ast_channel_monitor_set(struct ast_channel *chan, struct ast_channel_monitor *value)
573 chan->__do_not_use_monitor = value;
575 struct ast_filestream *ast_channel_stream(const struct ast_channel *chan)
577 return chan->__do_not_use_stream;
579 void ast_channel_stream_set(struct ast_channel *chan, struct ast_filestream *value)
581 chan->__do_not_use_stream = value;
583 struct ast_filestream *ast_channel_vstream(const struct ast_channel *chan)
585 return chan->__do_not_use_vstream;
587 void ast_channel_vstream_set(struct ast_channel *chan, struct ast_filestream *value)
589 chan->__do_not_use_vstream = value;
591 struct ast_format_cap *ast_channel_nativeformats(const struct ast_channel *chan)
593 return chan->__do_not_use_nativeformats;
595 void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
597 chan->__do_not_use_nativeformats = value;
599 struct ast_framehook_list *ast_channel_framehooks(const struct ast_channel *chan)
601 return chan->__do_not_use_framehooks;
603 void ast_channel_framehooks_set(struct ast_channel *chan, struct ast_framehook_list *value)
605 chan->__do_not_use_framehooks = value;
607 struct ast_generator *ast_channel_generator(const struct ast_channel *chan)
609 return chan->__do_not_use_generator;
611 void ast_channel_generator_set(struct ast_channel *chan, struct ast_generator *value)
613 chan->__do_not_use_generator = value;
615 struct ast_pbx *ast_channel_pbx(const struct ast_channel *chan)
617 return chan->__do_not_use_pbx;
619 void ast_channel_pbx_set(struct ast_channel *chan, struct ast_pbx *value)
621 chan->__do_not_use_pbx = value;
623 struct ast_sched_context *ast_channel_sched(const struct ast_channel *chan)
625 return chan->__do_not_use_sched;
627 void ast_channel_sched_set(struct ast_channel *chan, struct ast_sched_context *value)
629 chan->__do_not_use_sched = value;
631 struct ast_timer *ast_channel_timer(const struct ast_channel *chan)
633 return chan->__do_not_use_timer;
635 void ast_channel_timer_set(struct ast_channel *chan, struct ast_timer *value)
637 chan->__do_not_use_timer = value;
639 struct ast_tone_zone *ast_channel_zone(const struct ast_channel *chan)
641 return chan->__do_not_use_zone;
643 void ast_channel_zone_set(struct ast_channel *chan, struct ast_tone_zone *value)
645 chan->__do_not_use_zone = value;
647 struct ast_trans_pvt *ast_channel_readtrans(const struct ast_channel *chan)
649 return chan->__do_not_use_readtrans;
651 void ast_channel_readtrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
653 chan->__do_not_use_readtrans = value;
655 struct ast_trans_pvt *ast_channel_writetrans(const struct ast_channel *chan)
657 return chan->__do_not_use_writetrans;
659 void ast_channel_writetrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
661 chan->__do_not_use_writetrans = value;
663 const struct ast_channel_tech *ast_channel_tech(const struct ast_channel *chan)
665 return chan->__do_not_use_tech;
667 void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
669 chan->__do_not_use_tech = value;
671 enum ast_channel_adsicpe ast_channel_adsicpe(const struct ast_channel *chan)
673 return chan->__do_not_use_adsicpe;
675 void ast_channel_adsicpe_set(struct ast_channel *chan, enum ast_channel_adsicpe value)
677 chan->__do_not_use_adsicpe = value;
679 enum ast_channel_state ast_channel_state(const struct ast_channel *chan)
681 return chan->__do_not_use_state;
683 void ast_channel_state_set(struct ast_channel *chan, enum ast_channel_state value)
685 chan->__do_not_use_state = value;