81#if defined(KEEP_TILL_CHANNEL_PARTY_NUMBER_INFO_NEEDED)
89#define MONITOR_CONSTANT_DELAY
90#define MONITOR_DELAY 150 * 8
98#define STATE2STR_BUFSIZE 32
102#define AST_DEFAULT_EMULATE_DTMF_DURATION 100
106#define DEFAULT_EMULATE_MF_DURATION 55
108#define DEFAULT_AMA_FLAGS AST_AMA_DOCUMENTATION
112#define AST_MIN_DTMF_GAP 45
208#if defined(KEEP_TILL_CHANNEL_PARTY_NUMBER_INFO_NEEDED)
209static const char *party_number_ton2str(
int ton)
212 switch ((ton >> 4) & 0x07) {
213 case PRI_TON_INTERNATIONAL:
214 return "International";
215 case PRI_TON_NATIONAL:
217 case PRI_TON_NET_SPECIFIC:
218 return "Network Specific";
219 case PRI_TON_SUBSCRIBER:
221 case PRI_TON_ABBREVIATED:
222 return "Abbreviated";
223 case PRI_TON_RESERVED:
225 case PRI_TON_UNKNOWN:
234#if defined(KEEP_TILL_CHANNEL_PARTY_NUMBER_INFO_NEEDED)
235static const char *party_number_plan2str(
int plan)
238 switch (plan & 0x0F) {
240 case PRI_NPI_UNKNOWN:
242 case PRI_NPI_E163_E164:
243 return "Public (E.163/E.164)";
245 return "Data (X.121)";
247 return "Telex (F.69)";
248 case PRI_NPI_NATIONAL:
249 return "National Standard";
250 case PRI_NPI_PRIVATE:
252 case PRI_NPI_RESERVED:
263#define FORMAT "%-15.15s %-40.40s %-13.13s %-13.13s %-13.13s %-13.13s\n"
269 e->
command =
"core show channeltypes";
271 "Usage: core show channeltypes\n"
272 " Lists available channel types registered in your\n"
273 " Asterisk server.\n";
282 ast_cli(
a->fd,
FORMAT,
"Type",
"Description",
"Devicestate",
"Presencestate",
"Indications",
"Transfer");
283 ast_cli(
a->fd,
FORMAT,
"-------------",
"-------------",
"-------------",
"-------------",
"-------------",
"-------------");
288 (cl->
tech->devicestate) ?
"yes" :
"no",
289 (cl->
tech->presencestate) ?
"yes" :
"no",
290 (cl->
tech->indicate) ?
"yes" :
"no",
291 (cl->
tech->transfer) ?
"yes" :
"no");
296 ast_cli(
a->fd,
"----------\n%d channel drivers registered.\n", count_chan);
312 wordlen = strlen(
a->word);
316 if (!strncasecmp(
a->word, cl->
tech->type, wordlen)) {
333 e->
command =
"core show channeltype";
335 "Usage: core show channeltype <name>\n"
336 " Show details about the specified channel type, <name>.\n";
348 if (!strncasecmp(cl->
tech->type,
a->argv[3], strlen(cl->
tech->type)))
354 ast_cli(
a->fd,
"\n%s is not a registered channel driver.\n",
a->argv[3]);
360 "-- Info about channel driver: %s --\n"
361 " Device State: %s\n"
362 "Presence State: %s\n"
365 " Capabilities: %s\n"
369 " Image Support: %s\n"
370 " Text Support: %s\n",
372 (cl->
tech->devicestate) ?
"yes" :
"no",
373 (cl->
tech->presencestate) ?
"yes" :
"no",
374 (cl->
tech->indicate) ?
"yes" :
"no",
375 (cl->
tech->transfer) ?
"yes" :
"no",
377 (cl->
tech->send_digit_begin) ?
"yes" :
"no",
378 (cl->
tech->send_digit_end) ?
"yes" :
"no",
379 (cl->
tech->send_html) ?
"yes" :
"no",
380 (cl->
tech->send_image) ?
"yes" :
"no",
381 (cl->
tech->send_text) ?
"yes" :
"no"
436 .description =
"Kill channel (should not see this)",
473 ast_debug(1,
"Setting hangupcause of channel %s to %d (is %d now)\n",
525 struct timeval whentohangup;
574 ast_debug(5,
"Unregistering channel type '%s'\n",
tech->type);
582 ast_verb(5,
"Unregistered channel type '%s'\n",
tech->type);
600 if (!strcasecmp(
name, chanls->
tech->type)) {
617 if (
causes[x].cause == cause)
658 return "Dialing Offhook";
674 switch (transfercapability) {
680 return "RESTRICTED_DIGITAL";
684 return "DIGITAL_W_TONES";
698 .description =
"Surrogate channel used to pull channel from an application",
704 .description =
"Null channel (should not see this)",
722 ast_log(
LOG_ERROR,
"Channel Unique ID '%s' already in use by channel %s(%p)\n",
732static struct ast_channel *__attribute__((format(printf, 15, 0)))
737 const
char *function, const
char *name_fmt, va_list ap)
741 char *tech =
"", *tech2 =
NULL;
756 file, line, function);
773 if (!nativeformats) {
792 ast_log(
LOG_WARNING,
"Channel allocation failed: Unable to create schedule context\n");
860 char *slash, *slash2;
868 ast_channel_name_build_va(
tmp, name_fmt, ap);
870 if ((slash = strchr(tech,
'/'))) {
871 if ((slash2 = strchr(slash + 1,
'/'))) {
882 ast_channel_name_set(
tmp,
"-**Unknown**");
892 ast_channel_accountcode_set(
tmp, acctcode);
955 const char *cid_name,
const char *acctcode,
959 const char *
file,
int line,
const char *function,
960 const char *name_fmt, ...)
965 va_start(ap, name_fmt);
967 assignedids, requestor, amaflag, endpoint,
NULL,
file, line, function, name_fmt, ap);
974 const char *cid_name,
const char *acctcode,
978 const char *
file,
int line,
const char *function,
979 const char *name_fmt, ...)
984 va_start(ap, name_fmt);
986 assignedids, requestor, amaflag, endpoint, initializers,
file, line, function, name_fmt, ap);
1000 file, line, function);
1032 unsigned int new_frames = 0;
1033 unsigned int new_voice_frames = 0;
1034 unsigned int queued_frames = 0;
1035 unsigned int queued_voice_frames = 0;
1097 queued_voice_frames++;
1101 if ((queued_frames + new_frames > 128 || queued_voice_frames + new_voice_frames > 96)) {
1102 int total_queued = queued_frames + new_frames;
1103 int total_voice = queued_voice_frames + new_voice_frames;
1105 ast_log(
LOG_WARNING,
"Exceptionally long %squeue length (%d voice / %d total) queuing to %s\n",
1106 queued_frames + new_frames > 128 ?
"" :
"voice ", total_voice, total_queued,
ast_channel_name(chan));
1140 while (new_frames--) {
1217 f.
data.
ptr = (
void *) musicclass;
1218 f.
datalen = strlen(musicclass) + 1;
1221 "musicclass", musicclass);
1298 void *
data,
int ao2_flags)
1306 const char *
name = arg;
1307 size_t name_len = *(
size_t *)
data;
1311 ast_log(
LOG_ERROR,
"BUG! Must supply a channel name or partial name to match!\n");
1352 size_t id_len = *(
size_t *)
data;
1356 ast_log(
LOG_ERROR,
"BUG! Must supply a uniqueid or partial uniqueid to match!\n");
1390 char *l_exten = (
char *) exten;
1391 char *l_context = (
char *)
context;
1410 char *l_name = (
char *)
name;
1456 char *l_name = (
char *)
name;
1464 (name_len == 0) ?
OBJ_KEY : 0);
1480 char *l_exten = (
char *)
exten;
1481 char *l_context = (
char *)
context;
1522 struct timeval start;
1647 if (src->
str && src->
str != dest->
str) {
1700 if (src->
str && src->
str != dest->
str) {
1753 if (src->
str && src->
str != dest->
str) {
1771 update_id->
name = 1;
1824 if (src->
tag && src->
tag != dest->
tag) {
1842 int number_priority;
1844 int number_screening;
1849 if (!
id->name.valid) {
1854 switch (name_value) {
1872 if (!
id->number.valid) {
1875 number_priority = 3;
1879 switch (number_value) {
1881 number_priority = 0;
1884 number_priority = 1;
1887 number_priority = 2;
1892 number_priority = 3;
1898 if (name_priority < number_priority) {
1899 number_value = name_value;
1905 return number_value | number_screening;
1911 id->number.valid = 0;
1912 id->subaddress.valid = 0;
1926 if (overlay->name.valid) {
1927 merged.
name = overlay->name;
1929 if (overlay->number.valid) {
1930 merged.
number = overlay->number;
1932 if (overlay->subaddress.valid) {
2127 if (src->
str && src->
str != dest->
str) {
2273 if ((dashptr = strrchr(device_name,
'-'))) {
2277 device_name[0] =
'\0';
2332 if (device_name[0]) {
2435 if ((datastore->
uid !=
NULL) && !strcasecmp(
uid, datastore->
uid)) {
2524 ast_channel_hangupsource_set(chan, source);
2531 ast_channel_hangupsource_set(bridge, source);
2623 ast_log(
LOG_WARNING,
"Hard hangup called by thread LWP %d on %s, while blocked by thread LWP %d in procedure %s! Expect a failure\n",
2650 struct timeval answertime;
2725 switch (old_state) {
2735 int timeout_ms =
MAX(delay, 500);
2736 unsigned int done = 0;
2737 struct timeval start;
2751 ast_debug(2,
"Didn't receive a media frame from %s within %u ms of answering. Continuing anyway\n",
ast_channel_name(chan),
MAX(delay, 500));
2901 if (generator && generator->
release) {
2950 if (!
tmp || !generate) {
2963 ast_debug(1,
"Auto-deactivating generator\n");
2979 if (generator_old && generator_old->
release) {
3008 int *exception,
int *outfd,
int *ms)
3010 struct timeval start = { 0 , 0 };
3011 struct pollfd *pfds =
NULL;
3016 struct timeval now = { 0, 0 };
3017 struct timeval whentohangup = { 0, 0 }, diff;
3031 for (x = 0; x < n; x++) {
3045 whentohangup = diff;
3061 if (!
ast_tvzero(whentohangup) && whentohangup.tv_sec < INT_MAX / 1000) {
3062 rms = whentohangup.tv_sec * 1000 + whentohangup.tv_usec / 1000;
3063 if (*ms >= 0 && *ms < rms) {
3066 }
else if (!
ast_tvzero(whentohangup) && rms < 0) {
3076 for (x = 0; x < n; x++) {
3079 fdmap[
max].fdno = y;
3080 fdmap[
max].chan = x;
3087 for (x = 0; x < nfds; x++) {
3088 fdmap[
max].chan = -1;
3096 if (
sizeof(
int) == 4) {
3099 if (kbrms > 600000) {
3106 }
while (!res && (rms > 0));
3110 for (x = 0; x < n; x++) {
3116 if (
errno != EINTR) {
3123 for (x = 0; x < n; x++) {
3127 if (winner ==
NULL) {
3142 for (x = 0; x <
max; x++) {
3143 res = pfds[x].revents;
3147 if (fdmap[x].chan >= 0) {
3148 winner =
c[fdmap[x].chan];
3150 if (res & POLLPRI) {
3159 *outfd = pfds[x].fd;
3162 *exception = (res & POLLPRI) ? -1 : 0;
3207 unsigned int real_rate = rate, max_rate;
3222 real_rate = max_rate;
3225 ast_debug(3,
"Scheduling timer at (%u requested / %u actual) timer ticks per second\n", rate, real_rate);
3236 if (
data && is_ao2_obj) {
3283 if (!rchan && outfd < 0 && ms) {
3289 }
else if (outfd > -1) {
3291 ast_log(
LOG_WARNING,
"The FD we were waiting for has something waiting. Waitfordigit returning numeric 1\n");
3309 if (!breakon || strchr(breakon, res)) {
3393 char digit_str[] = {
digit,
'\0' };
3409 char digit_str[] = {
digit,
'\0' };
3455 samples = (int) (((
float) f->
samples) * factor);
3480 ast_debug(1,
"Auto-deactivating generator\n");
3533 int diff = sample_rate - seek_rate;
3537 }
else if (diff < 0) {
3591 "ast_read() on chan '%s' called with no recorded file descriptor.\n",
3630 if (trigger_dtmf_emulating) {
3640 }
else if (trigger_dtmf_emulating) {
3686 int skipped_dtmf_frame = 0;
3695 skipped_dtmf_frame = 1;
3707 if (!skipped_dtmf_frame) {
3800 if (stream == default_stream) {
3827 if (dropnondefault && stream != default_stream) {
3839 ast_debug(1,
"Dropping duplicate answer!\n");
3852 read_action_payload = f->
data.
ptr;
3853 switch (read_action_payload->
action) {
3973 }
else if (!f->
len) {
4057 if (old_frame != f) {
4075 if (stream != default_stream) {
4181 if (old_frame != f) {
4199 if (old_frame != f) {
4306 switch (condition) {
4374 snprintf(causevar,
sizeof(causevar),
"HASH(SIP_CAUSE,%s)", cause_code->
chan_name);
4381 if (!strcasecmp(
flag,
"default"))
4383 if (!strcasecmp(
flag,
"omit"))
4385 if (!strcasecmp(
flag,
"billing"))
4387 if (!strcasecmp(
flag,
"documentation"))
4400 return "DOCUMENTATION";
4426 unsigned char proposed[1024];
4442 chan_indicated,
NULL);
4444 chan_connected,
NULL);
4445 if (current_size == -1 || proposed_size == -1) {
4449 if (current_size == proposed_size && !memcmp(
current, proposed, current_size)) {
4450 ast_debug(1,
"%s: Dropping redundant connected line update \"%s\" <%s>.\n",
4486 return res ? -1 : 0;
4498 switch (condition) {
4516 t38_parameters = data;
4562 if (_condition < 0) {
4570 switch (condition) {
4654 ast_debug(1,
"Driver for channel '%s' does not support indication %u, emulating it\n",
ast_channel_name(chan), condition);
4685 goto indicate_cleanup;
4692 .subclass.integer = _condition,
4693 .data.ptr = (
void *)
data,
4706 goto indicate_cleanup;
4718 if (awesome_frame) {
4731 c = *(
unsigned char *)
buf;
4789 size_t body_len = strlen(body);
4792 memset(&f, 0,
sizeof(f));
4808 ast_debug(1,
"Sending TEXT_DATA from '%s' to %s:%s %s\n",
4819 ast_debug(1,
"Channel technology does not support sending content type '%s' on channel '%s'\n",
4836 .value = (
char *)
text,
4856 static const char *
const mf_tones[] = {
4876 }
else if (
digit ==
'*') {
4878 }
else if (
digit ==
'#') {
4880 }
else if (
digit ==
'A') {
4882 }
else if (
digit ==
'B') {
4884 }
else if (
digit ==
'C') {
4897 static const char *
const dtmf_tones[] = {
4931 else if (
digit ==
'*')
4933 else if (
digit ==
'#')
4972 unsigned int durationkp,
unsigned int durationst,
int is_external)
4979 duration = durationkp;
4981 duration = durationst;
4985 usleep(duration * 1000);
5013 usleep(duration * 1000);
5062 struct plc_ds *plc = data;
5074 int num_new_samples = frame->
samples;
5096 if (!num_new_samples) {
5118 frame->
datalen = num_new_samples * 2;
5132 plc = datastore->
data;
5146 datastore->
data = plc;
5259 if (old_frame != fr)
5272 if (new_frame != fr) {
5307 }
else if ((stream == default_stream) &&
ast_channel_tech(chan)->write_video) {
5316 res =
tech_write(chan, stream, default_stream, fr);
5354 ast_debug(1,
"Channel %s changing write format from %s to %s, native formats %s\n",
5367 if (trans_frame != f && f != fr) {
5385 int freeoldlist = 0;
5399 if (new_frame != cur) {
5410 if (new_frame != dup) {
5434 unsigned int skip = 0;
5441 res =
tech_write(chan, stream, default_stream, cur);
5459 res =
tech_write(chan, stream, default_stream, f);
5518 ast_debug(1,
"Channel %s setting read format path: %s -> %s\n",
5554 ast_debug(1,
"Channel %s setting write format path: %s -> %s\n",
5632 if (!best_set_fmt) {
5642 &best_set_fmt,
sizeof(best_set_fmt), 0);
5644 ast_debug(1,
"Channel driver natively set channel %s to %s format %s\n",
5686 ast_log(
LOG_ERROR,
"Unable to set format because channel %s supports no formats\n",
5719 if (trans_pvt !=
NULL) {
5756 res = trans_pvt ? 0 : -1;
5763 ast_debug(1,
"Channel %s setting %s format path: %s -> %s\n",
5850 return "Call Failure (not BUSY, and not NO_ANSWER, maybe Circuit busy or down?)";
5854 return "Local Ring";
5856 return "Remote end Ringing";
5858 return "Remote end has Answered";
5860 return "Remote end is Busy";
5862 return "Congestion (circuits busy)";
5864 return "Unknown Reason!!";
5929 if ((
data = strchr(tmpchan,
'/'))) {
5933 const char *forward_context;
5961 ast_channel_accountcode_set(new_chan, oh->
account);
5962 ast_channel_peeraccount_set(new_chan, oh->
account);
6001 int last_subclass = 0;
6007 outstate = &dummy_outstate;
6042 ast_channel_accountcode_set(chan, oh->
account);
6043 ast_channel_peeraccount_set(chan, oh->
account);
6065 connected.id.number.str = (
char *) cid_num;
6070 connected.id.name.str = (
char *) cid_name;
6208 if (!requestor || !
out) {
6216 ops[1][1] = encrypt->
media;
6223 for (i = 0; i < 2; i++) {
6256 if (strcasecmp(
type, chan->
tech->type)) {
6272 if (chan->
tech->requester_with_stream_topology) {
6275 if (!topology && request_cap) {
6280 c = chan->
tech->requester_with_stream_topology(
type, topology, assignedids, requestor, addr, cause);
6283 }
else if (chan->
tech->requester) {
6290 if (!request_cap && topology) {
6334 if (best_audio_fmt) {
6339 c = chan->
tech->requester(
type, joint_cap, assignedids, requestor, addr, cause);
6407 switch (relationship) {
6422 }
else if (!precious
6465 int (*pre_call)(
struct ast_channel *chan,
const char *sub_args);
6472 res = pre_call(chan, sub_args);
6546 if (res < 0 || !(fr =
ast_read(chan))) {
6623 if (strchr(enders,
d) && (pos == 0)) {
6628 if (!strchr(enders,
d)) {
6631 if (strchr(enders,
d) || (pos >=
len)) {
6775 ast_channel_name_set(chan, newname);
6794 const char *varname;
6804 if (varname[0] ==
'_') {
6806 if (varname[1] ==
'_') {
6822 ast_debug(1,
"Inheriting variable %s from %s to %s.\n",
6863 dash = strrchr(channel_name,
'-');
6880 unsigned int orig_disablestatecache;
6881 unsigned int clone_disablestatecache;
6883 int visible_indication;
6884 int clone_hold_state;
6902 char clone_sending_dtmf_digit;
6903 struct timeval clone_sending_dtmf_tv;
6938 if (moh_is_playing) {
6955 ast_debug(1,
"Actually Masquerading %s(%u) into the structure of %s(%u)\n",
7001 ast_channel_name_set(original, tmp_name);
7066 if (orig_disablestatecache != clone_disablestatecache) {
7067 if (orig_disablestatecache) {
7227 ast_log(
LOG_WARNING,
"Channel type '%s' could not fixup channel %s, strange things may happen. (clonechan)\n",
7233 ast_log(
LOG_WARNING,
"Channel type '%s' could not fixup channel %s, strange things may happen. (original)\n",
7268 ast_debug(1,
"Channel %s simulating UNHOLD for masquerade.\n",
7272 if (clone_sending_dtmf_digit) {
7290 if (visible_indication) {
7292 const char *latest_musicclass;
7299 latest_musicclass =
NULL;
7302 len = strlen(latest_musicclass) + 1;
7314 if (moh_is_playing) {
7413 if (oldstate ==
state)
7417 if ((dashptr = strrchr(
name,
'-'))) {
7561 if (
len >
sizeof(ts->
data) / 2 - 1) {
7565 memset(&ts->
f, 0,
sizeof(ts->
f));
7566 for (x=0;x<
len/2;x++) {
7576 p = ts->
v3_2 - 32768;
7578 p = ((p * 9) / 10) + 1;
7579 ts->
data[x] = (ts->
v3_1 * p) >> 15;
7611 d.vol = (
vol < 1) ? 8192 :
vol;
7644 int start=0, finish=0, x;
7652 while ((piece =
strsep(&
c,
","))) {
7653 if (sscanf(piece,
"%30d-%30d", &start, &finish) == 2) {
7655 }
else if (sscanf(piece,
"%30d", &start)) {
7659 ast_log(
LOG_ERROR,
"Syntax error parsing group configuration '%s' at '%s'. Ignoring.\n", s, piece);
7662 for (x = start; x <= finish; x++) {
7663 if ((x > 63) || (x < 0)) {
7719 while ((piece =
strsep(&
c,
","))) {
7726 len = strlen(piece);
7736 strcpy(
member->name, piece);
7751 return (
struct ast_namedgroups *) namedgroups;
7793 ast_verb(3,
"Music class %s requested but no musiconhold loaded.\n", mclass ? mclass : (interpclass ? interpclass :
"default"));
7874 return vars_present;
7893 for (i = 0; i < varc; ++i) {
7894 const char *
var = vars[i];
7896 if (!(mcv =
ast_calloc(1,
sizeof(*mcv) + strlen(
var) + 1))) {
7900 if (strchr(
var,
'(')) {
7986 "Error invoking function %s\n", mcv->
name);
8064 for (i = 0; i <= 63; i++) {
8067 strncat(
buf,
", ", buflen - strlen(
buf) - 1);
8071 snprintf(num,
sizeof(num),
"%u", i);
8072 strncat(
buf, num, buflen - strlen(
buf) - 1);
8129 SWAP(group_a, group_b);
8141 for (cur = vars; cur; cur = cur->
next) {
8164 .datalen =
sizeof(
buf),
8168 memset(
buf, 0,
sizeof(
buf));
8214 ast_debug(1,
"Trying to stop silence generator when there is no generator on '%s'\n",
8220 ast_debug(1,
"Trying to stop silence generator when it is not the current generator on '%s'\n",
8241 ast_log(
LOG_ERROR,
"Could not return write format to its original state\n");
8276 const char *ints,
const char *lang)
8282 const char *ints,
const char *lang)
8288 const char *ints,
const char *lang)
8300 const char *ints,
const char *lang)
8306 const char *ints,
const char *lang,
int audiofd,
int ctrlfd)
8310 snprintf(
buf,
sizeof(
buf),
"%d", num);
8380 length = strlen(
name->str);
8381 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
8385 data[pos++] = ies->
str;
8386 data[pos++] = length;
8387 memcpy(data + pos,
name->str, length);
8391 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8397 data[pos++] =
name->char_set;
8399 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8405 data[pos++] =
name->presentation;
8407 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8411 data[pos++] = ies->
valid;
8413 data[pos++] =
name->valid;
8454 length = strlen(
number->str);
8455 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
8459 data[pos++] = ies->
str;
8460 data[pos++] = length;
8461 memcpy(data + pos,
number->str, length);
8465 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8469 data[pos++] = ies->
plan;
8471 data[pos++] =
number->plan;
8473 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8479 data[pos++] =
number->presentation;
8481 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8485 data[pos++] = ies->
valid;
8487 data[pos++] =
number->valid;
8527 if (subaddress->
str) {
8528 length = strlen(subaddress->
str);
8529 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
8533 data[pos++] = ies->
str;
8534 data[pos++] = length;
8535 memcpy(data + pos, subaddress->
str, length);
8539 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8543 data[pos++] = ies->
type;
8545 data[pos++] = subaddress->
type;
8547 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8549 "No space left for %s subaddress odd-even indicator\n", label);
8556 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8560 data[pos++] = ies->
valid;
8562 data[pos++] = subaddress->
valid;
8641 length = strlen(
id->tag);
8642 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
8646 data[pos++] = ies->
tag;
8647 data[pos++] = length;
8648 memcpy(data + pos,
id->tag, length);
8664 presentation =
id->number.presentation;
8667 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8673 data[pos++] = presentation;
8762 .combined_presentation = 0,
8771 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8794 if (datalen < pos + (
sizeof(data[0]) * 2) +
sizeof(
value)) {
8799 data[pos++] =
sizeof(
value);
8802 pos +=
sizeof(
value);
8810 unsigned char ie_len;
8811 unsigned char ie_id;
8813 int frame_version = 1;
8815 int got_combined_presentation = 0;
8817 for (pos = 0; pos < datalen; pos += ie_len) {
8818 if (datalen < pos +
sizeof(ie_id) +
sizeof(ie_len)) {
8822 ie_id = data[pos++];
8823 ie_len = data[pos++];
8824 if (datalen < pos + ie_len) {
8837 frame_version = data[pos];
8844 memcpy(
connected->id.name.str, data + pos, ie_len);
8854 connected->id.name.char_set = data[pos];
8862 connected->id.name.presentation = data[pos];
8877 memcpy(
connected->id.number.str, data + pos, ie_len);
8895 connected->id.number.presentation = data[pos];
8910 memcpy(
connected->id.subaddress.str, data + pos, ie_len);
8911 connected->id.subaddress.str[ie_len] = 0;
8920 connected->id.subaddress.type = data[pos];
8925 "Invalid connected line subaddress odd-even indicator (%u)\n",
8929 connected->id.subaddress.odd_even_indicator = data[pos];
8937 connected->id.subaddress.valid = data[pos];
8944 memcpy(
connected->id.tag, data + pos, ie_len);
8956 got_combined_presentation = 1;
8963 memcpy(
connected->priv.name.str, data + pos, ie_len);
8973 connected->priv.name.char_set = data[pos];
8981 connected->priv.name.presentation = data[pos];
8996 memcpy(
connected->priv.number.str, data + pos, ie_len);
9006 connected->priv.number.plan = data[pos];
9014 connected->priv.number.presentation = data[pos];
9022 connected->priv.number.valid = data[pos];
9029 memcpy(
connected->priv.subaddress.str, data + pos, ie_len);
9030 connected->priv.subaddress.str[ie_len] = 0;
9039 connected->priv.subaddress.type = data[pos];
9044 "Invalid connected line private subaddress odd-even indicator (%u)\n",
9048 connected->priv.subaddress.odd_even_indicator = data[pos];
9056 connected->priv.subaddress.valid = data[pos];
9063 memcpy(
connected->priv.tag, data + pos, ie_len);
9069 if (ie_len !=
sizeof(
value)) {
9079 ast_debug(1,
"Unknown connected line element: %u (%u)\n",
9080 (
unsigned) ie_id, (
unsigned) ie_len);
9085 switch (frame_version) {
9094 if (got_combined_presentation) {
9107 ast_debug(1,
"Connected line frame has newer version: %u\n",
9108 (
unsigned) frame_version);
9117 unsigned char data[1024];
9121 if (datalen == (
size_t) -1) {
9130 unsigned char data[1024];
9134 if (datalen == (
size_t) -1) {
9265 if (datalen < pos + (
sizeof(data[0]) * 2) +
sizeof(
value)) {
9269 data[pos++] = ies->
code;
9270 data[pos++] =
sizeof(
value);
9273 pos +=
sizeof(
value);
9276 length = strlen(reason->
str);
9277 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
9281 data[pos++] = ies->
str;
9282 data[pos++] = length;
9283 memcpy(data + pos, reason->
str, length);
9313 .combined_presentation = 0,
9370 .combined_presentation = 0,
9389 .combined_presentation = 0,
9408 .combined_presentation = 0,
9421 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
9451 "redirecting-priv-orig", &priv_orig_ies,
update ? &
update->priv_orig :
NULL);
9458 "redirecting-priv-from", &priv_from_ies,
update ? &
update->priv_from :
NULL);
9473 "redirecting-reason", &reason_ies);
9481 "redirecting-orig-reason", &orig_reason_ies);
9488 if (datalen < pos + (
sizeof(data[0]) * 2) +
sizeof(
value)) {
9493 data[pos++] =
sizeof(
value);
9496 pos +=
sizeof(
value);
9504 unsigned char ie_len;
9505 unsigned char ie_id;
9507 int frame_version = 1;
9508 int from_combined_presentation = 0;
9509 int got_from_combined_presentation = 0;
9510 int to_combined_presentation = 0;
9511 int got_to_combined_presentation = 0;
9513 for (pos = 0; pos < datalen; pos += ie_len) {
9514 if (datalen < pos +
sizeof(ie_id) +
sizeof(ie_len)) {
9518 ie_id = data[pos++];
9519 ie_len = data[pos++];
9520 if (datalen < pos + ie_len) {
9533 frame_version = data[pos];
9540 memcpy(redirecting->
orig.
name.
str, data + pos, ie_len);
9621 "Invalid redirecting-orig subaddress odd-even indicator (%u)\n",
9640 memcpy(redirecting->
orig.
tag, data + pos, ie_len);
9641 redirecting->
orig.
tag[ie_len] = 0;
9649 memcpy(redirecting->
from.
name.
str, data + pos, ie_len);
9717 from_combined_presentation = data[pos];
9718 got_from_combined_presentation = 1;
9740 "Invalid redirecting-from subaddress odd-even indicator (%u)\n",
9759 memcpy(redirecting->
from.
tag, data + pos, ie_len);
9760 redirecting->
from.
tag[ie_len] = 0;
9768 memcpy(redirecting->
to.
name.
str, data + pos, ie_len);
9801 memcpy(redirecting->
to.
number.
str, data + pos, ie_len);
9836 to_combined_presentation = data[pos];
9837 got_to_combined_presentation = 1;
9859 "Invalid redirecting-to subaddress odd-even indicator (%u)\n",
9877 if (redirecting->
to.
tag) {
9878 memcpy(redirecting->
to.
tag, data + pos, ie_len);
9879 redirecting->
to.
tag[ie_len] = 0;
9968 "Invalid private redirecting-orig subaddress odd-even indicator (%u)\n",
9987 memcpy(redirecting->
priv_orig.
tag, data + pos, ie_len);
10003 (
unsigned) ie_len);
10011 (
unsigned) ie_len);
10019 (
unsigned) ie_len);
10036 (
unsigned) ie_len);
10044 (
unsigned) ie_len);
10052 (
unsigned) ie_len);
10069 (
unsigned) ie_len);
10077 "Invalid private redirecting-from subaddress odd-even indicator (%u)\n",
10078 (
unsigned) ie_len);
10086 (
unsigned) ie_len);
10096 memcpy(redirecting->
priv_from.
tag, data + pos, ie_len);
10112 (
unsigned) ie_len);
10120 (
unsigned) ie_len);
10128 (
unsigned) ie_len);
10145 (
unsigned) ie_len);
10153 (
unsigned) ie_len);
10161 (
unsigned) ie_len);
10178 (
unsigned) ie_len);
10186 "Invalid private redirecting-to subaddress odd-even indicator (%u)\n",
10187 (
unsigned) ie_len);
10195 (
unsigned) ie_len);
10205 memcpy(redirecting->
priv_to.
tag, data + pos, ie_len);
10211 if (ie_len !=
sizeof(
value)) {
10213 (
unsigned) ie_len);
10224 memcpy(redirecting->
reason.
str, data + pos, ie_len);
10230 if (ie_len !=
sizeof(
value)) {
10232 (
unsigned) ie_len);
10249 if (ie_len !=
sizeof(
value)) {
10251 (
unsigned) ie_len);
10259 ast_debug(1,
"Unknown redirecting element: %u (%u)\n",
10260 (
unsigned) ie_id, (
unsigned) ie_len);
10265 switch (frame_version) {
10277 if (got_from_combined_presentation) {
10285 if (got_to_combined_presentation) {
10298 ast_debug(1,
"Redirecting frame has newer version: %u\n",
10299 (
unsigned) frame_version);
10308 unsigned char data[1024];
10312 if (datalen == (
size_t) -1) {
10321 unsigned char data[1024];
10325 if (datalen == (
size_t) -1) {
10349 in_intercept_mode ? &(
int) { 1 } :
NULL);
10363 const char *sub_args;
10378 const struct ast_frame *frame = connected_info;
10408 const char *sub_args;
10423 const struct ast_frame *frame = redirecting_info;
10468 .
type =
"Call Completion",
10491 cc_datastore->
data = cc_params;
10515 return cc_datastore->
data;
10520 int len = name_buffer_length;
10528 if ((dash = strrchr(device_name,
'-'))) {
10583 return ((hangup_test || unbridge) && (hangup_test == hangup_flags));
10609 if (bridge_channel) {
10612 return bridge_channel;
10627 } my_vars = { 0, };
10643 my_vars.priority++;
10652 my_vars.exten, my_vars.context,
NULL, yankee, my_vars.
amaflags,
10653 "Surrogate/%s", my_vars.name))) {
10673 return yanked_chan;
10693 if (dest == source) {
10705 "Can't move channel. One or both is dead (%s <-- %s)\n",
10732 .
type =
"suppressvoice",
10757 int suppress_frame = 0;
10768 suppress_frame = 1;
10770 suppress_frame = 1;
10773 if (suppress_frame) {
10791 switch (frametype) {
10813 ast_log(
LOG_WARNING,
"Attempted to suppress an unsupported frame type (%u).\n", frametype);
10818 suppress = datastore->
data;
10824 ast_log(
LOG_WARNING,
"Failed to allocate data while attempting to suppress a stream.\n");
10831 interface.
data = suppress;
10834 if (framehook_id < 0) {
10836 ast_log(
LOG_WARNING,
"Failed to attach framehook while attempting to suppress a stream.\n");
10847 ast_log(
LOG_WARNING,
"Failed to allocate datastore while attempting to suppress a stream.\n");
10854 datastore->
data = suppress;
10877 suppress = datastore->
data;
10899 & ~AST_SOFTHANGUP_ASYNCGOTO);
10911 ast_log(
LOG_DTMF,
"DTMF end '%c' simulated on %s due to %s, duration %ld ms\n",
10921 .
type =
"bridge-features",
10933 return datastore->
data;
10943 ds_features = datastore->
data;
10960 if (!ds_features) {
10968 datastore->
data = ds_features;
11003 ast_debug(2,
"%s: Topologies already match. Current: %s Requested: %s\n",
Prototypes for public functions only of internal interest,.
void ast_jb_destroy(struct ast_channel *chan)
Destroys jitterbuffer on a channel.
static struct aco_type agent_type
static struct ast_generator gen
struct sla_ringing_trunk * first
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
int ast_shutting_down(void)
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_strndup(str, len)
A wrapper for strndup()
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_malloc(len)
A wrapper for malloc()
#define ao2_iterator_next(iter)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_NOLOCK
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
void ao2_container_unregister(const char *name)
Unregister a container for CLI stats and integrity check.
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define ao2_callback_data(container, flags, cb_fn, arg, data)
#define ao2_unlink(container, obj)
Remove an object from a container.
#define ao2_link_flags(container, obj, flags)
Add an object to a container.
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_replace(dst, src)
Replace one object reference with another cleaning up the original.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
int ao2_container_register(const char *name, struct ao2_container *self, ao2_prnt_obj_fn *prnt_obj)
Register a container for CLI stats and integrity check.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
int() ao2_callback_data_fn(void *obj, void *arg, void *data, int flags)
Type of a generic callback function.
@ OBJ_NOLOCK
Assume that the ao2_container is already locked.
#define ao2_alloc(data_size, destructor_fn)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
void() ao2_prnt_fn(void *where, const char *fmt,...)
Print output.
struct ast_frame * ast_audiohook_write_list(struct ast_channel *chan, struct ast_audiohook_list *audiohook_list, enum ast_audiohook_direction direction, struct ast_frame *frame)
Pass a frame off to be handled by the audiohook core.
@ AST_AUDIOHOOK_DIRECTION_READ
@ AST_AUDIOHOOK_DIRECTION_WRITE
int ast_audiohook_write_list_empty(struct ast_audiohook_list *audiohook_list)
Determine if a audiohook_list is empty or not.
void ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list)
Detach audiohooks from list and destroy said list.
void ast_audiohook_move_all(struct ast_channel *old_chan, struct ast_channel *new_chan)
Move all audiohooks from one channel to another.
"smart" channels that update automatically if a channel is masqueraded
void ast_autochan_new_channel(struct ast_channel *old_chan, struct ast_channel *new_chan)
Switch what channel autochans point to.
struct ast_channel * ast_bridge_peer(struct ast_bridge *bridge, struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
void ast_bridge_notify_masquerade(struct ast_channel *chan)
Notify bridging that this channel was just masqueraded.
int ast_bridge_features_init(struct ast_bridge_features *features)
Initialize bridge features structure.
struct ast_bridge_features * ast_bridge_features_new(void)
Allocate a new bridge features struct.
void ast_bridge_features_merge(struct ast_bridge_features *into, const struct ast_bridge_features *from)
Merge one ast_bridge_features into another.
void ast_bridge_features_cleanup(struct ast_bridge_features *features)
Clean up the contents of a bridge features structure.
void ast_bridge_features_destroy(struct ast_bridge_features *features)
Destroy an allocated bridge features struct.
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
#define AST_PRES_USER_NUMBER_UNSCREENED
#define AST_PRES_UNAVAILABLE
#define AST_PRES_RESTRICTED
@ AST_CONNECTED_LINE_UPDATE_SOURCE_UNKNOWN
#define AST_PRES_NUMBER_NOT_AVAILABLE
@ AST_REDIRECTING_REASON_UNKNOWN
#define AST_PRES_NUMBER_TYPE
#define AST_PRES_RESTRICTION
#define AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED
Internal Asterisk hangup causes.
#define AST_CAUSE_SWITCH_CONGESTION
#define AST_CAUSE_NUMBER_PORTED_NOT_HERE
#define AST_CAUSE_CONGESTION
#define AST_CAUSE_INVALID_IE_CONTENTS
#define AST_CAUSE_UNALLOCATED
#define AST_CAUSE_INTERWORKING
#define AST_CAUSE_PROTOCOL_ERROR
#define AST_CAUSE_NUMBER_CHANGED
#define AST_CAUSE_BEARERCAPABILITY_NOTAVAIL
#define AST_CAUSE_CALL_AWARDED_DELIVERED
#define AST_CAUSE_INVALID_NUMBER_FORMAT
#define AST_CAUSE_OUTGOING_CALL_BARRED
#define AST_CAUSE_CHAN_NOT_IMPLEMENTED
#define AST_CAUSE_WRONG_MESSAGE
#define AST_CAUSE_INCOMPATIBLE_DESTINATION
#define AST_CAUSE_BEARERCAPABILITY_NOTAUTH
#define AST_CAUSE_DESTINATION_OUT_OF_ORDER
#define AST_CAUSE_NO_USER_RESPONSE
#define AST_CAUSE_NORMAL_TEMPORARY_FAILURE
#define AST_CAUSE_MESSAGE_TYPE_NONEXIST
#define AST_CAUSE_MANDATORY_IE_LENGTH_ERROR
#define AST_CAUSE_REDIRECTED_TO_NEW_DESTINATION
#define AST_CAUSE_FACILITY_NOT_SUBSCRIBED
#define AST_CAUSE_BEARERCAPABILITY_NOTIMPL
#define AST_CAUSE_WRONG_CALL_STATE
#define AST_CAUSE_PRE_EMPTED
#define AST_CAUSE_REQUESTED_CHAN_UNAVAIL
#define AST_CAUSE_NORMAL_CIRCUIT_CONGESTION
#define AST_CAUSE_CHANNEL_UNACCEPTABLE
#define AST_CAUSE_NOTDEFINED
#define AST_CAUSE_CALL_REJECTED
#define AST_CAUSE_SUBSCRIBER_ABSENT
#define AST_CAUSE_NETWORK_OUT_OF_ORDER
#define AST_CAUSE_INVALID_CALL_REFERENCE
#define AST_CAUSE_FACILITY_REJECTED
#define AST_CAUSE_ANSWERED_ELSEWHERE
#define AST_CAUSE_NORMAL_UNSPECIFIED
#define AST_CAUSE_FACILITY_NOT_IMPLEMENTED
#define AST_CAUSE_INCOMING_CALL_BARRED
#define AST_CAUSE_MANDATORY_IE_MISSING
#define AST_CAUSE_NOSUCHDRIVER
#define AST_CAUSE_ACCESS_INFO_DISCARDED
#define AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE
#define AST_CAUSE_NO_ROUTE_TRANSIT_NET
#define AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY
#define AST_CAUSE_NO_ROUTE_DESTINATION
#define AST_CAUSE_INVALID_MSG_UNSPECIFIED
#define AST_CAUSE_NO_ANSWER
#define AST_CAUSE_NORMAL_CLEARING
#define AST_CAUSE_MISDIALLED_TRUNK_PREFIX
#define AST_CAUSE_IE_NONEXIST
#define AST_CAUSE_USER_BUSY
#define ast_cc_config_params_init()
Allocate and initialize an ast_cc_config_params structure.
void ast_cc_config_params_destroy(struct ast_cc_config_params *params)
Free memory from CCSS configuration params.
int ast_cc_offer(struct ast_channel *caller_chan)
Offer CC to a caller.
void ast_cc_copy_config_params(struct ast_cc_config_params *dest, const struct ast_cc_config_params *src)
copy CCSS configuration parameters from one structure to another
void ast_cdr_free(struct ast_cdr *cdr)
Free a CDR record.
static int match(struct ast_sockaddr *addr, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int check_dcallno)
static struct ast_timer * timer
static char language[MAX_LANGUAGE]
static int indicate(void *data)
static int transfer(void *data)
static int hangup(void *data)
static int answer(void *data)
static int call(void *data)
static void send_text(unsigned char pos, unsigned char inverse, struct unistimsession *pte, const char *text)
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.
static void channels_shutdown(void)
static void channel_do_masquerade(struct ast_channel *original, struct ast_channel *clonechan)
Masquerade a channel.
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options)
says a number
struct varshead * ast_channel_get_manager_vars(struct ast_channel *chan)
Gets the variables for a given channel, as specified by ast_channel_set_manager_vars().
int ast_senddigit_mf_begin(struct ast_channel *chan, char digit)
Send an MF digit to a channel.
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
static int kill_write(struct ast_channel *chan, struct ast_frame *frame)
void ast_softhangup_all(void)
Soft hangup all active channels.
int ast_channel_request_stream_topology_change(struct ast_channel *chan, struct ast_stream_topology *topology, void *change_source)
Request that the stream topology of a channel change.
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_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.
struct ast_channel * ast_channel_get_by_exten(const char *exten, const char *context)
Find a channel by extension and context.
static void channel_req_accountcodes(struct ast_channel *chan, const struct ast_channel *requestor, enum ast_channel_requestor_relationship relationship, int precious)
static int indicate_connected_line(struct ast_channel *chan, const void *data, size_t datalen)
void ast_party_name_init(struct ast_party_name *init)
Initialize the given name structure.
char * ast_recvtext(struct ast_channel *chan, int timeout)
Receives a text string from a channel Read a string of text from a channel.
static void generator_write_format_change(struct ast_channel *chan)
enum ast_channel_error ast_channel_errno(void)
Get error code for latest channel operation.
int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params)
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.
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.
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.
struct ast_channel * ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, int nfds, int *exception, int *outfd, int *ms)
Wait for x amount of time on a file descriptor to have input.
static int set_format(struct ast_channel *chan, struct ast_format_cap *cap_set, const int direction, int interleaved_stereo)
int ast_auto_answer(struct ast_channel *chan)
Answer a channel, if it's not already answered.
static int silence_generator_generate(struct ast_channel *chan, void *data, int len, int samples)
void ast_party_redirecting_init(struct ast_party_redirecting *init)
Initialize the given redirecting structure.
int ast_write(struct ast_channel *chan, struct ast_frame *fr)
Write a frame to a channel This function writes the given frame to the indicated channel.
int ast_call(struct ast_channel *chan, const char *addr, int timeout)
Make a call.
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.
static void handle_cause(int cause, int *outstate)
void ast_channel_clear_flag(struct ast_channel *chan, unsigned int flag)
Clear a flag on a channel.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
static void send_dtmf_begin_event(struct ast_channel *chan, enum DtmfDirection direction, const char digit)
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....
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
void ast_party_id_init(struct ast_party_id *init)
Initialize the given party id structure.
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.
void ast_channel_clear_softhangup(struct ast_channel *chan, int flag)
Clear a set of softhangup flags from a channel.
static void clone_variables(struct ast_channel *original, struct ast_channel *clonechan)
Clone channel variables from 'clone' channel into 'original' channel.
static char * handle_cli_core_show_channeltype(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Show details about a channel driver - CLI command.
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.
int ast_say_digit_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang)
says digits of a string
struct varshead * ast_channel_get_vars(struct ast_channel *chan)
Gets the variables for a given channel, as set using pbx_builtin_setvar_helper().
int ast_prod(struct ast_channel *chan)
Send empty audio to prime a channel driver.
int __ast_answer(struct ast_channel *chan, unsigned int delay)
Answer a channel, with a selectable delay before returning.
static int calc_monitor_jump(int samples, int sample_rate, int seek_rate)
calculates the number of samples to jump forward with in a monitor stream.
static struct ast_frame * kill_exception(struct ast_channel *chan)
static int ast_channel_make_compatible_helper(struct ast_channel *from, struct ast_channel *to)
Set up translation from one channel to another.
void ast_party_number_init(struct ast_party_number *init)
Initialize the given number structure.
static void suppress_framehook_fixup_cb(void *data, int framehook_id, struct ast_channel *old_chan, struct ast_channel *new_chan)
void ast_hangup(struct ast_channel *chan)
Hangup 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.
static int tonepair_generator(struct ast_channel *chan, void *data, int len, int samples)
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
void ast_moh_cleanup(struct ast_channel *chan)
int ast_raw_answer_with_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
Answer a channel passing in a stream topology.
int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int ftimeout, char *enders)
Reads multiple digits.
int ast_channel_sendurl(struct ast_channel *chan, const char *url)
Sends a URL on a given link Send URL on link.
struct ast_channel_iterator * ast_channel_iterator_destroy(struct ast_channel_iterator *i)
Destroy a channel iterator.
int ast_queue_hangup(struct ast_channel *chan)
Queue a hangup frame for channel.
static int ast_channel_by_exten_cb(void *obj, void *arg, void *data, int flags)
struct ast_channel * ast_channel_bridge_peer(struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
int ast_transfer_protocol(struct ast_channel *chan, char *dest, int *protocol)
Transfer a call to dest, if the channel supports transfer.
static int indicate_redirecting(struct ast_channel *chan, const void *data, size_t datalen)
static void(* ast_moh_cleanup_ptr)(struct ast_channel *)
static int set_security_requirements(const struct ast_channel *requestor, struct ast_channel *out)
static int does_id_conflict(const char *uniqueid)
static void ast_read_generator_actions(struct ast_channel *chan, struct ast_frame *f)
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.
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 ast_senddigit_begin(struct ast_channel *chan, char digit)
Send a DTMF digit to a channel.
static int channel_has_external_vars(struct external_vars *channelvars)
int ast_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
static int party_subaddress_build_data(unsigned char *data, size_t datalen, const struct ast_party_subaddress *subaddress, const char *label, const struct ast_party_subaddress_ies *ies)
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.
static int namedgroup_cmp_cb(void *obj, void *arg, int flags)
Comparison function used for named group container.
void ast_channel_unlink(struct ast_channel *chan)
Remove a channel from the global channels container.
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin)
Queue one or more frames to a channel's frame queue.
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_party_subaddress_init(struct ast_party_subaddress *init)
Initialize the given subaddress structure.
int ast_channel_has_hook_requiring_audio(struct ast_channel *chan)
Check if the channel has any active hooks that require audio.
int ast_readstring_full(struct ast_channel *c, char *s, int len, int timeout, int ftimeout, char *enders, int audiofd, int ctrlfd)
static const struct ast_datastore_info suppress_datastore_voice
void ast_party_connected_line_free(struct ast_party_connected_line *doomed)
Destroy the connected line information contents.
static const struct ast_datastore_info plc_ds_info
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.
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.
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.
static int party_name_build_data(unsigned char *data, size_t datalen, const struct ast_party_name *name, const char *label, const struct ast_party_name_ies *ies)
int ast_set_read_format_from_cap(struct ast_channel *chan, struct ast_format_cap *cap)
Sets read format on channel chan from capabilities Set read format for channel to whichever component...
int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
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...
static char * handle_cli_core_show_channeltypes(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Show channel types - CLI command.
int ast_senddigit(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel.
#define AST_DEFAULT_EMULATE_DTMF_DURATION
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.
const struct ast_channel_tech ast_kill_tech
Kill the channel channel driver technology descriptor.
int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *peer)
Make the frame formats of two channels compatible.
int ast_channel_queryoption(struct ast_channel *chan, int option, void *data, int *datalen, int block)
Checks the value of an option.
AST_THREADSTORAGE_RAW(in_intercept_routine)
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().
static void queue_dtmf_readq(struct ast_channel *chan, struct ast_frame *f)
static int ast_channel_hash_cb(const void *obj, const int flags)
static void * channel_cc_params_copy(void *data)
static int deactivate_silence_generator(struct ast_channel *chan)
static void tonepair_release(struct ast_channel *chan, void *params)
static struct varshead * channel_get_external_vars(struct external_vars *channelvars, struct ast_channel *chan)
int ast_channel_setoption(struct ast_channel *chan, int option, void *data, int datalen, int block)
Sets an option on a channel.
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
void ast_party_id_free(struct ast_party_id *doomed)
Destroy the party id contents.
void ast_channel_unregister(const struct ast_channel_tech *tech)
Unregister channel driver.
static const struct ast_datastore_info * suppress_get_datastore_information(enum ast_frame_type frametype)
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_waitfor_n_fd(int *fds, int n, int *ms, int *exception)
Wait for x amount of time on a file descriptor to have input.
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.
int ast_set_write_format_from_cap(struct ast_channel *chan, struct ast_format_cap *cap)
Sets write format on channel chan Set write format for channel to whichever component of "format" is ...
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_channel * ast_channel_iterator_next(struct ast_channel_iterator *i)
Get the next channel for a channel iterator.
void ast_set_variables(struct ast_channel *chan, struct ast_variable *vars)
adds a list of channel variables to a channel
struct ast_namedgroups * ast_ref_namedgroups(struct ast_namedgroups *groups)
static const struct ast_channel_tech null_tech
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.
static void silence_generator_release(struct ast_channel *chan, void *data)
static int namedgroup_hash_cb(const void *obj, const int flags)
Hashing function used for named group container.
struct ast_silence_generator * ast_channel_start_silence_generator(struct ast_channel *chan)
Starts a silence generator on the given channel.
static void(* ast_moh_stop_ptr)(struct ast_channel *)
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.
int ast_recvchar(struct ast_channel *chan, int timeout)
Receives a text character from a channel.
static struct external_vars ari_vars
struct ast_channel * ast_channel_yank(struct ast_channel *yankee)
Gain control of a channel in the system.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame.
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_say_ordinal(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options)
says an ordinal number
int ast_channel_get_intercept_mode(void)
Am I currently running an intercept dialplan routine.
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 ast_write_stream(struct ast_channel *chan, int stream_num, struct ast_frame *fr)
Write a frame to a stream This function writes the given frame to the indicated stream on the channel...
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.
int ast_settimeout_full(struct ast_channel *c, unsigned int rate, int(*func)(const void *data), void *data, unsigned int is_ao2_obj)
static int should_skip_dtmf(struct ast_channel *chan)
Determine whether or not we should ignore DTMF in the readq.
static struct ast_channel * __ast_channel_alloc_ap(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, struct ast_channel_initializers *initializers, const char *file, int line, const char *function, const char *name_fmt, va_list ap)
Create a new channel structure.
void ast_party_dialed_init(struct ast_party_dialed *init)
Initialize the given dialed structure.
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_setstate(struct ast_channel *chan, enum ast_channel_state state)
Change the state of a channel.
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.
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.
int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *to)
Inherit datastores from a parent to a child.
char * ast_transfercapability2str(int transfercapability)
Gives the string form of a given transfer capability.
void ast_channel_undefer_dtmf(struct ast_channel *chan)
Unset defer DTMF flag on channel.
static void deactivate_generator_nolock(struct ast_channel *chan)
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_deactivate_generator(struct ast_channel *chan)
static void channel_cc_params_destroy(void *data)
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.
struct ast_channel_iterator * ast_channel_iterator_by_exten_new(const char *exten, const char *context)
Create a new channel iterator based on extension.
int ast_check_hangup_locked(struct ast_channel *chan)
static const struct causes_map causes[]
static void plc_ds_destroy(void *data)
int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Compare a offset with when to hangup channel.
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.
void ast_install_music_functions(int(*start_ptr)(struct ast_channel *, const char *, const char *), void(*stop_ptr)(struct ast_channel *), void(*cleanup_ptr)(struct ast_channel *))
char * ast_print_group(char *buf, int buflen, ast_group_t group)
Print call group and pickup group —.
static void varshead_dtor(void *obj)
Destructor for lists of variables.
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_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_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....
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.
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 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.
static int safe_sleep_conditional(struct ast_channel *chan, int timeout_ms, int(*cond)(void *), void *data, unsigned int generate_silence)
Wait, look for hangups and condition arg.
static void __ast_change_name_nolink(struct ast_channel *chan, const char *newname)
this function simply changes the name of the channel and issues a manager_event with out unlinking an...
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.
int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang)
says digits
int ast_undestroyed_channels(void)
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
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 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_bridge_features * ast_channel_feature_hooks_get(struct ast_channel *chan)
Gets the channel-attached features a channel has access to upon being bridged.
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.
int ast_senddigit_mf_end(struct ast_channel *chan)
End sending an MF digit to a channel.
int ast_channel_move(struct ast_channel *dest, struct ast_channel *source)
Move a channel from its current location to a new location.
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.
void ast_party_redirecting_reason_init(struct ast_party_redirecting_reason *init)
Initialize the given redirecting reason structure.
int ast_senddigit_external(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel from an external thread.
int ast_sendtext(struct ast_channel *chan, const char *text)
Sends text to a channel.
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 *outstate, const char *cidnum, const char *cidname)
Request a channel of a given type, with data as optional information used by the low level module and...
struct ast_frame * ast_read_stream(struct ast_channel *chan)
Reads a frame, but does not filter to just the default streams.
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.
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_free(struct ast_party_name *doomed)
Destroy the party name contents.
@ AST_CONNECTED_LINE_NUMBER_VALID
@ AST_CONNECTED_LINE_SOURCE
@ AST_CONNECTED_LINE_PRIV_SUBADDRESS_VALID
@ AST_CONNECTED_LINE_PRIV_SUBADDRESS_ODD_EVEN
@ AST_CONNECTED_LINE_PRIV_NAME_VALID
@ AST_CONNECTED_LINE_PRIV_SUBADDRESS_TYPE
@ AST_CONNECTED_LINE_PRIV_NUMBER_PRESENTATION
@ AST_CONNECTED_LINE_NAME_CHAR_SET
@ AST_CONNECTED_LINE_SUBADDRESS_VALID
@ AST_CONNECTED_LINE_SUBADDRESS_ODD_EVEN
@ AST_CONNECTED_LINE_SUBADDRESS
@ AST_CONNECTED_LINE_PRIV_NUMBER_PLAN
@ AST_CONNECTED_LINE_NUMBER
@ AST_CONNECTED_LINE_ID_PRESENTATION
@ AST_CONNECTED_LINE_PRIV_NAME_PRESENTATION
@ AST_CONNECTED_LINE_PRIV_NAME
@ AST_CONNECTED_LINE_PRIV_NUMBER_VALID
@ AST_CONNECTED_LINE_NUMBER_PRESENTATION
@ AST_CONNECTED_LINE_PRIV_NAME_CHAR_SET
@ AST_CONNECTED_LINE_NAME
@ AST_CONNECTED_LINE_NAME_PRESENTATION
@ AST_CONNECTED_LINE_SUBADDRESS_TYPE
@ AST_CONNECTED_LINE_PRIV_SUBADDRESS
@ AST_CONNECTED_LINE_PRIV_TAG
@ AST_CONNECTED_LINE_NAME_VALID
@ AST_CONNECTED_LINE_PRIV_NUMBER
@ AST_CONNECTED_LINE_NUMBER_PLAN
@ AST_CONNECTED_LINE_VERSION
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.
void ast_party_dialed_free(struct ast_party_dialed *doomed)
Destroy the dialed party contents.
int ast_say_money_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang)
function to pronounce monetary amounts
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.
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_channel_inherit_variables(const struct ast_channel *parent, struct ast_channel *child)
Inherits channel variable from parent to child channel.
static ast_mutex_t channel_move_lock
static int namedgroup_match(void *obj, void *arg, int flags)
int ast_queue_frame_head(struct ast_channel *chan, struct ast_frame *fin)
Queue one or more frames to the head of a channel's frame queue.
static const struct ast_datastore_info cc_channel_datastore_info
static int channel_feature_hooks_set_full(struct ast_channel *chan, struct ast_bridge_features *features, int replace)
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_sendhtml(struct ast_channel *chan, int subclass, const char *data, int datalen)
Sends HTML on given channel Send HTML or URL on link.
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 *outstate, 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...
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 ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
static void free_external_channelvars(struct external_vars *channelvars)
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_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options)
says an enumeration
int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
Queue a hangup frame for channel.
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.
void ast_party_caller_free(struct ast_party_caller *doomed)
Destroy the caller party contents.
struct ast_channel * __ast_dummy_channel_alloc(const char *file, int line, const char *function)
const char * ast_cause2str(int cause)
Gives the string form of a given hangup cause.
const char * ast_channel_amaflags2string(enum ama_flags flag)
Convert the enum representation of an AMA flag to a string representation.
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_active_channels(void)
returns number of active/allocated channels
static struct ast_frame * kill_read(struct ast_channel *chan)
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)
static const struct set_format_access set_format_access_write
struct ast_namedgroups * ast_get_namedgroups(const char *s)
Create an ast_namedgroups set with group names from comma separated string.
static struct ast_generator tonepair
static int generator_force(const void *data)
static void call_forward_inherit(struct ast_channel *new_chan, struct ast_channel *parent, struct ast_channel *orig)
static void adjust_frame_for_plc(struct ast_channel *chan, struct ast_frame *frame, struct ast_datastore *datastore)
void ast_uninstall_music_functions(void)
static void channel_set_intercept_mode(int in_intercept_mode)
int ast_channels_init(void)
int ast_waitfordigit_full(struct ast_channel *c, int timeout_ms, const char *breakon, int audiofd, int cmdfd)
Wait for a digit Same as ast_waitfordigit() with audio fd for outputting read audio and ctrlfd to mon...
int ast_check_hangup(struct ast_channel *chan)
Checks to see if a channel is needing hang up.
static void prnt_channel_key(void *v_obj, void *where, ao2_prnt_fn *prnt)
int ast_say_character_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang, enum ast_say_case_sensitivity sensitivity)
function to pronounce character and phonetic strings
static struct external_vars ami_vars
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.
static void features_destroy(void *obj)
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_channel_is_bridged(const struct ast_channel *chan)
Determine if a channel is in a bridge.
static int kill_hangup(struct ast_channel *chan)
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.
const char * ast_channel_reason2str(int reason)
return an english explanation of the code returned thru __ast_request_and_dial's 'outstate' argument
struct ast_frame * ast_read_noaudio(struct ast_channel *chan)
Reads a frame, returning AST_FRAME_NULL frame if audio.
int64_t ast_channel_get_duration_ms(struct ast_channel *chan)
Obtain how long it's been, in milliseconds, since the channel was created.
struct ast_bridge * ast_channel_get_bridge(const struct ast_channel *chan)
Get the bridge associated with a channel.
static void suppress_datastore_destroy_cb(void *data)
struct ast_channel * ast_channel_release(struct ast_channel *chan)
Unlink and release reference to a channel.
static int ast_channel_softhangup_cb(void *obj, void *arg, int flags)
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_set_hangupsource(struct ast_channel *chan, const char *source, int force)
Set the source of the hangup in this channel and it's bridge.
void ast_channel_set_flag(struct ast_channel *chan, unsigned int flag)
Set a flag on a channel.
int ast_softhangup(struct ast_channel *chan, int cause)
Softly hangup a channel, lock.
static void send_flash_event(struct ast_channel *chan)
int ast_write_video(struct ast_channel *chan, struct ast_frame *fr)
Write video frame to a channel This function writes the given frame to the indicated channel.
static void send_dtmf_end_event(struct ast_channel *chan, enum DtmfDirection direction, const char digit, long duration_ms)
void ast_channel_name_to_dial_string(char *channel_name)
Removes the trailing identifiers from a channel name string.
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.
struct ast_channel * __ast_channel_alloc_with_initializers(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, struct ast_channel_initializers *initializers, const char *file, int line, const char *function, const char *name_fmt,...)
Create a channel structure.
int ast_queue_unhold(struct ast_channel *chan)
Queue an unhold frame.
static void destroy_hooks(struct ast_channel *chan)
int ast_channel_connected_line_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const void *connected_info, int is_frame)
Run a connected line interception subroutine and update a channel's connected line information.
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.
int ast_channel_has_manager_vars(void)
Return whether or not any manager variables have been set.
void ast_party_id_reset(struct ast_party_id *id)
Destroy and initialize the given party id structure.
void ast_party_id_invalidate(struct ast_party_id *id)
Invalidate all components of the given party id.
int ast_queue_hold(struct ast_channel *chan, const char *musicclass)
Queue a hold frame.
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 ast_senddigit_end(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel.
int ast_channel_has_ari_vars(void)
Return whether or not any ARI variables have been set.
int ast_channel_register(const struct ast_channel_tech *tech)
Register a new telephony channel in Asterisk.
int ast_say_phonetic_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang)
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.
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...
#define DEFAULT_EMULATE_MF_DURATION
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 ast_settimeout(struct ast_channel *c, unsigned int rate, int(*func)(const void *data), void *data)
Enable or disable timer ticks for a channel.
static const struct ast_channel_tech surrogate_tech
Channel technology used to extract a channel from a running application. The channel created with thi...
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
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_number_free(struct ast_party_number *doomed)
Destroy the party number contents.
void ast_party_connected_line_init(struct ast_party_connected_line *init)
Initialize the given connected line structure.
int ast_channel_get_up_time(struct ast_channel *chan)
Obtain how long it has been since the channel was answered.
static char * complete_channeltypes(struct ast_cli_args *a)
int ast_channel_is_leaving_bridge(struct ast_channel *chan)
Determine if a channel is leaving a bridge, but not hung up.
void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Set when to hangup channel.
int ast_redirecting_parse_data(const unsigned char *data, size_t datalen, struct ast_party_redirecting *redirecting)
Parse redirecting indication frame data.
static int indicate_data_internal(struct ast_channel *chan, int _condition, const void *data, size_t datalen)
struct ast_variable * ast_channeltype_list(void)
return an ast_variable list of channeltypes
int ast_say_digits_full(struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd)
Same as ast_say_digits() with audiofd for received audio and returns 1 on ctrlfd being readable.
struct ast_bridge_channel * ast_channel_get_bridge_channel(struct ast_channel *chan)
Get a reference to the channel's bridge pointer.
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.
static struct ast_generator silence_generator
int ast_safe_sleep_conditional(struct ast_channel *chan, int timeout_ms, int(*cond)(void *), void *data)
Wait for a specified amount of time, looking for hangups and a condition argument.
static void suppress_framehook_destroy_cb(void *data)
static void channel_set_external_vars(struct external_vars *channelvars, size_t varc, char **vars)
int ast_transfer(struct ast_channel *chan, char *dest)
Transfer a call to dest, if the channel supports transfer.
static int ast_channel_by_uniqueid_cb(void *obj, void *arg, void *data, int flags)
static int party_id_build_data(unsigned char *data, size_t datalen, const struct ast_party_id *id, const char *label, const struct ast_party_id_ies *ies, const struct ast_set_party_id *update)
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.
void ast_party_redirecting_free(struct ast_party_redirecting *doomed)
Destroy the redirecting information contents.
static void free_translation(struct ast_channel *clonechan)
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
const char * ast_state2str(enum ast_channel_state state)
Gives the string form of a given channel state.
static int tech_write(struct ast_channel *chan, struct ast_stream *stream, struct ast_stream *default_stream, struct ast_frame *frame)
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.
int ast_softhangup_nolock(struct ast_channel *chan, int cause)
Softly hangup a channel, don't lock.
enum ama_flags ast_channel_string2amaflag(const char *flag)
Convert a string to a detail record AMA flag.
static int redirecting_reason_build_data(unsigned char *data, size_t datalen, const struct ast_party_redirecting_reason *reason, const char *label, const struct ast_party_redirecting_reason_ies *ies)
int ast_indicate_data(struct ast_channel *chan, int _condition, const void *data, size_t datalen)
Indicates condition of channel, with payload.
static struct ast_frame * suppress_framehook_event_cb(struct ast_channel *chan, struct ast_frame *frame, enum ast_framehook_event event, void *data)
static int attribute_const is_visible_indication(enum ast_control_frame_type condition)
static void ast_channel_destructor(void *obj)
Free a channel structure.
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().
static int party_number_build_data(unsigned char *data, size_t datalen, const struct ast_party_number *number, const char *label, const struct ast_party_number_ies *ies)
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.
static void apply_plc(struct ast_channel *chan, struct ast_frame *frame)
static struct ast_cli_entry cli_channel[]
int ast_pre_call(struct ast_channel *chan, const char *sub_args)
Execute a Gosub call on the channel before a call is placed.
int ast_channel_supports_html(struct ast_channel *chan)
Checks for HTML support on a channel.
static int ast_channel_by_name_cb(void *obj, void *arg, void *data, int flags)
int ast_queue_answer(struct ast_channel *chan, const struct ast_stream_topology *topology)
Queue an ANSWER control frame with topology.
int ast_str2cause(const char *name)
Convert a symbolic hangup cause to number.
static void * tonepair_alloc(struct ast_channel *chan, void *params)
struct ast_namedgroups * ast_unref_namedgroups(struct ast_namedgroups *groups)
void ast_party_subaddress_free(struct ast_party_subaddress *doomed)
Destroy the party subaddress contents.
static void set_channel_answer_time(struct ast_channel *chan)
static struct ao2_container * channels
All active channels on the system.
static void * silence_generator_alloc(struct ast_channel *chan, void *data)
int ast_channel_get_duration(struct ast_channel *chan)
Obtain how long the channel since the channel was created.
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.
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.
unsigned long global_fout
static struct ast_frame * __ast_read(struct ast_channel *chan, int dropaudio, int dropnondefault)
static struct ast_channel * request_channel(const char *type, struct ast_format_cap *request_cap, struct ast_stream_topology *topology, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
static int should_trigger_dtmf_emulating(struct ast_channel *chan)
Determine whether or not we have to trigger dtmf emulating using 50 fps timer events especially when ...
static int kill_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
static struct ast_threadstorage state2str_threadbuf
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.
static int __ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin, int head, struct ast_frame *after)
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.
const struct ast_channel_tech * ast_get_channel_tech(const char *name)
Get handle to channel driver based on name.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
int ast_channel_defer_dtmf(struct ast_channel *chan)
Set defer DTMF flag on channel.
static const struct ast_datastore_info bridge_features_info
int ast_tonepair(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
int ast_answer(struct ast_channel *chan)
Answer a channel.
void ast_change_name(struct ast_channel *chan, const char *newname)
Change channel name.
int ast_waitfor(struct ast_channel *c, int ms)
Wait for input on a channel.
static int ast_channel_cmp_cb(void *obj, void *arg, int flags)
ast_group_t ast_get_group(const char *s)
static const struct set_format_access set_format_access_read
int ast_channel_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
Bridge two channels together (early)
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
static const char * dtmf_direction_to_string(enum DtmfDirection direction)
int ast_is_deferrable_frame(const struct ast_frame *frame)
Should we keep this frame for later?
struct ast_channel_iterator * ast_channel_iterator_all_new(void)
Create a new channel iterator.
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait, look for hangups.
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.
static void send_wink_event(struct ast_channel *chan)
static int(* ast_moh_start_ptr)(struct ast_channel *, const char *, const char *)
struct ast_cc_config_params * ast_channel_get_cc_config_params(struct ast_channel *chan)
Get the CCSS parameters from a channel.
#define DEFAULT_AMA_FLAGS
int ast_raw_answer(struct ast_channel *chan)
Answer a channel.
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.
@ AST_REDIRECTING_FROM_NAME_PRESENTATION
@ AST_REDIRECTING_TO_NAME
@ AST_REDIRECTING_VERSION
@ AST_REDIRECTING_PRIV_FROM_NAME_VALID
@ AST_REDIRECTING_PRIV_FROM_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_FROM_NUMBER_PLAN
@ AST_REDIRECTING_PRIV_TO_NAME_VALID
@ AST_REDIRECTING_ORIG_TAG
@ AST_REDIRECTING_PRIV_ORIG_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_REASON_CODE
@ AST_REDIRECTING_PRIV_TO_NUMBER_VALID
@ AST_REDIRECTING_PRIV_TO_NUMBER_PRESENTATION
@ AST_REDIRECTING_ORIG_REASON_CODE
@ AST_REDIRECTING_TO_NAME_PRESENTATION
@ AST_REDIRECTING_PRIV_TO_NAME
@ AST_REDIRECTING_PRIV_ORIG_NAME_VALID
@ AST_REDIRECTING_ORIG_NUMBER_VALID
@ AST_REDIRECTING_FROM_NUMBER_PRESENTATION
@ AST_REDIRECTING_ORIG_SUBADDRESS_VALID
@ AST_REDIRECTING_FROM_NUMBER_VALID
@ AST_REDIRECTING_TO_NAME_VALID
@ AST_REDIRECTING_PRIV_FROM_NAME
@ AST_REDIRECTING_TO_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_ORIG_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_PRIV_FROM_SUBADDRESS_TYPE
@ AST_REDIRECTING_PRIV_TO_SUBADDRESS_VALID
@ AST_REDIRECTING_PRIV_TO_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_ORIG_NAME_CHAR_SET
@ AST_REDIRECTING_PRIV_FROM_SUBADDRESS
@ AST_REDIRECTING_TO_NUMBER_PLAN
@ AST_REDIRECTING_PRIV_TO_NUMBER
@ AST_REDIRECTING_PRIV_FROM_NUMBER_VALID
@ AST_REDIRECTING_ORIG_NAME
@ AST_REDIRECTING_ORIG_SUBADDRESS
@ AST_REDIRECTING_FROM_TAG
@ AST_REDIRECTING_PRIV_ORIG_NUMBER_PLAN
@ AST_REDIRECTING_TO_NUMBER
@ AST_REDIRECTING_ORIG_SUBADDRESS_TYPE
@ AST_REDIRECTING_FROM_NAME_CHAR_SET
@ AST_REDIRECTING_PRIV_FROM_TAG
@ AST_REDIRECTING_FROM_ID_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NUMBER
@ AST_REDIRECTING_PRIV_TO_NUMBER_PLAN
@ AST_REDIRECTING_TO_NUMBER_VALID
@ AST_REDIRECTING_FROM_SUBADDRESS_VALID
@ AST_REDIRECTING_FROM_NAME_VALID
@ AST_REDIRECTING_PRIV_TO_NAME_CHAR_SET
@ AST_REDIRECTING_PRIV_ORIG_TAG
@ AST_REDIRECTING_FROM_SUBADDRESS_TYPE
@ AST_REDIRECTING_PRIV_TO_TAG
@ AST_REDIRECTING_FROM_SUBADDRESS
@ AST_REDIRECTING_PRIV_ORIG_NAME_CHAR_SET
@ AST_REDIRECTING_ORIG_NAME_VALID
@ AST_REDIRECTING_TO_ID_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NUMBER_PLAN
@ AST_REDIRECTING_PRIV_TO_NAME_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NUMBER_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NAME_PRESENTATION
@ AST_REDIRECTING_PRIV_ORIG_SUBADDRESS_TYPE
@ AST_REDIRECTING_ORIG_REASON_STR
@ AST_REDIRECTING_ORIG_NAME_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NAME_CHAR_SET
@ AST_REDIRECTING_ORIG_NUMBER
@ AST_REDIRECTING_PRIV_ORIG_NAME
@ AST_REDIRECTING_PRIV_TO_SUBADDRESS_TYPE
@ AST_REDIRECTING_PRIV_ORIG_NUMBER_VALID
@ AST_REDIRECTING_PRIV_ORIG_NUMBER_PRESENTATION
@ AST_REDIRECTING_TO_SUBADDRESS_VALID
@ AST_REDIRECTING_PRIV_ORIG_SUBADDRESS_VALID
@ AST_REDIRECTING_TO_SUBADDRESS_TYPE
@ AST_REDIRECTING_REASON_STR
@ AST_REDIRECTING_FROM_NAME
@ AST_REDIRECTING_PRIV_ORIG_NUMBER
@ AST_REDIRECTING_PRIV_FROM_SUBADDRESS_VALID
@ AST_REDIRECTING_ORIG_NUMBER_PRESENTATION
@ AST_REDIRECTING_PRIV_TO_SUBADDRESS
@ AST_REDIRECTING_PRIV_ORIG_NAME_PRESENTATION
@ AST_REDIRECTING_TO_NUMBER_PRESENTATION
@ AST_REDIRECTING_FROM_NUMBER
@ AST_REDIRECTING_ORIG_NUMBER_PLAN
@ AST_REDIRECTING_FROM_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_PRIV_ORIG_SUBADDRESS
@ AST_REDIRECTING_TO_SUBADDRESS
@ AST_REDIRECTING_TO_NAME_CHAR_SET
char * ast_print_namedgroups(struct ast_str **buf, struct ast_namedgroups *group)
Print named call groups and named pickup groups.
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_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 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.
void ast_party_redirecting_reason_free(struct ast_party_redirecting_reason *doomed)
Destroy the redirecting reason contents.
#define STATE2STR_BUFSIZE
void ast_party_caller_init(struct ast_party_caller *init)
Initialize the given caller structure.
void ast_tonepair_stop(struct ast_channel *chan)
struct ast_channel * ast_waitfor_n(struct ast_channel **c, 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_channel_has_audio_frame_or_monitor(struct ast_channel *chan)
Check if the channel has active audiohooks, active framehooks, or a monitor.
static void ast_dummy_channel_destructor(void *obj)
Free a dummy channel structure.
General Asterisk PBX channel definitions.
void ast_channel_internal_alertpipe_swap(struct ast_channel *chan1, struct ast_channel *chan2)
Swap the interal alertpipe between two channels.
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
const char * ast_channel_name(const struct ast_channel *chan)
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
struct ast_bridge * ast_channel_internal_bridge(const struct ast_channel *chan)
struct timeval ast_channel_answertime(struct ast_channel *chan)
void ast_channel_named_pickupgroups_set(struct ast_channel *chan, struct ast_namedgroups *value)
int(* ast_timing_func_t)(const void *data)
struct ast_channel * ast_channel_masq(const struct ast_channel *chan)
int ast_channel_blocker_tid(const struct ast_channel *chan)
void ast_channel_stream_set(struct ast_channel *chan, struct ast_filestream *value)
void ast_channel_visible_indication_set(struct ast_channel *chan, int value)
const char * ast_channel_blockproc(const struct ast_channel *chan)
void ast_channel_caller_set(struct ast_channel *chan, struct ast_party_caller *value)
@ AST_CHAN_TP_INTERNAL
Channels with this particular technology are an implementation detail of Asterisk and should generall...
@ AST_CHAN_TP_SEND_TEXT_DATA
Channels have this property if they implement send_text_data.
void * ast_channel_tech_pvt(const struct ast_channel *chan)
void ast_channel_dialed_set(struct ast_channel *chan, struct ast_party_dialed *value)
struct ast_format * ast_channel_rawreadformat(struct ast_channel *chan)
void * ast_channel_music_state(const struct ast_channel *chan)
unsigned int ast_channel_fin(const struct ast_channel *chan)
const char * ast_channel_latest_musicclass(const struct ast_channel *chan)
void ast_channel_callid_cleanup(struct ast_channel *chan)
void ast_channel_set_oldwriteformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_softhangup_internal_flag_clear(struct ast_channel *chan, int value)
struct varshead * ast_channel_varshead(struct ast_channel *chan)
void ast_channel_generator_set(struct ast_channel *chan, struct ast_generator *value)
#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag,...)
Create a channel structure.
void ast_channel_sending_dtmf_digit_set(struct ast_channel *chan, char value)
void * ast_channel_timingdata(const struct ast_channel *chan)
int ast_channel_internal_alert_readfd(struct ast_channel *chan)
ast_channel_requestor_relationship
@ AST_CHANNEL_REQUESTOR_BRIDGE_PEER
@ AST_CHANNEL_REQUESTOR_REPLACEMENT
void ast_channel_dtmf_tv_set(struct ast_channel *chan, struct timeval *value)
struct ast_flags * ast_channel_snapshot_segment_flags(struct ast_channel *chan)
#define DATASTORE_INHERIT_FOREVER
#define CHECK_BLOCKING(c)
Set the blocking indication on the channel.
void ast_channel_internal_swap_endpoint_forward(struct ast_channel *a, struct ast_channel *b)
Swap endpoint_forward between two channels.
void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
const char * ast_channel_musicclass(const struct ast_channel *chan)
int ast_channel_fdno(const struct ast_channel *chan)
void ast_channel_internal_fd_clear_all(struct ast_channel *chan)
void ast_channel_internal_alertpipe_close(struct ast_channel *chan)
void ast_channel_answertime_set(struct ast_channel *chan, struct timeval *value)
void ast_channel_hold_state_set(struct ast_channel *chan, int value)
#define ast_channel_lock(chan)
struct ast_trans_pvt * ast_channel_readtrans(const struct ast_channel *chan)
struct ast_format_cap * ast_channel_nativeformats(const struct ast_channel *chan)
struct timeval ast_channel_sending_dtmf_tv(const struct ast_channel *chan)
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
struct ast_trans_pvt * ast_channel_writetrans(const struct ast_channel *chan)
void ast_channel_vstreamid_set(struct ast_channel *chan, int value)
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...
void ast_channel_timingdata_set(struct ast_channel *chan, void *value)
struct ast_cdr * ast_channel_cdr(const struct ast_channel *chan)
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
void ast_channel_redirecting_set(struct ast_channel *chan, struct ast_party_redirecting *value)
unsigned long long ast_group_t
@ AST_CHANNEL_ERROR_ID_EXISTS
int ast_channel_priority(const struct ast_channel *chan)
void ast_channel_writetrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
void ast_channel_streamid_set(struct ast_channel *chan, int value)
#define ast_channel_ref(c)
Increase channel reference count.
void ast_channel_generatordata_set(struct ast_channel *chan, void *value)
#define ast_channel_lock_both(chan1, chan2)
Lock two channels.
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
void ast_channel_softhangup_internal_flag_set(struct ast_channel *chan, int value)
ast_callid ast_channel_callid(const struct ast_channel *chan)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
const char * ast_channel_accountcode(const struct ast_channel *chan)
const char * ast_channel_context(const struct ast_channel *chan)
const char * ast_channel_userfield(const struct ast_channel *chan)
char ast_channel_dtmf_digit_to_emulate(const struct ast_channel *chan)
void ast_channel_timingfd_set(struct ast_channel *chan, int value)
#define AST_MUTE_DIRECTION_READ
pthread_t ast_channel_blocker(const struct ast_channel *chan)
ama_flags
Channel AMA Flags.
void ast_channel_sending_dtmf_tv_set(struct ast_channel *chan, struct timeval value)
#define ast_channel_trylock(chan)
const char * ast_channel_parkinglot(const struct ast_channel *chan)
void ast_channel_internal_swap_topics(struct ast_channel *a, struct ast_channel *b)
Swap topics beteween two channels.
const char * ast_channel_peeraccount(const struct ast_channel *chan)
struct timeval ast_channel_creationtime(struct ast_channel *chan)
struct ast_bridge_channel * ast_channel_internal_bridge_channel(const struct ast_channel *chan)
struct ast_framehook_list * ast_channel_framehooks(const struct ast_channel *chan)
void ast_channel_audiohooks_set(struct ast_channel *chan, struct ast_audiohook_list *value)
int ast_channel_fd(const struct ast_channel *chan, int which)
void ast_channel_timer_set(struct ast_channel *chan, struct ast_timer *value)
void ast_channel_internal_fd_set(struct ast_channel *chan, int which, int value)
void ast_channel_fin_set(struct ast_channel *chan, unsigned int value)
void ast_channel_set_rawreadformat(struct ast_channel *chan, struct ast_format *format)
struct ast_audiohook_list * ast_channel_audiohooks(const struct ast_channel *chan)
void ast_channel_tech_pvt_set(struct ast_channel *chan, void *value)
enum ama_flags ast_channel_amaflags(const struct ast_channel *chan)
void ast_channel_readtrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
void * ast_channel_generatordata(const struct ast_channel *chan)
struct ast_format * ast_channel_rawwriteformat(struct ast_channel *chan)
void ast_channel_set_is_t38_active_nolock(struct ast_channel *chan, int is_t38_active)
Variant of ast_channel_set_is_t38_active. Use this if the channel is already locked prior to calling.
const char * ast_channel_hangupsource(const struct ast_channel *chan)
unsigned int ast_channel_fout(const struct ast_channel *chan)
struct ast_stream_topology * ast_channel_get_stream_topology(const struct ast_channel *chan)
Retrieve the topology of streams on a channel.
#define AST_NUM_CHANNEL_BUCKETS
int ast_channel_hangupcause(const struct ast_channel *chan)
int ast_channel_timingfd(const struct ast_channel *chan)
void ast_channel_fdno_set(struct ast_channel *chan, int value)
void ast_channel_set_rawwriteformat(struct ast_channel *chan, struct ast_format *format)
struct ast_party_dialed * ast_channel_dialed(struct ast_channel *chan)
@ AST_PARTY_CHAR_SET_ISO8859_1
void ast_channel_creationtime_set(struct ast_channel *chan, struct timeval *value)
struct ast_tone_zone * ast_channel_zone(const struct ast_channel *chan)
int ast_channel_dialed_causes_add(const struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code, int datalen)
Add cause code information to the channel.
void ast_channel_named_callgroups_set(struct ast_channel *chan, struct ast_namedgroups *value)
int ast_channel_alert_write(struct ast_channel *chan)
struct ast_readq_list * ast_channel_readq(struct ast_channel *chan)
ast_timing_func_t ast_channel_timingfunc(const struct ast_channel *chan)
void ast_channel_set_readformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_dtmf_digit_to_emulate_set(struct ast_channel *chan, char value)
void ast_channel_softhangup_internal_flag_add(struct ast_channel *chan, int value)
struct timeval * ast_channel_whentohangup(struct ast_channel *chan)
#define ast_channel_unref(c)
Decrease channel reference count.
struct ast_stream * ast_channel_get_default_stream(struct ast_channel *chan, enum ast_media_type type)
Retrieve the default stream of a specific media type on a channel.
struct ast_filestream * ast_channel_vstream(const struct ast_channel *chan)
ast_alert_status_t ast_channel_internal_alert_read(struct ast_channel *chan)
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
@ AST_SOFTHANGUP_ASYNCGOTO
@ AST_SOFTHANGUP_EXPLICIT
@ AST_SOFTHANGUP_SHUTDOWN
void ast_channel_internal_swap_uniqueid_and_linkedid(struct ast_channel *a, struct ast_channel *b)
Swap uniqueid and linkedid beteween two channels.
struct ast_generator * ast_channel_generator(const struct ast_channel *chan)
int ast_channel_unbridged(struct ast_channel *chan)
This function will check if the bridge needs to be re-evaluated due to external changes.
int ast_channel_hold_state(const struct ast_channel *chan)
void ast_channel_emulate_dtmf_duration_set(struct ast_channel *chan, unsigned int value)
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
const char * ast_channel_language(const struct ast_channel *chan)
struct ast_party_connected_line * ast_channel_connected_indicated(struct ast_channel *chan)
void ast_channel_cdr_set(struct ast_channel *chan, struct ast_cdr *value)
void ast_channel_context_set(struct ast_channel *chan, const char *value)
void ast_channel_connected_set(struct ast_channel *chan, struct ast_party_connected_line *value)
void ast_channel_timingfunc_set(struct ast_channel *chan, ast_timing_func_t value)
struct ast_sched_context * ast_channel_sched(const struct ast_channel *chan)
void ast_channel_state_set(struct ast_channel *chan, enum ast_channel_state)
int ast_channel_fd_count(const struct ast_channel *chan)
Retrieve the number of file decriptor positions present on the channel.
#define AST_MUTE_DIRECTION_WRITE
struct ast_frame * ast_channel_dtmff(struct ast_channel *chan)
void ast_channel_internal_swap_snapshots(struct ast_channel *a, struct ast_channel *b)
Swap snapshots beteween two channels.
unsigned int ast_channel_emulate_dtmf_duration(const struct ast_channel *chan)
static int ast_add_fd(struct pollfd *pfd, int fd)
if fd is a valid descriptor, set *pfd with the descriptor
const char * ast_channel_call_forward(const struct ast_channel *chan)
@ AST_FLAG_DISABLE_DEVSTATE_CACHE
@ AST_FLAG_SNAPSHOT_STAGE
@ AST_FLAG_TIMINGDATA_IS_AO2_OBJ
#define AST_JITTERBUFFER_FD
struct ast_filestream * ast_channel_stream(const struct ast_channel *chan)
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
void ast_channel_fout_set(struct ast_channel *chan, unsigned int value)
struct ast_autochan_list * ast_channel_autochans(struct ast_channel *chan)
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
void ast_channel_zone_set(struct ast_channel *chan, struct ast_tone_zone *value)
struct ast_channel * ast_channel_masqr(const struct ast_channel *chan)
int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
struct timeval * ast_channel_dtmf_tv(struct ast_channel *chan)
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
char ast_channel_sending_dtmf_digit(const struct ast_channel *chan)
int ast_channel_visible_indication(const struct ast_channel *chan)
#define FRAMECOUNT_INC(x)
struct ast_timer * ast_channel_timer(const struct ast_channel *chan)
struct ast_hangup_handler_list * ast_channel_hangup_handlers(struct ast_channel *chan)
void ast_channel_masqr_set(struct ast_channel *chan, struct ast_channel *value)
void ast_channel_callid_set(struct ast_channel *chan, ast_callid value)
void ast_channel_internal_alertpipe_clear(struct ast_channel *chan)
void ast_channel_priority_set(struct ast_channel *chan, int value)
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
void ast_channel_whentohangup_set(struct ast_channel *chan, struct timeval *value)
#define ast_channel_cleanup(c)
Cleanup a channel reference.
int ast_channel_fd_isset(const struct ast_channel *chan, int which)
void ast_channel_adsicpe_set(struct ast_channel *chan, enum ast_channel_adsicpe value)
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
int ast_channel_internal_alertpipe_init(struct ast_channel *chan)
void ast_channel_sched_set(struct ast_channel *chan, struct ast_sched_context *value)
void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
const char * ast_channel_exten(const struct ast_channel *chan)
struct ast_datastore_list * ast_channel_datastores(struct ast_channel *chan)
#define ast_channel_unlock(chan)
void ast_channel_masq_set(struct ast_channel *chan, struct ast_channel *value)
void ast_channel_set_writeformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_vstream_set(struct ast_channel *chan, struct ast_filestream *value)
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
int ast_channel_alert_writable(struct ast_channel *chan)
Internal channel functions for channel.c to use.
void ast_channel_internal_set_stream_topology_change_source(struct ast_channel *chan, void *change_source)
void ast_channel_internal_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
int ast_channel_internal_is_finalized(struct ast_channel *chan)
struct ast_channel * __ast_channel_internal_alloc_with_initializers(void(*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const struct ast_channel_initializers *initializers, const char *file, int line, const char *function)
enum ast_channel_error ast_channel_internal_errno(void)
void ast_channel_internal_swap_stream_topology(struct ast_channel *chan1, struct ast_channel *chan2)
void ast_channel_internal_cleanup(struct ast_channel *chan)
struct ast_channel * __ast_channel_internal_alloc(void(*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *file, int line, const char *function)
int ast_channel_internal_setup_topics(struct ast_channel *chan)
void ast_channel_internal_finalize(struct ast_channel *chan)
void ast_channel_internal_errno_set(enum ast_channel_error error)
ast_channel_state
ast_channel states
@ AST_STATE_DIALING_OFFHOOK
const char * ast_var_name(const struct ast_var_t *var)
#define ast_var_assign(name, value)
const char * ast_var_full_name(const struct ast_var_t *var)
const char * ast_var_value(const struct ast_var_t *var)
void ast_var_delete(struct ast_var_t *var)
Standard Command Line Interface.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
#define AST_CLI_DEFINE(fn, txt,...)
int ast_cli_completion_add(char *value)
Add a result to a request for completion options.
void ast_cli(int fd, const char *fmt,...)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
ast_media_type
Types of media.
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
#define ast_datastore_alloc(info, uid)
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
@ AST_DEVSTATE_NOT_CACHABLE
int ast_devstate_changed_literal(enum ast_device_state state, enum ast_devstate_cache cachable, const char *device)
Tells Asterisk the State for Device is changed.
static const float mf_tones[]
int ast_endpoint_add_channel(struct ast_endpoint *endpoint, struct ast_channel *chan)
Adds a channel to the given endpoint.
Call Parking and Pickup API Includes code and algorithms from the Zapata library.
Generic File Format Support. Should be included by clients of the file handling routines....
int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd)
int ast_stopstream(struct ast_channel *c)
Stops a stream.
int ast_closestream(struct ast_filestream *f)
Closes a stream.
int ast_framehook_list_contains_no_active_of_type(struct ast_framehook_list *framehooks, enum ast_frame_type type)
Determine if a framehook list is free of active framehooks consuming a specific type of frame.
int ast_framehook_attach(struct ast_channel *chan, struct ast_framehook_interface *i)
Attach an framehook onto a channel for frame interception.
ast_framehook_event
These are the types of events that the framehook's event callback can receive.
@ AST_FRAMEHOOK_EVENT_WRITE
@ AST_FRAMEHOOK_EVENT_READ
struct ast_frame * ast_framehook_list_read_event(struct ast_framehook_list *framehooks, struct ast_frame *frame)
This is used by the channel API push a frame read event to a channel's framehook list.
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
int ast_framehook_list_destroy(struct ast_channel *chan)
This is used by the channel API to detach and destroy all framehooks on a channel during channel dest...
void ast_framehook_list_fixup(struct ast_channel *old_chan, struct ast_channel *new_chan)
This is used by the channel API during a masquerade operation to move all mobile framehooks from the ...
int ast_framehook_list_contains_no_active(struct ast_framehook_list *framehooks)
Determine if a framehook list is free of active framehooks or not.
int ast_framehook_list_is_empty(struct ast_framehook_list *framehooks)
Determine if an framehook list is empty or not.
struct ast_frame * ast_framehook_list_write_event(struct ast_framehook_list *framehooks, struct ast_frame *frame)
This is used by the channel API push a frame write event to a channel's framehook list.
#define AST_FRAMEHOOK_INTERFACE_VERSION
static int replace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
globally accessible channel datastores
const struct ast_datastore_info secure_call_info
#define SCOPE_TRACE(__level,...)
struct stasis_message_type * ast_channel_masquerade_type(void)
Message type for when a channel is being masqueraded.
void ast_channel_publish_varset(struct ast_channel *chan, const char *variable, const char *value)
Publish a ast_channel_publish_varset for a channel.
struct stasis_message_type * ast_channel_hold_type(void)
Message type for when a channel is placed on hold.
struct stasis_message_type * ast_channel_dtmf_begin_type(void)
Message type for when DTMF begins on a channel.
void ast_channel_snapshot_invalidate_segment(struct ast_channel *chan, enum ast_channel_snapshot_segment_invalidation segment)
Invalidate a channel snapshot segment from being reused.
void ast_channel_publish_final_snapshot(struct ast_channel *chan)
Send the final channel snapshot for a channel, thus removing it from cache.
void ast_channel_stage_snapshot_done(struct ast_channel *chan)
Clear flag to indicate channel snapshot is being staged, and publish snapshot.
struct stasis_message_type * ast_channel_unhold_type(void)
Message type for when a channel is removed from hold.
struct stasis_message_type * ast_channel_hangup_request_type(void)
Message type for when a hangup is requested on a channel.
struct stasis_message_type * ast_channel_flash_type(void)
Message type for when a hook flash occurs on a channel.
struct stasis_message_type * ast_channel_dtmf_end_type(void)
Message type for when DTMF ends on a channel.
struct stasis_message_type * ast_channel_wink_type(void)
Message type for when a wink occurs on a channel.
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
void ast_channel_publish_blob(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Publish a channel blob message.
void ast_channel_stage_snapshot(struct ast_channel *chan)
Set flag to indicate channel snapshot is being staged.
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CONNECTED
const char * ast_msg_data_get_attribute(struct ast_msg_data *msg, enum ast_msg_data_attribute_type attribute_type)
Get attribute from ast_msg_data.
struct ast_msg_data * ast_msg_data_alloc(enum ast_msg_data_source_type source, struct ast_msg_data_attribute attributes[], size_t count)
Allocates an ast_msg_data structure.
@ AST_MSG_DATA_ATTR_CONTENT_TYPE
@ AST_MSG_DATA_SOURCE_TYPE_UNKNOWN
unsigned int option_dtmfminduration
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
@ AST_GETDATA_INTERRUPTED
@ AST_GETDATA_EMPTY_END_TERMINATED
int ast_app_run_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const char *sub_location, const char *sub_args, int ignore_hangup)
Run a subroutine on a channel, placing an optional second channel into autoservice.
int ast_app_group_update(struct ast_channel *oldchan, struct ast_channel *newchan)
Update all group counting for a channel to a new one.
int ast_app_group_discard(struct ast_channel *chan)
Discard all group counting for a channel.
int ast_app_exec_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const char *sub_args, int ignore_hangup)
Run a subroutine on a channel, placing an optional second channel into autoservice.
char * strsep(char **str, const char *delims)
#define ast_variable_new(name, value, filename)
Asterisk internal frame definitions.
@ AST_T38_REQUEST_TERMINATE
@ AST_T38_REQUEST_NEGOTIATE
@ AST_FRAME_READ_ACTION_CONNECTED_LINE_MACRO
@ AST_FRAME_READ_ACTION_SEND_TEXT
@ AST_FRAME_READ_ACTION_SEND_TEXT_DATA
#define AST_OPTION_DEVICE_NAME
#define ast_frisolate(fr)
Makes a frame independent of any static storage.
void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
#define ast_frdup(fr)
Copies a frame.
#define AST_OPTION_FORMAT_WRITE
#define AST_OPTION_CC_AGENT_TYPE
#define AST_OPTION_SECURE_MEDIA
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
#define AST_OPTION_FORMAT_READ
#define AST_OPTION_SECURE_SIGNALING
ast_frame_type
Frame types.
@ AST_FRAME_BRIDGE_ACTION_SYNC
@ AST_FRAME_BRIDGE_ACTION
ast_control_frame_type
Internal control frame subtype field values.
@ AST_CONTROL_RECORD_CANCEL
@ AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED
@ AST_CONTROL_STREAM_RESTART
@ AST_CONTROL_STREAM_SUSPEND
@ AST_CONTROL_RADIO_UNKEY
@ AST_CONTROL_STREAM_TOPOLOGY_REQUEST_CHANGE
@ AST_CONTROL_STREAM_REVERSE
@ AST_CONTROL_REDIRECTING
@ AST_CONTROL_TAKEOFFHOOK
@ AST_CONTROL_T38_PARAMETERS
@ AST_CONTROL_READ_ACTION
@ AST_CONTROL_RECORD_STOP
@ AST_CONTROL_RECORD_MUTE
@ AST_CONTROL_STREAM_STOP
@ AST_CONTROL_STREAM_TOPOLOGY_CHANGED
@ AST_CONTROL_CONNECTED_LINE
@ AST_CONTROL_STREAM_FORWARD
@ AST_CONTROL_RECORD_SUSPEND
@ AST_CONTROL_MASQUERADE_NOTIFY
@ AST_CONTROL_PVT_CAUSE_CODE
@ AST_CONTROL_UPDATE_RTP_PEER
struct ast_frame ast_null_frame
#define ast_debug(level,...)
Log a DEBUG message.
void ast_log_callid(int level, const char *file, int line, const char *function, ast_callid callid, const char *fmt,...)
Used for sending a log message with a known call_id This is a modified logger function which is funct...
#define ast_verb(level,...)
static struct ast_tone_zone_sound * ast_tone_zone_sound_unref(struct ast_tone_zone_sound *ts)
Release a reference to an ast_tone_zone_sound.
int ast_playtones_start(struct ast_channel *chan, int vol, const char *tonelist, int interruptible)
Start playing a list of tones on a channel.
void ast_playtones_stop(struct ast_channel *chan)
Stop playing tones on a channel.
struct ast_tone_zone_sound * ast_get_indication_tone(const struct ast_tone_zone *zone, const char *indication)
Locate a tone zone sound.
static struct ast_tone_zone * ast_tone_zone_unref(struct ast_tone_zone *tz)
Release a reference to an ast_tone_zone.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
AST_JSON_INT_T ast_json_int_t
Primarily used to cast when packing to an "I" type.
A set of macros to manage forward-linked lists.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_LIST_LAST(head)
Returns the last entry contained in a list.
#define AST_RWLIST_TRAVERSE_SAFE_BEGIN
#define AST_LIST_INSERT_LIST_AFTER(head, list, elm, field)
Inserts a whole list after a specific entry in a list.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_RWLIST_HEAD_INIT(head)
Initializes an rwlist head structure.
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
#define AST_RWLIST_REMOVE_HEAD
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
#define AST_RWLIST_HEAD(name, type)
Defines a structure to be used to hold a read/write list of specified type.
#define AST_RWLIST_TRAVERSE
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define AST_RWLIST_INSERT_HEAD
#define AST_RWLIST_INSERT_TAIL
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_APPEND_LIST(head, list, field)
Appends a whole list to the tail of a list.
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
Asterisk locking-related definitions:
#define CHANNEL_DEADLOCK_AVOIDANCE(chan)
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
#define SCOPED_LOCK(varname, lock, lockfunc, unlockfunc)
Scoped Locks.
#define SCOPED_MUTEX(varname, lock)
scoped lock specialization for mutexes
#define AST_MUTEX_DEFINE_STATIC(mutex)
static struct groups groups
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define ast_manager_event(chan, category, event, contents,...)
int ast_max_forwards_decrement(struct ast_channel *chan)
Decrement the max forwards count for a particular channel.
Out-of-call text message support.
#define ast_opt_transcode_via_slin
#define ast_opt_generic_plc_on_equal_codecs
#define ast_opt_generic_plc
char ast_defaultlanguage[]
#define ast_opt_transmit_silence
Asterisk file paths, configured in asterisk.conf.
Core PBX routines and definitions.
void ast_pbx_hangup_handler_destroy(struct ast_channel *chan)
Destroy the hangup handler container on a channel.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name.
int ast_func_read2(struct ast_channel *chan, const char *function, struct ast_str **str, ssize_t maxlen)
executes a read operation on a function
void ast_pbx_hangup_handler_init(struct ast_channel *chan)
Init the hangup handler container on a channel.
int ast_pbx_hangup_handler_run(struct ast_channel *chan)
Run all hangup handlers on the channel.
int ast_func_write(struct ast_channel *chan, const char *function, const char *value)
executes a write operation on a function
int plc_fillin(plc_state_t *s, int16_t amp[], int len)
Fill-in a block of missing audio samples.
int plc_rx(plc_state_t *s, int16_t amp[], int len)
Process a block of received audio samples.
#define ast_poll(a, b, c)
struct stasis_forward * sub
Say numbers and dates (maybe words one day too)
SAY_EXTERN int(* ast_say_money_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_money_str_full)
SAY_EXTERN int(* ast_say_number_full)(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_number_full)
Same as ast_say_number() with audiofd for received audio and returns 1 on ctrlfd being readable.
SAY_EXTERN int(* ast_say_enumeration_full)(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_enumeration_full)
Same as ast_say_enumeration() with audiofd for received audio and returns 1 on ctrlfd being readable.
SAY_EXTERN int(* ast_say_ordinal_full)(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_ordinal_full)
Same as ast_say_number() with audiofd for received audio and returns 1 on ctrlfd being readable.
SAY_EXTERN int(* ast_say_character_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, enum ast_say_case_sensitivity sensitivity, int audiofd, int ctrlfd) SAY_INIT(ast_say_character_str_full)
SAY_EXTERN int(* ast_say_digit_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_digit_str_full)
Same as ast_say_digit_str() with audiofd for received audio and returns 1 on ctrlfd being readable.
ast_say_case_sensitivity
Controls how ast_say_character_str denotes the case of characters in a string.
SAY_EXTERN int(* ast_say_phonetic_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_phonetic_str_full)
Scheduler Routines (derived from cheops)
void ast_sched_context_destroy(struct ast_sched_context *c)
destroys a schedule context
struct ast_sched_context * ast_sched_context_create(void)
Create a scheduler context.
A machine to gather up arbitrary frames and convert them to raw slinear on demand.
int ast_stasis_channels_init(void)
Initialize the stasis channel topic and message types.
struct ast_stream_topology * ast_stream_topology_alloc(void)
Create a stream topology.
int ast_stream_get_position(const struct ast_stream *stream)
Get the position of the stream in the topology.
const char * ast_stream_topology_to_str(const struct ast_stream_topology *topology, struct ast_str **buf)
Get a string representing the topology for debugging/display purposes.
struct ast_stream * ast_stream_topology_get_stream(const struct ast_stream_topology *topology, unsigned int position)
Get a specific stream from the topology.
int ast_stream_topology_get_count(const struct ast_stream_topology *topology)
Get the number of streams in a topology.
enum ast_media_type ast_stream_get_type(const struct ast_stream *stream)
Get the media type of a stream.
void ast_stream_topology_free(struct ast_stream_topology *topology)
Unreference and destroy a stream topology.
struct ast_stream_topology * ast_stream_topology_create_from_format_cap(struct ast_format_cap *cap)
A helper function that, given a format capabilities structure, creates a topology and separates the m...
struct ast_format_cap * ast_stream_topology_get_formats(struct ast_stream_topology *topology)
Create a format capabilities structure representing the topology.
int ast_stream_topology_equal(const struct ast_stream_topology *left, const struct ast_stream_topology *right)
Compare two stream topologies to see if they are equal.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_tmp(init_len, __expr)
Provides a temporary ast_str and returns a copy of its buffer.
#define ast_str_alloca(init_len)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
static force_inline int attribute_pure ast_str_case_hash(const char *str)
Compute a hash value on a case-insensitive string.
char * ast_trim_blanks(char *str)
Trims trailing whitespace characters from a string.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static int force_inline attribute_pure ast_begins_with(const char *str, const char *prefix)
Checks whether a string begins with another.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Structure to pass both assignedid values to channel drivers.
Structure that contains information regarding a channel in a bridge.
struct ast_channel * chan
Structure that contains features information.
Structure that contains information about a bridge.
Helper struct for initializing additional channel information on channel creation.
struct ao2_iterator simple_iterator
struct ao2_iterator * active_iterator
Structure to describe a channel "technology", ie a channel driver See for examples:
int(*const write)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format (see frame.h)
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....
int(*const write_stream)(struct ast_channel *chan, int stream_num, struct ast_frame *frame)
Write a frame on a specific stream, in standard format (see frame.h)
struct ast_frame *(*const read_stream)(struct ast_channel *chan)
Read a frame (or chain of frames from the same stream), in standard format (see frame....
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(*const send_text)(struct ast_channel *chan, const char *text)
Display or transmit text.
int(*const write_text)(struct ast_channel *chan, struct ast_frame *frame)
Write a text frame, in standard format.
int(*const call)(struct ast_channel *chan, const char *addr, int timeout)
Make a call.
enum ast_bridge_result(*const early_bridge)(struct ast_channel *c0, struct ast_channel *c1)
Bridge two channels of the same type together (early)
int(*const send_text_data)(struct ast_channel *chan, struct ast_msg_data *data)
Display or transmit text with data.
int(*const hangup)(struct ast_channel *chan)
Hangup (and possibly destroy) the channel.
int(*const queryoption)(struct ast_channel *chan, int option, void *data, int *datalen)
Query a given option. Called with chan locked.
int(*const setoption)(struct ast_channel *chan, int option, void *data, int datalen)
Set a given option. Called with chan locked.
int(*const answer)(struct ast_channel *chan)
Answer the channel.
const char *const description
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(*const send_digit_end)(struct ast_channel *chan, char digit, unsigned int duration)
Stop sending a literal DTMF digit.
int(*const transfer)(struct ast_channel *chan, const char *newdest)
Blind transfer other side (see app_transfer.c and ast_transfer()
int(*const write_video)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format.
struct ast_frame *(*const exception)(struct ast_channel *chan)
Handle an exception, reading a frame.
int(*const send_html)(struct ast_channel *chan, int subclass, const char *data, int len)
Send HTML data.
int(*const answer_with_stream_topology)(struct ast_channel *chan, struct ast_stream_topology *topology)
Answer the channel with topology.
Main Channel structure associated with a channel.
struct ast_channel_id uniqueid
struct ast_party_connected_line connected
Channel Connected Line ID information.
const ast_string_field accountcode
struct ast_channel::@331 fds
char exten[AST_MAX_EXTENSION]
const struct ast_channel_tech * tech
struct ast_format * writeformat
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
struct ast_party_dialed dialed
Dialed/Called information.
char context[AST_MAX_CONTEXT]
const ast_string_field name
struct ast_format * readformat
struct ast_party_caller caller
Channel Caller ID information.
descriptor for a cli entry.
unsigned int emulate_sip_cause
char chan_name[AST_CHANNEL_NAME]
enum ast_frame_read_action action
enum ast_control_t38 request_response
Structure for a data store type.
void *(* duplicate)(void *data)
void(* chan_fixup)(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
Fix up channel references on the masquerading channel.
void(* chan_breakdown)(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
Fix up channel references on the channel being masqueraded into.
Structure for a data store object.
const struct ast_datastore_info * info
struct ast_format * format
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
union ast_frame::@226 data
enum ast_frame_type frametype
void(* digit)(struct ast_channel *chan, char digit)
int(* generate)(struct ast_channel *chan, void *data, int len, int samples)
void *(* alloc)(struct ast_channel *chan, void *params)
void(* release)(struct ast_channel *chan, void *data)
void(* write_format_change)(struct ast_channel *chan, void *data)
Abstract JSON element (object, array, string, int, ...).
enum ast_msg_data_attribute_type type
Structure used to transport a message through the frame core.
Caller Party information.
struct ast_party_id priv
Private caller party ID.
struct ast_party_id id
Caller party ID.
int ani2
Automatic Number Identification 2 (Info Digits)
struct ast_party_id ani
Automatic Number Identification (ANI)
Connected Line/Party information.
int source
Information about the source of an update.
struct ast_party_id priv
Private connected party ID.
struct ast_party_id id
Connected party ID.
int ani2
Automatic Number Identification 2 (Info Digits)
struct ast_party_id ani
Automatic Number Identification (ANI)
Dialed/Called Party information.
struct ast_party_dialed::@208 number
Dialed/Called number.
struct ast_party_subaddress subaddress
Dialed/Called subaddress.
char * str
Subscriber phone number (Malloced)
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
int transit_network_select
Transit Network Select.
struct ast_party_subaddress_ies subaddress
Subscriber subaddress ies.
struct ast_party_name_ies name
Subscriber name ies.
int combined_presentation
Combined name and number presentation ie.
struct ast_party_number_ies number
Subscriber phone number ies.
int tag
User party id tag ie.
Information needed to identify an endpoint in a call.
struct ast_party_subaddress subaddress
Subscriber subaddress.
char * tag
User-set "tag".
struct ast_party_name name
Subscriber name.
struct ast_party_number number
Subscriber phone number.
int char_set
Character set ie.
int presentation
presentation-indicator ie
int str
Subscriber name ie.
int valid
valid/present ie
Information needed to specify a name in a call.
int char_set
Character set the name is using.
int presentation
Q.931 encoded presentation-indicator encoded field.
unsigned char valid
TRUE if the name information is valid/present.
char * str
Subscriber name (Malloced)
int presentation
presentation-indicator ie
int str
Subscriber phone number ie.
int valid
valid/present ie
int plan
Type-Of-Number and Numbering-Plan ie.
Information needed to specify a number in a call.
int presentation
Q.931 presentation-indicator and screening-indicator encoded fields.
unsigned char valid
TRUE if the number information is valid/present.
char * str
Subscriber phone number (Malloced)
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
Redirecting reason information.
int code
enum AST_REDIRECTING_REASON value for redirection
char * str
a string value for the redirecting reason
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
struct ast_party_id priv_to
Call is redirecting to a new party (Sent to the caller) - private representation.
struct ast_party_redirecting_reason orig_reason
Reason for the redirection by the original party.
struct ast_party_redirecting_reason reason
Reason for the redirection.
struct ast_party_id priv_from
Who is redirecting the call (Sent to the party the call is redirected toward) - private representatio...
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
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)
struct ast_party_id orig
Who originally redirected the call (Sent to the party the call is redirected toward)
struct ast_party_id priv_orig
Who originally redirected the call (Sent to the party the call is redirected toward) - private repres...
int odd_even_indicator
odd/even indicator ie
int valid
valid/present ie
int type
subaddress type ie
Information needed to specify a subaddress in a call.
unsigned char odd_even_indicator
TRUE if odd number of address signals.
unsigned char valid
TRUE if the subaddress information is valid/present.
char * str
Malloced subaddress string.
int type
Q.931 subaddress type.
Indicate what information in ast_party_caller should be set.
Indicate what information in ast_party_connected_line should be set.
Indicate what information in ast_party_id should be set.
Indicate what information in ast_party_redirecting should be set.
struct ast_format * old_write_format
Support for dynamic strings.
const char * data
Description of a tone.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
struct ast_var_t::@211 entries
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
the list of registered channel types
map AST_CAUSE's to readable string representations
struct ast_channel * chan
const struct ast_channel_tech * tech
struct chanlist::@329 list
List of channel variables to append to all channel-related events.
struct manager_channel_variable::@330 entry
Named group member structure.
struct ast_variable * vars
int connect_on_early_media
struct ast_channel * parent_channel
enum ast_frame_type frametype
unsigned char offset[AST_FRIENDLY_OFFSET]
struct ast_format * origwfmt
#define ast_test_suite_event_notify(s, f,...)
static const struct ast_aeap_message_handler handlers[]
Definitions to aid in the use of thread local storage.
int ast_threadstorage_set_ptr(struct ast_threadstorage *ts, void *ptr)
Set a raw pointer from threadstorage.
void * ast_threadstorage_get_ptr(struct ast_threadstorage *ts)
Retrieve a raw pointer from threadstorage.
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
int ast_tvcmp(struct timeval _a, struct timeval _b)
Compress two struct timeval instances returning -1, 0, 1 if the first arg is smaller,...
int ast_remaining_ms(struct timeval start, int max_ms)
Calculate remaining milliseconds given a starting timestamp and upper bound.
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
struct timeval ast_tvsub(struct timeval a, struct timeval b)
Returns the difference of two timevals a - b.
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Timing source management.
unsigned int ast_timer_get_max_rate(const struct ast_timer *handle)
Get maximum rate supported for a timer.
void ast_timer_close(struct ast_timer *handle)
Close an opened timing handle.
int ast_timer_ack(const struct ast_timer *handle, unsigned int quantity)
Acknowledge a timer event.
int ast_timer_set_rate(const struct ast_timer *handle, unsigned int rate)
Set the timing tick rate.
enum ast_timer_event ast_timer_get_event(const struct ast_timer *handle)
Retrieve timing event.
int ast_timer_enable_continuous(const struct ast_timer *handle)
Enable continuous mode.
const char * ast_timer_get_name(const struct ast_timer *handle)
Get name of timer in use.
int ast_timer_disable_continuous(const struct ast_timer *handle)
Disable continuous mode.
struct ast_timer * ast_timer_open(void)
Open a timer.
@ AST_TIMING_EVENT_CONTINUOUS
@ AST_TIMING_EVENT_EXPIRED
int ast_timer_fd(const struct ast_timer *handle)
Get a poll()-able file descriptor for a timer.
General Asterisk channel transcoding definitions.
#define AST_TRANS_CAP_RESTRICTED_DIGITAL
#define AST_TRANS_CAP_DIGITAL
#define AST_TRANS_CAP_DIGITAL_W_TONES
#define AST_TRANS_CAP_SPEECH
#define AST_TRANS_CAP_3_1K_AUDIO
#define AST_TRANS_CAP_VIDEO
Support for translation of data formats. translate.c.
struct ast_frame * ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, int consume)
translates one or more frames Apply an input frame into the translator and receive zero or one output...
int ast_translator_best_choice(struct ast_format_cap *dst_cap, struct ast_format_cap *src_cap, struct ast_format **dst_fmt_out, struct ast_format **src_fmt_out)
Chooses the best translation path.
void ast_translator_free_path(struct ast_trans_pvt *tr)
Frees a translator path Frees the given translator path structure.
struct ast_trans_pvt * ast_translator_build_path(struct ast_format *dest, struct ast_format *source)
Builds a translator path Build a path (possibly NULL) from source to dest.
unsigned int ast_translate_path_steps(struct ast_format *dest, struct ast_format *src)
Returns the number of steps required to convert from 'src' to 'dest'.
#define ast_test_flag(p, flag)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
int ast_get_tid(void)
Get current thread ID.
#define ast_clear_flag(p, flag)
#define ast_set_flag(p, flag)