231#define DEFINE_STRINGFIELD_SETTERS_FOR(field, assert_on_null) \
232void ast_channel_##field##_set(struct ast_channel *chan, const char *value) \
234 if ((assert_on_null)) ast_assert(!ast_strlen_zero(value)); \
235 if (!strcmp(value, chan->field)) return; \
236 ast_string_field_set(chan, field, value); \
239void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) \
241 ast_string_field_build_va(chan, field, fmt, ap); \
243void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) \
247 ast_channel_##field##_build_va(chan, fmt, ap); \
251#define DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR(field, publish, assert_on_null, invalidate) \
252void ast_channel_##field##_set(struct ast_channel *chan, const char *value) \
254 if ((assert_on_null)) ast_assert(!ast_strlen_zero(value)); \
255 if (!strcmp(value, chan->field)) return; \
256 ast_string_field_set(chan, field, value); \
257 ast_channel_snapshot_invalidate_segment(chan, invalidate); \
258 if (publish && ast_channel_internal_is_finalized(chan)) ast_channel_publish_snapshot(chan); \
261void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) \
263 ast_string_field_build_va(chan, field, fmt, ap); \
264 ast_channel_snapshot_invalidate_segment(chan, invalidate); \
265 if (publish && ast_channel_internal_is_finalized(chan)) ast_channel_publish_snapshot(chan); \
267void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) \
271 ast_channel_##field##_build_va(chan, fmt, ap); \
287#define DEFINE_STRINGFIELD_GETTER_FOR(field) const char *ast_channel_##field(const struct ast_channel *chan) \
289 return chan->field; \
413 return chan->sending_dtmf_tv;
776 if (
value->read_stream ||
value->write_stream) {
802 call_identifier_from[0] =
'\0';
806 ast_debug(3,
"Channel Call ID changing from %s to %s\n", call_identifier_from, call_identifier_to);
812 "State: CallIDChange\r\n"
818 call_identifier_from);
979 return chan->creationtime;
989 return chan->answertime;
1263 return &chan->
flags;
1300 if (ao2_cause_code) {
1301 memcpy(ao2_cause_code, cause_code, datalen);
1331#define DIALED_CAUSES_BUCKETS 37
1351 if (!
tmp->dialed_causes) {
1358 if (initializers->
version == 0) {
1359 ast_log(
LOG_ERROR,
"Channel initializers must have a non-zero version.\n");
1363 "Please ensure all modules were compiled for "
1364 "this version of Asterisk.\n");
1370 tmp->uniqueid.creation_time = time(
NULL);
1377 snprintf(
tmp->uniqueid.unique_id,
sizeof(
tmp->uniqueid.unique_id),
"%li.%d",
1378 (
long)(
tmp->uniqueid.creation_time),
1379 tmp->uniqueid.creation_unique);
1381 snprintf(
tmp->uniqueid.unique_id,
sizeof(
tmp->uniqueid.unique_id),
"%s-%li.%d",
1383 (
long)(
tmp->uniqueid.creation_time),
1384 tmp->uniqueid.creation_unique);
1391 tmp->linkedid =
tmp->uniqueid;
1411 const struct ast_channel *requestor,
const char *
file,
int line,
const char *function)
1421 if (
a->linkedid.creation_time <
b->linkedid.creation_time) {
1424 if (
b->linkedid.creation_time <
a->linkedid.creation_time) {
1427 if (
a->linkedid.creation_unique <
b->linkedid.creation_unique) {
1454 a->uniqueid =
b->uniqueid;
1458 a->linkedid =
b->linkedid;
1468 a->topic =
b->topic;
1471 forward =
a->channel_forward;
1472 a->channel_forward =
b->channel_forward;
1473 b->channel_forward = forward;
1480 temp =
a->endpoint_forward;
1481 a->endpoint_forward =
b->endpoint_forward;
1482 b->endpoint_forward = temp;
1489 snapshot =
a->snapshot;
1490 a->snapshot =
b->snapshot;
1491 b->snapshot = snapshot;
1504 "done with dialed causes since the channel is going away");
1563 static int dummy_id;
1599 *error_code =
error;
1638 new_topology = topology;
void ast_alertpipe_close(int alert_pipe[2])
Close an alert pipe.
ssize_t ast_alertpipe_write(int alert_pipe[2])
Write an event to an alert pipe.
void ast_alertpipe_swap(int alert_pipe_1[2], int alert_pipe_2[2])
Swap the file descriptors from two alert pipes.
void ast_alertpipe_clear(int alert_pipe[2])
Sets the alert pipe file descriptors to default values.
ast_alert_status_t ast_alertpipe_flush(int alert_pipe[2])
Consume all alerts written to the alert pipe.
int ast_alertpipe_readable(int alert_pipe[2])
Determine if the alert pipe is readable.
int ast_alertpipe_readfd(int alert_pipe[2])
Get the alert pipe's read file descriptor.
int ast_alertpipe_init(int alert_pipe[2])
Initialize an alert pipe.
int ast_alertpipe_writable(int alert_pipe[2])
Determine if the alert pipe is writable.
ast_alert_status_t ast_alertpipe_read(int alert_pipe[2])
Read an event from an alert pipe.
static char dialcontext[AST_MAX_CONTEXT]
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
#define ao2_t_ref(o, delta, tag)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
#define ao2_find(container, arg, flags)
#define ao2_replace(dst, src)
Replace one object reference with another cleaning up the original.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
#define ao2_alloc(data_size, destructor_fn)
void * __ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
#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.
static char language[MAX_LANGUAGE]
static char accountcode[AST_MAX_ACCOUNT_CODE]
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
int(* ast_timing_func_t)(const void *data)
#define ast_channel_lock(chan)
struct ast_namedgroups * ast_ref_namedgroups(struct ast_namedgroups *groups)
unsigned long long ast_group_t
@ AST_CHANNEL_ERROR_UNKNOWN
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to a channel's frame queue.
ama_flags
Channel AMA Flags.
#define AST_CHANNEL_INITIALIZERS_VERSION
struct ABI version
#define ast_channel_unref(c)
Decrease channel reference count.
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.
#define AST_MAX_TENANT_ID
struct ast_namedgroups * ast_unref_namedgroups(struct ast_namedgroups *groups)
#define ast_channel_unlock(chan)
#define AST_MAX_EXTENSION
Internal channel functions for channel.c to use.
void ast_channel_internal_set_stream_topology_change_source(struct ast_channel *chan, void *change_source)
void ast_channel_internal_alertpipe_swap(struct ast_channel *chan1, struct ast_channel *chan2)
Swap the interal alertpipe between two channels.
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
static struct ast_threadstorage channel_errno
const char * ast_channel_linkedid(const struct ast_channel *chan)
struct ast_bridge * ast_channel_internal_bridge(const struct ast_channel *chan)
void * ast_channel_get_stream_topology_change_source(struct ast_channel *chan)
Retrieve the source that initiated the last stream topology change.
struct timeval ast_channel_answertime(struct ast_channel *chan)
static void channel_set_default_streams(struct ast_channel *chan)
void ast_channel_rings_set(struct ast_channel *chan, int value)
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.
void ast_channel_named_pickupgroups_set(struct ast_channel *chan, struct ast_namedgroups *value)
struct ast_channel * ast_channel_masq(const struct ast_channel *chan)
int ast_channel_blocker_tid(const struct ast_channel *chan)
void ast_channel_stream_set(struct ast_channel *chan, struct ast_filestream *value)
void ast_channel_appl_set(struct ast_channel *chan, const char *value)
void ast_channel_dtmff_set(struct ast_channel *chan, struct ast_frame *value)
void ast_channel_visible_indication_set(struct ast_channel *chan, int value)
const char * ast_channel_blockproc(const struct ast_channel *chan)
void ast_channel_caller_set(struct ast_channel *chan, struct ast_party_caller *value)
void ast_channel_internal_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
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.
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.
struct ast_namedgroups * ast_channel_named_pickupgroups(const struct ast_channel *chan)
void * ast_channel_tech_pvt(const struct ast_channel *chan)
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)
const char * ast_channel_data(const struct ast_channel *chan)
void ast_channel_dialed_set(struct ast_channel *chan, struct ast_party_dialed *value)
struct ast_party_id ast_channel_redirecting_effective_to(struct ast_channel *chan)
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.
struct ast_format * ast_channel_rawreadformat(struct ast_channel *chan)
struct ast_party_id ast_channel_redirecting_effective_from(struct ast_channel *chan)
void * ast_channel_music_state(const struct ast_channel *chan)
void ast_channel_blockproc_set(struct ast_channel *chan, const char *value)
unsigned int ast_channel_fin(const struct ast_channel *chan)
void ast_channel_callid_cleanup(struct ast_channel *chan)
void ast_channel_insmpl_set(struct ast_channel *chan, unsigned long value)
void ast_channel_set_oldwriteformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_softhangup_internal_flag_clear(struct ast_channel *chan, int value)
struct varshead * ast_channel_varshead(struct ast_channel *chan)
int ast_channel_rings(const struct ast_channel *chan)
void ast_channel_generator_set(struct ast_channel *chan, struct ast_generator *value)
void ast_channel_blocker_set(struct ast_channel *chan, pthread_t value)
void ast_channel_tenantid_set(struct ast_channel *chan, const char *value)
void ast_channel_sending_dtmf_digit_set(struct ast_channel *chan, char value)
void * ast_channel_timingdata(const struct ast_channel *chan)
#define DEFINE_STRINGFIELD_GETTER_FOR(field)
int ast_channel_internal_alert_readfd(struct ast_channel *chan)
const char * ast_channel_tenantid(const struct ast_channel *chan)
void ast_channel_dtmf_tv_set(struct ast_channel *chan, struct timeval *value)
int ast_channel_internal_is_finalized(struct ast_channel *chan)
struct ast_flags * ast_channel_snapshot_segment_flags(struct ast_channel *chan)
void ast_channel_internal_swap_endpoint_forward(struct ast_channel *a, struct ast_channel *b)
Swap endpoint_forward between two channels.
void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
int ast_channel_fdno(const struct ast_channel *chan)
void ast_channel_internal_fd_clear_all(struct ast_channel *chan)
void ast_channel_internal_bridge_channel_set(struct ast_channel *chan, struct ast_bridge_channel *value)
void ast_channel_internal_alertpipe_close(struct ast_channel *chan)
struct ast_channel * __ast_channel_internal_alloc_with_initializers(void(*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const struct ast_channel_initializers *initializers, const char *file, int line, const char *function)
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
void ast_channel_answertime_set(struct ast_channel *chan, struct timeval *value)
void ast_channel_hold_state_set(struct ast_channel *chan, int value)
struct ast_trans_pvt * ast_channel_readtrans(const struct ast_channel *chan)
const char * ast_channel_lastexten(const struct ast_channel *chan)
struct ast_format_cap * ast_channel_nativeformats(const struct ast_channel *chan)
void ast_channel_data_set(struct ast_channel *chan, const char *value)
void ast_channel_blocker_tid_set(struct ast_channel *chan, int value)
struct timeval ast_channel_sending_dtmf_tv(const struct ast_channel *chan)
void ast_channel_jb_set(struct ast_channel *chan, struct ast_jb *value)
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
enum ast_channel_error ast_channel_internal_errno(void)
void ast_channel_snapshot_set(struct ast_channel *chan, struct ast_channel_snapshot *snapshot)
struct ast_trans_pvt * ast_channel_writetrans(const struct ast_channel *chan)
static int uniqueint
The monotonically increasing integer counter for channel uniqueids.
unsigned short ast_channel_transfercapability(const struct ast_channel *chan)
struct ast_namedgroups * ast_channel_named_callgroups(const struct ast_channel *chan)
ast_group_t ast_channel_pickupgroup(const struct ast_channel *chan)
void ast_channel_vstreamid_set(struct ast_channel *chan, int value)
#define DEFINE_STRINGFIELD_SETTERS_FOR(field, assert_on_null)
void ast_channel_internal_swap_stream_topology(struct ast_channel *chan1, struct ast_channel *chan2)
void ast_channel_timingdata_set(struct ast_channel *chan, void *value)
struct ast_format * ast_channel_oldwriteformat(struct ast_channel *chan)
int ast_channel_internal_alert_readable(struct ast_channel *chan)
struct ast_cdr * ast_channel_cdr(const struct ast_channel *chan)
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
void ast_channel_redirecting_set(struct ast_channel *chan, struct ast_party_redirecting *value)
int ast_channel_priority(const struct ast_channel *chan)
void ast_channel_writetrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
void ast_channel_streamid_set(struct ast_channel *chan, int value)
void ast_channel_callid_set(struct ast_channel *chan, ast_callid callid)
void ast_channel_generatordata_set(struct ast_channel *chan, void *value)
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
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.
void ast_channel_softhangup_internal_flag_set(struct ast_channel *chan, int value)
ast_callid ast_channel_callid(const struct ast_channel *chan)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
const char * ast_channel_context(const struct ast_channel *chan)
char ast_channel_dtmf_digit_to_emulate(const struct ast_channel *chan)
unsigned long ast_channel_insmpl(const struct ast_channel *chan)
int ast_channel_fd_add(struct ast_channel *chan, int value)
Add a file descriptor to the channel without a fixed position.
ast_alert_status_t ast_channel_internal_alert_flush(struct ast_channel *chan)
void ast_channel_timingfd_set(struct ast_channel *chan, int value)
pthread_t ast_channel_blocker(const struct ast_channel *chan)
void ast_channel_sending_dtmf_tv_set(struct ast_channel *chan, struct timeval value)
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.
void ast_channel_internal_swap_topics(struct ast_channel *a, struct ast_channel *b)
Swap topics beteween two channels.
const char * ast_channel_appl(const struct ast_channel *chan)
void ast_channel_internal_cleanup(struct ast_channel *chan)
int ast_channel_unbridged_nolock(struct ast_channel *chan)
ast_channel_unbridged variant. Use this if the channel is already locked prior to calling.
void ast_channel_framehooks_set(struct ast_channel *chan, struct ast_framehook_list *value)
struct timeval ast_channel_creationtime(struct ast_channel *chan)
struct ast_channel_snapshot * ast_channel_snapshot(const struct ast_channel *chan)
struct ast_bridge_channel * ast_channel_internal_bridge_channel(const struct ast_channel *chan)
struct ast_framehook_list * ast_channel_framehooks(const struct ast_channel *chan)
void ast_channel_audiohooks_set(struct ast_channel *chan, struct ast_audiohook_list *value)
int ast_channel_fd(const struct ast_channel *chan, int which)
void ast_channel_timer_set(struct ast_channel *chan, struct ast_timer *value)
void ast_channel_internal_fd_set(struct ast_channel *chan, int which, int value)
void ast_channel_fin_set(struct ast_channel *chan, unsigned int value)
void ast_channel_set_rawreadformat(struct ast_channel *chan, struct ast_format *format)
struct ast_audiohook_list * ast_channel_audiohooks(const struct ast_channel *chan)
void ast_channel_tech_pvt_set(struct ast_channel *chan, void *value)
enum ama_flags ast_channel_amaflags(const struct ast_channel *chan)
void ast_channel_readtrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
void ast_channel_callgroup_set(struct ast_channel *chan, ast_group_t value)
void ast_channel_internal_bridge_set(struct ast_channel *chan, struct ast_bridge *value)
void * ast_channel_generatordata(const struct ast_channel *chan)
struct ast_format * ast_channel_rawwriteformat(struct ast_channel *chan)
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.
unsigned int ast_channel_fout(const struct ast_channel *chan)
struct ast_stream_topology * ast_channel_get_stream_topology(const struct ast_channel *chan)
Retrieve the topology of streams on a channel.
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...
void ast_channel_outsmpl_set(struct ast_channel *chan, unsigned long value)
int ast_channel_hangupcause(const struct ast_channel *chan)
int ast_channel_timingfd(const struct ast_channel *chan)
void ast_channel_fdno_set(struct ast_channel *chan, int value)
void ast_channel_set_rawwriteformat(struct ast_channel *chan, struct ast_format *format)
struct ast_party_dialed * ast_channel_dialed(struct ast_channel *chan)
void ast_channel_creationtime_set(struct ast_channel *chan, struct timeval *value)
struct ast_tone_zone * ast_channel_zone(const struct ast_channel *chan)
struct ast_party_id ast_channel_redirecting_effective_orig(struct ast_channel *chan)
enum ast_channel_adsicpe ast_channel_adsicpe(const struct ast_channel *chan)
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.
void ast_channel_named_callgroups_set(struct ast_channel *chan, struct ast_namedgroups *value)
int ast_channel_alert_write(struct ast_channel *chan)
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)
const char * ast_channel_lastcontext(const struct ast_channel *chan)
int ast_channel_vstreamid(const struct ast_channel *chan)
struct ast_readq_list * ast_channel_readq(struct ast_channel *chan)
void ast_channel_set_is_t38_active(struct ast_channel *chan, int is_t38_active)
Sets the is_t38_active flag.
struct ast_jb * ast_channel_jb(struct ast_channel *chan)
ast_timing_func_t ast_channel_timingfunc(const struct ast_channel *chan)
static int collect_names_cb(void *obj, void *arg, int flags)
void ast_channel_set_readformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_dtmf_digit_to_emulate_set(struct ast_channel *chan, char value)
void ast_channel_softhangup_internal_flag_add(struct ast_channel *chan, int value)
struct timeval * ast_channel_whentohangup(struct ast_channel *chan)
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.
struct ast_filestream * ast_channel_vstream(const struct ast_channel *chan)
ast_alert_status_t ast_channel_internal_alert_read(struct ast_channel *chan)
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
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_generator * ast_channel_generator(const struct ast_channel *chan)
ast_group_t ast_channel_callgroup(const struct ast_channel *chan)
struct ast_party_id ast_channel_connected_effective_id(struct ast_channel *chan)
int ast_channel_unbridged(struct ast_channel *chan)
This function will check if the bridge needs to be re-evaluated due to external changes.
int ast_channel_hold_state(const struct ast_channel *chan)
void ast_channel_emulate_dtmf_duration_set(struct ast_channel *chan, unsigned int value)
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
struct ast_party_connected_line * ast_channel_connected_indicated(struct ast_channel *chan)
void ast_channel_cdr_set(struct ast_channel *chan, struct ast_cdr *value)
void ast_channel_context_set(struct ast_channel *chan, const char *value)
int ast_channel_streamid(const struct ast_channel *chan)
void ast_channel_connected_set(struct ast_channel *chan, struct ast_party_connected_line *value)
void ast_channel_state_set(struct ast_channel *chan, enum ast_channel_state value)
int ast_channel_internal_setup_topics(struct ast_channel *chan)
void ast_channel_timingfunc_set(struct ast_channel *chan, ast_timing_func_t value)
struct ast_sched_context * ast_channel_sched(const struct ast_channel *chan)
int ast_channel_forward_endpoint(struct ast_channel *chan, struct ast_endpoint *endpoint)
Forward channel stasis messages to the given endpoint.
int ast_channel_fd_count(const struct ast_channel *chan)
Retrieve the number of file decriptor positions present on the channel.
static int pvt_cause_cmp_fn(void *obj, void *vstr, int flags)
Comparison function for pvt cause code frames.
struct ast_frame * ast_channel_dtmff(struct ast_channel *chan)
void ast_channel_internal_swap_snapshots(struct ast_channel *a, struct ast_channel *b)
Swap snapshots beteween two channels.
void ast_channel_music_state_set(struct ast_channel *chan, void *value)
unsigned int ast_channel_emulate_dtmf_duration(const struct ast_channel *chan)
struct ast_filestream * ast_channel_stream(const struct ast_channel *chan)
void ast_channel_internal_fd_clear(struct ast_channel *chan, int which)
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
void ast_channel_fout_set(struct ast_channel *chan, unsigned int value)
struct ast_autochan_list * ast_channel_autochans(struct ast_channel *chan)
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
void ast_channel_zone_set(struct ast_channel *chan, struct ast_tone_zone *value)
struct ast_channel * ast_channel_masqr(const struct ast_channel *chan)
int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
enum ast_channel_state ast_channel_state(const struct ast_channel *chan)
struct timeval * ast_channel_dtmf_tv(struct ast_channel *chan)
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
char ast_channel_sending_dtmf_digit(const struct ast_channel *chan)
int ast_channel_visible_indication(const struct ast_channel *chan)
struct ast_timer * ast_channel_timer(const struct ast_channel *chan)
struct ast_hangup_handler_list * ast_channel_hangup_handlers(struct ast_channel *chan)
void ast_channel_transfercapability_set(struct ast_channel *chan, unsigned short value)
unsigned long ast_channel_outsmpl(const struct ast_channel *chan)
void ast_channel_masqr_set(struct ast_channel *chan, struct ast_channel *value)
void ast_channel_internal_finalize(struct ast_channel *chan)
void ast_channel_internal_alertpipe_clear(struct ast_channel *chan)
void ast_channel_priority_set(struct ast_channel *chan, int value)
#define DIALED_CAUSES_BUCKETS
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
void ast_channel_internal_errno_set(enum ast_channel_error error)
void ast_channel_whentohangup_set(struct ast_channel *chan, struct timeval *value)
void ast_channel_pickupgroup_set(struct ast_channel *chan, ast_group_t value)
static int pvt_cause_hash_fn(const void *vpc, const int flags)
Hash function for pvt cause code frames.
int ast_channel_fd_isset(const struct ast_channel *chan, int which)
void ast_channel_adsicpe_set(struct ast_channel *chan, enum ast_channel_adsicpe value)
void ast_channel_dialed_causes_clear(const struct ast_channel *chan)
Clear all cause information from the channel.
#define DEFINE_STRINGFIELD_SETTERS_AND_INVALIDATE_FOR(field, publish, assert_on_null, invalidate)
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
int ast_channel_internal_alertpipe_init(struct ast_channel *chan)
void ast_channel_sched_set(struct ast_channel *chan, struct ast_sched_context *value)
void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
const char * ast_channel_exten(const struct ast_channel *chan)
int ast_channel_is_t38_active(struct ast_channel *chan)
This function will check if T.38 is active on the channel.
struct ast_datastore_list * ast_channel_datastores(struct ast_channel *chan)
void ast_channel_masq_set(struct ast_channel *chan, struct ast_channel *value)
void ast_channel_varshead_set(struct ast_channel *chan, struct varshead *value)
void ast_channel_pbx_set(struct ast_channel *chan, struct ast_pbx *value)
struct ast_channel * ast_channel_internal_oldest_linkedid(struct ast_channel *a, struct ast_channel *b)
Determine which channel has an older linkedid.
void ast_channel_set_writeformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_vstream_set(struct ast_channel *chan, struct ast_filestream *value)
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
int ast_channel_alert_writable(struct ast_channel *chan)
ast_channel_state
ast_channel states
ast_media_type
Types of media.
#define SCOPE_EXIT_RTN(...)
#define SCOPE_EXIT_RTN_VALUE(__return_value,...)
#define SCOPE_ENTER(level,...)
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
struct stasis_topic * ast_endpoint_topic(struct ast_endpoint *endpoint)
Returns the topic for a specific endpoint.
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.
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_BRIDGE
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CONNECTED
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN
struct ast_frame ast_null_frame
void ast_callid_strnprint(char *buffer, size_t buffer_size, ast_callid callid)
copy a string representation of the callid into a target string
#define ast_debug(level,...)
Log a DEBUG message.
#define AST_CALLID_BUFFER_LENGTH
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Asterisk file paths, configured in asterisk.conf.
const char * ast_config_AST_SYSTEM_NAME
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
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_topology * ast_stream_topology_alloc(void)
Create a stream topology.
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.
void ast_stream_topology_free(struct ast_stream_topology *topology)
Unreference and destroy a stream topology.
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...
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.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define AST_STRING_FIELD(name)
Declare a string field.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
char * ast_tech_to_upper(char *dev_str)
Convert the tech portion of a device string to upper case.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_tmp(init_len, __expr)
Provides a temporary ast_str and returns a copy of its buffer.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Structure to pass both assignedid values to channel drivers.
Structure that contains information regarding a channel in a bridge.
struct ast_channel * chan
Structure that contains information about a bridge.
Responsible for call detail data.
Channel UniqueId structure.
char unique_id[AST_MAX_UNIQUEID]
char tenant_id[AST_MAX_TENANT_ID]
Helper struct for initializing additional channel information on channel creation.
uint32_t version
struct ABI version
Structure representing a snapshot of channel state.
Structure to describe a channel "technology", ie a channel driver See for examples:
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)
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....
Main Channel structure associated with a channel.
struct ast_filestream * stream
struct ast_stream * default_streams[AST_MEDIA_TYPE_END]
struct ast_channel_id uniqueid
struct stasis_topic * topic
const ast_string_field language
const ast_string_field latest_musicclass
struct ast_bridge_channel * bridge_channel
struct ast_framehook_list * framehooks
const ast_string_field dialcontext
char lastexten[AST_MAX_EXTENSION]
struct timeval creationtime
char lastcontext[AST_MAX_CONTEXT]
const ast_string_field musicclass
struct ast_sched_context * sched
struct ast_channel_snapshot * snapshot
struct ast_datastore_list datastores
struct ast_tone_zone * zone
struct ao2_container * dialed_causes
ast_timing_func_t timingfunc
const ast_string_field peeraccount
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.
const ast_string_field accountcode
struct ast_trans_pvt * writetrans
struct timeval whentohangup
const ast_string_field userfield
unsigned short transfercapability
char dtmf_digit_to_emulate
unsigned int emulate_dtmf_duration
void * stream_topology_change_source
struct ast_channel::@331 fds
struct ast_readq_list readq
const ast_string_field call_forward
struct ast_format * rawreadformat
char exten[AST_MAX_EXTENSION]
const ast_string_field parkinglot
struct ast_party_connected_line connected_indicated
Channel Connected Line ID information that was last indicated.
struct ast_namedgroups * named_pickupgroups
struct stasis_forward * endpoint_forward
struct ast_flags snapshot_segment_flags
struct ast_trans_pvt * readtrans
struct ast_namedgroups * named_callgroups
struct ast_hangup_handler_list hangup_handlers
const struct ast_channel_tech * tech
struct ast_format * writeformat
struct ast_channel_id linkedid
enum ast_channel_state state
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
struct ast_channel * masqr
struct ast_party_dialed dialed
Dialed/Called information.
char context[AST_MAX_CONTEXT]
const ast_string_field name
struct ast_filestream * vstream
struct timeval answertime
struct ast_format * readformat
struct ast_audiohook_list * audiohooks
struct ast_format * oldwriteformat
struct stasis_forward * channel_forward
struct ast_channel * masq
struct ast_format_cap * nativeformats
const ast_string_field hangupsource
struct ast_autochan_list autochans
struct ast_stream_topology * stream_topology
struct ast_party_caller caller
Channel Caller ID information.
char chan_name[AST_CHANNEL_NAME]
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
Structure used to handle boolean flags.
Data structure associated with a single frame of data.
General jitterbuffer state.
Caller Party information.
Connected Line/Party information.
Dialed/Called Party information.
Information needed to identify an endpoint in a call.
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
Support for dynamic strings.
A set of tones for a given locale.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
#define ast_test_suite_event_notify(s, f,...)
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
int error(const char *format,...)
#define ast_set_flag(p, flag)
Vector container support.
#define AST_VECTOR_REPLACE(vec, idx, elem)
Replace an element at a specific position in a vector, growing the vector if needed.
#define AST_VECTOR_RESET(vec, cleanup)
Reset vector.
#define AST_VECTOR_ELEM_CLEANUP_NOOP(elem)
Vector element cleanup that does nothing.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
#define AST_VECTOR(name, type)
Define a vector structure.
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.