39 #include "asterisk/alertpipe.h"
45 #include "asterisk/stasis_channels.h"
87 ast_timing_func_t timingfunc;
230 #define DEFINE_STRINGFIELD_SETTERS_FOR(field, assert_on_null) \
231 void ast_channel_##field##_set(struct ast_channel *chan, const char *value) \
233 if ((assert_on_null)) ast_assert(!ast_strlen_zero(value)); \
234 if (!strcmp(value, chan->field)) return; \
235 ast_string_field_set(chan, field, value); \
238 void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) \
240 ast_string_field_build_va(chan, field, fmt, ap); \
242 void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) \
246 ast_channel_##field##_build_va(chan, fmt, ap); \
250 #define DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR(field, publish, assert_on_null, invalidate) \
251 void ast_channel_##field##_set(struct ast_channel *chan, const char *value) \
253 if ((assert_on_null)) ast_assert(!ast_strlen_zero(value)); \
254 if (!strcmp(value, chan->field)) return; \
255 ast_string_field_set(chan, field, value); \
256 ast_channel_snapshot_invalidate_segment(chan, invalidate); \
257 if (publish && ast_channel_internal_is_finalized(chan)) ast_channel_publish_snapshot(chan); \
260 void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) \
262 ast_string_field_build_va(chan, field, fmt, ap); \
263 ast_channel_snapshot_invalidate_segment(chan, invalidate); \
264 if (publish && ast_channel_internal_is_finalized(chan)) ast_channel_publish_snapshot(chan); \
266 void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) \
270 ast_channel_##field##_build_va(chan, fmt, ap); \
276 DEFINE_STRINGFIELD_SETTERS_FOR(
musicclass, 0);
282 DEFINE_STRINGFIELD_SETTERS_FOR(parkinglot, 0);
286 #define DEFINE_STRINGFIELD_GETTER_FOR(field) const char *ast_channel_##field(const struct ast_channel *chan) \
288 return chan->field; \
291 DEFINE_STRINGFIELD_GETTER_FOR(
name);
292 DEFINE_STRINGFIELD_GETTER_FOR(
language);
297 DEFINE_STRINGFIELD_GETTER_FOR(
userfield);
299 DEFINE_STRINGFIELD_GETTER_FOR(parkinglot);
303 const char *ast_channel_uniqueid(
const struct ast_channel *chan)
309 const char *ast_channel_linkedid(
const struct ast_channel *chan)
315 const char *ast_channel_appl(
const struct ast_channel *chan)
319 void ast_channel_appl_set(
struct ast_channel *chan,
const char *value)
324 const char *ast_channel_blockproc(
const struct ast_channel *chan)
328 void ast_channel_blockproc_set(
struct ast_channel *chan,
const char *value)
332 const char *ast_channel_data(
const struct ast_channel *chan)
336 void ast_channel_data_set(
struct ast_channel *chan,
const char *value)
342 const char *ast_channel_context(
const struct ast_channel *chan)
346 const char *ast_channel_lastcontext(
const struct ast_channel *chan)
350 void ast_channel_context_set(
struct ast_channel *chan,
const char *value)
359 const char *ast_channel_exten(
const struct ast_channel *chan)
363 const char *ast_channel_lastexten(
const struct ast_channel *chan)
367 void ast_channel_exten_set(
struct ast_channel *chan,
const char *value)
377 char ast_channel_dtmf_digit_to_emulate(
const struct ast_channel *chan)
381 void ast_channel_dtmf_digit_to_emulate_set(
struct ast_channel *chan,
char value)
386 char ast_channel_sending_dtmf_digit(
const struct ast_channel *chan)
390 void ast_channel_sending_dtmf_digit_set(
struct ast_channel *chan,
char value)
395 struct timeval ast_channel_sending_dtmf_tv(const struct
ast_channel *chan)
399 void ast_channel_sending_dtmf_tv_set(
struct ast_channel *chan,
struct timeval value)
417 int ast_channel_fdno(
const struct ast_channel *chan)
421 void ast_channel_fdno_set(
struct ast_channel *chan,
int value)
425 int ast_channel_hangupcause(
const struct ast_channel *chan)
429 void ast_channel_hangupcause_set(
struct ast_channel *chan,
int value)
434 int ast_channel_priority(
const struct ast_channel *chan)
438 void ast_channel_priority_set(
struct ast_channel *chan,
int value)
443 int ast_channel_rings(
const struct ast_channel *chan)
447 void ast_channel_rings_set(
struct ast_channel *chan,
int value)
451 int ast_channel_streamid(
const struct ast_channel *chan)
455 void ast_channel_streamid_set(
struct ast_channel *chan,
int value)
459 int ast_channel_timingfd(
const struct ast_channel *chan)
463 void ast_channel_timingfd_set(
struct ast_channel *chan,
int value)
467 int ast_channel_visible_indication(
const struct ast_channel *chan)
471 void ast_channel_visible_indication_set(
struct ast_channel *chan,
int value)
475 int ast_channel_hold_state(
const struct ast_channel *chan)
479 void ast_channel_hold_state_set(
struct ast_channel *chan,
int value)
483 int ast_channel_vstreamid(
const struct ast_channel *chan)
487 void ast_channel_vstreamid_set(
struct ast_channel *chan,
int value)
491 unsigned short ast_channel_transfercapability(
const struct ast_channel *chan)
495 void ast_channel_transfercapability_set(
struct ast_channel *chan,
unsigned short value)
499 unsigned int ast_channel_emulate_dtmf_duration(
const struct ast_channel *chan)
503 void ast_channel_emulate_dtmf_duration_set(
struct ast_channel *chan,
unsigned int value)
507 unsigned int ast_channel_fin(
const struct ast_channel *chan)
511 void ast_channel_fin_set(
struct ast_channel *chan,
unsigned int value)
515 unsigned int ast_channel_fout(
const struct ast_channel *chan)
519 void ast_channel_fout_set(
struct ast_channel *chan,
unsigned int value)
523 unsigned long ast_channel_insmpl(
const struct ast_channel *chan)
527 void ast_channel_insmpl_set(
struct ast_channel *chan,
unsigned long value)
531 unsigned long ast_channel_outsmpl(
const struct ast_channel *chan)
535 void ast_channel_outsmpl_set(
struct ast_channel *chan,
unsigned long value)
539 void *ast_channel_generatordata(
const struct ast_channel *chan)
543 void ast_channel_generatordata_set(
struct ast_channel *chan,
void *value)
547 void *ast_channel_music_state(
const struct ast_channel *chan)
551 void ast_channel_music_state_set(
struct ast_channel *chan,
void *value)
555 void *ast_channel_tech_pvt(
const struct ast_channel *chan)
559 void ast_channel_tech_pvt_set(
struct ast_channel *chan,
void *value)
566 void *ast_channel_timingdata(
const struct ast_channel *chan)
568 return chan->timingdata;
570 void ast_channel_timingdata_set(
struct ast_channel *chan,
void *value)
572 chan->timingdata = value;
576 return chan->audiohooks;
580 chan->audiohooks = value;
627 static void channel_set_default_streams(
struct ast_channel *chan)
631 ast_assert(chan != NULL);
633 for (type = AST_MEDIA_TYPE_UNKNOWN; type < AST_MEDIA_TYPE_END; type++) {
643 void ast_channel_internal_set_stream_topology(
struct ast_channel *chan,
648 channel_set_default_streams(chan);
651 void ast_channel_internal_set_stream_topology_change_source(
662 void ast_channel_nativeformats_set(
struct ast_channel *chan,
665 SCOPE_ENTER(2,
"%s: %sFormats: %s\n",
S_OR(ast_channel_name(chan),
"<initializing>"),
669 ast_assert(chan != NULL);
677 SCOPE_EXIT_RTN(
"Channel is being initialized or destroyed\n");
684 ast_channel_internal_set_stream_topology(chan, new_topology);
685 SCOPE_EXIT_RTN(
"New %stopology set\n", value ?
"" :
"empty ");
687 SCOPE_EXIT_RTN(
"Set native formats but not topology\n");
692 return chan->framehooks;
696 chan->framehooks = value;
766 enum ast_channel_adsicpe ast_channel_adsicpe(
const struct ast_channel *chan)
770 void ast_channel_adsicpe_set(
struct ast_channel *chan,
enum ast_channel_adsicpe value)
778 ast_callid ast_channel_callid(
const struct ast_channel *chan)
784 char call_identifier_from[AST_CALLID_BUFFER_LENGTH];
785 char call_identifier_to[AST_CALLID_BUFFER_LENGTH];
786 call_identifier_from[0] =
'\0';
790 ast_debug(3,
"Channel Call ID changing from %s to %s\n", call_identifier_from, call_identifier_to);
796 "State: CallIDChange\r\n"
800 ast_channel_name(chan),
802 call_identifier_from);
909 struct timeval *ast_channel_dtmf_tv(
struct ast_channel *chan)
913 struct timeval *ast_channel_whentohangup(
struct ast_channel *chan)
923 chan->
dtmff = *value;
949 void ast_channel_dtmf_tv_set(
struct ast_channel *chan,
struct timeval *value)
961 struct timeval ast_channel_creationtime(struct
ast_channel *chan)
965 void ast_channel_creationtime_set(
struct ast_channel *chan,
struct timeval *value)
971 struct timeval ast_channel_answertime(struct
ast_channel *chan)
976 void ast_channel_answertime_set(
struct ast_channel *chan,
struct timeval *value)
982 int ast_channel_softhangup_internal_flag(
struct ast_channel *chan)
986 void ast_channel_softhangup_internal_flag_set(
struct ast_channel *chan,
int value)
990 void ast_channel_softhangup_internal_flag_add(
struct ast_channel *chan,
int value)
994 void ast_channel_softhangup_internal_flag_clear(
struct ast_channel *chan,
int value)
1007 ast_channel_lock(chan);
1009 ast_channel_unlock(chan);
1021 ast_channel_lock(chan);
1023 ast_channel_unlock(chan);
1035 ast_channel_lock(chan);
1037 ast_channel_unlock(chan);
1048 ast_channel_lock(chan);
1050 ast_channel_unlock(chan);
1053 void ast_channel_callid_cleanup(
struct ast_channel *chan)
1059 ast_group_t ast_channel_callgroup(
const struct ast_channel *chan)
1067 ast_group_t ast_channel_pickupgroup(
const struct ast_channel *chan)
1075 struct ast_namedgroups *ast_channel_named_callgroups(
const struct ast_channel *chan)
1079 void ast_channel_named_callgroups_set(
struct ast_channel *chan,
struct ast_namedgroups *value)
1084 struct ast_namedgroups *ast_channel_named_pickupgroups(
const struct ast_channel *chan)
1088 void ast_channel_named_pickupgroups_set(
struct ast_channel *chan,
struct ast_namedgroups *value)
1095 int ast_channel_alert_write(
struct ast_channel *chan)
1100 ast_alert_status_t ast_channel_internal_alert_flush(
struct ast_channel *chan)
1105 ast_alert_status_t ast_channel_internal_alert_read(
struct ast_channel *chan)
1110 int ast_channel_alert_writable(
struct ast_channel *chan)
1112 return ast_alertpipe_writable(chan->alertpipe);
1115 int ast_channel_internal_alert_readable(
struct ast_channel *chan)
1117 return ast_alertpipe_readable(chan->alertpipe);
1120 void ast_channel_internal_alertpipe_clear(
struct ast_channel *chan)
1122 ast_alertpipe_clear(chan->alertpipe);
1125 void ast_channel_internal_alertpipe_close(
struct ast_channel *chan)
1130 int ast_channel_internal_alertpipe_init(
struct ast_channel *chan)
1135 int ast_channel_internal_alert_readfd(
struct ast_channel *chan)
1137 return ast_alertpipe_readfd(chan->alertpipe);
1142 ast_alertpipe_swap(chan1->alertpipe, chan2->alertpipe);
1146 void ast_channel_internal_fd_set(
struct ast_channel *chan,
int which,
int value)
1159 void ast_channel_internal_fd_clear(
struct ast_channel *chan,
int which)
1167 void ast_channel_internal_fd_clear_all(
struct ast_channel *chan)
1171 int ast_channel_fd(
const struct ast_channel *chan,
int which)
1175 int ast_channel_fd_isset(
const struct ast_channel *chan,
int which)
1177 return ast_channel_fd(chan, which) > -1;
1189 while (ast_channel_fd_isset(chan, pos)) {
1198 pthread_t ast_channel_blocker(
const struct ast_channel *chan)
1202 void ast_channel_blocker_set(
struct ast_channel *chan, pthread_t value)
1207 int ast_channel_blocker_tid(
const struct ast_channel *chan)
1211 void ast_channel_blocker_tid_set(
struct ast_channel *chan,
int value)
1216 ast_timing_func_t ast_channel_timingfunc(
const struct ast_channel *chan)
1218 return chan->timingfunc;
1220 void ast_channel_timingfunc_set(
struct ast_channel *chan, ast_timing_func_t value)
1222 chan->timingfunc = value;
1247 return &chan->
flags;
1250 static int collect_names_cb(
void *obj,
void *arg,
int flags)
1282 ao2_cause_code = ao2_alloc(datalen, NULL);
1284 if (ao2_cause_code) {
1285 memcpy(ao2_cause_code, cause_code, datalen);
1315 #define DIALED_CAUSES_BUCKETS 37
1317 struct ast_channel *__ast_channel_internal_alloc(
void (*destructor)(
void *obj),
const struct ast_assigned_ids *assignedids,
const struct ast_channel *requestor,
const char *file,
int line,
const char *
function)
1321 tmp = __ao2_alloc(
sizeof(*tmp), destructor,
1343 if (assignedids && !ast_strlen_zero(assignedids->uniqueid)) {
1345 }
else if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
1351 ast_config_AST_SYSTEM_NAME,
1457 void ast_channel_internal_cleanup(
struct ast_channel *chan)
1461 "done with dialed causes since the channel is going away");
1470 ao2_cleanup(chan->
topic);
1473 ast_channel_internal_set_stream_topology(chan, NULL);
1478 void ast_channel_internal_finalize(
struct ast_channel *chan)
1483 int ast_channel_internal_is_finalized(
struct ast_channel *chan)
1500 ast_assert(chan != NULL);
1501 ast_assert(endpoint != NULL);
1513 int ast_channel_internal_setup_topics(
struct ast_channel *chan)
1517 ast_assert(chan->
topic == NULL);
1520 static int dummy_id;
1531 ast_free(topic_name);
1549 void ast_channel_internal_errno_set(
enum ast_channel_error error)
1556 *error_code = error;
1559 enum ast_channel_error ast_channel_internal_errno(
void)
1563 return AST_CHANNEL_ERROR_UNKNOWN;
1572 ast_assert(chan != NULL);
1581 SCOPE_ENTER(1,
"%s: %s\n", ast_channel_name(chan),
1584 ast_assert(chan != NULL);
1595 new_topology = topology;
1599 ast_channel_internal_set_stream_topology(chan, new_topology);
1602 SCOPE_EXIT_RTN_VALUE(new_topology,
"Used %s topology\n", topology ?
"provided" :
"empty");
1608 ast_assert(chan != NULL);
1609 ast_assert(type < AST_MEDIA_TYPE_END);
1614 void ast_channel_internal_swap_stream_topology(
struct ast_channel *chan1,
1619 ast_assert(chan1 != NULL && chan2 != NULL);
1625 channel_set_default_streams(chan1);
1626 channel_set_default_streams(chan2);
const ast_string_field peeraccount
int ast_channel_unbridged(struct ast_channel *chan)
This function will check if the bridge needs to be re-evaluated due to external changes.
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
Information needed to identify an endpoint in a call.
struct ast_channel * masqr
static int pvt_cause_hash_fn(const void *vpc, const int flags)
Hash function for pvt cause code frames.
Main Channel structure associated with a channel.
struct ast_stream_topology * ast_channel_get_stream_topology(const struct ast_channel *chan)
Retrieve the topology of streams on a channel.
struct ast_channel * masq
struct ast_party_connected_line connected
Channel Connected Line ID information.
void ast_channel_pickupgroup_set(struct ast_channel *chan, ast_group_t value)
struct stasis_forward * channel_forward
void ast_channel_set_unbridged_nolock(struct ast_channel *chan, int value)
Variant of ast_channel_set_unbridged. Use this if the channel is already locked prior to calling...
void ast_channel_set_unbridged(struct ast_channel *chan, int value)
Sets the unbridged flag and queues a NULL frame on the channel to trigger a check by bridge_channel_w...
Asterisk main include file. File version handling, generic pbx functions.
struct timeval answertime
struct ast_party_id priv_to
Call is redirecting to a new party (Sent to the caller) - private representation. ...
char chan_name[AST_CHANNEL_NAME]
struct ast_party_caller caller
Channel Caller ID information.
struct ast_tone_zone * zone
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
char lastcontext[AST_MAX_CONTEXT]
struct ast_channel_id linkedid
void ast_channel_snapshot_invalidate_segment(struct ast_channel *chan, enum ast_channel_snapshot_segment_invalidation segment)
Invalidate a channel snapshot segment from being reused.
struct ast_channel::@335 fds
void ast_channel_internal_alertpipe_swap(struct ast_channel *chan1, struct ast_channel *chan2)
Swap the interal alertpipe between two channels.
struct ast_party_id id
Connected party ID.
#define ast_channel_unref(c)
Decrease channel reference count.
struct ast_party_id priv_orig
Who originally redirected the call (Sent to the party the call is redirected toward) - private repres...
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
Channel UniqueId structure.
char context[AST_MAX_CONTEXT]
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below.
struct ast_autochan_list autochans
struct ast_party_id priv_from
Who is redirecting the call (Sent to the party the call is redirected toward) - private representatio...
int ast_channel_is_t38_active_nolock(struct ast_channel *chan)
ast_channel_is_t38_active variant. Use this if the channel is already locked prior to calling...
struct ast_generator * generator
unsigned int emulate_dtmf_duration
char dtmf_digit_to_emulate
Structure representing a snapshot of channel state.
struct ast_frame *(*const read_stream)(struct ast_channel *chan)
Read a frame (or chain of frames from the same stream), in standard format (see frame.h), with stream num.
int ast_channel_forward_endpoint(struct ast_channel *chan, struct ast_endpoint *endpoint)
Forward channel stasis messages to the given endpoint.
void ast_alertpipe_close(int alert_pipe[2])
Close an alert pipe.
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
Structure to pass both assignedid values to channel drivers.
struct ast_sched_context * sched
ast_channel_state
ast_channel states
char unique_id[AST_MAX_UNIQUEID]
struct stasis_topic * ast_endpoint_topic(struct ast_endpoint *endpoint)
Returns the topic for a specific endpoint.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
struct ast_stream_topology * ast_stream_topology_create_from_format_cap(struct ast_format_cap *cap)
A helper function that, given a format capabilities structure, creates a topology and separates the m...
unsigned short transfercapability
struct ast_format * oldwriteformat
struct ast_format * rawreadformat
void ast_channel_internal_bridge_set(struct ast_channel *chan, struct ast_bridge *value)
struct ast_format * rawwriteformat
struct ast_format_cap * nativeformats
enum ast_channel_adsicpe adsicpe
void ast_channel_dialed_causes_clear(const struct ast_channel *chan)
Clear all cause information from the channel.
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
void ast_channel_internal_swap_topics(struct ast_channel *a, struct ast_channel *b)
Swap topics beteween two channels.
int ast_channel_is_t38_active(struct ast_channel *chan)
This function will check if T.38 is active on the channel.
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
struct ast_format * writeformat
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
void ast_channel_callgroup_set(struct ast_channel *chan, ast_group_t value)
struct ast_party_id orig
Who originally redirected the call (Sent to the party the call is redirected toward) ...
const struct ast_channel_tech * tech
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
void ast_channel_internal_set_fake_ids(struct ast_channel *chan, const char *uniqueid, const char *linkedid)
Set uniqueid and linkedid string value only (not time)
#define ast_str_tmp(init_len, __expr)
Provides a temporary ast_str and returns a copy of its buffer.
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
struct ast_bridge_channel * bridge_channel
struct ast_stream * default_streams[AST_MEDIA_TYPE_END]
const char * ast_stream_topology_to_str(const struct ast_stream_topology *topology, struct ast_str **buf)
Get a string representing the topology for debugging/display purposes.
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
struct ast_stream * ast_stream_topology_get_first_stream_by_type(const struct ast_stream_topology *topology, enum ast_media_type type)
Gets the first active stream of a specific type from the topology.
General Asterisk PBX channel definitions.
Asterisk file paths, configured in asterisk.conf.
enum ast_media_type type
The type of media the stream is handling.
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
#define AST_VECTOR_ELEM_CLEANUP_NOOP(elem)
Vector element cleanup that does nothing.
A set of tones for a given locale.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_strdupa(s)
duplicate a string in memory from the stack
ast_alert_status_t ast_alertpipe_read(int alert_pipe[2])
Read an event from an alert pipe.
struct stasis_topic * topic
enum ast_channel_state state
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define AST_MAX_EXTENSION
struct ast_stream_topology * ast_channel_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
Set the topology of streams on a channel.
#define AST_STRING_FIELD(name)
Declare a string field.
struct ast_stream_topology * stream_topology
void ast_channel_callid_set(struct ast_channel *chan, ast_callid callid)
Caller Party information.
void ast_channel_internal_swap_snapshots(struct ast_channel *a, struct ast_channel *b)
Swap snapshots beteween two channels.
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
int ast_channel_unbridged_nolock(struct ast_channel *chan)
ast_channel_unbridged variant. Use this if the channel is already locked prior to calling...
struct ao2_container * dialed_causes
#define ast_debug(level,...)
Log a DEBUG message.
#define AST_VECTOR(name, type)
Define a vector structure.
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
struct ast_format * readformat
int ast_channel_fd_count(const struct ast_channel *chan)
Retrieve the number of file decriptor positions present on the channel.
Structure to describe a channel "technology", ie a channel driver See for examples: ...
const ast_string_field dialcontext
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to a channel's frame queue.
void ast_channel_internal_copy_linkedid(struct ast_channel *dest, struct ast_channel *source)
Copy the full linkedid channel id structure from one channel to another.
int ast_alertpipe_init(int alert_pipe[2])
Initialize an alert pipe.
#define ast_test_suite_event_notify(s, f,...)
struct ast_party_dialed dialed
Dialed/Called information.
struct ast_trans_pvt * writetrans
Dialed/Called Party information.
Responsible for call detail data.
Structure that contains information about a bridge.
struct ast_hangup_handler_list hangup_handlers
char * ast_tech_to_upper(char *dev_str)
Convert the tech portion of a device string to upper case.
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
int(*const write_stream)(struct ast_channel *chan, int stream_num, struct ast_frame *frame)
Write a frame on a specific stream, in standard format (see frame.h)
Support for dynamic strings.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
Internal channel functions for channel.c to use.
struct ast_party_id ast_party_id_merge(struct ast_party_id *base, struct ast_party_id *overlay)
Merge a given party id into another given party id.
struct ast_stream_topology * ast_stream_topology_alloc(void)
Create a stream topology.
void * ast_channel_get_stream_topology_change_source(struct ast_channel *chan)
Retrieve the source that initiated the last stream topology change.
struct timeval sending_dtmf_tv
const ast_string_field call_forward
struct ast_namedgroups * named_pickupgroups
struct ast_channel * ast_channel_internal_oldest_linkedid(struct ast_channel *a, struct ast_channel *b)
Determine which channel has an older linkedid.
Connected Line/Party information.
const ast_string_field name
void ast_channel_set_is_t38_active(struct ast_channel *chan, int is_t38_active)
Sets the is_t38_active flag.
const ast_string_field hangupsource
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
struct ast_bridge * bridge
General jitterbuffer state.
struct ast_control_pvt_cause_code * ast_channel_dialed_causes_find(const struct ast_channel *chan, const char *chan_name)
Retrieve a ref-counted cause code information structure.
void * stream_topology_change_source
int ast_channel_dialed_causes_add(const struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code, int datalen)
Add cause code information to the channel.
#define AST_VECTOR_RESET(vec, cleanup)
Reset vector.
struct ast_filestream * vstream
struct ast_datastore_list datastores
struct timeval creationtime
Vector container support.
const ast_string_field userfield
struct ast_flags snapshot_segment_flags
Structure used to handle boolean flags.
struct ast_str * ast_channel_dialed_causes_channels(const struct ast_channel *chan)
Retrieve a comma-separated list of channels for which dialed cause information is available...
struct ast_party_connected_line connected_indicated
Channel Connected Line ID information that was last indicated.
void ast_channel_internal_swap_uniqueid_and_linkedid(struct ast_channel *a, struct ast_channel *b)
Swap uniqueid and linkedid beteween two channels.
struct ast_frame ast_null_frame
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
void ast_channel_set_is_t38_active_nolock(struct ast_channel *chan, int is_t38_active)
Variant of ast_channel_set_is_t38_active. Use this if the channel is already locked prior to calling...
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.
Structure that contains information regarding a channel in a bridge.
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
ast_alert_status_t ast_alertpipe_flush(int alert_pipe[2])
Consume all alerts written to the alert pipe.
ssize_t ast_alertpipe_write(int alert_pipe[2])
Write an event to an alert pipe.
#define ao2_replace(dst, src)
Replace one object reference with another cleaning up the original.
struct ast_party_id to
Call is redirecting to a new party (Sent to the caller)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
void ast_channel_whentohangup_set(struct ast_channel *chan, struct timeval *value)
#define AST_VECTOR_REPLACE(vec, idx, elem)
Replace an element at a specific position in a vector, growing the vector if needed.
const ast_string_field musicclass
const ast_string_field accountcode
Data structure associated with a single frame of data.
struct ast_namedgroups * named_callgroups
struct stasis_forward * endpoint_forward
struct ast_channel_id uniqueid
struct timeval whentohangup
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
char lastexten[AST_MAX_EXTENSION]
ast_media_type
Types of media.
struct ast_trans_pvt * readtrans
ama_flags
Channel AMA Flags.
static int pvt_cause_cmp_fn(void *obj, void *vstr, int flags)
Comparison function for pvt cause code frames.
void ast_callid_strnprint(char *buffer, size_t buffer_size, ast_callid callid)
copy a string representation of the callid into a target string
struct stasis_forward * stasis_forward_all(struct stasis_topic *from_topic, struct stasis_topic *to_topic)
Create a subscription which forwards all messages from one topic to another.
struct ast_stream * ast_channel_get_default_stream(struct ast_channel *chan, enum ast_media_type type)
Retrieve the default stream of a specific media type on a channel.
void ast_stream_topology_free(struct ast_stream_topology *topology)
Unreference and destroy a stream topology.
struct ast_filestream * stream
struct ast_channel_snapshot * snapshot
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
struct ast_party_id priv
Private connected party ID.
const ast_string_field latest_musicclass
void ast_channel_internal_swap_endpoint_forward(struct ast_channel *a, struct ast_channel *b)
Swap endpoint_forward between two channels.
const ast_string_field language
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
char exten[AST_MAX_EXTENSION]
static int uniqueint
The monotonically increasing integer counter for channel uniqueids.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
int ast_channel_fd_add(struct ast_channel *chan, int value)
Add a file descriptor to the channel without a fixed position.
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
#define ao2_link(container, obj)
Add an object to a container.