123 #ifndef _ASTERISK_CHANNEL_H
124 #define _ASTERISK_CHANNEL_H
131 #if defined(__cplusplus) || defined(c_plusplus)
135 #define AST_MAX_EXTENSION 80
136 #define AST_MAX_CONTEXT 80
137 #define AST_CHANNEL_NAME 80
138 #define MAX_LANGUAGE 40
139 #define MAX_MUSICCLASS 80
156 #define DATASTORE_INHERIT_FOREVER INT_MAX
158 #define AST_MAX_FDS 10
163 #define AST_ALERT_FD (AST_MAX_FDS-1)
164 #define AST_TIMING_FD (AST_MAX_FDS-2)
165 #define AST_AGENT_FD (AST_MAX_FDS-3)
166 #define AST_GENERATOR_FD (AST_MAX_FDS-4)
484 #define AST_CHAN_WRITE_INFO_T_VERSION 1
488 const char *
function;
648 #define DEBUGCHAN_FLAG 0x80000000
651 #define FRAMECOUNT_INC(x) ( ((x) & DEBUGCHAN_FLAG) | (((x)+1) & ~DEBUGCHAN_FLAG) )
1079 __attribute__((deprecated));
1087 __attribute__((deprecated));
1138 const
char *
cid_name, const
char *acctcode,
1140 const
char *
linkedid, const
int amaflag,
1141 const
char *file,
int line, const
char *function,
1142 const
char *name_fmt, ...);
1154 #define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, linkedid, amaflag, ...) \
1155 __ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, linkedid, amaflag, \
1156 __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
1158 #if defined(REF_DEBUG) || defined(__AST_DEBUG_MALLOC)
1175 #define ast_dummy_channel_alloc() __ast_dummy_channel_alloc(__FILE__, __LINE__, __PRETTY_FUNCTION__)
1176 struct ast_channel *__ast_dummy_channel_alloc(
const char *file,
int line,
const char *
function);
1282 const void *data,
size_t datalen);
1349 int timeout,
int *reason,
const char *cid_num,
const char *cid_name);
1367 int timeout,
int *reason,
const char *cid_num,
const char *cid_name,
struct outgoing_helper *oh);
1403 #ifdef CHANNEL_TRACE
1408 int ast_channel_trace_update(
struct ast_channel *chan);
1414 int ast_channel_trace_enable(
struct ast_channel *chan);
1421 int ast_channel_trace_disable(
struct ast_channel *chan);
1427 int ast_channel_trace_is_enabled(
struct ast_channel *chan);
1745 int *
fds,
int nfds,
int *exception,
int *outfd,
int *ms);
1932 #define AST_BRIDGE_DTMF_CHANNEL_0 (1 << 0)
1934 #define AST_BRIDGE_DTMF_CHANNEL_1 (1 << 1)
1936 #define AST_BRIDGE_REC_CHANNEL_0 (1 << 2)
1938 #define AST_BRIDGE_REC_CHANNEL_1 (1 << 3)
1940 #define AST_BRIDGE_IGNORE_SIGS (1 << 4)
2042 int transferee_held);
2393 pfd->events = POLLIN | POLLPRI;
2398 static inline int ast_fdisset(
struct pollfd *pfds,
int fd,
int maximum,
int *start)
2407 for (x = *start; x < maximum; x++)
2408 if (pfds[x].fd == fd) {
2411 return pfds[x].revents;
2420 int datalen =
sizeof(
state);
2427 #define CHECK_BLOCKING(c) do { \
2428 if (ast_test_flag(c, AST_FLAG_BLOCKING)) {\
2429 ast_debug(1, "Thread %p is blocking '%s', already blocked by thread %p in procedure %s\n", \
2430 (void *) pthread_self(), (c)->name, (void *) (c)->blocker, (c)->blockproc); \
2432 (c)->blocker = pthread_self(); \
2433 (c)->blockproc = __PRETTY_FUNCTION__; \
2434 ast_set_flag(c, AST_FLAG_BLOCKING); \
2466 #define ast_channel_lock(chan) ao2_lock(chan)
2467 #define ast_channel_unlock(chan) ao2_unlock(chan)
2468 #define ast_channel_trylock(chan) ao2_trylock(chan)
2473 #define ast_channel_lock_both(chan1, chan2) do { \
2474 ast_channel_lock(chan1); \
2475 while (ast_channel_trylock(chan2)) { \
2476 ast_channel_unlock(chan1); \
2478 ast_channel_lock(chan1); \
2491 #define ast_channel_ref(c) ({ ao2_ref(c, +1); (c); })
2502 #define ast_channel_unref(c) ({ ao2_ref(c, -1); (struct ast_channel *) (NULL); })
2606 void *data,
int ao2_flags);
3406 const char *structure_name);
3526 #if defined(__cplusplus) || defined(c_plusplus)
int(* func_channel_read)(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len)
Provide additional read items for CHANNEL() dialplan function.
const ast_string_field peeraccount
void ast_party_connected_line_collect_caller(struct ast_party_connected_line *connected, struct ast_party_caller *caller)
Collect the caller party information into a connected line structure.
static enum ast_t38_state ast_channel_get_t38_state(struct ast_channel *chan)
Retrieves the current T38 state of a channel.
struct ast_channel * ast_waitfor_n(struct ast_channel **chan, int n, int *ms)
Waits for input on a group of channels Wait for input on an array of channels for a given # of millis...
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
void ast_party_name_copy(struct ast_party_name *dest, const struct ast_party_name *src)
Copy the source party name information to the destination party name.
int ast_queue_hangup(struct ast_channel *chan)
Queue a hangup frame.
unsigned long long ast_group_t
union ast_frame_subclass subclass
int ast_hangup(struct ast_channel *chan)
Hang up a channel.
int ast_channel_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
Bridge two channels together (early)
Information needed to identify an endpoint in a call.
enum sip_cc_notify_state state
int ast_recvchar(struct ast_channel *chan, int timeout)
Receives a text character from a channel.
void ast_party_connected_line_init(struct ast_party_connected_line *init)
Initialize the given connected line structure.
int presentation
Q.931 encoded presentation-indicator encoded field.
struct ast_channel * masqr
void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char *cid_name, const char *cid_ani)
Set caller ID number, name and ANI and generate AMI event.
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
void ast_party_redirecting_set(struct ast_party_redirecting *dest, const struct ast_party_redirecting *src, const struct ast_set_party_redirecting *update)
Set the redirecting information based on another redirecting source.
struct ast_channel * ast_channel_get_by_exten(const char *exten, const char *context)
Find a channel by extension and context.
int ast_connected_line_build_data(unsigned char *data, size_t datalen, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Build the connected line information data frame.
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
char * str
Subscriber phone number (Malloced)
struct ast_channel * masq
struct ast_party_connected_line connected
Channel Connected Line ID information.
Asterisk locking-related definitions:
struct ast_channel * ast_channel_iterator_next(struct ast_channel_iterator *i)
Get the next channel for a channel iterator.
void ast_poll_channel_add(struct ast_channel *chan0, struct ast_channel *chan1)
struct ast_channel *(*const requester)(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause)
Requester - to set up call data structures (pvt's)
int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset)
Compare a offset with the settings of when to hang a channel up.
void(* end_bridge_callback_data_fixup)(struct ast_bridge_config *bconfig, struct ast_channel *originator, struct ast_channel *terminator)
int(*const send_image)(struct ast_channel *chan, struct ast_frame *frame)
Display or send an image.
static const char config[]
The data tree to be returned by the callbacks and managed by functions local to this file...
char * str
Subscriber phone number (Malloced)
void ast_channel_set_caller_event(struct ast_channel *chan, const struct ast_party_caller *caller, const struct ast_set_party_caller *update)
Set the caller id information in the Asterisk channel and generate an AMI event if the caller id name...
int(*const write_video)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame with payload.
int ast_redirecting_parse_data(const unsigned char *data, size_t datalen, struct ast_party_redirecting *redirecting)
Parse redirecting indication frame data.
struct timeval feature_start_time
struct ast_party_caller caller
Channel Caller ID information.
int ast_write_text(struct ast_channel *chan, struct ast_frame *frame)
Write text frame to a channel This function writes the given frame to the indicated channel...
struct ast_tone_zone * zone
struct ast_set_party_id ani
int ast_autoservice_start(struct ast_channel *chan)
Automatically service a channel for us...
void ast_party_number_set_init(struct ast_party_number *init, const struct ast_party_number *guide)
Initialize the given party number structure using the given guide for a set update operation...
struct ast_channel_tech * ast_get_channel_tech(const char *name)
Get a channel technology structure by name.
const ast_string_field uniqueid
struct ast_flags features_callee
int presentation
Q.931 presentation-indicator and screening-indicator encoded fields.
channelreloadreason
Channel reload reasons for manager events at load or reload of configuration.
int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clone)
Weird function made for call transfers.
struct ast_channel * parent_channel
struct ast_party_id id
Connected party ID.
void ast_party_connected_line_set_init(struct ast_party_connected_line *init, const struct ast_party_connected_line *guide)
Initialize the given connected line structure using the given guide for a set update operation...
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. ...
int __ast_answer(struct ast_channel *chan, unsigned int delay, int cdr_answer)
Answer a channel, with a selectable delay before returning.
void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Set when to hang a channel up.
int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params)
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
struct ast_party_name name
Subscriber name.
void ast_channel_unregister(const struct ast_channel_tech *tech)
Unregister a channel technology.
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
int ast_channel_queryoption(struct ast_channel *channel, int option, void *data, int *datalen, int block)
Checks the value of an option.
void ast_channel_update_redirecting(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Indicate that the redirecting id has changed.
char context[AST_MAX_CONTEXT]
int(*const send_digit_begin)(struct ast_channel *chan, char digit)
Start sending a literal DTMF digit.
struct ast_variable * ast_channeltype_list(void)
return an ast_variable list of channeltypes
struct ast_channel * ast_channel_release(struct ast_channel *chan)
Unlink and release reference to a channel.
int ast_channel_supports_html(struct ast_channel *channel)
Checks for HTML support on a channel.
int ast_check_hangup_locked(struct ast_channel *chan)
struct ast_channel * __ast_request_and_dial(const char *type, format_t format, const struct ast_channel *requestor, void *data, int timeout, int *reason, const char *cid_num, const char *cid_name, struct outgoing_helper *oh)
Request a channel of a given type, with data as optional information used by the low level module and...
static int ast_fdisset(struct pollfd *pfds, int fd, int maximum, int *start)
Helper function for migrating select to poll.
int ast_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
static void dummy(char *unused,...)
void ast_channel_update_connected_line(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Indicate that the connected line information has changed.
void ast_party_caller_set(struct ast_party_caller *dest, const struct ast_party_caller *src, const struct ast_set_party_caller *update)
Set the caller information based on another caller source.
void ast_begin_shutdown(int hangup)
static int ast_add_fd(struct pollfd *pfd, int fd)
if fd is a valid descriptor, set *pfd with the descriptor
int ast_settimeout_full(struct ast_channel *c, unsigned int rate, int(*func)(const void *data), void *data, unsigned int is_ao2_obj)
struct ast_datastore_info * info
void ast_party_id_copy(struct ast_party_id *dest, const struct ast_party_id *src)
Copy the source party id information to the destination party id.
Structure for variables, used for configurations and for channel variables.
int ast_channel_datastore_free(struct ast_datastore *datastore)
Free a channel data store object.
struct ast_generator * generator
unsigned int emulate_dtmf_duration
void ast_set_variables(struct ast_channel *chan, struct ast_variable *vars)
adds a list of channel variables to a channel
int(* cc_callback)(struct ast_channel *inbound, const char *dest, ast_cc_callback_fn callback)
Call a function with cc parameters as a function parameter.
void ast_channel_set_caller(struct ast_channel *chan, const struct ast_party_caller *caller, const struct ast_set_party_caller *update)
Set the caller id information in the Asterisk channel.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
struct ast_frame *(*const read)(struct ast_channel *chan)
Read a frame, in standard format (see frame.h)
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
int char_set
Character set the name is using.
Structure for a data store type.
Configuration File Parser.
ast_channel_state
ast_channel states
char * str
Subscriber name (Malloced)
int ast_indicate_data(struct ast_channel *chan, int condition, const void *data, size_t datalen)
Indicates condition of channel, with payload.
unsigned long global_fout
struct timeval nexteventts
ast_t38_state
Possible T38 states on channels.
void ast_party_caller_free(struct ast_party_caller *doomed)
Destroy the caller party contents.
unsigned char valid
TRUE if the subaddress information is valid/present.
int(*const send_digit_end)(struct ast_channel *chan, char digit, unsigned int duration)
Stop sending a literal DTMF digit.
format_t ast_best_codec(format_t fmts)
Pick the best audio codec.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
int ani2
Automatic Number Identification 2 (Info Digits)
unsigned short transfercapability
int ast_channel_register(const struct ast_channel_tech *tech)
Register a channel technology (a new channel driver) Called by a channel module to register the kind ...
void ast_party_id_free(struct ast_party_id *doomed)
Destroy the party id contents.
Structure for a data store object.
void ast_party_connected_line_free(struct ast_party_connected_line *doomed)
Destroy the connected line information contents.
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
int(*const queryoption)(struct ast_channel *chan, int option, void *data, int *datalen)
Query a given option. Called with chan locked.
int ast_channel_connected_line_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const void *connected_info, int caller, int frame)
Run a connected line interception macro and update a channel's connected line information.
int ast_prod(struct ast_channel *chan)
Send empty audio to prime a channel driver.
const char * ast_state2str(enum ast_channel_state)
Gives the string form of a given channel state.
struct ast_datastore *attribute_malloc ast_channel_datastore_alloc(const struct ast_datastore_info *info, const char *uid)
Create a channel data store object.
int ast_senddigit_begin(struct ast_channel *chan, char digit)
Send a DTMF digit to a channel.
char * str
Malloced subaddress string.
int ast_senddigit(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel.
Common implementation-independent jitterbuffer stuff.
int(* ast_acf_read2_fn_t)(struct ast_channel *, const char *, char *, struct ast_str **, ssize_t)
Typedef for a custom read2 function.
const ast_string_field linkedid
int ast_channel_setoption(struct ast_channel *channel, int option, void *data, int datalen, int block)
Sets an option on a channel.
int(*const fixup)(struct ast_channel *oldchan, struct ast_channel *newchan)
Fix up a channel: If a channel is consumed, this is called. Basically update any ->owner links...
enum ast_channel_adsicpe adsicpe
static char cid_num[AST_MAX_EXTENSION]
struct ast_channel * ast_waitfor_nandfds(struct ast_channel **chan, int n, int *fds, int nfds, int *exception, int *outfd, int *ms)
Waits for activity on a group of channels.
unsigned char odd_even_indicator
TRUE if odd number of address signals.
Indicate what information in ast_party_caller should be set.
struct ast_variable * vars
struct ast_cc_config_params * ast_channel_get_cc_config_params(struct ast_channel *chan)
Get the CCSS parameters from a channel.
int(*const answer)(struct ast_channel *chan)
Answer the channel.
String fields in structures.
char * ast_print_group(char *buf, int buflen, ast_group_t group)
print call- and pickup groups into buffer
void ast_party_caller_copy(struct ast_party_caller *dest, const struct ast_party_caller *src)
Copy the source caller information to the destination caller.
int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
Queue a hangup frame with hangupcause set.
struct ast_channel * ast_channel_get_by_name_prefix(const char *name, size_t name_len)
Find a channel by a name prefix.
void ast_party_dialed_set(struct ast_party_dialed *dest, const struct ast_party_dialed *src)
Set the dialed information based on another dialed source.
struct ast_set_party_id from
int ast_channel_defer_dtmf(struct ast_channel *chan)
Defers DTMF so that you only read things like hangups and audio.
Asterisk datastore objects.
void ast_party_id_set(struct ast_party_id *dest, const struct ast_party_id *src, const struct ast_set_party_id *update)
Set the source party id information into the destination party id.
struct ast_party_id id
Caller party ID.
int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc)
Bridge two channels together.
int ast_set_write_format(struct ast_channel *chan, format_t format)
Sets write format on channel chan Set write format for channel to whichever component of "format" is ...
void ast_change_name(struct ast_channel *chan, const char *newname)
Change channel name.
int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *to)
Inherit datastores from a parent to a child.
int ast_set_read_format(struct ast_channel *chan, format_t format)
Sets read format on channel chan Set read format for channel to whichever component of "format" is be...
int(*const setoption)(struct ast_channel *chan, int option, void *data, int datalen)
Set a given option. Called with chan locked.
int ast_channel_data_add_structure(struct ast_data *tree, struct ast_channel *chan, int add_bridged)
Insert into an astdata tree, the channel structure.
int ast_waitfor_n_fd(int *fds, int n, int *ms, int *exception)
Waits for input on an fd.
void ast_channel_queue_connected_line_update(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Queue a connected line update frame on a channel.
struct ast_party_id ani
Automatic Number Identification (ANI)
struct ast_channel * ast_call_forward(struct ast_channel *caller, struct ast_channel *orig, int *timeout, format_t format, struct outgoing_helper *oh, int *outstate)
Forwards a call to a new channel specified by the original channel's call_forward str...
struct ast_channel * chan
int(* set_base_channel)(struct ast_channel *chan, struct ast_channel *base)
Set base channel (agent and local)
struct ast_party_dialed::@155 number
Dialed/Called number.
int ast_raw_answer(struct ast_channel *chan, int cdr_answer)
Answer a channel.
void ast_set_hangupsource(struct ast_channel *chan, const char *source, int force)
Set the source of the hangup in this channel and it's bridge.
int(*const hangup)(struct ast_channel *chan)
Hangup (and possibly destroy) the channel.
void ast_channel_clear_softhangup(struct ast_channel *chan, int flag)
Clear a set of softhangup flags from a channel.
void ast_channel_undefer_dtmf(struct ast_channel *chan)
Unset defer DTMF flag on channel.
struct timeval start_time
int ast_write_video(struct ast_channel *chan, struct ast_frame *frame)
Write video frame to a channel This function writes the given frame to the indicated channel...
A set of tones for a given locale.
static struct ast_generator gen
void ast_party_subaddress_free(struct ast_party_subaddress *doomed)
Destroy the party subaddress contents.
int ast_senddigit_end(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel.
int ast_channel_data_cmp_structure(const struct ast_data_search *tree, struct ast_channel *chan, const char *structure_name)
Compare to channel structures using the data api.
struct ast_audiohook_list * audiohooks
Asterisk internal frame definitions.
#define AST_MAX_EXTENSION
int ast_settimeout(struct ast_channel *c, unsigned int rate, int(*func)(const void *data), void *data)
Enable or disable timer ticks for a channel.
Scheduler Routines (derived from cheops)
#define AST_STRING_FIELD(name)
Declare a string field.
void ast_party_number_init(struct ast_party_number *init)
Initialize the given number structure.
void * end_bridge_callback_data
Caller Party information.
int(*const write_text)(struct ast_channel *chan, struct ast_frame *frame)
Write a text frame, in standard format.
int ast_shutting_down(void)
Returns non-zero if Asterisk is being shut down.
int ast_softhangup(struct ast_channel *chan, int reason)
Softly hangup up a channel.
const ast_string_field parkinglot
int ast_internal_timing_enabled(struct ast_channel *chan)
Check if the channel can run in internal timing mode.
int ast_channel_get_cc_agent_type(struct ast_channel *chan, char *agent_type, size_t size)
Find the appropriate CC agent type to use given a channel.
struct sched_context * sched
struct ast_set_party_id id
struct ast_frame *(*const exception)(struct ast_channel *chan)
Handle an exception, reading a frame.
A set of macros to manage forward-linked lists.
void ast_channel_set_redirecting(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Set the redirecting id information in the Asterisk channel.
int(* timingfunc)(const void *data)
void ast_channel_set_linkgroup(struct ast_channel *chan, struct ast_channel *peer)
propagate the linked id between chan and peer
struct ast_channel * _bridge
ast_group_t ast_get_group(const char *s)
int(* ast_acf_read_fn_t)(struct ast_channel *, const char *, char *, char *, size_t)
Typedef for a custom read function.
struct ast_party_id ani
Automatic Number Identification (ANI)
Structure to describe a channel "technology", ie a channel driver See for examples: ...
const ast_string_field dialcontext
int ast_channel_cc_params_init(struct ast_channel *chan, const struct ast_cc_config_params *base_params)
Set up datastore with CCSS parameters for a channel.
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_party_number_free(struct ast_party_number *doomed)
Destroy the party number contents.
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
struct ast_flags features_caller
void ast_party_subaddress_set_init(struct ast_party_subaddress *init, const struct ast_party_subaddress *guide)
Initialize the given party subaddress structure using the given guide for a set update operation...
struct ast_channel * ast_channel_callback(ao2_callback_data_fn *cb_fn, void *arg, void *data, int ao2_flags)
Call a function with every active channel.
struct ast_channel * chan
The list of nodes with their search requirement.
ast_acf_write_fn_t write_fn
enum ast_bridge_result(*const bridge)(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms)
Bridge two channels of the same type together.
struct ast_party_dialed dialed
Dialed/Called information.
struct ast_silence_generator * ast_channel_start_silence_generator(struct ast_channel *chan)
Starts a silence generator on the given channel.
struct ast_trans_pvt * writetrans
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
struct ast_party_subaddress subaddress
Subscriber subaddress.
Dialed/Called Party information.
int ast_connected_line_parse_data(const unsigned char *data, size_t datalen, struct ast_party_connected_line *connected)
Parse connected line indication frame data.
Responsible for call detail data.
Structure that contains information about a bridge.
Indicate what information in ast_party_id should be set.
ast_control_frame_type
Internal control frame subtype field values.
struct ast_channel_tech ast_kill_tech
Kill the channel channel driver technology descriptor.
void ast_party_dialed_init(struct ast_party_dialed *init)
Initialize the given dialed structure.
int ast_channel_transfer_masquerade(struct ast_channel *target_chan, const struct ast_party_connected_line *target_id, int target_held, struct ast_channel *transferee_chan, const struct ast_party_connected_line *transferee_id, int transferee_held)
Setup a masquerade to transfer a call.
void ast_party_caller_set_init(struct ast_party_caller *init, const struct ast_party_caller *guide)
Initialize the given caller structure using the given guide for a set update operation.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
void ast_party_name_set(struct ast_party_name *dest, const struct ast_party_name *src)
Set the source party name information into the destination party name.
struct timeval sending_dtmf_tv
char * ast_recvtext(struct ast_channel *chan, int timeout)
Receives a text string from a channel Read a string of text from a channel.
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.
const ast_string_field call_forward
void ast_party_name_init(struct ast_party_name *init)
Initialize the given name structure.
void ast_party_connected_line_set(struct ast_party_connected_line *dest, const struct ast_party_connected_line *src, const struct ast_set_party_connected_line *update)
Set the connected line information based on another connected line source.
struct ast_framehook_list * framehooks
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ani2
Automatic Number Identification 2 (Info Digits)
enum ast_channel_state _state
#define AST_OPTION_T38_STATE
struct ast_channel * ast_bridged_channel(struct ast_channel *chan)
Find bridged channel.
struct ast_channel_iterator * ast_channel_iterator_by_exten_new(const char *exten, const char *context)
Create a new channel iterator based on extension.
void(* release)(struct ast_channel *chan, void *data)
Connected Line/Party information.
const ast_string_field name
void ast_party_id_set_init(struct ast_party_id *init, const struct ast_party_id *guide)
Initialize the given party id structure using the given guide for a set update operation.
void ast_party_name_set_init(struct ast_party_name *init, const struct ast_party_name *guide)
Initialize the given party name structure using the given guide for a set update operation.
const ast_string_field hangupsource
void ast_party_name_free(struct ast_party_name *doomed)
Destroy the party name contents.
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
int ast_softhangup_nolock(struct ast_channel *chan, int reason)
Softly hangup up a channel (no channel lock)
int ast_channel_sendhtml(struct ast_channel *channel, int subclass, const char *data, int datalen)
Sends HTML on given channel Send HTML or URL on link.
struct ast_bridge * bridge
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
General jitterbuffer state.
int ast_channel_sendurl(struct ast_channel *channel, const char *url)
Sends a URL on a given link Send URL on link.
int(*const send_html)(struct ast_channel *chan, int subclass, const char *data, int len)
Send HTML data.
int(*const transfer)(struct ast_channel *chan, const char *newdest)
Blind transfer other side (see app_transfer.c and ast_transfer()
void ast_channel_stop_silence_generator(struct ast_channel *chan, struct ast_silence_generator *state)
Stops a previously-started silence generator on the given channel.
const char * ast_cause2str(int state) attribute_pure
Gives the string form of a given cause code.
int(*const send_text)(struct ast_channel *chan, const char *text)
Display or transmit text.
void ast_channel_inherit_variables(const struct ast_channel *parent, struct ast_channel *child)
Inherits channel variable from parent to child channel.
int source
Information about the source of an update.
char macrocontext[AST_MAX_CONTEXT]
void ast_cancel_shutdown(void)
Cancel a shutdown in progress.
struct ast_filestream * vstream
Structure to handle passing func_channel_write info to channels via setoption.
Call Completion Supplementary Services API.
struct ast_channel *attribute_malloc __ast_channel_alloc(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const char *linkedid, const int amaflag, const char *file, int line, const char *function, const char *name_fmt,...)
Create a channel structure.
struct ast_channel *(*const bridged_channel)(struct ast_channel *chan, struct ast_channel *bridge)
Find bridged channel.
int ast_write(struct ast_channel *chan, struct ast_frame *frame)
Write a frame to a channel This function writes the given frame to the indicated channel.
void ast_party_number_copy(struct ast_party_number *dest, const struct ast_party_number *src)
Copy the source party number information to the destination party number.
int ast_call(struct ast_channel *chan, char *addr, int timeout)
Make a call.
const ast_string_field userfield
struct ast_party_subaddress subaddress
Dialed/Called subaddress.
void ast_party_id_init(struct ast_party_id *init)
Initialize the given party id structure.
void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset)
Set when to hang a channel up.
const char *const description
int ast_autoservice_ignore(struct ast_channel *chan, enum ast_frame_type ftype)
Ignore certain frame types.
Structure used to handle boolean flags.
struct ast_channel_iterator * ast_channel_iterator_by_name_new(const char *name, size_t name_len)
Create a new channel iterator based on name.
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
static char cid_name[AST_MAX_EXTENSION]
Indicate what information in ast_party_connected_line should be set.
int(* generate)(struct ast_channel *chan, void *data, int len, int samples)
ast_frame_type
Frame types.
int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int ctrlfd)
Wait for a digit Same as ast_waitfordigit() with audio fd for outputting read audio and ctrlfd to mon...
int(*const write)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format (see frame.h)
char macroexten[AST_MAX_EXTENSION]
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
char * tag
User-set "tag".
struct ast_set_party_id id
void ast_deactivate_generator(struct ast_channel *chan)
int type
Q.931 subaddress type.
void ast_poll_channel_del(struct ast_channel *chan0, struct ast_channel *chan1)
int transit_network_select
Transit Network Select.
void ast_party_redirecting_free(struct ast_party_redirecting *doomed)
Destroy the redirecting information contents.
int(*const call)(struct ast_channel *chan, char *addr, int timeout)
Call a given phone number (address, etc), but don't take longer than timeout seconds to do so...
int(*const devicestate)(void *data)
void ast_party_connected_line_copy(struct ast_party_connected_line *dest, const struct ast_party_connected_line *src)
Copy the source connected line information to the destination connected line.
struct ast_set_party_id to
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
int ast_channel_make_compatible(struct ast_channel *c0, struct ast_channel *c1)
Makes two channel formats compatible.
Channels have this property if they can create jitter; i.e. most VoIP channels.
Indicate what information in ast_party_redirecting should be set.
struct ast_channel * ast_request_and_dial(const char *type, format_t format, const struct ast_channel *requestor, void *data, int timeout, int *reason, const char *cid_num, const char *cid_name)
Request a channel of a given type, with data as optional information used by the low level module and...
void ast_tonepair_stop(struct ast_channel *chan)
int count
Number of times the call was redirected.
struct ast_party_id to
Call is redirecting to a new party (Sent to the caller)
void ast_connected_line_copy_from_caller(struct ast_party_connected_line *dest, const struct ast_party_caller *src)
Copy the caller information to the connected line information.
void ast_party_subaddress_init(struct ast_party_subaddress *init)
Initialize the given subaddress structure.
enum ast_bridge_result(*const early_bridge)(struct ast_channel *c0, struct ast_channel *c1)
Bridge two channels of the same type together (early)
struct ast_set_party_id ani
struct ast_group_info::@157 group_list
void ast_party_redirecting_init(struct ast_party_redirecting *init)
Initialize the given redirecting structure.
int ast_readstring_full(struct ast_channel *c, char *s, int len, int timeout, int rtimeout, char *enders, int audiofd, int ctrlfd)
struct ast_channel_iterator * ast_channel_iterator_destroy(struct ast_channel_iterator *i)
Destroy a channel iterator.
Information needed to specify a number in a call.
int ast_answer(struct ast_channel *chan)
Answer a channel.
char * ast_transfercapability2str(int transfercapability) attribute_const
Gives the string form of a given transfer capability.
int ast_queue_control_data(struct ast_channel *chan, enum ast_control_frame_type control, const void *data, size_t datalen)
Queue a control frame with payload.
int ast_transfer(struct ast_channel *chan, char *dest)
Transfer a channel (if supported).
const ast_string_field musicclass
int ast_is_deferrable_frame(const struct ast_frame *frame)
Should we keep this frame for later?
int ast_channel_get_device_name(struct ast_channel *chan, char *device_name, size_t name_buffer_length)
Get a device name given its channel structure.
const ast_string_field accountcode
Data structure associated with a single frame of data.
void ast_party_redirecting_set_init(struct ast_party_redirecting *init, const struct ast_party_redirecting *guide)
Initialize the given redirecting id structure using the given guide for a set update operation...
void ast_connected_line_copy_to_caller(struct ast_party_caller *dest, const struct ast_party_connected_line *src)
Copy the connected line information to the caller information.
int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
void ast_party_dialed_free(struct ast_party_dialed *doomed)
Destroy the dialed party contents.
Channels have this property if they can accept input with jitter; i.e. most VoIP channels.
struct timeval whentohangup
int ast_str2cause(const char *name) attribute_pure
Convert the string form of a cause code to a number.
const char * warning_sound
void ast_channel_queue_redirecting_update(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Queue a redirecting update frame on a channel.
int ast_safe_sleep_conditional(struct ast_channel *chan, int ms, int(*cond)(void *), void *data)
Wait for a specified amount of time, looking for hangups and a condition argument.
int ast_undestroyed_channels(void)
struct ast_trans_pvt * readtrans
unsigned char valid
TRUE if the name information is valid/present.
const char * ast_channel_reason2str(int reason)
return an english explanation of the code returned thru __ast_request_and_dial's 'outstate' argument ...
const char * channelreloadreason2txt(enum channelreloadreason reason)
Convert enum channelreloadreason to text string for manager event.
static char context[AST_MAX_CONTEXT]
int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int rtimeout, char *enders)
Reads multiple digits.
Information needed to specify a subaddress in a call.
int ast_tonepair(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
struct ast_channel_monitor * monitor
void ast_party_number_set(struct ast_party_number *dest, const struct ast_party_number *src)
Set the source party number information into the destination party number.
struct ast_channel_iterator * ast_channel_iterator_all_new(void)
Create a new channel iterator.
void(* end_bridge_callback)(void *)
int reason
enum AST_REDIRECTING_REASON value for redirection
struct ast_channel * ast_dummy_channel_alloc(void)
Create a fake channel structure.
struct ast_filestream * stream
int ast_queue_frame_head(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to the head of a channel's frame queue.
void ast_party_caller_init(struct ast_party_caller *init)
Initialize the given caller structure.
int(* func_channel_write)(struct ast_channel *chan, const char *function, char *data, const char *value)
Provide additional write items for CHANNEL() dialplan function.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
int(* ast_acf_write_fn_t)(struct ast_channel *, const char *, char *, const char *)
Typedef for a custom write function.
struct ast_channel * ast_request(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *status)
Requests a channel.
static snd_pcm_format_t format
int ast_active_channels(void)
returns number of active/allocated channels
struct ast_channel_tech * tech
struct ast_channel::@156 readq
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
Information needed to specify a name in a call.
struct ast_frame * ast_read_noaudio(struct ast_channel *chan)
Reads a frame, returning AST_FRAME_NULL frame if audio.
int(*const indicate)(struct ast_channel *c, int condition, const void *data, size_t datalen)
Indicate a particular condition (e.g. AST_CONTROL_BUSY or AST_CONTROL_RINGING or AST_CONTROL_CONGESTI...
unsigned char valid
TRUE if the number information is valid/present.
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
const ast_string_field language
void ast_channel_set_connected_line(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Set the connected line information in the Asterisk channel.
int( ao2_callback_data_fn)(void *obj, void *arg, void *data, int flags)
Type of a generic callback function.
int ast_do_masquerade(struct ast_channel *chan)
Start masquerading a channel.
char exten[AST_MAX_EXTENSION]
int ast_redirecting_build_data(unsigned char *data, size_t datalen, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Build the redirecting id data frame.
void ast_party_redirecting_copy(struct ast_party_redirecting *dest, const struct ast_party_redirecting *src)
Copy the source redirecting information to the destination redirecting.
int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Compare a offset with the settings of when to hang a channel up.
void ast_party_dialed_copy(struct ast_party_dialed *dest, const struct ast_party_dialed *src)
Copy the source dialed party information to the destination dialed party.
int ast_channel_redirecting_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const void *redirecting_info, int is_caller, int is_frame)
Run a redirecting interception macro and update a channel's redirecting information.
void ast_party_dialed_set_init(struct ast_party_dialed *init, const struct ast_party_dialed *guide)
Initialize the given dialed structure using the given guide for a set update operation.
void ast_party_subaddress_set(struct ast_party_subaddress *dest, const struct ast_party_subaddress *src)
Set the source party subaddress information into the destination party subaddress.
int ast_sendtext(struct ast_channel *chan, const char *text)
Sends text to a channel.
void(* digit)(struct ast_channel *chan, char digit)