122#ifndef _ASTERISK_CHANNEL_H
123#define _ASTERISK_CHANNEL_H
130#if defined(__cplusplus) || defined(c_plusplus)
134#define AST_MAX_EXTENSION 80
135#define AST_MAX_CONTEXT 80
147#define AST_MAX_PUBLIC_UNIQUEID 149
149#define AST_MAX_TENANT_ID 64
155#define AST_NUM_CHANNEL_BUCKETS 61
157#define AST_NUM_CHANNEL_BUCKETS 1567
170#define AST_MAX_UNIQUEID (AST_MAX_PUBLIC_UNIQUEID + 2 + 1)
172#define AST_MAX_ACCOUNT_CODE 80
173#define AST_CHANNEL_NAME 80
174#define MAX_LANGUAGE 40
175#define MAX_MUSICCLASS 80
176#define AST_MAX_USER_FIELD 256
194#define DATASTORE_INHERIT_FOREVER INT_MAX
196#define AST_MAX_FDS 11
197#define AST_EXTENDED_FDS 12
202#define AST_ALERT_FD (AST_MAX_FDS-1)
203#define AST_TIMING_FD (AST_MAX_FDS-2)
204#define AST_AGENT_FD (AST_MAX_FDS-3)
205#define AST_GENERATOR_FD (AST_MAX_FDS-4)
206#define AST_JITTERBUFFER_FD (AST_MAX_FDS-5)
593 #define AST_CHAN_WRITE_INFO_T_VERSION 1
620 #define AST_CHANNEL_INITIALIZERS_VERSION 1
870struct ast_epoll_data;
877#define DEBUGCHAN_FLAG 0x80000000
880#define FRAMECOUNT_INC(x) ( ((x) & DEBUGCHAN_FLAG) | (((x)+1) & ~DEBUGCHAN_FLAG) )
1092#define AST_FEATURE_DTMF_MASK (AST_FEATURE_REDIRECT | AST_FEATURE_DISCONNECT |\
1093 AST_FEATURE_ATXFER | AST_FEATURE_AUTOMON | AST_FEATURE_PARKCALL | AST_FEATURE_AUTOMIXMON)
1258struct ast_channel * __attribute__((format(printf, 15, 16)))
1260 const
char *cid_name, const
char *acctcode,
1264 const
char *
file,
int line, const
char *function,
1265 const
char *name_fmt, ...);
1279struct
ast_channel * __attribute__((format(printf, 16, 17)))
1281 const
char *cid_name, const
char *acctcode,
1285 const
char *
file,
int line, const
char *function,
1286 const
char *name_fmt, ...);
1299#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag, ...) \
1300 __ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag, NULL, \
1301 __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
1303#define ast_channel_alloc_with_endpoint(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag, endpoint, ...) \
1304 __ast_channel_alloc((needqueue), (state), (cid_num), (cid_name), (acctcode), (exten), (context), (assignedids), (requestor), (amaflag), (endpoint), \
1305 __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
1307#define ast_channel_alloc_with_initializers(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag, endpoint, initializers, ...) \
1308 __ast_channel_alloc_with_initializers((needqueue), (state), (cid_num), (cid_name), (acctcode), (exten), (context), (assignedids), (requestor), (amaflag), (endpoint), \
1309 (initializers), __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
1328#define ast_dummy_channel_alloc() __ast_dummy_channel_alloc(__FILE__, __LINE__, __PRETTY_FUNCTION__)
1442 const void *
data,
size_t datalen);
1574 int timeout,
int *reason,
const char *cid_num,
const char *cid_name);
1593 int timeout,
int *reason,
const char *cid_num,
const char *cid_name,
struct outgoing_helper *oh);
2047 int *
fds,
int nfds,
int *exception,
int *outfd,
int *ms);
2313 unsigned int durationkp,
unsigned int durationst,
int is_external);
2416#define AST_BRIDGE_DTMF_CHANNEL_0 (1 << 0)
2418#define AST_BRIDGE_DTMF_CHANNEL_1 (1 << 1)
2868 pfd->events = POLLIN | POLLPRI;
2873static inline int ast_fdisset(
struct pollfd *pfds,
int fd,
int maximum,
int *start)
2882 for (
x = *start;
x < maximum;
x++)
2883 if (pfds[
x].fd == fd) {
2886 return pfds[
x].revents;
2899 int datalen =
sizeof(
state);
2917#define CHECK_BLOCKING(c) \
2919 if (ast_test_flag(ast_channel_flags(c), AST_FLAG_BLOCKING)) { \
2921 ast_log(LOG_DEBUG, "Thread LWP %d is blocking '%s', already blocked by thread LWP %d in procedure %s\n", \
2922 ast_get_tid(), ast_channel_name(c), \
2923 ast_channel_blocker_tid(c), ast_channel_blockproc(c)); \
2926 ast_channel_blocker_tid_set((c), ast_get_tid()); \
2927 ast_channel_blocker_set((c), pthread_self()); \
2928 ast_channel_blockproc_set((c), __PRETTY_FUNCTION__); \
2929 ast_set_flag(ast_channel_flags(c), AST_FLAG_BLOCKING); \
2938struct ast_namedgroups;
2968#define ast_channel_lock(chan) ao2_lock(chan)
2969#define ast_channel_unlock(chan) ao2_unlock(chan)
2970#define ast_channel_trylock(chan) ao2_trylock(chan)
2975#define ast_channel_lock_both(chan1, chan2) do { \
2976 ast_channel_lock(chan1); \
2977 while (ast_channel_trylock(chan2)) { \
2978 ast_channel_unlock(chan1); \
2980 ast_channel_lock(chan1); \
2993#define ast_channel_ref(c) ({ ao2_ref(c, +1); (c); })
3004#define ast_channel_unref(c) ({ ao2_ref(c, -1); (struct ast_channel *) (NULL); })
3015#define ast_channel_cleanup(c) ({ ao2_cleanup(c); (struct ast_channel *) (NULL); })
3131 void *
data,
int ao2_flags);
4033#if defined(__cplusplus) || defined(c_plusplus)
4084#define DECLARE_STRINGFIELD_SETTERS_FOR(field) \
4085 void ast_channel_##field##_set(struct ast_channel *chan, const char *field); \
4086 void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) __attribute__((format(printf, 2, 0))); \
4087 void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) __attribute__((format(printf, 2, 3)))
4760#define AST_MUTE_DIRECTION_READ (1 << 0)
4761#define AST_MUTE_DIRECTION_WRITE (1 << 1)
4996#define ast_channel_has_tech_function(chan, function) \
4997 (ast_channel_tech(chan) ? ast_channel_tech(chan)->function != NULL : 0)
Common implementation-independent jitterbuffer stuff.
static struct aco_type agent_type
static struct ast_generator gen
static char dialcontext[AST_MAX_CONTEXT]
int() ao2_callback_data_fn(void *obj, void *arg, void *data, int flags)
Type of a generic callback function.
Call Completion Supplementary Services API.
void(* ast_cc_callback_fn)(struct ast_channel *chan, struct ast_cc_config_params *cc_params, const char *monitor_type, const char *const device_name, const char *const dialstring, void *private_data)
Callback made from ast_cc_callback for certain channel types.
static char language[MAX_LANGUAGE]
static char accountcode[AST_MAX_ACCOUNT_CODE]
static void dummy(char *unused,...)
void ast_party_subaddress_copy(struct ast_party_subaddress *dest, const struct ast_party_subaddress *src)
Copy the source party subaddress information to the destination party subaddress.
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)
struct varshead * ast_channel_get_manager_vars(struct ast_channel *chan)
Gets the variables for a given channel, as specified by ast_channel_set_manager_vars().
int ast_senddigit_mf_begin(struct ast_channel *chan, char digit)
Send an MF digit to a channel.
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
int ast_str2cause(const char *name) attribute_pure
Convert the string form of a cause code to a number.
const char * ast_channel_linkedid(const struct ast_channel *chan)
const char * ast_channel_name(const struct ast_channel *chan)
static int ast_fdisset(struct pollfd *pfds, int fd, int maximum, int *start)
Helper function for migrating select to poll.
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
char * ast_print_namedgroups(struct ast_str **buf, struct ast_namedgroups *groups)
Print named call groups and named pickup groups.
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)
void ast_softhangup_all(void)
Soft hangup all active channels.
int ast_channel_request_stream_topology_change(struct ast_channel *chan, struct ast_stream_topology *topology, void *change_source)
Request that the stream topology of a channel change.