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) 209 static const char *party_number_ton2str(
int ton)
211 #if defined(HAVE_PRI) 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) 235 static const char *party_number_plan2str(
int plan)
237 #if defined(HAVE_PRI) 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;
546 if (!strcasecmp(tech->
type, chan->
tech->type)) {
560 ast_debug(1,
"Registered handler for '%s' (%s)\n", chan->
tech->type, chan->
tech->description);
562 ast_verb(2,
"Registered channel type '%s' (%s)\n", chan->
tech->type, chan->
tech->description);
574 ast_debug(1,
"Unregistering channel type '%s'\n", tech->
type);
579 if (chan->
tech == tech) {
582 ast_verb(2,
"Unregistered channel type '%s'\n", tech->
type);
600 if (!strcasecmp(name, chanls->
tech->type)) {
616 for (x = 0; x <
ARRAY_LEN(causes); x++) {
617 if (causes[x].cause == cause)
618 return causes[x].
desc;
630 if (!strncasecmp(causes[x].name, name, strlen(causes[x].name)))
631 return causes[x].cause;
664 return "Dialing Offhook";
680 switch (transfercapability) {
686 return "RESTRICTED_DIGITAL";
690 return "DIGITAL_W_TONES";
704 .description =
"Surrogate channel used to pull channel from an application",
710 .description =
"Null channel (should not see this)",
728 ast_log(
LOG_ERROR,
"Channel Unique ID '%s' already in use by channel %s(%p)\n",
742 const
char *
file,
int line,
743 const
char *function, const
char *name_fmt, va_list ap)
762 file, line,
function);
779 if (!nativeformats) {
798 ast_log(
LOG_WARNING,
"Channel allocation failed: Unable to create schedule context\n");
866 char *slash, *slash2;
874 ast_channel_name_build_va(tmp, name_fmt, ap);
876 if ((slash = strchr(
tech,
'/'))) {
877 if ((slash2 = strchr(slash + 1,
'/'))) {
898 ast_channel_accountcode_set(tmp, acctcode);
961 const char *
cid_name,
const char *acctcode,
965 const char *
file,
int line,
const char *
function,
966 const char *name_fmt, ...)
971 va_start(ap, name_fmt);
973 assignedids, requestor, amaflag, endpoint, file, line,
function, name_fmt, ap);
987 file, line,
function);
1019 unsigned int new_frames = 0;
1020 unsigned int new_voice_frames = 0;
1021 unsigned int queued_frames = 0;
1022 unsigned int queued_voice_frames = 0;
1084 queued_voice_frames++;
1088 if ((queued_frames + new_frames > 128 || queued_voice_frames + new_voice_frames > 96)) {
1121 while (new_frames--) {
1198 f.
data.
ptr = (
void *) musicclass;
1199 f.
datalen = strlen(musicclass) + 1;
1202 "musicclass", musicclass);
1279 void *
data,
int ao2_flags)
1287 const char *
name = arg;
1288 size_t name_len = *(
size_t *) data;
1292 ast_log(
LOG_ERROR,
"BUG! Must supply a channel name or partial name to match!\n");
1333 size_t id_len = *(
size_t *) data;
1337 ast_log(
LOG_ERROR,
"BUG! Must supply a uniqueid or partial uniqueid to match!\n");
1371 char *l_exten = (
char *) exten;
1372 char *l_context = (
char *) context;
1391 char *l_name = (
char *) name;
1437 char *l_name = (
char *) name;
1440 (name_len == 0) ?
OBJ_KEY : 0);
1461 char *l_exten = (
char *) exten;
1462 char *l_context = (
char *) context;
1503 struct timeval start;
1518 if (
cond && ((*
cond)(data) == 0)) {
1628 if (src->
str && src->
str != dest->
str) {
1681 if (src->
str && src->
str != dest->
str) {
1734 if (src->
str && src->
str != dest->
str) {
1752 update_id->
name = 1;
1795 if (!update || update->
name) {
1798 if (!update || update->
number) {
1805 if (src->
tag && src->
tag != dest->
tag) {
1823 int number_priority;
1825 int number_screening;
1835 switch (name_value) {
1856 number_priority = 3;
1860 switch (number_value) {
1862 number_priority = 0;
1865 number_priority = 1;
1868 number_priority = 2;
1873 number_priority = 3;
1879 if (name_priority < number_priority) {
1880 number_value = name_value;
1886 return number_value | number_screening;
1892 id->number.valid = 0;
1893 id->subaddress.valid = 0;
1907 if (overlay->name.valid) {
1908 merged.
name = overlay->name;
1910 if (overlay->number.valid) {
1911 merged.number = overlay->number;
1913 if (overlay->subaddress.valid) {
1914 merged.subaddress = overlay->subaddress;
2065 connected->
id = caller->
id;
2066 connected->
ani = caller->
ani;
2108 if (src->
str && src->
str != dest->
str) {
2259 if ((dashptr = strrchr(device_name,
'-'))) {
2263 device_name[0] =
'\0';
2318 if (device_name[0]) {
2412 if (datastore->
info != info) {
2421 if ((datastore->
uid !=
NULL) && !strcasecmp(uid, datastore->
uid)) {
2510 ast_channel_hangupsource_set(chan, source);
2517 ast_channel_hangupsource_set(bridge, source);
2611 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",
2640 struct timeval answertime;
2715 switch (old_state) {
2725 int timeout_ms =
MAX(delay, 500);
2726 unsigned int done = 0;
2727 struct timeval start;
2741 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));
2891 if (generator && generator->
release) {
2940 if (!tmp || !generate) {
2953 ast_debug(1,
"Auto-deactivating generator\n");
2969 if (generator_old && generator_old->
release) {
2973 if (gen->
alloc && !(generatordata = gen->
alloc(chan, params))) {
2998 int *exception,
int *outfd,
int *ms)
3000 struct timeval start = { 0 , 0 };
3001 struct pollfd *pfds =
NULL;
3006 struct timeval now = { 0, 0 };
3007 struct timeval whentohangup = { 0, 0 }, diff;
3021 for (x = 0; x < n; x++) {
3035 whentohangup = diff;
3051 if (!
ast_tvzero(whentohangup) && whentohangup.tv_sec < INT_MAX / 1000) {
3052 rms = whentohangup.tv_sec * 1000 + whentohangup.tv_usec / 1000;
3053 if (*ms >= 0 && *ms < rms) {
3056 }
else if (!
ast_tvzero(whentohangup) && rms < 0) {
3066 for (x = 0; x < n; x++) {
3069 fdmap[
max].fdno = y;
3070 fdmap[
max].chan = x;
3077 for (x = 0; x < nfds; x++) {
3078 fdmap[
max].chan = -1;
3086 if (
sizeof(
int) == 4) {
3089 if (kbrms > 600000) {
3096 }
while (!res && (rms > 0));
3100 for (x = 0; x < n; x++) {
3106 if (
errno != EINTR) {
3113 for (x = 0; x < n; x++) {
3117 if (winner ==
NULL) {
3132 for (x = 0; x <
max; x++) {
3133 res = pfds[x].revents;
3137 if (fdmap[x].chan >= 0) {
3138 winner = c[fdmap[x].chan];
3140 if (res & POLLPRI) {
3149 *outfd = pfds[x].fd;
3152 *exception = (res & POLLPRI) ? -1 : 0;
3197 unsigned int real_rate = rate, max_rate;
3212 real_rate = max_rate;
3215 ast_debug(1,
"Scheduling timer at (%u requested / %u actual) timer ticks per second\n", rate, real_rate);
3226 if (data && is_ao2_obj) {
3273 if (!rchan && outfd < 0 && ms) {
3279 }
else if (outfd > -1) {
3281 ast_log(
LOG_WARNING,
"The FD we were waiting for has something waiting. Waitfordigit returning numeric 1\n");
3299 if (!breakon || strchr(breakon, res)) {
3368 switch (direction) {
3382 char digit_str[] = {
digit,
'\0' };
3398 char digit_str[] = {
digit,
'\0' };
3439 samples = (int) (((
float) f->
samples) * factor);
3464 ast_debug(1,
"Auto-deactivating generator\n");
3518 int diff = sample_rate - seek_rate;
3521 samples = samples / (float) (sample_rate / seek_rate);
3522 }
else if (diff < 0) {
3523 samples = samples * (float) (seek_rate / sample_rate);
3577 "ast_read() on chan '%s' called with no recorded file descriptor.\n",
3616 if (trigger_dtmf_emulating) {
3626 }
else if (trigger_dtmf_emulating) {
3672 int skipped_dtmf_frame = 0;
3681 skipped_dtmf_frame = 1;
3693 if (!skipped_dtmf_frame) {
3786 if (stream == default_stream) {
3814 if (dropnondefault && stream != default_stream) {
3826 ast_debug(1,
"Dropping duplicate answer!\n");
3839 read_action_payload = f->
data.
ptr;
3840 switch (read_action_payload->
action) {
3959 }
else if (!f->
len) {
4043 if (old_frame != f) {
4061 if (stream != default_stream) {
4172 if (old_frame != f) {
4179 #ifndef MONITOR_CONSTANT_DELAY 4186 ast_log(
LOG_WARNING,
"Failed to perform seek in monitoring read stream, synchronization between the files may be broken\n");
4196 if (jump - MONITOR_DELAY >= 0) {
4198 ast_log(
LOG_WARNING,
"Failed to perform seek in monitoring read stream, synchronization between the files may be broken\n");
4224 if (old_frame != f) {
4332 switch (condition) {
4400 snprintf(causevar,
sizeof(causevar),
"HASH(SIP_CAUSE,%s)", cause_code->
chan_name);
4407 if (!strcasecmp(flag,
"default"))
4409 if (!strcasecmp(flag,
"omit"))
4411 if (!strcasecmp(flag,
"billing"))
4413 if (!strcasecmp(flag,
"documentation"))
4426 return "DOCUMENTATION";
4451 unsigned char current[1024];
4452 unsigned char proposed[1024];
4468 chan_indicated,
NULL);
4470 chan_connected,
NULL);
4471 if (current_size == -1 || proposed_size == -1) {
4475 if (current_size == proposed_size && !memcmp(current, proposed, current_size)) {
4476 ast_debug(1,
"%s: Dropping redundant connected line update \"%s\" <%s>.\n",
4512 return res ? -1 : 0;
4524 switch (condition) {
4542 t38_parameters = data;
4588 if (_condition < 0) {
4596 switch (condition) {
4680 ast_debug(1,
"Driver for channel '%s' does not support indication %u, emulating it\n",
ast_channel_name(chan), condition);
4711 goto indicate_cleanup;
4718 .subclass.integer = _condition,
4719 .data.ptr = (
void *) data,
4732 goto indicate_cleanup;
4736 data = awesome_frame->
data.
ptr;
4737 datalen = awesome_frame->
datalen;
4744 if (awesome_frame) {
4757 c = *(
unsigned char *)buf;
4815 size_t body_len = strlen(body);
4818 memset(&f, 0,
sizeof(f));
4834 ast_debug(1,
"Sending TEXT_DATA from '%s' to %s:%s %s\n",
4845 ast_debug(1,
"Channel technology does not support sending content type '%s' on channel '%s'\n",
4862 .value = (
char *)text,
4882 static const char *
const mf_tones[] = {
4900 if (digit >=
'0' && digit <=
'9') {
4902 }
else if (digit ==
'*') {
4904 }
else if (digit ==
'#') {
4906 }
else if (digit ==
'A') {
4908 }
else if (digit ==
'B') {
4910 }
else if (digit ==
'C') {
4923 static const char *
const dtmf_tones[] = {
4953 if (digit >=
'0' && digit <=
'9')
4955 else if (digit >=
'A' && digit <=
'D')
4957 else if (digit ==
'*')
4959 else if (digit ==
'#')
4998 unsigned int durationkp,
unsigned int durationst,
int is_external)
5005 duration = durationkp;
5006 }
else if (digit ==
'#' || digit ==
'A' || digit ==
'B' || digit ==
'C') {
5007 duration = durationst;
5011 usleep(duration * 1000);
5039 usleep(duration * 1000);
5088 struct plc_ds *plc = data;
5100 int num_new_samples = frame->
samples;
5122 if (!num_new_samples) {
5144 frame->
datalen = num_new_samples * 2;
5158 plc = datastore->
data;
5172 datastore->
data = plc;
5217 if (stream_num >= 0) {
5285 if (old_frame != fr)
5298 if (new_frame != fr) {
5333 }
else if ((stream == default_stream) &&
ast_channel_tech(chan)->write_video) {
5342 res =
tech_write(chan, stream, default_stream, fr);
5380 ast_debug(1,
"Channel %s changing write format from %s to %s, native formats %s\n",
5393 if (trans_frame != f && f != fr) {
5411 int freeoldlist = 0;
5425 if (new_frame != cur) {
5436 if (new_frame != dup) {
5463 #ifndef MONITOR_CONSTANT_DELAY 5470 ast_log(
LOG_WARNING,
"Failed to perform seek in monitoring write stream, synchronization between the files may be broken\n");
5480 if (jump - MONITOR_DELAY >= 0) {
5482 ast_log(
LOG_WARNING,
"Failed to perform seek in monitoring write stream, synchronization between the files may be broken\n");
5502 unsigned int skip = 0;
5509 res =
tech_write(chan, stream, default_stream, cur);
5527 res =
tech_write(chan, stream, default_stream, f);
5586 ast_debug(1,
"Channel %s setting read format path: %s -> %s\n",
5622 ast_debug(1,
"Channel %s setting write format path: %s -> %s\n",
5700 if (!best_set_fmt) {
5710 &best_set_fmt,
sizeof(best_set_fmt), 0);
5712 ast_debug(1,
"Channel driver natively set channel %s to %s format %s\n",
5754 ast_log(
LOG_ERROR,
"Unable to set format because channel %s supports no formats\n",
5787 if (trans_pvt !=
NULL) {
5824 res = trans_pvt ? 0 : -1;
5831 ast_debug(1,
"Channel %s setting %s format path: %s -> %s\n",
5918 return "Call Failure (not BUSY, and not NO_ANSWER, maybe Circuit busy or down?)";
5922 return "Local Ring";
5924 return "Remote end Ringing";
5926 return "Remote end has Answered";
5928 return "Remote end is Busy";
5930 return "Congestion (circuits busy)";
5932 return "Unknown Reason!!";
6000 if ((data = strchr(tmpchan,
'/'))) {
6004 const char *forward_context;
6013 ast_log(
LOG_NOTICE,
"Unable to create channel for call forward to '%s/%s' (cause = %d)\n", type, data, cause);
6032 ast_channel_accountcode_set(new_chan, oh->
account);
6033 ast_channel_peeraccount_set(new_chan, oh->
account);
6037 }
else if (caller) {
6056 ast_log(
LOG_NOTICE,
"Unable to call forward to channel %s/%s\n", type, (
char *)data);
6072 int last_subclass = 0;
6078 outstate = &dummy_outstate;
6080 chan =
ast_request(type, cap, assignedids, requestor, addr, &cause);
6113 ast_channel_accountcode_set(chan, oh->
account);
6114 ast_channel_peeraccount_set(chan, oh->
account);
6141 connected.
id.
name.
str = (
char *) cid_name;
6279 if (!requestor || !out) {
6287 ops[1][1] = encrypt->
media;
6294 for (i = 0; i < 2; i++) {
6327 if (strcasecmp(type, chan->
tech->type)) {
6343 if (chan->
tech->requester_with_stream_topology) {
6346 if (!topology && request_cap) {
6351 c = chan->
tech->requester_with_stream_topology(type, topology, assignedids, requestor, addr, cause);
6354 }
else if (chan->
tech->requester) {
6361 if (!request_cap && topology) {
6384 ast_log(
LOG_WARNING,
"No translator path exists for channel type %s (native %s) to %s\n", type,
6405 if (best_audio_fmt) {
6410 c = chan->
tech->requester(type, joint_cap, assignedids, requestor, addr, cause);
6480 switch (relationship) {
6495 }
else if (!precious
6545 res = pre_call(chan, sub_args);
6624 if (res < 0 || !(fr =
ast_read(chan))) {
6641 *protocol = *message;
6701 if (strchr(enders, d) && (pos == 0)) {
6706 if (!strchr(enders, d)) {
6709 if (strchr(enders, d) || (pos >= len)) {
6870 const char *varname;
6880 if (varname[0] ==
'_') {
6882 if (varname[1] ==
'_') {
6898 ast_debug(1,
"Inheriting variable %s from %s to %s.\n",
6939 dash = strrchr(channel_name,
'-');
6956 unsigned int orig_disablestatecache;
6957 unsigned int clone_disablestatecache;
6959 int visible_indication;
6960 int clone_hold_state;
6978 char clone_sending_dtmf_digit;
6979 struct timeval clone_sending_dtmf_tv;
7014 if (moh_is_playing) {
7031 ast_debug(1,
"Actually Masquerading %s(%u) into the structure of %s(%u)\n",
7142 if (orig_disablestatecache != clone_disablestatecache) {
7143 if (orig_disablestatecache) {
7305 ast_log(
LOG_WARNING,
"Channel type '%s' could not fixup channel %s, strange things may happen. (clonechan)\n",
7311 ast_log(
LOG_WARNING,
"Channel type '%s' could not fixup channel %s, strange things may happen. (original)\n",
7346 ast_debug(1,
"Channel %s simulating UNHOLD for masquerade.\n",
7350 if (clone_sending_dtmf_digit) {
7368 if (visible_indication) {
7370 const char *latest_musicclass;
7377 latest_musicclass =
NULL;
7380 len = strlen(latest_musicclass) + 1;
7392 if (moh_is_playing) {
7491 if (oldstate == state)
7495 if ((dashptr = strrchr(name,
'-'))) {
7639 if (len >
sizeof(ts->
data) / 2 - 1) {
7643 memset(&ts->
f, 0,
sizeof(ts->
f));
7644 for (x=0;x<len/2;x++) {
7654 p = ts->
v3_2 - 32768;
7656 p = ((p * 9) / 10) + 1;
7657 ts->
data[x] = (ts->
v3_1 * p) >> 15;
7689 d.
vol = (vol < 1) ? 8192 : vol;
7722 int start=0, finish=0, x;
7730 while ((piece =
strsep(&c,
","))) {
7731 if (sscanf(piece,
"%30d-%30d", &start, &finish) == 2) {
7733 }
else if (sscanf(piece,
"%30d", &start)) {
7737 ast_log(
LOG_ERROR,
"Syntax error parsing group configuration '%s' at '%s'. Ignoring.\n", s, piece);
7740 for (x = start; x <= finish; x++) {
7741 if ((x > 63) || (x < 0)) {
7772 return member->
hash;
7797 while ((piece =
strsep(&c,
","))) {
7804 len = strlen(piece);
7814 strcpy(member->
name, piece);
7829 return (
struct ast_namedgroups *) namedgroups;
7871 ast_verb(3,
"Music class %s requested but no musiconhold loaded.\n", mclass ? mclass : (interpclass ? interpclass :
"default"));
7954 return vars_present;
7973 for (i = 0; i < varc; ++i) {
7974 const char *
var = vars[i];
7976 if (!(mcv =
ast_calloc(1,
sizeof(*mcv) + strlen(var) + 1))) {
7979 strcpy(mcv->
name, var);
7980 if (strchr(var,
'(')) {
8066 "Error invoking function %s\n", mcv->
name);
8144 for (i = 0; i <= 63; i++) {
8147 strncat(buf,
", ", buflen - strlen(buf) - 1);
8151 snprintf(num,
sizeof(num),
"%u", i);
8152 strncat(buf, num, buflen - strlen(buf) - 1);
8209 SWAP(group_a, group_b);
8214 return match !=
NULL;
8221 for (cur = vars; cur; cur = cur->
next) {
8244 .datalen =
sizeof(
buf),
8248 memset(buf, 0,
sizeof(buf));
8270 if (!(state =
ast_calloc(1,
sizeof(*state)))) {
8294 ast_debug(1,
"Trying to stop silence generator when there is no generator on '%s'\n",
8300 ast_debug(1,
"Trying to stop silence generator when it is not the current generator on '%s'\n",
8321 ast_log(
LOG_ERROR,
"Could not return write format to its original state\n");
8350 const char *ints,
const char *lang)
8356 const char *ints,
const char *lang)
8362 const char *ints,
const char *lang)
8374 const char *ints,
const char *lang)
8380 const char *ints,
const char *lang,
int audiofd,
int ctrlfd)
8384 snprintf(buf,
sizeof(buf),
"%d", num);
8454 length = strlen(name->
str);
8455 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
8459 data[pos++] = ies->
str;
8460 data[pos++] = length;
8461 memcpy(data + pos, name->
str, length);
8465 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8473 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8481 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8485 data[pos++] = ies->
valid;
8487 data[pos++] = name->
valid;
8528 length = strlen(number->
str);
8529 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
8533 data[pos++] = ies->
str;
8534 data[pos++] = length;
8535 memcpy(data + pos, number->
str, length);
8539 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8543 data[pos++] = ies->
plan;
8545 data[pos++] = number->
plan;
8547 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8555 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8559 data[pos++] = ies->
valid;
8561 data[pos++] = number->
valid;
8601 if (subaddress->
str) {
8602 length = strlen(subaddress->
str);
8603 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
8607 data[pos++] = ies->
str;
8608 data[pos++] = length;
8609 memcpy(data + pos, subaddress->
str, length);
8613 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8617 data[pos++] = ies->
type;
8619 data[pos++] = subaddress->
type;
8621 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8623 "No space left for %s subaddress odd-even indicator\n", label);
8630 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8634 data[pos++] = ies->
valid;
8636 data[pos++] = subaddress->
valid;
8686 if (!update || update->
name) {
8695 if (!update || update->
number) {
8715 length = strlen(id->
tag);
8716 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
8720 data[pos++] = ies->
tag;
8721 data[pos++] = length;
8722 memcpy(data + pos, id->
tag, length);
8730 if (!update || update->
name) {
8738 presentation =
id->number.presentation;
8741 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8747 data[pos++] = presentation;
8836 .combined_presentation = 0,
8845 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
8854 "connected line", &ies, update ? &update->
id :
NULL);
8861 "connected line priv", &priv_ies, update ? &update->
priv : NULL);
8868 if (datalen < pos + (
sizeof(data[0]) * 2) +
sizeof(value)) {
8873 data[pos++] =
sizeof(
value);
8874 value = htonl(connected->
source);
8875 memcpy(data + pos, &value,
sizeof(value));
8876 pos +=
sizeof(
value);
8884 unsigned char ie_len;
8885 unsigned char ie_id;
8887 int frame_version = 1;
8889 int got_combined_presentation = 0;
8891 for (pos = 0; pos < datalen; pos += ie_len) {
8892 if (datalen < pos +
sizeof(ie_id) +
sizeof(ie_len)) {
8896 ie_id = data[pos++];
8897 ie_len = data[pos++];
8898 if (datalen < pos + ie_len) {
8911 frame_version = data[pos];
8918 memcpy(connected->
id.
name.
str, data + pos, ie_len);
8951 memcpy(connected->
id.
number.
str, data + pos, ie_len);
8999 "Invalid connected line subaddress odd-even indicator (%u)\n",
9017 if (connected->
id.
tag) {
9018 memcpy(connected->
id.
tag, data + pos, ie_len);
9019 connected->
id.
tag[ie_len] = 0;
9029 combined_presentation = data[pos];
9030 got_combined_presentation = 1;
9037 memcpy(connected->
priv.
name.
str, data + pos, ie_len);
9118 "Invalid connected line private subaddress odd-even indicator (%u)\n",
9137 memcpy(connected->
priv.
tag, data + pos, ie_len);
9138 connected->
priv.
tag[ie_len] = 0;
9143 if (ie_len !=
sizeof(value)) {
9148 memcpy(&value, data + pos,
sizeof(value));
9149 connected->
source = ntohl(value);
9153 ast_debug(1,
"Unknown connected line element: %u (%u)\n",
9154 (
unsigned) ie_id, (
unsigned) ie_len);
9159 switch (frame_version) {
9168 if (got_combined_presentation) {
9181 ast_debug(1,
"Connected line frame has newer version: %u\n",
9182 (
unsigned) frame_version);
9191 unsigned char data[1024];
9195 if (datalen == (
size_t) -1) {
9204 unsigned char data[1024];
9208 if (datalen == (
size_t) -1) {
9338 if (datalen < pos + (
sizeof(data[0]) * 2) +
sizeof(value)) {
9342 data[pos++] = ies->
code;
9343 data[pos++] =
sizeof(
value);
9344 value = htonl(reason->
code);
9345 memcpy(data + pos, &value,
sizeof(value));
9346 pos +=
sizeof(
value);
9349 length = strlen(reason->
str);
9350 if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
9354 data[pos++] = ies->
str;
9355 data[pos++] = length;
9356 memcpy(data + pos, reason->
str, length);
9386 .combined_presentation = 0,
9443 .combined_presentation = 0,
9462 .combined_presentation = 0,
9481 .combined_presentation = 0,
9494 if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
9503 "redirecting-orig", &orig_ies, update ? &update->
orig :
NULL);
9510 "redirecting-from", &from_ies, update ? &update->
from : NULL);
9517 "redirecting-to", &to_ies, update ? &update->
to : NULL);
9524 "redirecting-priv-orig", &priv_orig_ies, update ? &update->
priv_orig : NULL);
9531 "redirecting-priv-from", &priv_from_ies, update ? &update->
priv_from : NULL);
9538 "redirecting-priv-to", &priv_to_ies, update ? &update->
priv_to : NULL);
9546 "redirecting-reason", &reason_ies);
9554 "redirecting-orig-reason", &orig_reason_ies);
9561 if (datalen < pos + (
sizeof(data[0]) * 2) +
sizeof(value)) {
9566 data[pos++] =
sizeof(
value);
9567 value = htonl(redirecting->
count);
9568 memcpy(data + pos, &value,
sizeof(value));
9569 pos +=
sizeof(
value);
9577 unsigned char ie_len;
9578 unsigned char ie_id;
9580 int frame_version = 1;
9581 int from_combined_presentation = 0;
9582 int got_from_combined_presentation = 0;
9583 int to_combined_presentation = 0;
9584 int got_to_combined_presentation = 0;
9586 for (pos = 0; pos < datalen; pos += ie_len) {
9587 if (datalen < pos +
sizeof(ie_id) +
sizeof(ie_len)) {
9591 ie_id = data[pos++];
9592 ie_len = data[pos++];
9593 if (datalen < pos + ie_len) {
9606 frame_version = data[pos];
9613 memcpy(redirecting->
orig.
name.
str, data + pos, ie_len);
9694 "Invalid redirecting-orig subaddress odd-even indicator (%u)\n",
9713 memcpy(redirecting->
orig.
tag, data + pos, ie_len);
9714 redirecting->
orig.
tag[ie_len] = 0;
9722 memcpy(redirecting->
from.
name.
str, data + pos, ie_len);
9790 from_combined_presentation = data[pos];
9791 got_from_combined_presentation = 1;
9813 "Invalid redirecting-from subaddress odd-even indicator (%u)\n",
9832 memcpy(redirecting->
from.
tag, data + pos, ie_len);
9833 redirecting->
from.
tag[ie_len] = 0;
9841 memcpy(redirecting->
to.
name.
str, data + pos, ie_len);
9874 memcpy(redirecting->
to.
number.
str, data + pos, ie_len);
9909 to_combined_presentation = data[pos];
9910 got_to_combined_presentation = 1;
9932 "Invalid redirecting-to subaddress odd-even indicator (%u)\n",
9950 if (redirecting->
to.
tag) {
9951 memcpy(redirecting->
to.
tag, data + pos, ie_len);
9952 redirecting->
to.
tag[ie_len] = 0;
10000 (
unsigned) ie_len);
10008 (
unsigned) ie_len);
10016 (
unsigned) ie_len);
10033 (
unsigned) ie_len);
10041 "Invalid private redirecting-orig subaddress odd-even indicator (%u)\n",
10042 (
unsigned) ie_len);
10050 (
unsigned) ie_len);
10060 memcpy(redirecting->
priv_orig.
tag, data + pos, ie_len);
10076 (
unsigned) ie_len);
10084 (
unsigned) ie_len);
10092 (
unsigned) ie_len);
10109 (
unsigned) ie_len);
10117 (
unsigned) ie_len);
10125 (
unsigned) ie_len);
10142 (
unsigned) ie_len);
10150 "Invalid private redirecting-from subaddress odd-even indicator (%u)\n",
10151 (
unsigned) ie_len);
10159 (
unsigned) ie_len);
10169 memcpy(redirecting->
priv_from.
tag, data + pos, ie_len);
10185 (
unsigned) ie_len);
10193 (
unsigned) ie_len);
10201 (
unsigned) ie_len);
10218 (
unsigned) ie_len);
10226 (
unsigned) ie_len);
10234 (
unsigned) ie_len);
10251 (
unsigned) ie_len);
10259 "Invalid private redirecting-to subaddress odd-even indicator (%u)\n",
10260 (
unsigned) ie_len);
10268 (
unsigned) ie_len);
10278 memcpy(redirecting->
priv_to.
tag, data + pos, ie_len);
10284 if (ie_len !=
sizeof(value)) {
10286 (
unsigned) ie_len);
10289 memcpy(&value, data + pos,
sizeof(value));
10297 memcpy(redirecting->
reason.
str, data + pos, ie_len);
10303 if (ie_len !=
sizeof(value)) {
10305 (
unsigned) ie_len);
10308 memcpy(&value, data + pos,
sizeof(value));
10322 if (ie_len !=
sizeof(value)) {
10324 (
unsigned) ie_len);
10327 memcpy(&value, data + pos,
sizeof(value));
10328 redirecting->
count = ntohl(value);
10332 ast_debug(1,
"Unknown redirecting element: %u (%u)\n",
10333 (
unsigned) ie_id, (
unsigned) ie_len);
10338 switch (frame_version) {
10350 if (got_from_combined_presentation) {
10358 if (got_to_combined_presentation) {
10371 ast_debug(1,
"Redirecting frame has newer version: %u\n",
10372 (
unsigned) frame_version);
10381 unsigned char data[1024];
10385 if (datalen == (
size_t) -1) {
10394 unsigned char data[1024];
10398 if (datalen == (
size_t) -1) {
10424 in_intercept_mode ? (
void *) 1 : (
void *) 0);
10437 static int deprecation_warning = 0;
10439 const char *macro_args;
10444 ?
"CONNECTED_LINE_CALLER_SEND_MACRO" :
"CONNECTED_LINE_CALLEE_SEND_MACRO");
10447 ?
"CONNECTED_LINE_CALLER_SEND_MACRO_ARGS" :
"CONNECTED_LINE_CALLEE_SEND_MACRO_ARGS");
10455 if (!deprecation_warning) {
10456 deprecation_warning = 1;
10457 ast_log(
LOG_WARNING,
"Usage of CONNECTED_LINE_CALLE[ER]_SEND_MACRO is deprecated. Please use CONNECTED_LINE_SEND_SUB instead.\n");
10460 const struct ast_frame *frame = connected_info;
10489 static int deprecation_warning = 0;
10491 const char *macro_args;
10496 ?
"REDIRECTING_CALLER_SEND_MACRO" :
"REDIRECTING_CALLEE_SEND_MACRO");
10499 ?
"REDIRECTING_CALLER_SEND_MACRO_ARGS" :
"REDIRECTING_CALLEE_SEND_MACRO_ARGS");
10507 if (!deprecation_warning) {
10508 deprecation_warning = 1;
10509 ast_log(
LOG_WARNING,
"Usage of REDIRECTING_CALLE[ER]_SEND_MACRO is deprecated. Please use REDIRECTING_SEND_SUB instead.\n");
10512 const struct ast_frame *frame = redirecting_info;
10542 const char *sub_args;
10557 const struct ast_frame *frame = connected_info;
10568 retval =
ast_app_run_sub(autoservice_chan, sub_chan, sub, sub_args, 0);
10587 const char *sub_args;
10602 const struct ast_frame *frame = redirecting_info;
10613 retval =
ast_app_run_sub(autoservice_chan, sub_chan, sub, sub_args, 0);
10647 .
type =
"Call Completion",
10670 cc_datastore->
data = cc_params;
10694 return cc_datastore->
data;
10699 int len = name_buffer_length;
10707 if ((dash = strrchr(device_name,
'-'))) {
10724 if ((slash = strchr(agent_type,
'/'))) {
10762 return ((hangup_test || unbridge) && (hangup_test == hangup_flags));
10788 if (bridge_channel) {
10791 return bridge_channel;
10806 } my_vars = { 0, };
10822 my_vars.priority++;
10831 my_vars.exten, my_vars.context,
NULL, yankee, my_vars.amaflags,
10832 "Surrogate/%s", my_vars.
name))) {
10852 return yanked_chan;
10872 if (dest == source) {
10884 "Can't move channel. One or both is dead (%s <-- %s)\n",
10911 .
type =
"suppressvoice",
10936 int suppress_frame = 0;
10947 suppress_frame = 1;
10949 suppress_frame = 1;
10952 if (suppress_frame) {
10970 switch (frametype) {
10992 ast_log(
LOG_WARNING,
"Attempted to suppress an unsupported frame type (%u).\n", frametype);
10997 suppress = datastore->
data;
11003 ast_log(
LOG_WARNING,
"Failed to allocate data while attempting to suppress a stream.\n");
11010 interface.
data = suppress;
11013 if (framehook_id < 0) {
11015 ast_log(
LOG_WARNING,
"Failed to attach framehook while attempting to suppress a stream.\n");
11026 ast_log(
LOG_WARNING,
"Failed to allocate datastore while attempting to suppress a stream.\n");
11033 datastore->
data = suppress;
11047 ast_log(
LOG_WARNING,
"Attempted to unsuppress an unsupported frame type (%u).\n", frametype);
11056 suppress = datastore->
data;
11090 ast_log(
LOG_DTMF,
"DTMF end '%c' simulated on %s due to %s, duration %ld ms\n",
11100 .
type =
"bridge-features",
11112 return datastore->
data;
11122 ds_features = datastore->
data;
11139 if (!ds_features) {
11147 datastore->
data = ds_features;
11182 ast_debug(2,
"%s: Topologies already match. Current: %s Requested: %s\n",
int ast_say_digit_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang)
says digits of a string
int valid
valid/present ie
struct stasis_message_type * ast_channel_hold_type(void)
Message type for when a channel is placed on hold.
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.
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
int(*const answer_with_stream_topology)(struct ast_channel *chan, struct ast_stream_topology *topology)
Answer the channel with topology.
#define AST_CAUSE_PROTOCOL_ERROR
void ast_channel_dtmf_digit_to_emulate_set(struct ast_channel *chan, char value)
static char musicclass[MAX_MUSICCLASS]
struct ast_variable * next
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options)
says a number
unsigned long long ast_group_t
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.
void ast_channel_internal_alertpipe_clear(struct ast_channel *chan)
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.
void ast_channel_fdno_set(struct ast_channel *chan, int value)
Information needed to identify an endpoint in a call.
enum sip_cc_notify_state state
const char * ast_channel_blockproc(const struct ast_channel *chan)
#define AST_LIST_INSERT_LIST_AFTER(head, list, elm, field)
Inserts a whole list after a specific entry in a list.
void ast_channel_unlink(struct ast_channel *chan)
Remove a channel from the global channels container.
int char_set
Character set ie.
static char accountcode[AST_MAX_ACCOUNT_CODE]
void ast_channel_timingfunc_set(struct ast_channel *chan, ast_timing_func_t value)
int presentation
Q.931 encoded presentation-indicator encoded field.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame.
int ast_channel_fd_isset(const struct ast_channel *chan, int which)
int ast_check_hangup_locked(struct ast_channel *chan)
#define AST_CAUSE_MANDATORY_IE_MISSING
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.
#define ast_channel_lock(chan)
#define AST_CAUSE_BEARERCAPABILITY_NOTAUTH
void ast_channel_clear_softhangup(struct ast_channel *chan, int flag)
Clear a set of softhangup flags from a channel.
static int indicate(void *data)
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
static void features_destroy(void *obj)
struct ast_party_dialed::@246 number
Dialed/Called number.
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...
void ast_bridge_features_cleanup(struct ast_bridge_features *features)
Clean up the contents of a bridge features structure.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
#define AST_CLI_DEFINE(fn, txt,...)
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.
void *(* duplicate)(void *data)
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
#define ast_frdup(fr)
Copies a frame.
static const struct set_format_access set_format_access_write
char * str
Subscriber phone number (Malloced)
int ast_channel_get_up_time(struct ast_channel *chan)
Obtain how long it has been since the channel was answered.
void ast_party_caller_init(struct ast_party_caller *init)
Initialize the given caller structure.
int(*const transfer)(struct ast_channel *chan, const char *newdest)
Blind transfer other side (see app_transfer.c and ast_transfer()
General Asterisk channel transcoding definitions.
int ast_channel_hold_state(const struct ast_channel *chan)
struct ast_party_connected_line connected
Channel Connected Line ID information.
int(*const setoption)(struct ast_channel *chan, int option, void *data, int datalen)
Set a given option. Called with chan locked.
#define AST_CAUSE_SUBSCRIBER_ABSENT
#define AST_CAUSE_OUTGOING_CALL_BARRED
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.
#define AST_CAUSE_INCOMPATIBLE_DESTINATION
Asterisk locking-related definitions:
unsigned int ast_timer_get_max_rate(const struct ast_timer *handle)
Get maximum rate supported for a timer.
static void adjust_frame_for_plc(struct ast_channel *chan, struct ast_frame *frame, struct ast_datastore *datastore)
struct stasis_message_type * ast_channel_dtmf_end_type(void)
Message type for when DTMF ends on a channel.
Asterisk main include file. File version handling, generic pbx functions.
int ast_shutting_down(void)
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
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_channel_visible_indication_set(struct ast_channel *chan, int value)
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
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...
struct ast_party_id priv_to
Call is redirecting to a new party (Sent to the caller) - private representation. ...
char * str
Subscriber phone number (Malloced)
char chan_name[AST_CHANNEL_NAME]
void ast_channel_timer_set(struct ast_channel *chan, struct ast_timer *value)
struct stasis_message_type * ast_channel_unhold_type(void)
Message type for when a channel is removed from hold.
Channels have this property if they implement send_text_data.
struct ast_party_caller caller
Channel Caller ID information.
static ast_mutex_t channel_move_lock
struct ast_filestream * ast_channel_vstream(const struct ast_channel *chan)
void * ast_channel_generatordata(const struct ast_channel *chan)
struct ast_set_party_id ani
void ast_channel_whentohangup_set(struct ast_channel *chan, struct timeval *value)
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
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...
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
int ast_channel_internal_alert_readfd(struct ast_channel *chan)
static int __ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin, int head, struct ast_frame *after)
static int attribute_const is_visible_indication(enum ast_control_frame_type condition)
void ast_channel_insmpl_set(struct ast_channel *chan, unsigned long value)
static struct ast_tone_zone * ast_tone_zone_unref(struct ast_tone_zone *tz)
Release a reference to an ast_tone_zone.
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().
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized...
static int channel_feature_hooks_set_full(struct ast_channel *chan, struct ast_bridge_features *features, int replace)
int(*const write_video)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format.
struct ast_cdr * ast_channel_cdr(const struct ast_channel *chan)
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.
unsigned int option_dtmfminduration
int ast_channel_get_duration(struct ast_channel *chan)
Obtain how long the channel since the channel was created.
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.
int str
Subscriber phone number ie.
struct ast_stream_topology * ast_channel_get_stream_topology(const struct ast_channel *chan)
Retrieve the topology of streams on a channel.
static void ast_dummy_channel_destructor(void *obj)
Free a dummy channel structure.
static const struct ast_datastore_info cc_channel_datastore_info
struct ast_party_subaddress_ies subaddress
Subscriber subaddress ies.
int presentation
Q.931 presentation-indicator and screening-indicator encoded fields.
ast_channel_requestor_relationship
enum ast_msg_data_attribute_type type
void ast_cc_config_params_destroy(struct ast_cc_config_params *params)
Free memory from CCSS configuration params.
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.
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
void ast_channel_set_writeformat(struct ast_channel *chan, struct ast_format *format)
#define AST_CAUSE_INCOMING_CALL_BARRED
#define STATE2STR_BUFSIZE
void ast_channel_set_oldwriteformat(struct ast_channel *chan, struct ast_format *format)
struct ast_channel * parent_channel
int(* stop)(struct ast_channel *chan, int need_lock)
int ast_softhangup(struct ast_channel *chan, int cause)
Softly hangup a channel, lock.
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.
struct ast_party_id id
Connected party ID.
const char * ast_channel_reason2str(int reason)
return an english explanation of the code returned thru __ast_request_and_dial's 'outstate' argument ...
void *(* alloc)(struct ast_channel *chan, void *params)
static int set_format(struct ast_channel *chan, struct ast_format_cap *cap_set, const int direction, int interleaved_stereo)
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.
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 that contains features information.
struct ast_format_cap * ast_stream_topology_get_formats(struct ast_stream_topology *topology)
Create a format capabilities structure representing the topology.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int ftimeout, char *enders)
Reads multiple digits.
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...
void * ast_channel_tech_pvt(const struct ast_channel *chan)
#define AST_CAUSE_NORMAL_TEMPORARY_FAILURE
int ast_queue_hold(struct ast_channel *chan, const char *musicclass)
Queue a hold frame.
static void suppress_framehook_destroy_cb(void *data)
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(*const write)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format (see frame.h)
#define ast_channel_unref(c)
Decrease channel reference count.
void ast_audiohook_move_all(struct ast_channel *old_chan, struct ast_channel *new_chan)
Move all audiohooks from one channel to another.
#define AST_CAUSE_NOSUCHDRIVER
#define ast_test_flag(p, flag)
static void send_dtmf_begin_event(struct ast_channel *chan, enum DtmfDirection direction, const char digit)
char ast_channel_sending_dtmf_digit(const struct ast_channel *chan)
#define AST_CAUSE_SWITCH_CONGESTION
int ast_softhangup_nolock(struct ast_channel *chan, int cause)
Softly hangup a channel, don't lock.
unsigned int ast_channel_fout(const struct ast_channel *chan)
struct ast_party_id priv_orig
Who originally redirected the call (Sent to the party the call is redirected toward) - private repres...
#define AST_OPTION_DEVICE_NAME
void ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list)
Detach audiohooks from list and destroy said list.
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
Support for translation of data formats. translate.c.
static void free_translation(struct ast_channel *clonechan)
int ast_namedgroups_intersect(struct ast_namedgroups *a, struct ast_namedgroups *b)
Return TRUE if group a and b contain at least one common groupname.
void ast_party_dialed_set(struct ast_party_dialed *dest, const struct ast_party_dialed *src)
Set the dialed information based on another dialed source.
int ast_app_run_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const char *macro_name, const char *macro_args)
Run a macro on a channel, placing an optional second channel into autoservice.
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_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
const char * ast_var_value(const struct ast_var_t *var)
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_party_name name
Subscriber name.
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
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...
#define AST_CAUSE_UNALLOCATED
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
static struct aco_type agent_type
int presentation
presentation-indicator ie
struct ast_silence_generator * ast_channel_start_silence_generator(struct ast_channel *chan)
Starts a silence generator on the given channel.
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
#define AST_DEFAULT_EMULATE_DTMF_DURATION
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait, look for hangups.
int(*const send_digit_end)(struct ast_channel *chan, char digit, unsigned int duration)
Stop sending a literal DTMF digit.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
int ast_channels_init(void)
#define AST_CAUSE_INVALID_MSG_UNSPECIFIED
struct chanlist::@369 list
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 ast_channel_by_exten_cb(void *obj, void *arg, void *data, int flags)
#define AST_CAUSE_NETWORK_OUT_OF_ORDER
const char * ast_var_name(const struct ast_var_t *var)
void ast_channel_set_rawwriteformat(struct ast_channel *chan, struct ast_format *format)
int ast_audiohook_write_list_empty(struct ast_audiohook_list *audiohook_list)
Determine if a audiohook_list is empty or not.
enum ast_media_type ast_stream_get_type(const struct ast_stream *stream)
Get the media type of a stream.
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.
#define ast_set_flag(p, flag)
struct ast_framehook_list * ast_channel_framehooks(const struct ast_channel *chan)
struct ast_party_number_ies number
Subscriber phone number ies.
int ast_framehook_list_is_empty(struct ast_framehook_list *framehooks)
Determine if an framehook list is empty or not.
void ast_channel_dialed_set(struct ast_channel *chan, struct ast_party_dialed *value)
descriptor for a cli entry.
unsigned long ast_channel_insmpl(const struct ast_channel *chan)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
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.
AST_JSON_INT_T ast_json_int_t
Primarily used to cast when packing to an "I" type.
ast_framehook_event
These are the types of events that the framehook's event callback can receive.
void ast_pbx_hangup_handler_init(struct ast_channel *chan)
Init the hangup handler container on a channel.
#define ao2_callback(c, flags, cb_fn, arg)
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
int ast_bridge_features_init(struct ast_bridge_features *features)
Initialize bridge features structure.
int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang)
says digits
struct timeval ast_channel_answertime(struct ast_channel *chan)
void ast_channel_internal_set_stream_topology_change_source(struct ast_channel *chan, void *change_source)
int plan
Type-Of-Number and Numbering-Plan ie.
static void * tonepair_alloc(struct ast_channel *chan, void *params)
struct ast_party_id priv_from
Who is redirecting the call (Sent to the party the call is redirected toward) - private representatio...
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
int ast_queue_unhold(struct ast_channel *chan)
Queue an unhold frame.
static int ast_add_fd(struct pollfd *pfd, int fd)
if fd is a valid descriptor, set *pfd with the descriptor
#define AST_CAUSE_FACILITY_REJECTED
#define AST_CAUSE_ACCESS_INFO_DISCARDED
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 destroy_hooks(struct ast_channel *chan)
#define AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE
void ast_tonepair_stop(struct ast_channel *chan)
int ast_channel_has_hook_requiring_audio(struct ast_channel *chan)
Check if the channel has any active hooks that require audio.
Structure for variables, used for configurations and for channel variables.
static int(* ast_moh_start_ptr)(struct ast_channel *, const char *, const char *)
struct ast_tone_zone * ast_channel_zone(const struct ast_channel *chan)
void ast_uninstall_music_functions(void)
void ast_channel_generator_set(struct ast_channel *chan, struct ast_generator *value)
struct ast_frame *(*const read_stream)(struct ast_channel *chan)
Read a frame (or chain of frames from the same stream), in standard format (see frame.h), with stream num.
Named group member structure.
#define AST_CAUSE_MISDIALLED_TRUNK_PREFIX
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
globally accessible channel datastores
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
struct ast_set_party_id priv_orig
void ast_channel_vstream_set(struct ast_channel *chan, struct ast_filestream *value)
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
int(*const answer)(struct ast_channel *chan)
Answer the channel.
AST_THREADSTORAGE_RAW(in_intercept_routine)
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
static void silence_generator_release(struct ast_channel *chan, void *data)
enum ast_control_t38 request_response
const struct ast_channel_tech * tech
int char_set
Character set the name is using.
void ast_timer_close(struct ast_timer *handle)
Close an opened timing handle.
Assume that the ao2_container is already locked.
Structure to pass both assignedid values to channel drivers.
int ast_answer(struct ast_channel *chan)
Answer a channel.
void ast_channel_readtrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
static int kill_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
void ast_party_id_free(struct ast_party_id *doomed)
Destroy the party id contents.
Structure for a data store type.
Structure used to transport a message through the frame core.
ast_channel_state
ast_channel states
void ast_channel_audiohooks_set(struct ast_channel *chan, struct ast_audiohook_list *value)
struct ast_timer * ast_timer_open(void)
Open a timer.
static void clone_variables(struct ast_channel *original, struct ast_channel *clonechan)
Clone channel variables from 'clone' channel into 'original' channel.
char * str
Subscriber name (Malloced)
int ast_transfer(struct ast_channel *chan, char *dest)
Transfer a call to dest, if the channel supports transfer.
struct stasis_message_type * ast_channel_flash_type(void)
Message type for when a hook flash occurs on a channel.
int ast_queue_hangup(struct ast_channel *chan)
Queue a hangup frame for channel.
void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
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
#define AST_NUM_CHANNEL_BUCKETS
static void * channel_cc_params_copy(void *data)
void ast_channel_answertime_set(struct ast_channel *chan, struct timeval *value)
int ast_senddigit_begin(struct ast_channel *chan, char digit)
Send a DTMF digit to a channel.
int ast_recvchar(struct ast_channel *chan, int timeout)
Receives a text character from a channel.
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_connected_line_init(struct ast_party_connected_line *init)
Initialize the given connected line structure.
static void channel_set_intercept_mode(int in_intercept_mode)
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
void ast_channel_named_pickupgroups_set(struct ast_channel *chan, struct ast_namedgroups *value)
int(*const hangup)(struct ast_channel *chan)
Hangup (and possibly destroy) the channel.
unsigned char valid
TRUE if the subaddress information is valid/present.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
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.
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)
static struct external_vars ami_vars
int connect_on_early_media
void ast_channel_internal_alertpipe_close(struct ast_channel *chan)
#define AST_OPTION_CC_AGENT_TYPE
ast_control_frame_type
Internal control frame subtype field values.
static const struct ast_datastore_info * suppress_get_datastore_information(enum ast_frame_type frametype)
int plc_fillin(plc_state_t *s, int16_t amp[], int len)
Fill-in a block of missing audio samples.
int ast_channel_connected_line_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const void *connected_info, int is_caller, int is_frame)
Run a connected line interception macro and update a channel's connected line information.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
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...
static void send_flash_event(struct ast_channel *chan)
void ast_channel_inherit_variables(const struct ast_channel *parent, struct ast_channel *child)
Inherits channel variable from parent to child channel.
struct ast_bridge * ast_channel_internal_bridge(const struct ast_channel *chan)
static int should_skip_dtmf(struct ast_channel *chan)
Determine whether or not we should ignore DTMF in the readq.
int ani2
Automatic Number Identification 2 (Info Digits)
int(* generate)(struct ast_channel *chan, void *data, int len, int samples)
int presentation
presentation-indicator ie
void ast_channel_unregister(const struct ast_channel_tech *tech)
Unregister channel driver.
int64_t ast_channel_get_duration_ms(struct ast_channel *chan)
Obtain how long it's been, in milliseconds, since the channel was created.
int 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.
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_link_flags(container, obj, flags)
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.
enum ast_frame_type frametype
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...
#define ast_opt_transmit_silence
#define AST_OPTION_SECURE_MEDIA
void ast_channel_internal_errno_set(enum ast_channel_error error)
static int match(struct ast_sockaddr *addr, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int check_dcallno)
int ast_channel_blocker_tid(const struct ast_channel *chan)
struct ast_frame * ast_read_stream(struct ast_channel *chan)
Reads a frame, but does not filter to just the default streams.
#define ast_str_alloca(init_len)
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
#define ast_strdup(str)
A wrapper for strdup()
static int call(void *data)
Structure for a data store object.
struct varshead * ast_channel_varshead(struct ast_channel *chan)
static int hangup(void *data)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
struct ast_variable * ast_channeltype_list(void)
return an ast_variable list of channeltypes
struct ast_namedgroups * ast_unref_namedgroups(struct ast_namedgroups *groups)
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_playtones_stop(struct ast_channel *chan)
Stop playing tones on a channel.
struct ast_stream * ast_stream_topology_get_stream(const struct ast_stream_topology *topology, unsigned int position)
Get a specific stream from the topology.
void ast_channel_softhangup_internal_flag_set(struct ast_channel *chan, int value)
char * str
Malloced subaddress string.
#define AST_RWLIST_HEAD_INIT(head)
Initializes an rwlist head structure.
static void set_channel_answer_time(struct ast_channel *chan)
struct ao2_iterator simple_iterator
#define AST_CAUSE_NO_USER_RESPONSE
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 ...
const struct ast_datastore_info secure_call_info
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.
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...
Definitions to aid in the use of thread local storage.
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...
Out-of-call text message support.
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...
#define AST_CAUSE_NORMAL_CIRCUIT_CONGESTION
void ast_cli(int fd, const char *fmt,...)
void ast_channel_zone_set(struct ast_channel *chan, struct ast_tone_zone *value)
#define ast_cc_config_params_init()
Allocate and initialize an ast_cc_config_params structure.
void ast_channel_internal_fd_clear_all(struct ast_channel *chan)
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
static struct ast_frame * kill_exception(struct ast_channel *chan)
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin)
Queue one or more frames to a channel's frame queue.
#define AST_CAUSE_INVALID_NUMBER_FORMAT
void ast_channel_internal_swap_stream_topology(struct ast_channel *chan1, struct ast_channel *chan2)
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...
#define AST_MUTE_DIRECTION_WRITE
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
#define AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED
const char * ast_channel_call_forward(const struct ast_channel *chan)
static char cid_num[AST_MAX_EXTENSION]
int ast_channel_priority(const struct ast_channel *chan)
int code
enum AST_REDIRECTING_REASON value for redirection
int() ao2_callback_data_fn(void *obj, void *arg, void *data, int flags)
Type of a generic callback function.
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.
unsigned char odd_even_indicator
TRUE if odd number of address signals.
#define ast_verb(level,...)
void ast_bridge_features_destroy(struct ast_bridge_features *features)
Destroy an allocated bridge features struct.
struct ast_party_name_ies name
Subscriber name ies.
struct ast_trans_pvt * ast_channel_readtrans(const struct ast_channel *chan)
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.
Indicate what information in ast_party_caller should be set.
int ast_raw_answer_with_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
Answer a channel passing in a stream topology.
void ast_channel_callid_cleanup(struct ast_channel *chan)
static const char ast_stream_topology_changed_external[]
Set as the change source reason when a channel stream topology has been changed externally as a resul...
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
struct ast_variable * vars
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.
the list of registered channel types
int ast_app_group_update(struct ast_channel *oldchan, struct ast_channel *newchan)
Update all group counting for a channel to a new one.
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)
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
struct ast_frame_subclass subclass
void ast_change_name(struct ast_channel *chan, const char *newname)
Change channel name.
int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *to)
Inherit datastores from a parent to a child.
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.
void ast_party_dialed_init(struct ast_party_dialed *init)
Initialize the given dialed structure.
static int does_id_conflict(const char *uniqueid)
void ast_channel_writetrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
#define AST_PRES_RESTRICTED
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
#define AST_OPTION_FORMAT_WRITE
void ast_party_redirecting_reason_free(struct ast_party_redirecting_reason *doomed)
Destroy the redirecting reason contents.
static int set_security_requirements(const struct ast_channel *requestor, struct ast_channel *out)
static struct ast_threadstorage state2str_threadbuf
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...
void() ao2_prnt_fn(void *where, const char *fmt,...)
Print output.
#define ast_strlen_zero(foo)
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.
static const struct ast_datastore_info suppress_datastore_voice
struct timeval * ast_channel_whentohangup(struct ast_channel *chan)
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
#define ast_manager_event(chan, category, event, contents,...)
struct ast_set_party_id from
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.
struct ast_party_id orig
Who originally redirected the call (Sent to the party the call is redirected toward) ...
void ast_channel_stream_set(struct ast_channel *chan, struct ast_filestream *value)
void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
int(*const call)(struct ast_channel *chan, const char *addr, int timeout)
Make a call.
ast_group_t ast_get_group(const char *s)
static int ast_channel_hash_cb(const void *obj, const int flags)
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...
static void plc_ds_destroy(void *data)
void ast_channel_internal_alertpipe_swap(struct ast_channel *chan1, struct ast_channel *chan2)
Swap the interal alertpipe between two channels.
static const struct ast_channel_tech surrogate_tech
Channel technology used to extract a channel from a running application. The channel created with thi...
static int deactivate_silence_generator(struct ast_channel *chan)
int ast_framehook_attach(struct ast_channel *chan, struct ast_framehook_interface *i)
Attach an framehook onto a channel for frame interception.
static int indicate_data_internal(struct ast_channel *chan, int _condition, const void *data, size_t datalen)
void ast_party_caller_free(struct ast_party_caller *doomed)
Destroy the caller party contents.
struct ast_party_id id
Caller party ID.
static void suppress_framehook_fixup_cb(void *data, int framehook_id, struct ast_channel *old_chan, struct ast_channel *new_chan)
void ast_party_name_init(struct ast_party_name *init)
Initialize the given name structure.
void(* write_format_change)(struct ast_channel *chan, void *data)
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.
#define AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
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 ...
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
List of channel variables to append to all channel-related events.
void ao2_container_unregister(const char *name)
Unregister a container for CLI stats and integrity check.
void ast_party_subaddress_init(struct ast_party_subaddress *init)
Initialize the given subaddress structure.
#define ast_str_tmp(init_len, __expr)
void ast_party_number_free(struct ast_party_number *doomed)
Destroy the party number contents.
struct ast_readq_list * ast_channel_readq(struct ast_channel *chan)
#define AST_RWLIST_INSERT_HEAD
int ast_check_hangup(struct ast_channel *chan)
Checks to see if a channel is needing hang up.
char * ast_print_group(char *buf, int buflen, ast_group_t group)
Print call group and pickup group —.
void ast_channel_internal_swap_endpoint_forward(struct ast_channel *a, struct ast_channel *b)
Swap endpoint_forward between two channels.
void(* chan_fixup)(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
Fix up channel references on the masquerading channel.
static int kill_hangup(struct ast_channel *chan)
int ast_indicate_data(struct ast_channel *chan, int _condition, const void *data, size_t datalen)
Indicates condition of channel, with payload.
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 ast_debug(level,...)
Log a DEBUG message.
void ast_party_redirecting_reason_init(struct ast_party_redirecting_reason *init)
Initialize the given redirecting reason structure.
void ast_channel_masq_set(struct ast_channel *chan, struct ast_channel *value)
void ast_channel_set_rawreadformat(struct ast_channel *chan, struct ast_format *format)
int ast_channel_supports_html(struct ast_channel *chan)
Checks for HTML support on a channel.
int ast_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options)
says an enumeration
#define AST_CAUSE_NO_ROUTE_TRANSIT_NET
void ast_channel_cdr_set(struct ast_channel *chan, struct ast_cdr *value)
unsigned int ast_channel_emulate_dtmf_duration(const struct ast_channel *chan)
unsigned int ast_channel_fin(const struct ast_channel *chan)
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)
void ast_party_connected_line_free(struct ast_party_connected_line *doomed)
Destroy the connected line information contents.
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...
void ast_channel_internal_swap_topics(struct ast_channel *a, struct ast_channel *b)
Swap topics beteween two channels.
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.
static int ast_channel_softhangup_cb(void *obj, void *arg, int flags)
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.
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.
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.
#define AST_MUTE_DIRECTION_READ
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.
void ast_moh_cleanup(struct ast_channel *chan)
const char * ast_channel_latest_musicclass(const struct ast_channel *chan)
struct ast_party_id ani
Automatic Number Identification (ANI)
int ast_channel_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
Bridge two channels together (early)
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)
int ast_call(struct ast_channel *chan, const char *addr, int timeout)
Make a call.
General Asterisk PBX channel definitions.
static void varshead_dtor(void *obj)
Destructor for lists of variables.
#define AST_PRES_USER_NUMBER_UNSCREENED
#define SCOPED_MUTEX(varname, lock)
scoped lock specialization for mutexes
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
const char * ast_channel_accountcode(const struct ast_channel *chan)
Asterisk file paths, configured in asterisk.conf.
int(*const send_html)(struct ast_channel *chan, int subclass, const char *data, int len)
Send HTML data.
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
int ast_threadstorage_set_ptr(struct ast_threadstorage *ts, void *ptr)
Set a raw pointer from threadstorage.
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.
static int ast_channel_by_uniqueid_cb(void *obj, void *arg, void *data, int flags)
struct ast_channel * chan
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.
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...
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...
static const struct set_format_access set_format_access_read
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_namedgroups * ast_get_namedgroups(const char *s)
Create an ast_namedgroups set with group names from comma separated string.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
void ast_channel_generatordata_set(struct ast_channel *chan, void *value)
int ast_get_tid(void)
Get current thread ID.
void ast_channel_clear_flag(struct ast_channel *chan, unsigned int flag)
static struct ast_generator gen
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.
void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
struct ast_party_redirecting_reason orig_reason
Reason for the redirection by the original party.
struct ast_trans_pvt * ast_channel_writetrans(const struct ast_channel *chan)
void ast_channel_stage_snapshot_done(struct ast_channel *chan)
Clear flag to indicate channel snapshot is being staged, and publish snapshot.
#define AST_TRANS_CAP_DIGITAL_W_TONES
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
int ast_channel_visible_indication(const struct ast_channel *chan)
static void handle_cause(int cause, int *outstate)
int ast_timer_disable_continuous(const struct ast_timer *handle)
Disable continuous mode.
#define ast_poll(a, b, c)
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
#define AST_CAUSE_ANSWERED_ELSEWHERE
int(*const write_text)(struct ast_channel *chan, struct ast_frame *frame)
Write a text frame, in standard format.
#define AST_TRANS_CAP_3_1K_AUDIO
struct ast_bridge * ast_channel_get_bridge(const struct ast_channel *chan)
Get the bridge associated with a channel.
struct ast_channel * ast_channel_iterator_next(struct ast_channel_iterator *i)
Get the next channel for a channel iterator.
void ast_channel_set_flag(struct ast_channel *chan, unsigned int flag)
Set a flag on a channel.
char ast_defaultlanguage[]
#define AST_RWLIST_TRAVERSE
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
#define AST_CAUSE_NORMAL_CLEARING
Scheduler Routines (derived from cheops)
#define AST_CAUSE_CHAN_NOT_IMPLEMENTED
Caller Party information.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
static int indicate_connected_line(struct ast_channel *chan, const void *data, size_t datalen)
#define ast_channel_cleanup(c)
Cleanup a channel reference.
ast_alert_status_t ast_channel_internal_alert_read(struct ast_channel *chan)
Asterisk internal frame definitions.
static int tech_write(struct ast_channel *chan, struct ast_stream *stream, struct ast_stream *default_stream, struct ast_frame *frame)
#define ao2_ref(o, delta)
void ast_channel_set_readformat(struct ast_channel *chan, struct ast_format *format)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
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.
void ast_jb_destroy(struct ast_channel *chan)
Destroys jitterbuffer on a channel.
struct ast_datastore_list * ast_channel_datastores(struct ast_channel *chan)
void(* release)(struct ast_channel *chan, void *data)
int ast_redirecting_parse_data(const unsigned char *data, size_t datalen, struct ast_party_redirecting *redirecting)
Parse redirecting indication frame data.
struct ast_cc_config_params * ast_channel_get_cc_config_params(struct ast_channel *chan)
Get the CCSS parameters from a channel.
const struct ast_datastore_info * info
struct ast_party_id priv
Private caller party ID.
struct ast_channel_iterator * ast_channel_iterator_all_new(void)
Create a new channel iterator.
void ast_channel_undefer_dtmf(struct ast_channel *chan)
Unset defer DTMF flag on channel.
#define ast_strdupa(s)
duplicate a string in memory from the stack
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.
static int silence_generator_generate(struct ast_channel *chan, void *data, int len, int samples)
void ast_channel_internal_cleanup(struct ast_channel *chan)
static int ast_channel_cmp_cb(void *obj, void *arg, int flags)
struct ast_bridge_channel * ast_channel_internal_bridge_channel(const struct ast_channel *chan)
struct ast_set_party_id id
map AST_CAUSE's to readable string representations
void ast_party_subaddress_free(struct ast_party_subaddress *doomed)
Destroy the party subaddress contents.
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
#define SCOPED_LOCK(varname, lock, lockfunc, unlockfunc)
Scoped Locks.
A set of macros to manage forward-linked lists.
static char language[MAX_LANGUAGE]
void ast_party_name_free(struct ast_party_name *doomed)
Destroy the party name contents.
int ast_senddigit_end(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel.
#define ast_malloc(len)
A wrapper for malloc()
void ast_channel_internal_swap_uniqueid_and_linkedid(struct ast_channel *a, struct ast_channel *b)
Swap uniqueid and linkedid beteween two channels.
int ast_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...
#define ast_variable_new(name, value, filename)
struct varshead * ast_channel_get_vars(struct ast_channel *chan)
Gets the variables for a given channel, as set using pbx_builtin_setvar_helper(). ...
static struct ast_generator silence_generator
int(*const send_text)(struct ast_channel *chan, const char *text)
Display or transmit text.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_CAUSE_NO_ANSWER
#define ast_opt_generic_plc
static const struct causes_map causes[]
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.
AST_LIST_HEAD_NOLOCK(contactliststruct, contact)
void * ast_channel_timingdata(const struct ast_channel *chan)
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.
struct ast_party_id ani
Automatic Number Identification (ANI)
int ast_auto_answer(struct ast_channel *chan)
Answer a channel, if it's not already answered.
static int answer(void *data)
Channels with this particular technology are an implementation detail of Asterisk and should generall...
void ast_party_id_reset(struct ast_party_id *id)
Destroy and initialize the given party id structure.
int odd_even_indicator
odd/even indicator ie
const char * ast_state2str(enum ast_channel_state state)
Gives the string form of a given channel state.
void ast_channel_caller_set(struct ast_channel *chan, struct ast_party_caller *value)
static void apply_plc(struct ast_channel *chan, struct ast_frame *frame)
#define AST_CAUSE_NUMBER_PORTED_NOT_HERE
#define AST_CAUSE_FACILITY_NOT_IMPLEMENTED
#define AST_CAUSE_NOTDEFINED
Structure to describe a channel "technology", ie a channel driver See for examples: ...
void ast_channel_adsicpe_set(struct ast_channel *chan, enum ast_channel_adsicpe value)
const char * ast_channel_exten(const struct ast_channel *chan)
int(* ast_timing_func_t)(const void *data)
Core PBX routines and definitions.
int ast_endpoint_add_channel(struct ast_endpoint *endpoint, struct ast_channel *chan)
Adds a channel to the given endpoint.
static struct external_vars ari_vars
void ast_party_subaddress_copy(struct ast_party_subaddress *dest, const struct ast_party_subaddress *src)
Copy the source party subaddress information to the destination party subaddress. ...
int(* 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...
void ast_channel_dtmf_tv_set(struct ast_channel *chan, struct timeval *value)
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
struct ast_party_connected_line connected
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_set_party_id priv
#define AST_RWLIST_TRAVERSE_SAFE_BEGIN
static void channel_req_accountcodes(struct ast_channel *chan, const struct ast_channel *requestor, enum ast_channel_requestor_relationship relationship, int precious)
ast_say_case_sensitivity
Controls how ast_say_character_str denotes the case of characters in a string.
#define AST_CAUSE_DESTINATION_OUT_OF_ORDER
const char * ast_channel_amaflags2string(enum ama_flags flag)
Convert the enum representation of an AMA flag to a string representation.
struct ast_sched_context * ast_sched_context_create(void)
Create a scheduler context.
#define ast_test_suite_event_notify(s, f,...)
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
int ast_channel_fdno(const struct ast_channel *chan)
void ast_channel_masqr_set(struct ast_channel *chan, struct ast_channel *value)
void ast_channel_timingdata_set(struct ast_channel *chan, void *value)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
ast_frame_type
Frame types.
int ast_senddigit_mf_begin(struct ast_channel *chan, char digit)
Send an MF digit to a channel.
void ast_party_redirecting_free(struct ast_party_redirecting *doomed)
Destroy the redirecting information contents.
static void channel_do_masquerade(struct ast_channel *original, struct ast_channel *clonechan)
Masquerade a 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.
void ast_bridge_features_merge(struct ast_bridge_features *into, const struct ast_bridge_features *from)
Merge one ast_bridge_features into another.
int ast_channel_timingfd(const struct ast_channel *chan)
struct ast_party_dialed dialed
Dialed/Called information.
int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *peer)
Make the frame formats of two channels compatible.
#define DEFAULT_AMA_FLAGS
int ast_readstring_full(struct ast_channel *c, char *s, int len, int timeout, int ftimeout, char *enders, int audiofd, int ctrlfd)
Redirecting reason information.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
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 tag
User party id tag ie.
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...
struct ast_party_subaddress subaddress
Subscriber subaddress.
void ast_channel_stage_snapshot(struct ast_channel *chan)
Set flag to indicate channel snapshot is being staged.
"smart" channels that update automatically if a channel is masqueraded
Dialed/Called Party information.
static const float mf_tones[]
static int namedgroup_hash_cb(const void *obj, const int flags)
Hashing function used for named group container.
Structure that contains information about a bridge.
#define AST_CAUSE_FACILITY_NOT_SUBSCRIBED
int ast_timer_ack(const struct ast_timer *handle, unsigned int quantity)
Acknowledge a timer event.
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.
Indicate what information in ast_party_id should be set.
struct ast_format * ast_channel_rawreadformat(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().
int ast_sendtext(struct ast_channel *chan, const char *text)
Sends text to a channel.
int ast_say_phonetic_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang)
#define AST_CAUSE_REDIRECTED_TO_NEW_DESTINATION
struct ast_sched_context * ast_channel_sched(const struct ast_channel *chan)
int ast_tvcmp(struct timeval _a, struct timeval _b)
Compres two struct timeval instances returning -1, 0, 1 if the first arg is smaller, equal or greater to the second.
void ast_party_redirecting_init(struct ast_party_redirecting *init)
Initialize the given redirecting structure.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
struct ast_generator * ast_channel_generator(const struct ast_channel *chan)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
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.
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.
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...
#define ast_opt_transcode_via_slin
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_channel * __ast_dummy_channel_alloc(const char *file, int line, const char *function)
int ast_channel_has_ari_vars(void)
Return whether or not any ARI variables have been set.
struct ast_channel * ast_channel_callback(ao2_callback_data_fn *cb_fn, void *arg, void *data, int ao2_flags)
Call a function with every active channel.
struct timeval * ast_channel_dtmf_tv(struct ast_channel *chan)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
int ast_cc_offer(struct ast_channel *caller_chan)
Offer CC to a caller.
static struct ast_generator generator
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
struct ast_channel_iterator * ast_channel_iterator_destroy(struct ast_channel_iterator *i)
Destroy a channel iterator.
#define AST_CAUSE_CALL_AWARDED_DELIVERED
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...
Internal channel functions for channel.c to use.
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_channel_internal_alertpipe_init(struct ast_channel *chan)
static struct ast_frame * suppress_framehook_event_cb(struct ast_channel *chan, struct ast_frame *frame, enum ast_framehook_event event, void *data)
struct ast_set_party_id priv_from
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, const char *file, int line, const char *function, const char *name_fmt, va_list ap)
Create a new channel structure.
#define ao2_unlink(container, obj)
struct ast_stream_topology * ast_stream_topology_alloc(void)
Create a stream topology.
static struct ao2_container * channels
All active channels on the system.
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.
#define AST_CAUSE_NORMAL_UNSPECIFIED
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
void ast_channel_named_callgroups_set(struct ast_channel *chan, struct ast_namedgroups *value)
int ast_remaining_ms(struct timeval start, int max_ms)
Calculate remaining milliseconds given a starting timestamp and upper bound.
#define AST_CAUSE_CHANNEL_UNACCEPTABLE
void ast_channel_publish_varset(struct ast_channel *chan, const char *variable, const char *value)
Publish a ast_channel_varset for a channel.
enum ama_flags ast_channel_string2amaflag(const char *flag)
Convert a string to a detail record AMA flag.
#define AST_PRES_NUMBER_TYPE
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.
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.
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_publish_final_snapshot(struct ast_channel *chan)
Send the final channel snapshot for a channel, thus removing it from cache.
#define AST_FRAMEHOOK_INTERFACE_VERSION
void ast_channel_streamid_set(struct ast_channel *chan, int value)
void ast_var_delete(struct ast_var_t *var)
int ast_queue_answer(struct ast_channel *chan, const struct ast_stream_topology *topology)
Queue an ANSWER control frame with topology.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ani2
Automatic Number Identification 2 (Info Digits)
struct ast_channel * ast_channel_masq(const struct ast_channel *chan)
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_tone_zone_sound * ast_get_indication_tone(const struct ast_tone_zone *zone, const char *indication)
Locate a tone zone sound.
#define ao2_callback_data(container, flags, cb_fn, arg, data)
struct ast_channel * ast_channel_get_by_exten(const char *exten, const char *context)
Find a channel by extension and context.
#define AST_TRANS_CAP_VIDEO
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
pthread_t ast_channel_blocker(const struct ast_channel *chan)
Connected Line/Party information.
int ast_channel_get_intercept_mode(void)
Am I currently running an intercept dialplan routine.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
const ast_string_field name
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)
struct ast_party_dialed * ast_channel_dialed(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...
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
struct sla_ringing_trunk * first
#define ast_strndup(str, len)
A wrapper for strndup()
void ast_channel_fout_set(struct ast_channel *chan, unsigned int value)
#define AST_CAUSE_WRONG_MESSAGE
enum ast_frame_read_action action
void ast_channel_name_to_dial_string(char *channel_name)
Removes the trailing identifiers from a channel name string.
#define ao2_iterator_next(iter)
#define ao2_alloc(data_size, destructor_fn)
#define AST_PRES_NUMBER_NOT_AVAILABLE
struct timeval ast_channel_creationtime(struct ast_channel *chan)
static void channel_set_external_vars(struct external_vars *channelvars, size_t varc, char **vars)
#define AST_LIST_LAST(head)
Returns the last entry contained in a list.
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
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...
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.
char * ast_trim_blanks(char *str)
Trims trailing whitespace characters from a string.
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...
int ast_seekstream(struct ast_filestream *fs, off_t sample_offset, int whence)
Seeks into stream.
const char * ast_channel_peeraccount(const struct ast_channel *chan)
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.
const char * ast_var_full_name(const struct ast_var_t *var)
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
enum ast_channel_error ast_channel_errno(void)
Get error code for latest channel operation.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
int ast_tonepair(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
void(* digit)(struct ast_channel *chan, char digit)
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
char * str
a string value for the redirecting reason
int ast_channel_feature_hooks_append(struct ast_channel *chan, struct ast_bridge_features *features)
Appends to the channel-attached features a channel has access to upon being bridged.
int ast_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.
#define ast_opt_generic_plc_on_equal_codecs
#define ast_channel_unlock(chan)
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_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.
A machine to gather up arbitrary frames and convert them to raw slinear on demand.
struct ast_channel * ast_channel_bridge_peer(struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
struct ast_channel_iterator * ast_channel_iterator_by_exten_new(const char *exten, const char *context)
Create a new channel iterator based on extension.
struct ast_frame *(*const exception)(struct ast_channel *chan)
Handle an exception, reading a frame.
struct ast_hangup_handler_list * ast_channel_hangup_handlers(struct ast_channel *chan)
int source
Information about the source of an update.
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...
int valid
valid/present ie
#define AST_CAUSE_BEARERCAPABILITY_NOTIMPL
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.
#define ast_calloc(num, len)
A wrapper for calloc()
static char * complete_channeltypes(struct ast_cli_args *a)
void ast_autochan_new_channel(struct ast_channel *old_chan, struct ast_channel *new_chan)
Switch what channel autochans point to.
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.
#define AST_OPTION_SECURE_SIGNALING
struct ast_var_t::@249 entries
int ast_channel_setoption(struct ast_channel *chan, int option, void *data, int datalen, int block)
Sets an option on a channel.
int valid
valid/present ie
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
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 int ast_channel_by_name_cb(void *obj, void *arg, void *data, int flags)
static int tonepair_generator(struct ast_channel *chan, void *data, int len, int samples)
#define ast_var_assign(name, value)
void ast_bridge_notify_masquerade(struct ast_channel *chan)
Notify bridging that this channel was just masqueraded.
#define CHANNEL_DEADLOCK_AVOIDANCE(chan)
int ast_closestream(struct ast_filestream *f)
Closes a stream.
int __ast_answer(struct ast_channel *chan, unsigned int delay)
Answer a channel, with a selectable delay before returning.
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...
struct ast_filestream * ast_channel_stream(const struct ast_channel *chan)
static void generator_write_format_change(struct ast_channel *chan)
int ast_is_deferrable_frame(const struct ast_frame *frame)
Should we keep this frame for later?
#define AST_CAUSE_NUMBER_CHANGED
struct ast_bridge_channel * ast_channel_get_bridge_channel(struct ast_channel *chan)
Get a reference to the channel's bridge pointer.
int ast_prod(struct ast_channel *chan)
Send empty audio to prime a channel driver.
void ast_party_number_init(struct ast_party_number *init)
Initialize the given number structure.
static void(* ast_moh_stop_ptr)(struct ast_channel *)
int ast_channel_sendurl(struct ast_channel *chan, const char *url)
Sends a URL on a given link Send URL on link.
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)
#define AST_RWLIST_REMOVE_HEAD
const struct ast_channel_tech * ast_get_channel_tech(const char *name)
Get handle to channel driver based on name.
Prototypes for public functions only of internal interest,.
int ast_channel_has_audio_frame_or_monitor(struct ast_channel *chan)
Check if the channel has active audiohooks, active framehooks, or a monitor.
#define FRAMECOUNT_INC(x)
struct ao2_iterator * active_iterator
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_senddigit(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel.
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...
#define DATASTORE_INHERIT_FOREVER
const char * ast_channel_hangupsource(const struct ast_channel *chan)
#define AST_CAUSE_MANDATORY_IE_LENGTH_ERROR
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. ...
#define ast_frisolate(fr)
Makes a frame independent of any static storage.
struct ast_autochan_list * ast_channel_autochans(struct ast_channel *chan)
#define ao2_find(container, arg, flags)
void * ast_threadstorage_get_ptr(struct ast_threadstorage *ts)
Retrieve a raw pointer from threadstorage.
void ast_channel_timingfd_set(struct ast_channel *chan, int value)
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
static int namedgroup_cmp_cb(void *obj, void *arg, int flags)
Comparison function used for named group container.
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)
void ast_deactivate_generator(struct ast_channel *chan)
int ast_timer_fd(const struct ast_timer *handle)
Get a poll()-able file descriptor for a timer.
int ast_timer_set_rate(const struct ast_timer *handle, unsigned int rate)
Set the timing tick rate.
static void channels_shutdown(void)
static void tonepair_release(struct ast_channel *chan, void *params)
#define AST_CAUSE_INTERWORKING
struct ast_party_redirecting_reason reason
Reason for the redirection.
struct ast_party_subaddress subaddress
Dialed/Called subaddress.
static int generator_force(const void *data)
int ast_stream_topology_get_count(const struct ast_stream_topology *topology)
Get the number of streams in a topology.
int ast_timer_enable_continuous(const struct ast_timer *handle)
Enable continuous mode.
int ast_framehook_list_contains_no_active(struct ast_framehook_list *framehooks)
Determine if a framehook list is free of active framehooks or not.
struct stasis_message_type * ast_channel_dtmf_begin_type(void)
Message type for when DTMF begins on a channel.
enum ast_channel_error ast_channel_internal_errno(void)
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.
void ast_channel_update_redirecting(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Indicate that the redirecting id has changed.
int64_t ast_channel_get_up_time_ms(struct ast_channel *chan)
Obtain how long it has been since the channel was answered in ms.
#define ast_clear_flag(p, flag)
int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Compare a offset with when to hangup channel.
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
char * ast_print_namedgroups(struct ast_str **buf, struct ast_namedgroups *group)
Print named call groups and named pickup groups.
static char cid_name[AST_MAX_EXTENSION]
struct ast_frame *(*const read)(struct ast_channel *chan)
Read a frame (or chain of frames from the same stream), in standard format (see frame.h)
void ast_channel_callid_set(struct ast_channel *chan, ast_callid value)
Indicate what information in ast_party_connected_line should be set.
static void send_text(unsigned char pos, unsigned char inverse, struct unistimsession *pte, const char *text)
#define CHECK_BLOCKING(c)
Set the blocking indication on the channel.
int ast_raw_answer(struct ast_channel *chan)
Answer a channel.
int ast_pbx_hangup_handler_run(struct ast_channel *chan)
Run all hangup handlers on the channel.
int ast_senddigit_mf_end(struct ast_channel *chan)
End sending an MF digit to a channel.
static int replace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
struct ast_format_cap * ast_channel_nativeformats(const struct ast_channel *chan)
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().
void ast_party_id_invalidate(struct ast_party_id *id)
Invalidate all components of the given party id.
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_pre_call(struct ast_channel *chan, const char *sub_args)
Execute a Gosub call on the channel before a call is placed.
#define AST_CAUSE_INVALID_IE_CONTENTS
struct ast_set_party_id orig
void ast_channel_sending_dtmf_tv_set(struct ast_channel *chan, struct timeval value)
char ast_channel_dtmf_digit_to_emulate(const struct ast_channel *chan)
#define AST_PRES_RESTRICTION
struct ast_bridge_features * ast_bridge_features_new(void)
Allocate a new bridge features struct.
static int channel_has_external_vars(struct external_vars *channelvars)
struct ast_frame ast_null_frame
struct timeval ast_channel_sending_dtmf_tv(const struct ast_channel *chan)
static void channel_cc_params_destroy(void *data)
void ast_channel_creationtime_set(struct ast_channel *chan, struct timeval *value)
int combined_presentation
Combined name and number presentation ie.
int ast_channel_is_leaving_bridge(struct ast_channel *chan)
Determine if a channel is leaving a bridge, but not hung up.
#define ast_channel_lock_both(chan1, chan2)
Lock two channels.
struct ast_channel * ast_channel_get_by_name_prefix(const char *name, size_t name_len)
Find a channel by a name prefix.
char * tag
User-set "tag".
int ast_channel_fd(const struct ast_channel *chan, int which)
struct ast_set_party_id id
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.
int type
Q.931 subaddress type.
int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
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.
#define AST_RWLIST_INSERT_TAIL
struct ast_set_party_id priv
#define AST_CAUSE_REQUESTED_CHAN_UNAVAIL
int transit_network_select
Transit Network Select.
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd)
char * ast_transfercapability2str(int transfercapability)
Gives the string form of a given transfer capability.
#define AST_CAUSE_PRE_EMPTED
int ast_channel_defer_dtmf(struct ast_channel *chan)
Set defer DTMF flag on channel.
struct ast_format * origwfmt
Structure that contains information regarding a channel in a bridge.
char * strsep(char **str, const char *delims)
struct ast_set_party_id to
#define AST_CAUSE_NO_ROUTE_DESTINATION
static void send_dtmf_end_event(struct ast_channel *chan, enum DtmfDirection direction, const char digit, long duration_ms)
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.
int ast_max_forwards_decrement(struct ast_channel *chan)
Decrement the max forwards count for a particular channel.
static const struct ast_datastore_info plc_ds_info
static void(* ast_moh_cleanup_ptr)(struct ast_channel *)
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_channel_internal_is_finalized(struct ast_channel *chan)
#define ast_channel_ref(c)
Increase channel reference count.
#define ao2_replace(dst, src)
int ast_channel_is_bridged(const struct ast_channel *chan)
Determine if a channel is in a bridge.
Indicate what information in ast_party_redirecting should be set.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
void ast_party_redirecting_reason_copy(struct ast_party_redirecting_reason *dest, const struct ast_party_redirecting_reason *src)
Copy the source redirecting reason information to the destination redirecting reason.
int count
Number of times the call was redirected.
Standard Command Line Interface.
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.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
struct ast_namedgroups * ast_ref_namedgroups(struct ast_namedgroups *groups)
int ast_channel_queryoption(struct ast_channel *chan, int option, void *data, int *datalen, int block)
Checks the value of an option.
#define SCOPE_TRACE(level,...)
Print a trace message with details when a scope is entered or existed.
int ast_channel_hangupcause(const struct ast_channel *chan)
void ast_channel_context_set(struct ast_channel *chan, const char *value)
struct ast_party_id to
Call is redirecting to a new party (Sent to the caller)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static int ast_channel_make_compatible_helper(struct ast_channel *from, struct ast_channel *to)
Set up translation from one channel to another.
unsigned int emulate_sip_cause
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
int type
subaddress type ie
void ast_channel_set_manager_vars(size_t varc, char **vars)
Sets the variables to be stored in the manager_vars field of all snapshots.
struct ast_set_party_id ani
const char * ast_channel_name(const struct ast_channel *chan)
#define AST_CAUSE_IE_NONEXIST
int ast_writestream(struct ast_filestream *fs, struct ast_frame *f)
Writes a frame to a stream.
int ast_channel_fd_count(const struct ast_channel *chan)
Retrieve the number of file decriptor positions present on the channel.
static void call_forward_inherit(struct ast_channel *new_chan, struct ast_channel *parent, struct ast_channel *orig)
#define AST_CAUSE_USER_BUSY
void ast_party_dialed_free(struct ast_party_dialed *doomed)
Destroy the dialed party contents.
void ast_channel_state_set(struct ast_channel *chan, enum ast_channel_state)
int ast_waitfor(struct ast_channel *c, int ms)
Wait for input on a channel.
int ast_channel_alert_writable(struct ast_channel *chan)
static const struct ast_channel_tech null_tech
void * ast_channel_music_state(const struct ast_channel *chan)
Information needed to specify a number in a call.
void ast_pbx_hangup_handler_destroy(struct ast_channel *chan)
Destroy the hangup handler container on a channel.
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_channel_connected_set(struct ast_channel *chan, struct ast_party_connected_line *value)
#define AST_OPTION_FORMAT_READ
void ast_hangup(struct ast_channel *chan)
Hangup a channel.
struct ast_set_party_id priv_to
void ast_channel_sched_set(struct ast_channel *chan, struct ast_sched_context *value)
unsigned long global_fout
void ast_cdr_free(struct ast_cdr *cdr)
Free a CDR record.
struct stasis_forward * sub
Data structure associated with a single frame of data.
void ast_channel_emulate_dtmf_duration_set(struct ast_channel *chan, unsigned int value)
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.
Internal Asterisk hangup causes.
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 int force_inline attribute_pure ast_begins_with(const char *str, const char *prefix)
void ast_channel_softhangup_internal_flag_add(struct ast_channel *chan, int value)
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.
const char * ast_channel_language(const struct ast_channel *chan)
int ast_channel_redirecting_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const void *redirecting_info, int is_caller, int is_frame)
Run a redirecting interception macro and update a channel's redirecting information.
static const struct ast_datastore_info bridge_features_info
static void ast_channel_destructor(void *obj)
Free a channel structure.
Abstract JSON element (object, array, string, int, ...).
int ast_playtones_start(struct ast_channel *chan, int vol, const char *tonelist, int interruptible)
Start playing a list of tones on a channel.
struct ast_flags * ast_channel_snapshot_segment_flags(struct ast_channel *chan)
int(*const send_text_data)(struct ast_channel *chan, struct ast_msg_data *data)
Display or transmit text with data.
const struct ast_channel_tech ast_kill_tech
Kill the channel channel driver technology descriptor.
int ast_channel_unbridged(struct ast_channel *chan)
This function will check if the bridge needs to be re-evaluated due to external changes.
#define AST_JITTERBUFFER_FD
int(*const queryoption)(struct ast_channel *chan, int option, void *data, int *datalen)
Query a given option. Called with chan locked.
static struct ast_frame * __ast_read(struct ast_channel *chan, int dropaudio, int dropnondefault)
#define AST_TRANS_CAP_RESTRICTED_DIGITAL
struct ast_channel * ast_channel_yank(struct ast_channel *yankee)
Gain control of a channel in the system.
int plc_rx(plc_state_t *s, int16_t amp[], int len)
Process a block of received audio samples.
struct ast_channel_id uniqueid
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)
int ast_stasis_channels_init(void)
Initialize the stasis channel topic and message types.
const char * ast_channel_context(const struct ast_channel *chan)
struct timeval ast_tvsub(struct timeval a, struct timeval b)
Returns the difference of two timevals a - b.
const char * ast_cause2str(int cause)
Gives the string form of a given hangup cause.
const char * data
Description of a tone.
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
void ast_party_id_init(struct ast_party_id *init)
Initialize the given party id structure.
#define ast_datastore_alloc(info, uid)
unsigned long ast_channel_outsmpl(const struct ast_channel *chan)
union ast_frame::@263 data
ast_media_type
Types of media.
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_channel_register(const struct ast_channel_tech *tech)
Register a new telephony channel in Asterisk.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
enum ast_frame_type frametype
int ast_transfer_protocol(struct ast_channel *chan, char *dest, int *protocol)
Transfer a call to dest, if the channel supports transfer.
void ast_softhangup_all(void)
Soft hangup all active channels.
#define AST_PRES_UNAVAILABLE
#define ast_channel_trylock(chan)
ama_flags
Channel AMA Flags.
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.
unsigned char valid
TRUE if the name information is valid/present.
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...
int ast_app_group_discard(struct ast_channel *chan)
Discard all group counting for a channel.
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.
void ast_channel_publish_blob(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Publish a channel blob message.
static char context[AST_MAX_CONTEXT]
#define AST_TRANS_CAP_SPEECH
Call Parking and Pickup API Includes code and algorithms from the Zapata library. ...
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
Information needed to specify a subaddress in a call.
static void * silence_generator_alloc(struct ast_channel *chan, void *data)
static int kill_write(struct ast_channel *chan, struct ast_frame *frame)
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.
void ast_channel_internal_fd_set(struct ast_channel *chan, int which, int value)
void ast_channel_hold_state_set(struct ast_channel *chan, int value)
void ast_channel_internal_swap_snapshots(struct ast_channel *a, struct ast_channel *b)
Swap snapshots beteween two channels.
struct ast_format * format
int ast_channel_move(struct ast_channel *dest, struct ast_channel *source)
Move a channel from its current location to a new location.
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
void ast_channel_fin_set(struct ast_channel *chan, unsigned int value)
static void free_external_channelvars(struct external_vars *channelvars)
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.
#define DEFAULT_EMULATE_MF_DURATION
static void queue_dtmf_readq(struct ast_channel *chan, struct ast_frame *f)
enum ast_timer_event ast_timer_get_event(const struct ast_timer *handle)
Retrieve timing event.
struct ast_audiohook_list * ast_channel_audiohooks(const struct ast_channel *chan)
int ast_str2cause(const char *name)
Convert a symbolic hangup cause to number.
void ast_stream_topology_free(struct ast_stream_topology *topology)
Unreference and destroy a stream topology.
int ast_cli_completion_add(char *value)
Add a result to a request for completion options.
const char * ast_channel_macrocontext(const struct ast_channel *chan)
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.
const char * ast_timer_get_name(const struct ast_timer *handle)
Get name of timer in use.
struct ast_format * old_write_format
int ast_stream_get_position(const struct ast_stream *stream)
Get the position of the stream in the topology.
void ast_channel_name_set(struct ast_channel *chan, const char *name)
Set the channel name.
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)
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)
struct stasis_message_type * ast_channel_hangup_request_type(void)
Message type for when a hangup is requested on a channel.
Say numbers and dates (maybe words one day too)
int ast_channel_internal_setup_topics(struct ast_channel *chan)
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'.
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_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.
#define AST_CAUSE_CALL_REJECTED
void ast_channel_priority_set(struct ast_channel *chan, int value)
static struct ast_timer * timer
#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag,...)
Create a channel structure.
struct ast_party_connected_line * ast_channel_connected_indicated(struct ast_channel *chan)
#define AST_CAUSE_BEARERCAPABILITY_NOTAVAIL
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
struct ast_channel_monitor * ast_channel_monitor(const struct ast_channel *chan)
void ast_channel_internal_finalize(struct ast_channel *chan)
int ast_undestroyed_channels(void)
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)
ast_timing_func_t ast_channel_timingfunc(const struct ast_channel *chan)
struct stasis_message_type * ast_channel_masquerade_type(void)
Message type for when a channel is being masqueraded.
struct ast_frame * ast_channel_dtmff(struct ast_channel *chan)
static int namedgroup_match(void *obj, void *arg, int flags)
static snd_pcm_format_t format
struct ast_channel * ast_channel_release(struct ast_channel *chan)
Unlink and release reference to a channel.
int ast_func_write(struct ast_channel *chan, const char *function, const char *value)
executes a write operation on a function
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...
#define AST_CAUSE_MESSAGE_TYPE_NONEXIST
static void prnt_channel_key(void *v_obj, void *where, ao2_prnt_fn *prnt)
static void suppress_datastore_destroy_cb(void *data)
enum ama_flags ast_channel_amaflags(const struct ast_channel *chan)
Information needed to specify a name in a call.
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...
void ast_channel_tech_pvt_set(struct ast_channel *chan, void *value)
enum ast_bridge_result(*const early_bridge)(struct ast_channel *c0, struct ast_channel *c1)
Bridge two channels of the same type together (early)
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
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.
struct ast_party_id priv
Private connected party ID.
int ast_say_money_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang)
function to pronounce monetary amounts
struct ast_format * ast_channel_rawwriteformat(struct ast_channel *chan)
static struct ast_frame * kill_read(struct ast_channel *chan)
unsigned char valid
TRUE if the number information is valid/present.
void ast_channel_sending_dtmf_digit_set(struct ast_channel *chan, char value)
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
ast_callid ast_channel_callid(const struct ast_channel *chan)
static void ast_read_generator_actions(struct ast_channel *chan, struct ast_frame *f)
void ast_channel_vstreamid_set(struct ast_channel *chan, int value)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
struct ast_channel * ast_channel_masqr(const struct ast_channel *chan)
int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
Queue a hangup frame for channel.
void ast_sched_context_destroy(struct ast_sched_context *c)
destroys a schedule context
const char * ast_channel_parkinglot(const struct ast_channel *chan)
int str
Subscriber name ie.
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.
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.
static void deactivate_generator_nolock(struct ast_channel *chan)
#define AST_CAUSE_INVALID_CALL_REFERENCE
#define AST_CAUSE_CONGESTION
const char * ast_channel_macroexten(const struct ast_channel *chan)
#define AST_TRANS_CAP_DIGITAL
void ast_channel_outsmpl_set(struct ast_channel *chan, unsigned long value)
static struct ast_cli_entry cli_channel[]
void ast_channel_softhangup_internal_flag_clear(struct ast_channel *chan, int value)
int ast_setstate(struct ast_channel *chan, enum ast_channel_state state)
Change the state of a channel.
Timing source management.
#define AST_MUTEX_DEFINE_STATIC(mutex)
#define AST_CAUSE_WRONG_CALL_STATE
int ast_stopstream(struct ast_channel *c)
Stops a stream.
void ast_party_connected_line_collect_caller(struct ast_party_connected_line *connected, struct ast_party_caller *caller)
Collect the caller party information into a connected line structure.
static const char * dtmf_direction_to_string(enum DtmfDirection direction)
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.
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 *))
static struct groups groups
static force_inline int attribute_pure ast_str_case_hash(const char *str)
Compute a hash value on a case-insensitive string.
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...
#define AST_RWLIST_HEAD(name, type)
Defines a structure to be used to hold a read/write list of specified type.
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
void ast_translator_free_path(struct ast_trans_pvt *tr)
Frees a translator path Frees the given translator path structure.
int ast_channel_alert_write(struct ast_channel *chan)
const char * ast_channel_musicclass(const struct ast_channel *chan)
static struct ast_generator tonepair
struct ast_timer * ast_channel_timer(const struct ast_channel *chan)
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_active_channels(void)
returns number of active/allocated channels
void ast_channel_internal_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
void ast_channel_redirecting_set(struct ast_channel *chan, struct ast_party_redirecting *value)
void ast_channel_monitor_set(struct ast_channel *chan, struct ast_channel_monitor *value)
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 int indicate_redirecting(struct ast_channel *chan, const void *data, size_t datalen)
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().
struct ast_frame * ast_read_noaudio(struct ast_channel *chan)
Reads a frame, returning AST_FRAME_NULL frame if audio.
void ast_set_variables(struct ast_channel *chan, struct ast_variable *vars)
adds a list of channel variables to a channel
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 force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
#define AST_LIST_APPEND_LIST(head, list, field)
Appends a whole list to the tail of a list.
int ast_channel_has_manager_vars(void)
Return whether or not any manager variables have been set.
static struct varshead * channel_get_external_vars(struct external_vars *channelvars, struct ast_channel *chan)
void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Set when to hangup channel.
int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params)
struct ast_party_number number
Subscriber phone number.
int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
#define ao2_link(container, obj)
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.