122 #ifndef _ASTERISK_CHANNEL_H
123 #define _ASTERISK_CHANNEL_H
125 #include "asterisk/alertpipe.h"
128 #include "asterisk/poll-compat.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
153 #define AST_NUM_CHANNEL_BUCKETS 61
155 #define AST_NUM_CHANNEL_BUCKETS 1567
168 #define AST_MAX_UNIQUEID (AST_MAX_PUBLIC_UNIQUEID + 2 + 1)
170 #define AST_MAX_ACCOUNT_CODE 80
171 #define AST_CHANNEL_NAME 80
172 #define MAX_LANGUAGE 40
173 #define MAX_MUSICCLASS 80
174 #define AST_MAX_USER_FIELD 256
192 #define DATASTORE_INHERIT_FOREVER INT_MAX
194 #define AST_MAX_FDS 11
195 #define AST_EXTENDED_FDS 12
200 #define AST_ALERT_FD (AST_MAX_FDS-1)
201 #define AST_TIMING_FD (AST_MAX_FDS-2)
202 #define AST_AGENT_FD (AST_MAX_FDS-3)
203 #define AST_GENERATOR_FD (AST_MAX_FDS-4)
204 #define AST_JITTERBUFFER_FD (AST_MAX_FDS-5)
206 enum ast_bridge_result {
207 AST_BRIDGE_COMPLETE = 0,
208 AST_BRIDGE_FAILED = -1,
209 AST_BRIDGE_FAILED_NOWARN = -2,
210 AST_BRIDGE_RETRY = -3,
213 typedef unsigned long long ast_group_t;
226 void *(*alloc)(
struct ast_channel *chan,
void *params);
243 AST_PARTY_CHAR_SET_UNKNOWN = 0,
244 AST_PARTY_CHAR_SET_ISO8859_1 = 1,
245 AST_PARTY_CHAR_SET_WITHDRAWN = 2,
246 AST_PARTY_CHAR_SET_ISO8859_2 = 3,
247 AST_PARTY_CHAR_SET_ISO8859_3 = 4,
248 AST_PARTY_CHAR_SET_ISO8859_4 = 5,
249 AST_PARTY_CHAR_SET_ISO8859_5 = 6,
250 AST_PARTY_CHAR_SET_ISO8859_7 = 7,
251 AST_PARTY_CHAR_SET_ISO10646_BMPSTRING = 8,
252 AST_PARTY_CHAR_SET_ISO10646_UTF_8STRING = 9,
591 #define AST_CHAN_WRITE_INFO_T_VERSION 1
595 const char *
function;
605 const char *uniqueid;
606 const char *uniqueid2;
629 const char *
const type;
630 const char *
const description;
850 struct ast_epoll_data;
857 #define DEBUGCHAN_FLAG 0x80000000
860 #define FRAMECOUNT_INC(x) ( ((x) & DEBUGCHAN_FLAG) | (((x)+1) & ~DEBUGCHAN_FLAG) )
868 enum ast_channel_adsicpe {
871 AST_ADSI_UNAVAILABLE,
872 AST_ADSI_OFFHOOKONLY,
899 typedef int(*ast_timing_func_t)(
const void *data);
1063 AST_FEATURE_PLAY_WARNING = (1 << 0),
1064 AST_FEATURE_REDIRECT = (1 << 1),
1065 AST_FEATURE_DISCONNECT = (1 << 2),
1066 AST_FEATURE_ATXFER = (1 << 3),
1067 AST_FEATURE_AUTOMON = (1 << 4),
1068 AST_FEATURE_PARKCALL = (1 << 5),
1069 AST_FEATURE_AUTOMIXMON = (1 << 6),
1072 #define AST_FEATURE_DTMF_MASK (AST_FEATURE_REDIRECT | AST_FEATURE_DISCONNECT |\
1073 AST_FEATURE_ATXFER | AST_FEATURE_AUTOMON | AST_FEATURE_PARKCALL | AST_FEATURE_AUTOMIXMON)
1079 struct timeval start_time;
1080 struct timeval nexteventts;
1081 struct timeval feature_start_time;
1086 const char *warning_sound;
1087 const char *end_sound;
1088 const char *start_sound;
1105 const char *context;
1108 int connect_on_early_media;
1109 const char *cid_num;
1110 const char *cid_name;
1111 const char *account;
1167 CHANNEL_MODULE_LOAD,
1168 CHANNEL_MODULE_RELOAD,
1170 CHANNEL_MANAGER_RELOAD,
1181 AST_AMA_DOCUMENTATION,
1238 struct ast_channel * __attribute__((format(printf, 15, 16)))
1240 const
char *cid_name, const
char *acctcode,
1244 const
char *file,
int line, const
char *function,
1245 const
char *name_fmt, ...);
1258 #define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag, ...) \
1259 __ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag, NULL, \
1260 __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
1262 #define ast_channel_alloc_with_endpoint(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag, endpoint, ...) \
1263 __ast_channel_alloc((needqueue), (state), (cid_num), (cid_name), (acctcode), (exten), (context), (assignedids), (requestor), (amaflag), (endpoint), \
1264 __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
1282 #define ast_dummy_channel_alloc() __ast_dummy_channel_alloc(__FILE__, __LINE__, __PRETTY_FUNCTION__)
1283 struct ast_channel *__ast_dummy_channel_alloc(
const char *file,
int line,
const char *
function);
1396 const void *data,
size_t datalen);
1528 int timeout,
int *reason,
const char *cid_num,
const char *cid_name);
1547 int timeout,
int *reason,
const char *cid_num,
const char *cid_name,
struct outgoing_helper *oh);
1658 int ast_check_hangup_locked(
struct ast_channel *chan);
2001 int *
fds,
int nfds,
int *exception,
int *outfd,
int *ms);
2267 unsigned int durationkp,
unsigned int durationst,
int is_external);
2367 int ast_readstring_full(
struct ast_channel *c,
char *s,
int len,
int timeout,
int rtimeout,
char *enders,
int audiofd,
int ctrlfd);
2370 #define AST_BRIDGE_DTMF_CHANNEL_0 (1 << 0)
2372 #define AST_BRIDGE_DTMF_CHANNEL_1 (1 << 1)
2658 int ast_settimeout_full(
struct ast_channel *c,
unsigned int rate,
int (*func)(
const void *data),
void *data,
unsigned int is_ao2_obj);
2822 pfd->events = POLLIN | POLLPRI;
2827 static inline int ast_fdisset(
struct pollfd *pfds,
int fd,
int maximum,
int *start)
2836 for (x = *start; x < maximum; x++)
2837 if (pfds[x].fd == fd) {
2840 return pfds[x].revents;
2853 int datalen =
sizeof(
state);
2871 #define CHECK_BLOCKING(c) \
2873 if (ast_test_flag(ast_channel_flags(c), AST_FLAG_BLOCKING)) { \
2875 ast_log(LOG_DEBUG, "Thread LWP %d is blocking '%s', already blocked by thread LWP %d in procedure %s\n", \
2876 ast_get_tid(), ast_channel_name(c), \
2877 ast_channel_blocker_tid(c), ast_channel_blockproc(c)); \
2880 ast_channel_blocker_tid_set((c), ast_get_tid()); \
2881 ast_channel_blocker_set((c), pthread_self()); \
2882 ast_channel_blockproc_set((c), __PRETTY_FUNCTION__); \
2883 ast_set_flag(ast_channel_flags(c), AST_FLAG_BLOCKING); \
2886 ast_group_t ast_get_group(
const char *s);
2892 struct ast_namedgroups;
2896 struct ast_namedgroups *ast_unref_namedgroups(
struct ast_namedgroups *
groups);
2897 struct ast_namedgroups *ast_ref_namedgroups(
struct ast_namedgroups *
groups);
2922 #define ast_channel_lock(chan) ao2_lock(chan)
2923 #define ast_channel_unlock(chan) ao2_unlock(chan)
2924 #define ast_channel_trylock(chan) ao2_trylock(chan)
2929 #define ast_channel_lock_both(chan1, chan2) do { \
2930 ast_channel_lock(chan1); \
2931 while (ast_channel_trylock(chan2)) { \
2932 ast_channel_unlock(chan1); \
2934 ast_channel_lock(chan1); \
2947 #define ast_channel_ref(c) ({ ao2_ref(c, +1); (c); })
2958 #define ast_channel_unref(c) ({ ao2_ref(c, -1); (struct ast_channel *) (NULL); })
2969 #define ast_channel_cleanup(c) ({ ao2_cleanup(c); (struct ast_channel *) (NULL); })
3085 void *data,
int ao2_flags);
3987 #if defined(__cplusplus) || defined(c_plusplus)
4031 enum AST_MONITORING_STATE {
4032 AST_MONITOR_RUNNING,
4038 #define DECLARE_STRINGFIELD_SETTERS_FOR(field) \
4039 void ast_channel_##field##_set(struct ast_channel *chan, const char *field); \
4040 void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) __attribute__((format(printf, 2, 0))); \
4041 void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) __attribute__((format(printf, 2, 3)))
4066 const char *ast_channel_name(
const struct ast_channel *chan);
4067 const char *ast_channel_language(
const struct ast_channel *chan);
4068 const char *ast_channel_musicclass(
const struct ast_channel *chan);
4069 const char *ast_channel_latest_musicclass(
const struct ast_channel *chan);
4070 const char *ast_channel_accountcode(
const struct ast_channel *chan);
4071 const char *ast_channel_peeraccount(
const struct ast_channel *chan);
4072 const char *ast_channel_userfield(
const struct ast_channel *chan);
4073 const char *ast_channel_call_forward(
const struct ast_channel *chan);
4074 const char *ast_channel_uniqueid(
const struct ast_channel *chan);
4075 const char *ast_channel_linkedid(
const struct ast_channel *chan);
4076 const char *ast_channel_parkinglot(
const struct ast_channel *chan);
4077 const char *ast_channel_hangupsource(
const struct ast_channel *chan);
4078 const char *ast_channel_dialcontext(
const struct ast_channel *chan);
4080 const char *ast_channel_appl(
const struct ast_channel *chan);
4081 void ast_channel_appl_set(
struct ast_channel *chan,
const char *value);
4082 const char *ast_channel_blockproc(
const struct ast_channel *chan);
4083 void ast_channel_blockproc_set(
struct ast_channel *chan,
const char *value);
4084 const char *ast_channel_data(
const struct ast_channel *chan);
4085 void ast_channel_data_set(
struct ast_channel *chan,
const char *value);
4087 const char *ast_channel_lastcontext(
const struct ast_channel *chan);
4088 const char *ast_channel_context(
const struct ast_channel *chan);
4089 void ast_channel_context_set(
struct ast_channel *chan,
const char *value);
4090 const char *ast_channel_lastexten(
const struct ast_channel *chan);
4091 const char *ast_channel_exten(
const struct ast_channel *chan);
4092 void ast_channel_exten_set(
struct ast_channel *chan,
const char *value);
4094 char ast_channel_dtmf_digit_to_emulate(
const struct ast_channel *chan);
4095 void ast_channel_dtmf_digit_to_emulate_set(
struct ast_channel *chan,
char value);
4096 char ast_channel_sending_dtmf_digit(
const struct ast_channel *chan);
4097 void ast_channel_sending_dtmf_digit_set(
struct ast_channel *chan,
char value);
4098 struct timeval ast_channel_sending_dtmf_tv(const struct
ast_channel *chan);
4099 void ast_channel_sending_dtmf_tv_set(
struct ast_channel *chan,
struct timeval value);
4106 int ast_channel_epfd(
const struct ast_channel *chan);
4107 void ast_channel_epfd_set(
struct ast_channel *chan,
int value);
4108 int ast_channel_fdno(
const struct ast_channel *chan);
4109 void ast_channel_fdno_set(
struct ast_channel *chan,
int value);
4110 int ast_channel_hangupcause(
const struct ast_channel *chan);
4111 void ast_channel_hangupcause_set(
struct ast_channel *chan,
int value);
4112 int ast_channel_priority(
const struct ast_channel *chan);
4113 void ast_channel_priority_set(
struct ast_channel *chan,
int value);
4114 int ast_channel_rings(
const struct ast_channel *chan);
4115 void ast_channel_rings_set(
struct ast_channel *chan,
int value);
4116 int ast_channel_streamid(
const struct ast_channel *chan);
4117 void ast_channel_streamid_set(
struct ast_channel *chan,
int value);
4118 int ast_channel_timingfd(
const struct ast_channel *chan);
4119 void ast_channel_timingfd_set(
struct ast_channel *chan,
int value);
4120 int ast_channel_visible_indication(
const struct ast_channel *chan);
4121 void ast_channel_visible_indication_set(
struct ast_channel *chan,
int value);
4122 int ast_channel_hold_state(
const struct ast_channel *chan);
4123 void ast_channel_hold_state_set(
struct ast_channel *chan,
int value);
4124 int ast_channel_vstreamid(
const struct ast_channel *chan);
4125 void ast_channel_vstreamid_set(
struct ast_channel *chan,
int value);
4126 unsigned short ast_channel_transfercapability(
const struct ast_channel *chan);
4127 void ast_channel_transfercapability_set(
struct ast_channel *chan,
unsigned short value);
4128 unsigned int ast_channel_emulate_dtmf_duration(
const struct ast_channel *chan);
4129 void ast_channel_emulate_dtmf_duration_set(
struct ast_channel *chan,
unsigned int value);
4130 unsigned int ast_channel_fin(
const struct ast_channel *chan);
4131 void ast_channel_fin_set(
struct ast_channel *chan,
unsigned int value);
4132 unsigned int ast_channel_fout(
const struct ast_channel *chan);
4133 void ast_channel_fout_set(
struct ast_channel *chan,
unsigned int value);
4134 unsigned long ast_channel_insmpl(
const struct ast_channel *chan);
4135 void ast_channel_insmpl_set(
struct ast_channel *chan,
unsigned long value);
4136 unsigned long ast_channel_outsmpl(
const struct ast_channel *chan);
4137 void ast_channel_outsmpl_set(
struct ast_channel *chan,
unsigned long value);
4138 void *ast_channel_generatordata(
const struct ast_channel *chan);
4139 void ast_channel_generatordata_set(
struct ast_channel *chan,
void *value);
4140 void *ast_channel_music_state(
const struct ast_channel *chan);
4141 void ast_channel_music_state_set(
struct ast_channel *chan,
void *value);
4142 void *ast_channel_tech_pvt(
const struct ast_channel *chan);
4143 void ast_channel_tech_pvt_set(
struct ast_channel *chan,
void *value);
4144 void *ast_channel_timingdata(
const struct ast_channel *chan);
4145 void ast_channel_timingdata_set(
struct ast_channel *chan,
void *value);
4180 enum ast_channel_adsicpe ast_channel_adsicpe(
const struct ast_channel *chan);
4181 void ast_channel_adsicpe_set(
struct ast_channel *chan,
enum ast_channel_adsicpe value);
4183 ast_callid ast_channel_callid(
const struct ast_channel *chan);
4195 void ast_channel_softhangup_internal_flag_set(
struct ast_channel *chan,
int value);
4196 void ast_channel_softhangup_internal_flag_add(
struct ast_channel *chan,
int value);
4197 void ast_channel_softhangup_internal_flag_clear(
struct ast_channel *chan,
int value);
4198 void ast_channel_callid_cleanup(
struct ast_channel *chan);
4199 int ast_channel_softhangup_internal_flag(
struct ast_channel *chan);
4227 struct timeval *ast_channel_dtmf_tv(
struct ast_channel *chan);
4228 struct timeval *ast_channel_whentohangup(
struct ast_channel *chan);
4237 void ast_channel_dtmf_tv_set(
struct ast_channel *chan,
struct timeval *value);
4244 struct timeval ast_channel_creationtime(struct
ast_channel *chan);
4245 void ast_channel_creationtime_set(
struct ast_channel *chan,
struct timeval *value);
4246 struct timeval ast_channel_answertime(struct
ast_channel *chan);
4247 void ast_channel_answertime_set(
struct ast_channel *chan,
struct timeval *value);
4256 ast_group_t ast_channel_callgroup(
const struct ast_channel *chan);
4261 ast_group_t ast_channel_pickupgroup(
const struct ast_channel *chan);
4266 struct ast_namedgroups *ast_channel_named_callgroups(
const struct ast_channel *chan);
4267 void ast_channel_named_callgroups_set(
struct ast_channel *chan,
struct ast_namedgroups *value);
4268 struct ast_namedgroups *ast_channel_named_pickupgroups(
const struct ast_channel *chan);
4269 void ast_channel_named_pickupgroups_set(
struct ast_channel *chan,
struct ast_namedgroups *value);
4272 int ast_channel_alert_write(
struct ast_channel *chan);
4273 int ast_channel_alert_writable(
struct ast_channel *chan);
4274 ast_alert_status_t ast_channel_internal_alert_flush(
struct ast_channel *chan);
4275 ast_alert_status_t ast_channel_internal_alert_read(
struct ast_channel *chan);
4276 int ast_channel_internal_alert_readable(
struct ast_channel *chan);
4277 void ast_channel_internal_alertpipe_clear(
struct ast_channel *chan);
4278 void ast_channel_internal_alertpipe_close(
struct ast_channel *chan);
4279 int ast_channel_internal_alert_readfd(
struct ast_channel *chan);
4280 int ast_channel_internal_alertpipe_init(
struct ast_channel *chan);
4287 void ast_channel_internal_fd_clear(
struct ast_channel *chan,
int which);
4288 void ast_channel_internal_fd_clear_all(
struct ast_channel *chan);
4289 void ast_channel_internal_fd_set(
struct ast_channel *chan,
int which,
int value);
4290 int ast_channel_fd(
const struct ast_channel *chan,
int which);
4291 int ast_channel_fd_isset(
const struct ast_channel *chan,
int which);
4318 pthread_t ast_channel_blocker(
const struct ast_channel *chan);
4319 void ast_channel_blocker_set(
struct ast_channel *chan, pthread_t value);
4321 int ast_channel_blocker_tid(
const struct ast_channel *chan);
4322 void ast_channel_blocker_tid_set(
struct ast_channel *chan,
int tid);
4324 ast_timing_func_t ast_channel_timingfunc(
const struct ast_channel *chan);
4325 void ast_channel_timingfunc_set(
struct ast_channel *chan, ast_timing_func_t value);
4712 #define AST_MUTE_DIRECTION_READ (1 << 0)
4713 #define AST_MUTE_DIRECTION_WRITE (1 << 1)
4793 enum ast_channel_error {
4795 AST_CHANNEL_ERROR_UNKNOWN,
4797 AST_CHANNEL_ERROR_ID_EXISTS,
4948 #define ast_channel_has_tech_function(chan, function) \
4949 (ast_channel_tech(chan) ? ast_channel_tech(chan)->function != NULL : 0)
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.
int(*const presencestate)(const char *presence_provider, char **subtype, char **message)
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.
int(*const answer_with_stream_topology)(struct ast_channel *chan, struct ast_stream_topology *topology)
Answer the channel with topology.
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.
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.
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.
void ast_channel_pickupgroup_set(struct ast_channel *chan, ast_group_t value)
int presentation
Q.931 encoded presentation-indicator encoded field.
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.
void ast_channel_req_accountcodes_precious(struct ast_channel *chan, const struct ast_channel *requestor, enum ast_channel_requestor_relationship relationship)
Setup new channel accountcodes from the requestor channel after ast_request().
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)
int64_t ast_channel_get_duration_ms(struct ast_channel *chan)
Obtain how long it's been, in milliseconds, since the channel was created.
int(*const transfer)(struct ast_channel *chan, const char *newdest)
Blind transfer other side (see app_transfer.c and ast_transfer()
int(*const setoption)(struct ast_channel *chan, int option, void *data, int datalen)
Set a given option. Called with chan locked.
Asterisk locking-related definitions:
Channels have this property if they implement send_text_data.
struct ast_channel * ast_channel_iterator_next(struct ast_channel_iterator *i)
Get the next channel for a channel iterator.
Channels with this particular technology are an implementation detail of Asterisk and should generall...
struct ast_party_id priv_to
Call is redirecting to a new party (Sent to the caller) - private representation. ...
char * str
Subscriber phone number (Malloced)
char chan_name[AST_CHANNEL_NAME]
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 send_image)(struct ast_channel *chan, struct ast_frame *frame)
Display or send an image.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame without payload.
int ast_redirecting_parse_data(const unsigned char *data, size_t datalen, struct ast_party_redirecting *redirecting)
Parse redirecting indication frame data.
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...
void ast_channel_whentohangup_set(struct ast_channel *chan, struct timeval *value)
struct ast_set_party_id ani
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
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...
int(*const write_video)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format.
struct ast_channel_id linkedid
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::@335 fds
int presentation
Q.931 presentation-indicator and screening-indicator encoded fields.
ast_channel_requestor_relationship
channelreloadreason
Channel reload reasons for manager events at load or reload of configuration.
struct ast_stream_topology * answer_topology
int ast_auto_answer(struct ast_channel *chan)
Answer a channel, if it's not already answered.
struct ast_party_id id
Connected party ID.
void ast_party_id_reset(struct ast_party_id *id)
Destroy and initialize the given party id structure.
Structure that contains features information.
const struct ast_channel_tech * ast_get_channel_tech(const char *name)
Get a channel technology structure by name.
int(*const write)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format (see frame.h)
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. ...
struct ast_party_id priv_orig
Who originally redirected the call (Sent to the party the call is redirected toward) - private repres...
void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Set when to hang a channel up.
struct ast_channel * ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, 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...
int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params)
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
struct ast_channel * ast_call_forward(struct ast_channel *caller, struct ast_channel *orig, int *timeout, struct ast_format_cap *cap, struct outgoing_helper *oh, int *outstate)
Forwards a call to a new channel specified by the original channel's call_forward str...
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.
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_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.
int64_t ast_channel_get_up_time_ms(struct ast_channel *chan)
Obtain how long it has been since the channel was answered in ms.
int ast_queue_unhold(struct ast_channel *chan)
Queue an unhold frame.
int(*const send_digit_end)(struct ast_channel *chan, char digit, unsigned int duration)
Stop sending a literal DTMF digit.
int ast_channel_forward_endpoint(struct ast_channel *chan, struct ast_endpoint *endpoint)
Forward channel stasis messages to the given endpoint.
char context[AST_MAX_CONTEXT]
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_softhangup(struct ast_channel *chan, int cause)
Softly hangup up a channel.
int ast_channel_supports_html(struct ast_channel *channel)
Checks for HTML support on a channel.
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().
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
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.
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.
struct ast_party_id priv_from
Who is redirecting the call (Sent to the party the call is redirected toward) - private representatio...
static int ast_add_fd(struct pollfd *pfd, int fd)
if fd is a valid descriptor, set *pfd with the descriptor
int ast_raw_answer_with_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
Answer a channel passing in a stream topology.
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.
void ast_party_redirecting_reason_copy(struct ast_party_redirecting_reason *dest, const struct ast_party_redirecting_reason *src)
Copy the source redirecting reason information to the destination redirecting reason.
int ast_call(struct ast_channel *chan, const char *addr, int timeout)
Make a call.
Structure for variables, used for configurations and for channel variables.
const char * ast_channel_oldest_linkedid(const char *a, const char *b)
Return the oldest linkedid between two channels.
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.
void ast_set_variables(struct ast_channel *chan, struct ast_variable *vars)
adds a list of channel variables to a channel
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_set_party_id priv_orig
void ast_channel_clear_flag(struct ast_channel *chan, unsigned int flag)
Clear a flag on a channel.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
int(*const answer)(struct ast_channel *chan)
Answer the channel.
int char_set
Character set the name is using.
Structure to pass both assignedid values to channel drivers.
struct ast_frame * ast_read_stream(struct ast_channel *chan)
Reads a frame, but does not filter to just the default streams.
Structure for a data store type.
void ast_channel_callgroup_set(struct ast_channel *chan, ast_group_t value)
Structure used to transport a message through the frame core.
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.
const char * ast_channel_amaflags2string(enum ama_flags flags)
Convert the enum representation of an AMA flag to a string representation.
ast_t38_state
Possible T38 states on channels.
void ast_party_caller_free(struct ast_party_caller *doomed)
Destroy the caller party contents.
int(*const hangup)(struct ast_channel *chan)
Hangup (and possibly destroy) the channel.
unsigned char valid
TRUE if the subaddress information is valid/present.
int ast_senddigit_external(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel from an external thread.
const char * ast_cause2str(int cause) attribute_pure
Gives the string form of a given cause code.
ast_control_frame_type
Internal control frame subtype field values.
struct ast_channel * ast_channel_yank(struct ast_channel *yankee)
Gain control of a channel in the system.
int ani2
Automatic Number Identification 2 (Info Digits)
int(* generate)(struct ast_channel *chan, void *data, int len, int samples)
int ast_channel_get_up_time(struct ast_channel *chan)
Obtain how long it has been since the channel was answered.
int(*const send_digit_begin)(struct ast_channel *chan, char digit)
Start sending a literal DTMF digit.
void ast_party_redirecting_reason_init(struct ast_party_redirecting_reason *init)
Initialize the given redirecting reason structure.
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 ...
struct ast_channel * ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, int nfds, int *exception, int *outfd, int *ms)
Waits for activity on a group of channels.
int ast_sendtext_data(struct ast_channel *chan, struct ast_msg_data *msg)
Sends text to a channel in an ast_msg_data structure wrapper with ast_sendtext as fallback...
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 ast_prod(struct ast_channel *chan)
Send empty audio to prime a channel driver.
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.
int ast_senddigit_begin(struct ast_channel *chan, char digit)
Send a DTMF digit to a channel.
char * str
Malloced subaddress string.
int ast_channel_move(struct ast_channel *dest, struct ast_channel *source)
Move a channel from its current location to a new location.
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_channel_setoption(struct ast_channel *channel, int option, void *data, int datalen, int block)
Sets an option on a channel.
void ast_channel_set_ari_vars(size_t varc, char **vars)
Sets the variables to be stored in the ari_vars field of all snapshots.
int ast_channel_suppress(struct ast_channel *chan, unsigned int direction, enum ast_frame_type frametype)
Suppress passing of a frame type on a channel.
int code
enum AST_REDIRECTING_REASON value for redirection
unsigned char odd_even_indicator
TRUE if odd number of address signals.
int ast_write_stream(struct ast_channel *chan, int stream_num, struct ast_frame *frame)
Write a frame to a stream This function writes the given frame to the indicated stream on the channel...
Indicate what information in ast_party_caller should be set.
static const char ast_stream_topology_changed_external[]
Set as the change source reason when a channel stream topology has been changed externally as a resul...
int ast_raw_answer(struct ast_channel *chan)
Answer a channel.
struct ast_cc_config_params * ast_channel_get_cc_config_params(struct ast_channel *chan)
Get the CCSS parameters from a channel.
int ast_set_write_format_interleaved_stereo(struct ast_channel *chan, struct ast_format *format)
Sets write format for a channel. All internal data will than be handled in an interleaved format...
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.
void ast_party_redirecting_reason_set_init(struct ast_party_redirecting_reason *init, const struct ast_party_redirecting_reason *guide)
Initialize the given redirecting reason structure using the given guide for a set update operation...
int ast_channel_unbridged_nolock(struct ast_channel *chan)
ast_channel_unbridged variant. Use this if the channel is already locked prior to calling...
int ast_set_read_format_path(struct ast_channel *chan, struct ast_format *raw_format, struct ast_format *core_format)
Set specific read path on channel.
struct ast_channel * ast_request(const char *type, struct ast_format_cap *request_cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requests a channel.
struct ast_set_party_id from
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_party_id orig
Who originally redirected the call (Sent to the party the call is redirected toward) ...
int ast_channel_defer_dtmf(struct ast_channel *chan)
Defers DTMF so that you only read things like hangups and audio.
int(*const call)(struct ast_channel *chan, const char *addr, int timeout)
Make a call.
Asterisk datastore objects.
const struct ast_channel_tech * tech
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.
void ast_channel_internal_alertpipe_swap(struct ast_channel *chan1, struct ast_channel *chan2)
Swap the interal alertpipe between two channels.
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...
enum ama_flags ast_channel_string2amaflag(const char *flag)
Convert a string to a detail record AMA flag.
struct ast_party_id id
Caller party ID.
void(* write_format_change)(struct ast_channel *chan, void *data)
int ast_queue_answer(struct ast_channel *chan, const struct ast_stream_topology *topology)
Queue an ANSWER control frame with topology.
void ast_change_name(struct ast_channel *chan, const char *newname)
Change channel name.
Configuration File Parser.
int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *to)
Inherit datastores from a parent to a child.
void ast_channel_internal_swap_endpoint_forward(struct ast_channel *a, struct ast_channel *b)
Swap endpoint_forward between two channels.
int ast_set_write_format_from_cap(struct ast_channel *chan, struct ast_format_cap *formats)
Sets write format on channel chan Set write format for channel to whichever component of "format" is ...
struct ast_bridge * ast_channel_get_bridge(const struct ast_channel *chan)
Get the bridge associated with a channel.
int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *peer)
Make the frame formats of two channels compatible.
void ast_channel_internal_swap_topics(struct ast_channel *a, struct ast_channel *b)
Swap topics beteween two channels.
int ast_waitfor_n_fd(int *fds, int n, int *ms, int *exception)
Waits for input on an fd.
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_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)
int ast_channel_fd_add(struct ast_channel *chan, int value)
Add a file descriptor to the channel without a fixed position.
void ast_party_id_merge_copy(struct ast_party_id *dest, struct ast_party_id *base, struct ast_party_id *overlay)
Copy a merge of a given party id into another given party id to a given destination party id...
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 send_html)(struct ast_channel *chan, int subclass, const char *data, int len)
Send HTML data.
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.
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...
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.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
void ast_channel_internal_bridge_set(struct ast_channel *chan, struct ast_bridge *value)
A set of tones for a given locale.
struct ast_party_redirecting_reason orig_reason
Reason for the redirection by the original party.
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(*const write_text)(struct ast_channel *chan, struct ast_frame *frame)
Write a text frame, in standard format.
enum ast_channel_state state
int(* ast_acf_write_fn_t)(struct ast_channel *chan, const char *function, char *data, const char *value)
Typedef for a custom write function.
void ast_softhangup_all(void)
Soft hangup all active channels.
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.
int ast_channel_redirecting_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const void *redirecting_info, int is_frame)
Run a redirecting interception subroutine and update a channel's redirecting information.
void ast_party_number_init(struct ast_party_number *init)
Initialize the given number structure.
void * end_bridge_callback_data
Caller Party information.
Asterisk internal frame definitions.
void(* end_bridge_callback_data_fixup)(struct ast_bridge_config *bconfig, struct ast_channel *originator, struct ast_channel *terminator)
void(* release)(struct ast_channel *chan, void *data)
const struct ast_datastore_info * info
struct ast_party_id priv
Private caller party ID.
struct ast_frame * ast_read_stream_noaudio(struct ast_channel *chan)
Reads a frame, but does not filter to just the default streams, returning AST_FRAME_NULL frame if aud...
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 varshead * ast_channel_get_ari_vars(struct ast_channel *chan)
Gets the variables for a given channel, as specified by ast_channel_set_ari_vars().
void ast_party_redirecting_reason_free(struct ast_party_redirecting_reason *doomed)
Destroy the redirecting reason contents.
struct ast_set_party_id id
struct ast_channel * ast_request_with_stream_topology(const char *type, struct ast_stream_topology *topology, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requests a channel (specifying stream topology)
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
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 ast_senddigit_mf_begin(struct ast_channel *chan, char digit)
Send an MF digit to a channel.
void ast_channel_internal_swap_uniqueid_and_linkedid(struct ast_channel *a, struct ast_channel *b)
Swap uniqueid and linkedid beteween two channels.
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
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...
int(*const send_text)(struct ast_channel *chan, const char *text)
Display or transmit text.
struct ast_party_id ani
Automatic Number Identification (ANI)
DECLARE_STRINGFIELD_SETTERS_FOR(name)
int ast_queue_hold(struct ast_channel *chan, const char *musicclass)
Queue a hold frame.
int ast_pre_call(struct ast_channel *chan, const char *sub_args)
Execute a Gosub call on the channel before a call is placed.
void ast_channel_req_accountcodes(struct ast_channel *chan, const struct ast_channel *requestor, enum ast_channel_requestor_relationship relationship)
Setup new channel accountcodes from the requestor channel after ast_request().
void ast_party_redirecting_reason_set(struct ast_party_redirecting_reason *dest, const struct ast_party_redirecting_reason *src)
Set the redirecting reason information based on another redirecting reason source.
Structure to describe a channel "technology", ie a channel driver See for examples: ...
int ast_channel_is_t38_active(struct ast_channel *chan)
This function will check if T.38 is active on the channel.
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(* pre_call)(struct ast_channel *chan, const char *sub_args)
Execute a Gosub call on the channel in a technology specific way before a call is placed...
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_channel_is_leaving_bridge(struct ast_channel *chan)
Determine if a channel is leaving a bridge, but not hung up.
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
struct ast_set_party_id priv
struct ast_channel *(*const requester_with_stream_topology)(const char *type, struct ast_stream_topology *topology, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requester - to set up call data structures (pvt's) with stream topology.
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.
ast_frame_type
Frame types.
struct ast_silence_generator * ast_channel_start_silence_generator(struct ast_channel *chan)
Starts a silence generator on the given channel.
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
Redirecting reason information.
#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.
void ast_channel_set_manager_vars(size_t varc, char **vars)
Sets the variables to be stored in the manager_vars field of all snapshots.
struct ast_namedgroups * ast_get_namedgroups(const char *s)
Create an ast_namedgroups set with group names from comma separated string.
void ast_party_dialed_init(struct ast_party_dialed *init)
Initialize the given dialed structure.
int ast_channel_stream_topology_changed(struct ast_channel *chan, struct ast_stream_topology *topology)
Provide notice to a channel that the stream topology has changed.
void * ast_channel_get_stream_topology_change_source(struct ast_channel *chan)
Retrieve the source that initiated the last stream topology change.
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.
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)
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.
Support for dynamic strings.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
void ast_channel_name_to_dial_string(char *channel_name)
Removes the trailing identifiers from a channel name string.
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.
void ast_channel_set_is_t38_active(struct ast_channel *chan, int is_t38_active)
Sets the is_t38_active flag.
void ast_channel_set_flag(struct ast_channel *chan, unsigned int flag)
Set a flag on a channel.
struct ast_set_party_id priv_from
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.
char * ast_recvtext(struct ast_channel *chan, int timeout)
Receives a text string from a channel Read a string of text from a channel.
int ast_channel_connected_line_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const void *connected_info, int frame)
Run a connected line interception subroutine and update a channel's connected line information...
int ast_senddigit_mf_end(struct ast_channel *chan)
End sending an MF digit to a channel.
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.
int ani2
Automatic Number Identification 2 (Info Digits)
struct ast_channel_iterator * ast_channel_iterator_by_exten_new(const char *exten, const char *context)
Create a new channel iterator based on extension.
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.
int ast_channel_has_ari_vars(void)
Return whether or not any ARI variables have been set.
void ast_party_name_free(struct ast_party_name *doomed)
Destroy the party name contents.
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...
struct varshead * ast_channel_get_vars(struct ast_channel *chan)
Gets the variables for a given channel, as set using pbx_builtin_setvar_helper(). ...
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
int __ast_answer(struct ast_channel *chan, unsigned int delay)
Answer a channel, with a selectable delay before returning.
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.
struct ast_format_cap * capabilities
int ast_channel_is_bridged(const struct ast_channel *chan)
Determine if a channel is in a bridge.
int ast_safe_sleep_without_silence(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups, and do not generate silence.
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.
int ast_set_write_format_path(struct ast_channel *chan, struct ast_format *core_format, struct ast_format *raw_format)
Set specific write path on channel.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
General jitterbuffer state.
void(* digit)(struct ast_channel *chan, char digit)
struct ast_channel * __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 struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, enum ama_flags amaflag, struct ast_endpoint *endpoint, const char *file, int line, const char *function, const char *name_fmt,...)
Create a channel structure.
char * str
a string value for the redirecting reason
struct ast_bridge_features * ast_channel_feature_hooks_get(struct ast_channel *chan)
Gets the channel-attached features a channel has access to upon being bridged.
int ast_channel_sendurl(struct ast_channel *channel, const char *url)
Sends a URL on a given link Send URL on link.
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.
struct ast_frame *(*const exception)(struct ast_channel *chan)
Handle an exception, reading a frame.
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.
int ast_channel_get_duration(struct ast_channel *chan)
Obtain how long the channel since the channel was created.
Structure to handle passing func_channel_write info to channels via setoption.
Call Completion Supplementary Services API.
void ast_hangup(struct ast_channel *chan)
Hang up a 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_channel_end_dtmf(struct ast_channel *chan, char digit, struct timeval start, const char *why)
Simulate a DTMF end on a broken bridge 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.
struct ast_channel * __ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, 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...
int ast_set_read_format_from_cap(struct ast_channel *chan, struct ast_format_cap *formats)
Sets read format on channel chan from capabilities Set read format for channel to whichever component...
int ast_namedgroups_intersect(struct ast_namedgroups *a, struct ast_namedgroups *b)
Return TRUE if group a and b contain at least one common groupname.
void ast_autoservice_chan_hangup_peer(struct ast_channel *chan, struct ast_channel *peer)
Put chan into autoservice while hanging up peer.
struct ast_party_redirecting_reason reason
Reason for the redirection.
struct ast_party_subaddress subaddress
Dialed/Called subaddress.
void ast_party_id_init(struct ast_party_id *init)
Initialize the given party id structure.
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)
struct ast_bridge_channel * ast_channel_get_bridge_channel(struct ast_channel *chan)
Get a reference to the channel's bridge pointer.
struct ast_frame *(*const read)(struct ast_channel *chan)
Read a frame (or chain of frames from the same stream), in standard format (see frame.h)
void ast_channel_callid_set(struct ast_channel *chan, ast_callid value)
struct ast_channel *(*const requester)(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requester - to set up call data structures (pvt's)
Indicate what information in ast_party_connected_line should be set.
int ast_channel_unsuppress(struct ast_channel *chan, unsigned int direction, enum ast_frame_type frametype)
Stop suppressing of a frame type on a channel.
int(* ast_acf_read2_fn_t)(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **str, ssize_t len)
Typedef for a custom read2 function.
struct ast_set_party_id orig
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
void(* end_bridge_callback)(void *)
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.
char * tag
User-set "tag".
struct ast_set_party_id id
int(* ast_acf_read_fn_t)(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len)
Typedef for a custom read function.
void ast_deactivate_generator(struct ast_channel *chan)
int type
Q.931 subaddress type.
struct ast_set_party_id priv
int transit_network_select
Transit Network Select.
void ast_party_redirecting_free(struct ast_party_redirecting *doomed)
Destroy the redirecting information contents.
Structure that contains information regarding a channel in a bridge.
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
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.
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.
Indicate what information in ast_party_redirecting should be set.
void ast_tonepair_stop(struct ast_channel *chan)
int ast_channel_has_hook_requiring_audio(struct ast_channel *chan)
Check if the channel has any active hooks that require audio.
int count
Number of times the call was redirected.
void ast_party_id_invalidate(struct ast_party_id *id)
Invalidate all components of the given party id.
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.
const struct ast_channel_tech ast_kill_tech
Kill the channel channel driver technology descriptor.
void ast_party_subaddress_init(struct ast_party_subaddress *init)
Initialize the given subaddress structure.
struct ast_channel * ast_channel_bridge_peer(struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
struct ast_set_party_id ani
void ast_party_redirecting_init(struct ast_party_redirecting *init)
Initialize the given redirecting structure.
int ast_channel_fd_count(const struct ast_channel *chan)
Retrieve the number of file decriptor positions present on the channel.
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.
Channels have this property if they can accept input with jitter; i.e. most VoIP channels.
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_transfer_protocol(struct ast_channel *chan, char *dest, int *protocol)
Transfer a channel (if supported) receieve protocol result.
int ast_answer(struct ast_channel *chan)
Answer a channel.
struct ast_party_dialed::@206 number
Dialed/Called number.
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.
struct ast_set_party_id priv_to
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(*const devicestate)(const char *device_number)
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.
Data structure associated with a single frame of data.
struct ast_hangup_handler::@207 node
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...
int(*const send_text_data)(struct ast_channel *chan, struct ast_msg_data *data)
Display or transmit text with data.
int ast_channel_has_manager_vars(void)
Return whether or not any manager variables have been set.
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(*const queryoption)(struct ast_channel *chan, int option, void *data, int *datalen)
Query a given option. Called with chan locked.
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.
struct ast_channel_id uniqueid
int ast_channel_get_intercept_mode(void)
Am I currently running an intercept dialplan routine.
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.
ast_media_type
Types of media.
int ast_str2cause(const char *name) attribute_pure
Convert the string form of a cause code to a number.
Channels have this property if they can create jitter; i.e. most VoIP channels.
void ast_channel_dialed_causes_clear(const struct ast_channel *chan)
Clear all cause information from the channel.
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)
ama_flags
Channel AMA Flags.
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 ...
enum ast_channel_error ast_channel_errno(void)
Get error code for latest channel operation.
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)
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.
void ast_channel_internal_swap_snapshots(struct ast_channel *a, struct ast_channel *b)
Swap snapshots beteween two channels.
struct ast_channel_iterator * ast_channel_iterator_all_new(void)
Create a new channel iterator.
int ast_channel_feature_hooks_append(struct ast_channel *chan, struct ast_bridge_features *features)
Appends to the channel-attached features a channel has access to upon being bridged.
int ast_softhangup_nolock(struct ast_channel *chan, int cause)
Softly hangup up a channel (no channel lock)
void ast_set_party_id_all(struct ast_set_party_id *update_id)
Set the update marker to update all information of a corresponding party id.
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.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
char * ast_print_namedgroups(struct ast_str **buf, struct ast_namedgroups *groups)
Print named call groups and named pickup groups.
int ast_channel_stream_topology_changed_externally(struct ast_channel *chan)
Provide notice from a channel that the topology has changed on it as a result of the remote party ren...
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...
int ast_active_channels(void)
returns number of active/allocated channels
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.
const char * ast_state2str(enum ast_channel_state state)
Gives the string form of a given channel state.
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...
int ast_channel_feature_hooks_replace(struct ast_channel *chan, struct ast_bridge_features *features)
Sets the channel-attached features a channel has access to upon being bridged.
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_frame * ast_read_noaudio(struct ast_channel *chan)
Reads a frame, returning AST_FRAME_NULL frame if audio.
int ast_channel_has_audio_frame_or_monitor(struct ast_channel *chan)
Check if the channel has active audiohooks, active framehooks, or a monitor.
int ast_senddigit_mf(struct ast_channel *chan, char digit, unsigned int duration, unsigned int durationkp, unsigned int durationst, int is_external)
Send an MF digit to a channel.
struct ast_party_id priv
Private connected party ID.
void ast_channel_softhangup_withcause_locked(struct ast_channel *chan, int causecode)
Lock the given channel, then request softhangup on the channel with the given causecode.
unsigned char valid
TRUE if the number information is valid/present.
void ast_channel_hangupcause_hash_set(struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code, int datalen)
Sets the HANGUPCAUSE hash and optionally the SIP_CAUSE hash on the given channel. ...
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
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_waitfordigit_full(struct ast_channel *c, int ms, const char *breakon, int audiofd, int ctrlfd)
Wait for a digit Same as ast_waitfordigit() with audio fd for outputting read audio and ctrlfd to mon...
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.
void ast_channel_unlink(struct ast_channel *chan)
Remove a channel from the global channels container.
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_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.
struct ast_channel * ast_channel_internal_oldest_linkedid(struct ast_channel *a, struct ast_channel *b)
Determine which channel has an older linkedid.
int ast_sendtext(struct ast_channel *chan, const char *text)
Sends text to a channel.
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)