84#if defined(KEEP_TILL_CHANNEL_PARTY_NUMBER_INFO_NEEDED) 
   92#define MONITOR_CONSTANT_DELAY 
   93#define MONITOR_DELAY   150 * 8      
  101#define STATE2STR_BUFSIZE   32 
  105#define AST_DEFAULT_EMULATE_DTMF_DURATION 100 
  109#define DEFAULT_EMULATE_MF_DURATION 55 
  111#define DEFAULT_AMA_FLAGS AST_AMA_DOCUMENTATION 
  115#define AST_MIN_DTMF_GAP 45 
  208#if defined(KEEP_TILL_CHANNEL_PARTY_NUMBER_INFO_NEEDED) 
  209static const char *party_number_ton2str(
int ton)
 
  212    switch ((ton >> 4) & 0x07) {
 
  213    case PRI_TON_INTERNATIONAL:
 
  214        return "International";
 
  215    case PRI_TON_NATIONAL:
 
  217    case PRI_TON_NET_SPECIFIC:
 
  218        return "Network Specific";
 
  219    case PRI_TON_SUBSCRIBER:
 
  221    case PRI_TON_ABBREVIATED:
 
  222        return "Abbreviated";
 
  223    case PRI_TON_RESERVED:
 
  225    case PRI_TON_UNKNOWN:
 
  234#if defined(KEEP_TILL_CHANNEL_PARTY_NUMBER_INFO_NEEDED) 
  235static const char *party_number_plan2str(
int plan)
 
  238    switch (plan & 0x0F) {
 
  240    case PRI_NPI_UNKNOWN:
 
  242    case PRI_NPI_E163_E164:
 
  243        return "Public (E.163/E.164)";
 
  245        return "Data (X.121)";
 
  247        return "Telex (F.69)";
 
  248    case PRI_NPI_NATIONAL:
 
  249        return "National Standard";
 
  250    case PRI_NPI_PRIVATE:
 
  252    case PRI_NPI_RESERVED:
 
  263#define FORMAT  "%-15.15s  %-40.40s %-13.13s %-13.13s %-13.13s %-13.13s\n" 
  269        e->
command = 
"core show channeltypes";
 
  271            "Usage: core show channeltypes\n" 
  272            "       Lists available channel types registered in your\n" 
  273            "       Asterisk server.\n";
 
  282    ast_cli(
a->fd, 
FORMAT, 
"Type", 
"Description", 
"Devicestate", 
"Presencestate", 
"Indications", 
"Transfer");
 
  283    ast_cli(
a->fd, 
FORMAT, 
"-------------", 
"-------------", 
"-------------", 
"-------------", 
"-------------", 
"-------------");
 
  288            (cl->
tech->devicestate) ? 
"yes" : 
"no",
 
  289            (cl->
tech->presencestate) ? 
"yes" : 
"no",
 
  290            (cl->
tech->indicate) ? 
"yes" : 
"no",
 
  291            (cl->
tech->transfer) ? 
"yes" : 
"no");
 
  296    ast_cli(
a->fd, 
"----------\n%d channel drivers registered.\n", count_chan);
 
 
  312    wordlen = strlen(
a->word);
 
  316        if (!strncasecmp(
a->word, cl->
tech->type, wordlen)) {
 
 
  333        e->
command = 
"core show channeltype";
 
  335            "Usage: core show channeltype <name>\n" 
  336            "   Show details about the specified channel type, <name>.\n";
 
  348        if (!strncasecmp(cl->
tech->type, 
a->argv[3], strlen(cl->
tech->type)))
 
  354        ast_cli(
a->fd, 
"\n%s is not a registered channel driver.\n", 
a->argv[3]);
 
  360        "-- Info about channel driver: %s --\n" 
  361        "  Device State: %s\n" 
  362        "Presence State: %s\n" 
  365        "  Capabilities: %s\n" 
  369        " Image Support: %s\n" 
  370        "  Text Support: %s\n",
 
  372        (cl->
tech->devicestate) ? 
"yes" : 
"no",
 
  373        (cl->
tech->presencestate) ? 
"yes" : 
"no",
 
  374        (cl->
tech->indicate) ? 
"yes" : 
"no",
 
  375        (cl->
tech->transfer) ? 
"yes" : 
"no",
 
  377        (cl->
tech->send_digit_begin) ? 
"yes" : 
"no",
 
  378        (cl->
tech->send_digit_end) ? 
"yes" : 
"no",
 
  379        (cl->
tech->send_html) ? 
"yes" : 
"no",
 
  380        (cl->
tech->send_image) ? 
"yes" : 
"no",
 
  381        (cl->
tech->send_text) ? 
"yes" : 
"no" 
 
  436    .description = 
"Kill channel (should not see this)",
 
 
  473        ast_debug(1, 
"Setting hangupcause of channel %s to %d (is %d now)\n",
 
 
  525    struct timeval whentohangup;
 
 
  574    ast_debug(5, 
"Unregistering channel type '%s'\n", 
tech->type);
 
  582            ast_verb(5, 
"Unregistered channel type '%s'\n", 
tech->type);
 
 
  600        if (!strcasecmp(
name, chanls->
tech->type)) {
 
 
  617        if (
causes[x].cause == cause)
 
 
  658        return "Dialing Offhook";
 
 
  674    switch (transfercapability) {
 
  680        return "RESTRICTED_DIGITAL";
 
  684        return "DIGITAL_W_TONES";
 
 
  698    .description = 
"Surrogate channel used to pull channel from an application",
 
 
  704    .description = 
"Null channel (should not see this)",
 
 
  722            ast_log(
LOG_ERROR, 
"Channel Unique ID '%s' already in use by channel %s(%p)\n",
 
  733            ast_log(
LOG_ERROR, 
"Channel Unique ID2 '%s' already in use by channel %s(%p)\n",
 
 
  744static struct ast_channel *__attribute__((format(printf, 15, 0)))
 
  749               const 
char *function, const 
char *name_fmt, va_list ap)
 
  753    char *tech = 
"", *tech2 = 
NULL;
 
  768        file, line, function);
 
  785    if (!nativeformats) {
 
  804        ast_log(
LOG_WARNING, 
"Channel allocation failed: Unable to create schedule context\n");
 
  872        char *slash, *slash2;
 
  882        if ((slash = strchr(tech, 
'/'))) {
 
  883            if ((slash2 = strchr(slash + 1, 
'/'))) {
 
  904        ast_channel_accountcode_set(tmp, acctcode);
 
 
  967                    const char *cid_name, 
const char *acctcode,
 
  971                    const char *file, 
int line, 
const char *function,
 
  972                    const char *name_fmt, ...)
 
  977    va_start(ap, name_fmt);
 
  979                    assignedids, requestor, amaflag, 
endpoint, 
NULL, file, line, function, name_fmt, ap);
 
 
  986                    const char *cid_name, 
const char *acctcode,
 
  990                    const char *file, 
int line, 
const char *function,
 
  991                    const char *name_fmt, ...)
 
  996    va_start(ap, name_fmt);
 
  998                    assignedids, requestor, amaflag, 
endpoint, initializers, file, line, function, name_fmt, ap);
 
 
 1012        file, line, function);
 
 
 1044    unsigned int new_frames = 0;
 
 1045    unsigned int new_voice_frames = 0;
 
 1046    unsigned int queued_frames = 0;
 
 1047    unsigned int queued_voice_frames = 0;
 
 1109            queued_voice_frames++;
 
 1113    if ((queued_frames + new_frames > 128 || queued_voice_frames + new_voice_frames > 96)) {
 
 1114        int total_queued = queued_frames + new_frames;
 
 1115        int total_voice = queued_voice_frames + new_voice_frames;
 
 1117        ast_log(
LOG_WARNING, 
"Exceptionally long %squeue length (%d voice / %d total) queuing to %s\n",
 
 1118            queued_frames + new_frames > 128 ? 
"" : 
"voice ", total_voice, total_queued, 
ast_channel_name(chan));
 
 1152        while (new_frames--) {
 
 
 1185    int res, cause, tech_cause;
 
 
 1255        f.
data.
ptr = (
void *) musicclass;
 
 1256        f.
datalen = strlen(musicclass) + 1;
 
 1259                     "musicclass", musicclass);
 
 
 1489    struct timeval start;
 
 
 1614    if (src->
str && src->
str != dest->
str) {
 
 
 1667    if (src->
str && src->
str != dest->
str) {
 
 
 1720    if (src->
str && src->
str != dest->
str) {
 
 
 1738    update_id->
name = 1;
 
 
 1791    if (src->
tag && src->
tag != dest->
tag) {
 
 
 1809    int number_priority;
 
 1811    int number_screening;
 
 1816    if (!
id->name.valid) {
 
 1821        switch (name_value) {
 
 1839    if (!
id->number.valid) {
 
 1842        number_priority = 3;
 
 1846        switch (number_value) {
 
 1848            number_priority = 0;
 
 1851            number_priority = 1;
 
 1854            number_priority = 2;
 
 1859            number_priority = 3;
 
 1865    if (name_priority < number_priority) {
 
 1866        number_value = name_value;
 
 1872    return number_value | number_screening;
 
 
 1878    id->number.valid = 0;
 
 1879    id->subaddress.valid = 0;
 
 
 1893    if (overlay->name.valid) {
 
 1894        merged.
name = overlay->name;
 
 1896    if (overlay->number.valid) {
 
 1897        merged.
number = overlay->number;
 
 1899    if (overlay->subaddress.valid) {
 
 
 2094    if (src->
str && src->
str != dest->
str) {
 
 
 2244        if ((dashptr = strrchr(device_name, 
'-'))) {
 
 2248        device_name[0] = 
'\0';
 
 2303    if (device_name[0]) {
 
 
 2406        if ((datastore->
uid != 
NULL) && !strcasecmp(
uid, datastore->
uid)) {
 
 
 2502        ast_channel_hangupsource_set(chan, source);
 
 2509            ast_channel_hangupsource_set(bridge, source);
 
 
 2601        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",
 
 
 2628        struct timeval answertime;
 
 
 2704    switch (old_state) {
 
 2714            int timeout_ms = 
MAX(delay, 500);
 
 2715            unsigned int done = 0;
 
 2716            struct timeval start;
 
 2730                    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));
 
 
 2880        if (generator && generator->
release) {
 
 
 2928    if (!tmp || !generate) {
 
 2941        ast_debug(1, 
"Auto-deactivating generator\n");
 
 
 2957        if (generator_old && generator_old->
release) {
 
 
 2986                    int *exception, 
int *outfd, 
int *ms)
 
 2988    struct timeval start = { 0 , 0 };
 
 2989    struct pollfd *pfds = 
NULL;
 
 2994    struct timeval now = { 0, 0 };
 
 2995    struct timeval whentohangup = { 0, 0 }, diff;
 
 3009    for (x = 0; x < n; x++) {
 
 3023                whentohangup = diff;
 
 3039    if (!
ast_tvzero(whentohangup) && whentohangup.tv_sec < INT_MAX / 1000) {
 
 3040        rms = whentohangup.tv_sec * 1000 + whentohangup.tv_usec / 1000;              
 
 3041        if (*ms >= 0 && *ms < rms) {                                                 
 
 3044    } 
else if (!
ast_tvzero(whentohangup) && rms < 0) {
 
 3054    for (x = 0; x < n; x++) {
 
 3057            fdmap[
max].fdno = y;  
 
 3058            fdmap[
max].chan = x;  
 
 3065    for (x = 0; x < nfds; x++) {
 
 3066        fdmap[
max].chan = -1;
 
 3074    if (
sizeof(
int) == 4) { 
 
 3077            if (kbrms > 600000) {
 
 3084        } 
while (!res && (rms > 0));
 
 3088    for (x = 0; x < n; x++) {
 
 3094        if (
errno != EINTR) {
 
 3101        for (x = 0; x < n; x++) {
 
 3105                if (winner == 
NULL) {
 
 3120    for (x = 0; x < 
max; x++) {
 
 3121        res = pfds[x].revents;
 
 3125        if (fdmap[x].chan >= 0) {   
 
 3126            winner = 
c[fdmap[x].chan];  
 
 3128            if (res & POLLPRI) {
 
 3137                *outfd = pfds[x].fd;
 
 3140                *exception = (res & POLLPRI) ? -1 : 0;
 
 
 3185    unsigned int real_rate = rate, max_rate;
 
 3200        real_rate = max_rate;
 
 3203    ast_debug(3, 
"Scheduling timer at (%u requested / %u actual) timer ticks per second\n", rate, real_rate);
 
 3214    if (
data && is_ao2_obj) {
 
 
 3261        if (!rchan && outfd < 0 && ms) {
 
 3267        } 
else if (outfd > -1) {
 
 3269            ast_log(
LOG_WARNING, 
"The FD we were waiting for has something waiting. Waitfordigit returning numeric 1\n");
 
 3287                if (!breakon || strchr(breakon, res)) {
 
 
 3371    char digit_str[] = { 
digit, 
'\0' };
 
 
 3387    char digit_str[] = { 
digit, 
'\0' };
 
 
 3444        samples = (int) (((
float) f->
samples) * factor);
 
 3469            ast_debug(1, 
"Auto-deactivating generator\n");
 
 
 3522    int diff = sample_rate - seek_rate;
 
 3526    } 
else if (diff < 0) {
 
 
 3576                "ast_read() on chan '%s' called with no recorded file descriptor.\n",
 
 3615                if (trigger_dtmf_emulating) {
 
 3625            } 
else if (trigger_dtmf_emulating) {
 
 3660        int skipped_dtmf_frame = 0;
 
 3669                skipped_dtmf_frame = 1;
 
 3681            if (!skipped_dtmf_frame) {
 
 3774    if (stream == default_stream) {
 
 3801        if (dropnondefault && stream != default_stream) {
 
 3813                    ast_debug(1, 
"Dropping duplicate answer!\n");
 
 3826                read_action_payload = f->
data.
ptr;
 
 3827                switch (read_action_payload->
action) {
 
 3947                } 
else if (!f->
len) {
 
 4031                        if (old_frame != f) {
 
 4049            if (stream != default_stream) {
 
 4155                if (old_frame != f) {
 
 4173                if (old_frame != f) {
 
 
 4280    switch (condition) {
 
 
 4349        snprintf(causevar, 
sizeof(causevar), 
"HASH(SIP_CAUSE,%s)", cause_code->
chan_name);
 
 
 4356    if (!strcasecmp(
flag, 
"default"))
 
 4358    if (!strcasecmp(
flag, 
"omit"))
 
 4360    if (!strcasecmp(
flag, 
"billing"))
 
 4362    if (!strcasecmp(
flag, 
"documentation"))
 
 
 4375        return "DOCUMENTATION";
 
 
 4401    unsigned char proposed[1024];
 
 4417        chan_indicated, 
NULL);
 
 4419        chan_connected, 
NULL);
 
 4420    if (current_size == -1 || proposed_size == -1) {
 
 4424    if (current_size == proposed_size && !memcmp(
current, proposed, current_size)) {
 
 4425        ast_debug(1, 
"%s: Dropping redundant connected line update \"%s\" <%s>.\n",
 
 
 4461    return res ? -1 : 0;
 
 
 4473    switch (condition) {
 
 4491        t38_parameters = data;
 
 4537    if (_condition < 0) {
 
 4545    switch (condition) {
 
 4630        ast_debug(1, 
"Driver for channel '%s' does not support indication %u, emulating it\n", 
ast_channel_name(chan), condition);
 
 
 4661        goto indicate_cleanup;
 
 4668            .subclass.integer = _condition,
 
 4669            .data.ptr = (
void *) 
data, 
 
 4682            goto indicate_cleanup;
 
 4694    if (awesome_frame) {
 
 
 4707    c = *(
unsigned char *)
buf;
 
 
 4765        size_t body_len = strlen(body);
 
 4768        memset(&f, 0, 
sizeof(f));
 
 4784        ast_debug(1, 
"Sending TEXT_DATA from '%s' to %s:%s %s\n",
 
 4795        ast_debug(1, 
"Channel technology does not support sending content type '%s' on channel '%s'\n",
 
 
 4812            .value = (
char *)
text,
 
 
 4832    static const char * 
const mf_tones[] = {
 
 4852    } 
else if (
digit == 
'*') {
 
 4854    } 
else if (
digit == 
'#') {
 
 4856    } 
else if (
digit == 
'A') {
 
 4858    } 
else if (
digit == 
'B') {
 
 4860    } 
else if (
digit == 
'C') {
 
 
 4873    static const char * 
const dtmf_tones[] = {
 
 4907    else if (
digit == 
'*')
 
 4909    else if (
digit == 
'#')
 
 
 4948    unsigned int durationkp, 
unsigned int durationst, 
int is_external)
 
 4955            duration = durationkp;
 
 4957            duration = durationst;
 
 4961            usleep(duration * 1000);
 
 
 4989        usleep(duration * 1000);
 
 
 5038    struct plc_ds *plc = data;
 
 
 5050    int num_new_samples = frame->
samples;
 
 5072    if (!num_new_samples) {
 
 5094        frame->
datalen = num_new_samples * 2;
 
 
 5108        plc = datastore->
data;
 
 5122    datastore->
data = plc;
 
 
 5235            if (old_frame != fr)
 
 5248            if (new_frame != fr) {
 
 5283        } 
else if ((stream == default_stream) && 
ast_channel_tech(chan)->write_video) {
 
 5292        res = 
tech_write(chan, stream, default_stream, fr);
 
 5330                ast_debug(1, 
"Channel %s changing write format from %s to %s, native formats %s\n",
 
 5343                if (trans_frame != f && f != fr) {
 
 5361            int freeoldlist = 0;
 
 5375                if (new_frame != cur) {
 
 5386                        if (new_frame != dup) {
 
 5410            unsigned int skip = 0;
 
 5417                    res = 
tech_write(chan, stream, default_stream, cur);
 
 5435            res = 
tech_write(chan, stream, default_stream, f);
 
 
 5494    ast_debug(1, 
"Channel %s setting read format path: %s -> %s\n",
 
 
 5530    ast_debug(1, 
"Channel %s setting write format path: %s -> %s\n",
 
 
 5608    if (!best_set_fmt) {
 
 5618        &best_set_fmt, 
sizeof(best_set_fmt), 0);
 
 5620        ast_debug(1, 
"Channel driver natively set channel %s to %s format %s\n",
 
 5662        ast_log(
LOG_ERROR, 
"Unable to set format because channel %s supports no formats\n",
 
 5695        if (trans_pvt != 
NULL) {
 
 5732        res = trans_pvt ? 0 : -1;
 
 5739        ast_debug(1, 
"Channel %s setting %s format path: %s -> %s\n",
 
 
 5826        return "Call Failure (not BUSY, and not NO_ANSWER, maybe Circuit busy or down?)";
 
 5830        return "Local Ring";
 
 5832        return "Remote end Ringing";
 
 5834        return "Remote end has Answered";
 
 5836        return "Remote end is Busy";
 
 5838        return "Congestion (circuits busy)";
 
 5840        return "Unknown Reason!!";
 
 
 5905    if ((
data = strchr(tmpchan, 
'/'))) {
 
 5909        const char *forward_context;
 
 5937            ast_channel_accountcode_set(new_chan, oh->
account);
 
 5938            ast_channel_peeraccount_set(new_chan, oh->
account);
 
 
 5977    int last_subclass = 0;
 
 5983        outstate = &dummy_outstate; 
 
 6018            ast_channel_accountcode_set(chan, oh->
account);
 
 6019            ast_channel_peeraccount_set(chan, oh->
account);
 
 6041        connected.id.number.str = (
char *) cid_num;
 
 6046        connected.id.name.str = (
char *) cid_name;
 
 
 6184    if (!requestor || !
out) {
 
 6192        ops[1][1] = encrypt->
media;
 
 6199    for (i = 0; i < 2; i++) {
 
 
 6232        if (strcasecmp(
type, chan->
tech->type)) {
 
 6248    if (chan->
tech->requester_with_stream_topology) {
 
 6251        if (!topology && request_cap) {
 
 6256        c = chan->
tech->requester_with_stream_topology(
type, topology, assignedids, requestor, addr, cause);
 
 6259    } 
else if (chan->
tech->requester) {
 
 6266        if (!request_cap && topology) {
 
 6310        if (best_audio_fmt) { 
 
 6315        c = chan->
tech->requester(
type, joint_cap, assignedids, requestor, addr, cause);
 
 
 6383    switch (relationship) {
 
 6398            } 
else if (!precious
 
 
 6441    int (*pre_call)(
struct ast_channel *chan, 
const char *sub_args);
 
 6448        res = pre_call(chan, sub_args);
 
 
 6522        if (res < 0 || !(fr = 
ast_read(chan))) {
 
 
 6599        if (strchr(enders, 
d) && (pos == 0)) {
 
 6604        if (!strchr(enders, 
d)) {
 
 6607        if (strchr(enders, 
d) || (pos >= 
len)) {
 
 
 6775    const char *varname;
 
 6785        if (varname[0] == 
'_') {
 
 6787            if (varname[1] == 
'_') {
 
 6803            ast_debug(1, 
"Inheriting variable %s from %s to %s.\n",
 
 
 6844    dash = strrchr(channel_name, 
'-');
 
 
 6861    unsigned int orig_disablestatecache;
 
 6862    unsigned int clone_disablestatecache;
 
 6863    int visible_indication;
 
 6864    int clone_hold_state;
 
 6882    char clone_sending_dtmf_digit;
 
 6883    struct timeval clone_sending_dtmf_tv;
 
 6885    ast_debug(3, 
"Masquerading %s(%u) into the structure of %s(%u)\n",
 
 6927    if (moh_is_playing) {
 
 6944    ast_debug(1, 
"Actually Masquerading %s(%u) into the structure of %s(%u)\n",
 
 7058    if (orig_disablestatecache != clone_disablestatecache) {
 
 7059        if (orig_disablestatecache) {
 
 7216        ast_log(
LOG_WARNING, 
"Channel type '%s' could not fixup channel %s, strange things may happen. (clonechan)\n",
 
 7222        ast_log(
LOG_WARNING, 
"Channel type '%s' could not fixup channel %s, strange things may happen. (original)\n",
 
 7257        ast_debug(1, 
"Channel %s simulating UNHOLD for masquerade.\n",
 
 7261    if (clone_sending_dtmf_digit) {
 
 7279    if (visible_indication) {
 
 7281            const char *latest_musicclass;
 
 7288                latest_musicclass = 
NULL;
 
 7291                len = strlen(latest_musicclass) + 1;
 
 7303    if (moh_is_playing) {
 
 
 7403    if (oldstate == 
state)
 
 7407    if ((dashptr = strrchr(
name, 
'-'))) {
 
 
 7551    if (
len > 
sizeof(ts->
data) / 2 - 1) {
 
 7555    memset(&ts->
f, 0, 
sizeof(ts->
f));
 
 7556    for (x=0;x<
len/2;x++) {
 
 7566            p = ts->
v3_2 - 32768;
 
 7568            p = ((p * 9) / 10) + 1;
 
 7569            ts->
data[x] = (ts->
v3_1 * p) >> 15;
 
 
 7601    d.vol = (
vol < 1) ? 8192 : 
vol; 
 
 
 7634    int start=0, finish=0, x;
 
 7642    while ((piece = 
strsep(&
c, 
","))) {
 
 7643        if (sscanf(piece, 
"%30d-%30d", &start, &finish) == 2) {
 
 7645        } 
else if (sscanf(piece, 
"%30d", &start)) {
 
 7649            ast_log(
LOG_ERROR, 
"Syntax error parsing group configuration '%s' at '%s'. Ignoring.\n", s, piece);
 
 7652        for (x = start; x <= finish; x++) {
 
 7653            if ((x > 63) || (x < 0)) {
 
 
 7709    while ((piece = 
strsep(&
c, 
","))) {
 
 7716        len = strlen(piece);
 
 7726        strcpy(
member->name, piece);
 
 7741    return (
struct ast_namedgroups *) namedgroups;
 
 
 7783    ast_verb(3, 
"Music class %s requested but no musiconhold loaded.\n", mclass ? mclass : (interpclass ? interpclass : 
"default"));
 
 
 7837    return vars_present;
 
 
 7856    for (i = 0; i < varc; ++i) {
 
 7857        const char *
var = vars[i];
 
 7859        if (!(mcv = 
ast_calloc(1, 
sizeof(*mcv) + strlen(
var) + 1))) {
 
 7863        if (strchr(
var, 
'(')) {
 
 
 7949                    "Error invoking function %s\n", mcv->
name);
 
 
 8026        ast_log(
LOG_ERROR, 
"Cannot change channel storage driver after Asterisk has started\n");
 
 8034        "Invalid channel storage backend '%s' specified.  Attempting to use default '%s'.\n",
 
 8040    ast_log(
LOG_ERROR, 
"Unable to find default channel storage backend '%s'.\n",
 
 
 8086    for (i = 0; i <= 63; i++) { 
 
 8089                strncat(
buf, 
", ", buflen - strlen(
buf) - 1);
 
 8093            snprintf(num, 
sizeof(num), 
"%u", i);
 
 8094            strncat(
buf, num, buflen - strlen(
buf) - 1);
 
 
 8151        SWAP(group_a, group_b);
 
 
 8163    for (cur = vars; cur; cur = cur->
next) {
 
 
 8186        .datalen = 
sizeof(
buf),
 
 8190    memset(
buf, 0, 
sizeof(
buf));
 
 
 8236        ast_debug(1, 
"Trying to stop silence generator when there is no generator on '%s'\n",
 
 8242        ast_debug(1, 
"Trying to stop silence generator when it is not the current generator on '%s'\n",
 
 
 8263            ast_log(
LOG_ERROR, 
"Could not return write format to its original state\n");
 
 
 8298    const char *ints, 
const char *lang)
 
 
 8304    const char *ints, 
const char *lang)
 
 
 8310    const char *ints, 
const char *lang)
 
 
 8322    const char *ints, 
const char *lang)
 
 
 8328    const char *ints, 
const char *lang, 
int audiofd, 
int ctrlfd)
 
 8332    snprintf(
buf, 
sizeof(
buf), 
"%d", num);
 
 
 8402        length = strlen(
name->str);
 
 8403        if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
 
 8407        data[pos++] = ies->
str;
 
 8408        data[pos++] = length;
 
 8409        memcpy(data + pos, 
name->str, length);
 
 8413    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8419    data[pos++] = 
name->char_set;
 
 8421    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8427    data[pos++] = 
name->presentation;
 
 8429    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8433    data[pos++] = ies->
valid;
 
 8435    data[pos++] = 
name->valid;
 
 
 8476        length = strlen(
number->str);
 
 8477        if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
 
 8481        data[pos++] = ies->
str;
 
 8482        data[pos++] = length;
 
 8483        memcpy(data + pos, 
number->str, length);
 
 8487    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8491    data[pos++] = ies->
plan;
 
 8493    data[pos++] = 
number->plan;
 
 8495    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8501    data[pos++] = 
number->presentation;
 
 8503    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8507    data[pos++] = ies->
valid;
 
 8509    data[pos++] = 
number->valid;
 
 
 8549    if (subaddress->
str) {
 
 8550        length = strlen(subaddress->
str);
 
 8551        if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
 
 8555        data[pos++] = ies->
str;
 
 8556        data[pos++] = length;
 
 8557        memcpy(data + pos, subaddress->
str, length);
 
 8561    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8565    data[pos++] = ies->
type;
 
 8567    data[pos++] = subaddress->
type;
 
 8569    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8571            "No space left for %s subaddress odd-even indicator\n", label);
 
 8578    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8582    data[pos++] = ies->
valid;
 
 8584    data[pos++] = subaddress->
valid;
 
 
 8663        length = strlen(
id->tag);
 
 8664        if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
 
 8668        data[pos++] = ies->
tag;
 
 8669        data[pos++] = length;
 
 8670        memcpy(data + pos, 
id->tag, length);
 
 8686            presentation = 
id->number.presentation;
 
 8689        if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8695        data[pos++] = presentation;
 
 
 8784        .combined_presentation = 0,
 
 8793    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 8816    if (datalen < pos + (
sizeof(data[0]) * 2) + 
sizeof(
value)) {
 
 8821    data[pos++] = 
sizeof(
value);
 
 8824    pos += 
sizeof(
value);
 
 
 8832    unsigned char ie_len;
 
 8833    unsigned char ie_id;
 
 8835    int frame_version = 1;
 
 8837    int got_combined_presentation = 0;
 
 8839    for (pos = 0; pos < datalen; pos += ie_len) {
 
 8840        if (datalen < pos + 
sizeof(ie_id) + 
sizeof(ie_len)) {
 
 8844        ie_id = data[pos++];
 
 8845        ie_len = data[pos++];
 
 8846        if (datalen < pos + ie_len) {
 
 8859            frame_version = data[pos];
 
 8866                memcpy(
connected->id.name.str, data + pos, ie_len);
 
 8876            connected->id.name.char_set = data[pos];
 
 8884            connected->id.name.presentation = data[pos];
 
 8899                memcpy(
connected->id.number.str, data + pos, ie_len);
 
 8917            connected->id.number.presentation = data[pos];
 
 8932                memcpy(
connected->id.subaddress.str, data + pos, ie_len);
 
 8933                connected->id.subaddress.str[ie_len] = 0;
 
 8942            connected->id.subaddress.type = data[pos];
 
 8947                    "Invalid connected line subaddress odd-even indicator (%u)\n",
 
 8951            connected->id.subaddress.odd_even_indicator = data[pos];
 
 8959            connected->id.subaddress.valid = data[pos];
 
 8966                memcpy(
connected->id.tag, data + pos, ie_len);
 
 8978            got_combined_presentation = 1;
 
 8985                memcpy(
connected->priv.name.str, data + pos, ie_len);
 
 8995            connected->priv.name.char_set = data[pos];
 
 9003            connected->priv.name.presentation = data[pos];
 
 9018                memcpy(
connected->priv.number.str, data + pos, ie_len);
 
 9028            connected->priv.number.plan = data[pos];
 
 9036            connected->priv.number.presentation = data[pos];
 
 9044            connected->priv.number.valid = data[pos];
 
 9051                memcpy(
connected->priv.subaddress.str, data + pos, ie_len);
 
 9052                connected->priv.subaddress.str[ie_len] = 0;
 
 9061            connected->priv.subaddress.type = data[pos];
 
 9066                    "Invalid connected line private subaddress odd-even indicator (%u)\n",
 
 9070            connected->priv.subaddress.odd_even_indicator = data[pos];
 
 9078            connected->priv.subaddress.valid = data[pos];
 
 9085                memcpy(
connected->priv.tag, data + pos, ie_len);
 
 9091            if (ie_len != 
sizeof(
value)) {
 
 9101            ast_debug(1, 
"Unknown connected line element: %u (%u)\n",
 
 9102                (
unsigned) ie_id, (
unsigned) ie_len);
 
 9107    switch (frame_version) {
 
 9116        if (got_combined_presentation) {
 
 9129        ast_debug(1, 
"Connected line frame has newer version: %u\n",
 
 9130            (
unsigned) frame_version);
 
 
 9139    unsigned char data[1024];   
 
 9143    if (datalen == (
size_t) -1) {
 
 
 9152    unsigned char data[1024];   
 
 9156    if (datalen == (
size_t) -1) {
 
 
 9287    if (datalen < pos + (
sizeof(data[0]) * 2) + 
sizeof(
value)) {
 
 9291    data[pos++] = ies->
code;
 
 9292    data[pos++] = 
sizeof(
value);
 
 9295    pos += 
sizeof(
value);
 
 9298        length = strlen(reason->
str);
 
 9299        if (datalen < pos + (
sizeof(data[0]) * 2) + length) {
 
 9303        data[pos++] = ies->
str;
 
 9304        data[pos++] = length;
 
 9305        memcpy(data + pos, reason->
str, length);
 
 
 9335        .combined_presentation = 0,
 
 9392        .combined_presentation = 0,
 
 9411        .combined_presentation = 0,
 
 9430        .combined_presentation = 0,
 
 9443    if (datalen < pos + (
sizeof(data[0]) * 2) + 1) {
 
 9473        "redirecting-priv-orig", &priv_orig_ies, 
update ? &
update->priv_orig : 
NULL);
 
 9480        "redirecting-priv-from", &priv_from_ies, 
update ? &
update->priv_from : 
NULL);
 
 9495            "redirecting-reason", &reason_ies);
 
 9503            "redirecting-orig-reason", &orig_reason_ies);
 
 9510    if (datalen < pos + (
sizeof(data[0]) * 2) + 
sizeof(
value)) {
 
 9515    data[pos++] = 
sizeof(
value);
 
 9518    pos += 
sizeof(
value);
 
 
 9526    unsigned char ie_len;
 
 9527    unsigned char ie_id;
 
 9529    int frame_version = 1;
 
 9530    int from_combined_presentation = 0;
 
 9531    int got_from_combined_presentation = 0;
 
 9532    int to_combined_presentation = 0;
 
 9533    int got_to_combined_presentation = 0;
 
 9535    for (pos = 0; pos < datalen; pos += ie_len) {
 
 9536        if (datalen < pos + 
sizeof(ie_id) + 
sizeof(ie_len)) {
 
 9540        ie_id = data[pos++];
 
 9541        ie_len = data[pos++];
 
 9542        if (datalen < pos + ie_len) {
 
 9555            frame_version = data[pos];
 
 9562                memcpy(redirecting->
orig.
name.
str, data + pos, ie_len);
 
 9643                    "Invalid redirecting-orig subaddress odd-even indicator (%u)\n",
 
 9662                memcpy(redirecting->
orig.
tag, data + pos, ie_len);
 
 9663                redirecting->
orig.
tag[ie_len] = 0;
 
 9671                memcpy(redirecting->
from.
name.
str, data + pos, ie_len);
 
 9739            from_combined_presentation = data[pos];
 
 9740            got_from_combined_presentation = 1;
 
 9762                    "Invalid redirecting-from subaddress odd-even indicator (%u)\n",
 
 9781                memcpy(redirecting->
from.
tag, data + pos, ie_len);
 
 9782                redirecting->
from.
tag[ie_len] = 0;
 
 9790                memcpy(redirecting->
to.
name.
str, data + pos, ie_len);
 
 9823                memcpy(redirecting->
to.
number.
str, data + pos, ie_len);
 
 9858            to_combined_presentation = data[pos];
 
 9859            got_to_combined_presentation = 1;
 
 9881                    "Invalid redirecting-to subaddress odd-even indicator (%u)\n",
 
 9899            if (redirecting->
to.
tag) {
 
 9900                memcpy(redirecting->
to.
tag, data + pos, ie_len);
 
 9901                redirecting->
to.
tag[ie_len] = 0;
 
 9990                    "Invalid private redirecting-orig subaddress odd-even indicator (%u)\n",
 
10009                memcpy(redirecting->
priv_orig.
tag, data + pos, ie_len);
 
10025                    (
unsigned) ie_len);
 
10033                    (
unsigned) ie_len);
 
10041                    (
unsigned) ie_len);
 
10058                    (
unsigned) ie_len);
 
10066                    (
unsigned) ie_len);
 
10074                    (
unsigned) ie_len);
 
10091                    (
unsigned) ie_len);
 
10099                    "Invalid private redirecting-from subaddress odd-even indicator (%u)\n",
 
10100                    (
unsigned) ie_len);
 
10108                    (
unsigned) ie_len);
 
10118                memcpy(redirecting->
priv_from.
tag, data + pos, ie_len);
 
10134                    (
unsigned) ie_len);
 
10142                    (
unsigned) ie_len);
 
10150                    (
unsigned) ie_len);
 
10167                    (
unsigned) ie_len);
 
10175                    (
unsigned) ie_len);
 
10183                    (
unsigned) ie_len);
 
10200                    (
unsigned) ie_len);
 
10208                    "Invalid private redirecting-to subaddress odd-even indicator (%u)\n",
 
10209                    (
unsigned) ie_len);
 
10217                    (
unsigned) ie_len);
 
10227                memcpy(redirecting->
priv_to.
tag, data + pos, ie_len);
 
10233            if (ie_len != 
sizeof(
value)) {
 
10235                    (
unsigned) ie_len);
 
10246                memcpy(redirecting->
reason.
str, data + pos, ie_len);
 
10252            if (ie_len != 
sizeof(
value)) {
 
10254                    (
unsigned) ie_len);
 
10271            if (ie_len != 
sizeof(
value)) {
 
10273                    (
unsigned) ie_len);
 
10281            ast_debug(1, 
"Unknown redirecting element: %u (%u)\n",
 
10282                (
unsigned) ie_id, (
unsigned) ie_len);
 
10287    switch (frame_version) {
 
10299        if (got_from_combined_presentation) {
 
10307        if (got_to_combined_presentation) {
 
10320        ast_debug(1, 
"Redirecting frame has newer version: %u\n",
 
10321            (
unsigned) frame_version);
 
 
10330    unsigned char data[1024];   
 
10334    if (datalen == (
size_t) -1) {
 
 
10343    unsigned char data[1024];   
 
10347    if (datalen == (
size_t) -1) {
 
 
10371        in_intercept_mode ? &(
int) { 1 } : 
NULL);
 
 
10385    const char *sub_args;
 
10400        const struct ast_frame *frame = connected_info;
 
 
10430    const char *sub_args;
 
10445        const struct ast_frame *frame = redirecting_info;
 
 
10490    .
type = 
"Call Completion",
 
 
10513    cc_datastore->
data = cc_params;
 
 
10537    return cc_datastore->
data;
 
 
10542    int len = name_buffer_length;
 
10550    if ((dash = strrchr(device_name, 
'-'))) {
 
 
10605    return ((hangup_test || unbridge) && (hangup_test == hangup_flags));
 
 
10631    if (bridge_channel) {
 
10634    return bridge_channel;
 
 
10649    } my_vars = { 0, };
 
10665        my_vars.priority++;
 
10674                    my_vars.exten, my_vars.context, 
NULL, yankee, my_vars.
amaflags,
 
10675                    "Surrogate/%s", my_vars.name))) {
 
10695    return yanked_chan;
 
 
10715    if (dest == source) {
 
10727            "Can't move channel. One or both is dead (%s <-- %s)\n",
 
 
10754    .
type = 
"suppressvoice",
 
 
10779    int suppress_frame = 0;
 
10790        suppress_frame = 1;
 
10792        suppress_frame = 1;
 
10795    if (suppress_frame) {
 
 
10813    switch (frametype) {
 
 
10835        ast_log(
LOG_WARNING, 
"Attempted to suppress an unsupported frame type (%u).\n", frametype);
 
10840        suppress = datastore->
data;
 
10846        ast_log(
LOG_WARNING, 
"Failed to allocate data while attempting to suppress a stream.\n");
 
10853    interface.
data = suppress;
 
10856    if (framehook_id < 0) {
 
10858        ast_log(
LOG_WARNING, 
"Failed to attach framehook while attempting to suppress a stream.\n");
 
10869        ast_log(
LOG_WARNING, 
"Failed to allocate datastore while attempting to suppress a stream.\n");
 
10876    datastore->
data = suppress;
 
 
10899    suppress = datastore->
data;
 
 
10921            & ~AST_SOFTHANGUP_ASYNCGOTO);
 
10933    ast_log(
LOG_DTMF, 
"DTMF end '%c' simulated on %s due to %s, duration %ld ms\n",
 
 
10943    .
type = 
"bridge-features",
 
 
10955    return datastore->
data;
 
 
10965        ds_features = datastore->
data;
 
10982    if (!ds_features) {
 
10990    datastore->
data = ds_features;
 
 
11025        ast_debug(2, 
"%s: Topologies already match. Current: %s  Requested: %s\n",
 
 
Prototypes for public functions only of internal interest,.
void ast_jb_destroy(struct ast_channel *chan)
Destroys jitterbuffer on a channel.
void ast_cli_unregister_multiple(void)
static struct aco_type agent_type
static struct ast_generator gen
struct sla_ringing_trunk * first
char * strsep(char **str, const char *delims)
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
int ast_shutting_down(void)
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_strndup(str, len)
A wrapper for strndup()
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_malloc(len)
A wrapper for malloc()
#define ao2_iterator_next(iter)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_NOLOCK
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_replace(dst, src)
Replace one object reference with another cleaning up the original.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
int() ao2_callback_data_fn(void *obj, void *arg, void *data, int flags)
Type of a generic callback function.
@ OBJ_NOLOCK
Assume that the ao2_container is already locked.
#define ao2_alloc(data_size, destructor_fn)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
struct ast_frame * ast_audiohook_write_list(struct ast_channel *chan, struct ast_audiohook_list *audiohook_list, enum ast_audiohook_direction direction, struct ast_frame *frame)
Pass a frame off to be handled by the audiohook core.
@ AST_AUDIOHOOK_DIRECTION_READ
@ AST_AUDIOHOOK_DIRECTION_WRITE
int ast_audiohook_write_list_empty(struct ast_audiohook_list *audiohook_list)
Determine if a audiohook_list is empty or not.
void ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list)
Detach audiohooks from list and destroy said list.
void ast_audiohook_move_all(struct ast_channel *old_chan, struct ast_channel *new_chan)
Move all audiohooks from one channel to another.
"smart" channels that update automatically if a channel is masqueraded
void ast_autochan_new_channel(struct ast_channel *old_chan, struct ast_channel *new_chan)
Switch what channel autochans point to.
struct ast_channel * ast_bridge_peer(struct ast_bridge *bridge, struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
void ast_bridge_notify_masquerade(struct ast_channel *chan)
Notify bridging that this channel was just masqueraded.
int ast_bridge_features_init(struct ast_bridge_features *features)
Initialize bridge features structure.
struct ast_bridge_features * ast_bridge_features_new(void)
Allocate a new bridge features struct.
void ast_bridge_features_merge(struct ast_bridge_features *into, const struct ast_bridge_features *from)
Merge one ast_bridge_features into another.
void ast_bridge_features_cleanup(struct ast_bridge_features *features)
Clean up the contents of a bridge features structure.
void ast_bridge_features_destroy(struct ast_bridge_features *features)
Destroy an allocated bridge features struct.
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
#define AST_PRES_USER_NUMBER_UNSCREENED
#define AST_PRES_UNAVAILABLE
#define AST_PRES_RESTRICTED
@ AST_CONNECTED_LINE_UPDATE_SOURCE_UNKNOWN
#define AST_PRES_NUMBER_NOT_AVAILABLE
@ AST_REDIRECTING_REASON_UNKNOWN
#define AST_PRES_NUMBER_TYPE
#define AST_PRES_RESTRICTION
#define AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED
Internal Asterisk hangup causes.
#define AST_CAUSE_SWITCH_CONGESTION
#define AST_CAUSE_NUMBER_PORTED_NOT_HERE
#define AST_CAUSE_CONGESTION
#define AST_CAUSE_INVALID_IE_CONTENTS
#define AST_CAUSE_UNALLOCATED
#define AST_CAUSE_INTERWORKING
#define AST_CAUSE_PROTOCOL_ERROR
#define AST_CAUSE_NUMBER_CHANGED
#define AST_CAUSE_BEARERCAPABILITY_NOTAVAIL
#define AST_CAUSE_CALL_AWARDED_DELIVERED
#define AST_CAUSE_INVALID_NUMBER_FORMAT
#define AST_CAUSE_OUTGOING_CALL_BARRED
#define AST_CAUSE_CHAN_NOT_IMPLEMENTED
#define AST_CAUSE_WRONG_MESSAGE
#define AST_CAUSE_INCOMPATIBLE_DESTINATION
#define AST_CAUSE_BEARERCAPABILITY_NOTAUTH
#define AST_CAUSE_DESTINATION_OUT_OF_ORDER
#define AST_CAUSE_NO_USER_RESPONSE
#define AST_CAUSE_NORMAL_TEMPORARY_FAILURE
#define AST_CAUSE_MESSAGE_TYPE_NONEXIST
#define AST_CAUSE_MANDATORY_IE_LENGTH_ERROR
#define AST_CAUSE_REDIRECTED_TO_NEW_DESTINATION
#define AST_CAUSE_FACILITY_NOT_SUBSCRIBED
#define AST_CAUSE_BEARERCAPABILITY_NOTIMPL
#define AST_CAUSE_WRONG_CALL_STATE
#define AST_CAUSE_PRE_EMPTED
#define AST_CAUSE_REQUESTED_CHAN_UNAVAIL
#define AST_CAUSE_NORMAL_CIRCUIT_CONGESTION
#define AST_CAUSE_CHANNEL_UNACCEPTABLE
#define AST_CAUSE_NOTDEFINED
#define AST_CAUSE_CALL_REJECTED
#define AST_CAUSE_SUBSCRIBER_ABSENT
#define AST_CAUSE_NETWORK_OUT_OF_ORDER
#define AST_CAUSE_INVALID_CALL_REFERENCE
#define AST_CAUSE_FACILITY_REJECTED
#define AST_CAUSE_ANSWERED_ELSEWHERE
#define AST_CAUSE_NORMAL_UNSPECIFIED
#define AST_CAUSE_FACILITY_NOT_IMPLEMENTED
#define AST_CAUSE_INCOMING_CALL_BARRED
#define AST_CAUSE_MANDATORY_IE_MISSING
#define AST_CAUSE_NOSUCHDRIVER
#define AST_CAUSE_ACCESS_INFO_DISCARDED
#define AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE
#define AST_CAUSE_NO_ROUTE_TRANSIT_NET
#define AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY
#define AST_CAUSE_NO_ROUTE_DESTINATION
#define AST_CAUSE_INVALID_MSG_UNSPECIFIED
#define AST_CAUSE_NO_ANSWER
#define AST_CAUSE_NORMAL_CLEARING
#define AST_CAUSE_MISDIALLED_TRUNK_PREFIX
#define AST_CAUSE_IE_NONEXIST
#define AST_CAUSE_USER_BUSY
#define ast_cc_config_params_init()
Allocate and initialize an ast_cc_config_params structure.
void ast_cc_config_params_destroy(struct ast_cc_config_params *params)
Free memory from CCSS configuration params.
int ast_cc_offer(struct ast_channel *caller_chan)
Offer CC to a caller.
void ast_cc_copy_config_params(struct ast_cc_config_params *dest, const struct ast_cc_config_params *src)
copy CCSS configuration parameters from one structure to another
void ast_cdr_free(struct ast_cdr *cdr)
Free a CDR record.
void ast_cel_publish_event(struct ast_channel *chan, enum ast_cel_event_type event_type, struct ast_json *blob)
Publish a CEL event.
@ AST_CEL_DTMF
A DTMF digit was processed.
static int match(struct ast_sockaddr *addr, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int check_dcallno)
static struct ast_timer * timer
static char language[MAX_LANGUAGE]
static char accountcode[AST_MAX_ACCOUNT_CODE]
static int indicate(void *data)
static int transfer(void *data)
static int hangup(void *data)
static int answer(void *data)
static int call(void *data)
static void send_text(unsigned char pos, unsigned char inverse, struct unistimsession *pte, const char *text)
void ast_party_subaddress_copy(struct ast_party_subaddress *dest, const struct ast_party_subaddress *src)
Copy the source party subaddress information to the destination party subaddress.
static void channels_shutdown(void)
static void channel_do_masquerade(struct ast_channel *original, struct ast_channel *clonechan)
Masquerade a channel.
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options)
says a number
struct varshead * ast_channel_get_manager_vars(struct ast_channel *chan)
Gets the variables for a given channel, as specified by ast_channel_set_manager_vars().
int ast_senddigit_mf_begin(struct ast_channel *chan, char digit)
Send an MF digit to a channel.
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
static int kill_write(struct ast_channel *chan, struct ast_frame *frame)
void ast_softhangup_all(void)
Soft hangup all active channels.
int ast_channel_request_stream_topology_change(struct ast_channel *chan, struct ast_stream_topology *topology, void *change_source)
Request that the stream topology of a channel change.
void ast_channel_end_dtmf(struct ast_channel *chan, char digit, struct timeval start, const char *why)
Simulate a DTMF end on a broken bridge channel.
void ast_party_redirecting_reason_copy(struct ast_party_redirecting_reason *dest, const struct ast_party_redirecting_reason *src)
Copy the source redirecting reason information to the destination redirecting reason.
struct ast_channel * ast_channel_get_by_exten(const char *exten, const char *context)
Find a channel by extension and context.
static void channel_req_accountcodes(struct ast_channel *chan, const struct ast_channel *requestor, enum ast_channel_requestor_relationship relationship, int precious)
static int indicate_connected_line(struct ast_channel *chan, const void *data, size_t datalen)
void ast_party_name_init(struct ast_party_name *init)
Initialize the given name structure.
char * ast_recvtext(struct ast_channel *chan, int timeout)
Receives a text string from a channel Read a string of text from a channel.
static void generator_write_format_change(struct ast_channel *chan)
enum ast_channel_error ast_channel_errno(void)
Get error code for latest channel operation.
int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params)
struct ast_channel * ast_channel_callback(ao2_callback_data_fn *cb_fn, void *arg, void *data, int ao2_flags)
Call a function with every active channel.
void ast_party_dialed_set_init(struct ast_party_dialed *init, const struct ast_party_dialed *guide)
Initialize the given dialed structure using the given guide for a set update operation.
int ast_channel_get_device_name(struct ast_channel *chan, char *device_name, size_t name_buffer_length)
Get a device name given its channel structure.
static int do_ids_conflict(const struct ast_assigned_ids *assignedids)
struct ast_channel * ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, int nfds, int *exception, int *outfd, int *ms)
Wait for x amount of time on a file descriptor to have input.
static int set_format(struct ast_channel *chan, struct ast_format_cap *cap_set, const int direction, int interleaved_stereo)
int ast_auto_answer(struct ast_channel *chan)
Answer a channel, if it's not already answered.
static int silence_generator_generate(struct ast_channel *chan, void *data, int len, int samples)
void ast_party_redirecting_init(struct ast_party_redirecting *init)
Initialize the given redirecting structure.
int ast_write(struct ast_channel *chan, struct ast_frame *fr)
Write a frame to a channel This function writes the given frame to the indicated channel.
int ast_call(struct ast_channel *chan, const char *addr, int timeout)
Make a call.
void ast_channel_set_redirecting(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Set the redirecting id information in the Asterisk channel.
static void handle_cause(int cause, int *outstate)
void ast_channel_clear_flag(struct ast_channel *chan, unsigned int flag)
Clear a flag on a channel.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
static void send_dtmf_begin_event(struct ast_channel *chan, enum DtmfDirection direction, const char digit)
struct ast_channel * ast_call_forward(struct ast_channel *caller, struct ast_channel *orig, int *timeout, struct ast_format_cap *cap, struct outgoing_helper *oh, int *outstate)
Forwards a call to a new channel specified by the original channel's call_forward str....
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
void ast_party_id_init(struct ast_party_id *init)
Initialize the given party id structure.
int ast_set_read_format_path(struct ast_channel *chan, struct ast_format *raw_format, struct ast_format *core_format)
Set specific read path on channel.
void ast_channel_clear_softhangup(struct ast_channel *chan, int flag)
Clear a set of softhangup flags from a channel.
static void clone_variables(struct ast_channel *original, struct ast_channel *clonechan)
Clone channel variables from 'clone' channel into 'original' channel.
static char * handle_cli_core_show_channeltype(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Show details about a channel driver - CLI command.
struct ast_channel_iterator * ast_channel_iterator_by_name_new(const char *name, size_t name_len)
Create a new channel iterator based on name.
int ast_say_digit_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang)
says digits of a string
struct varshead * ast_channel_get_vars(struct ast_channel *chan)
Gets the variables for a given channel, as set using pbx_builtin_setvar_helper().
int ast_prod(struct ast_channel *chan)
Send empty audio to prime a channel driver.
int __ast_answer(struct ast_channel *chan, unsigned int delay)
Answer a channel, with a selectable delay before returning.
static int calc_monitor_jump(int samples, int sample_rate, int seek_rate)
calculates the number of samples to jump forward with in a monitor stream.
static struct ast_frame * kill_exception(struct ast_channel *chan)
static int ast_channel_make_compatible_helper(struct ast_channel *from, struct ast_channel *to)
Set up translation from one channel to another.
void ast_party_number_init(struct ast_party_number *init)
Initialize the given number structure.
static void suppress_framehook_fixup_cb(void *data, int framehook_id, struct ast_channel *old_chan, struct ast_channel *new_chan)
void ast_hangup(struct ast_channel *chan)
Hangup a channel.
void ast_channel_set_caller(struct ast_channel *chan, const struct ast_party_caller *caller, const struct ast_set_party_caller *update)
Set the caller id information in the Asterisk channel.
static int tonepair_generator(struct ast_channel *chan, void *data, int len, int samples)
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
void ast_moh_cleanup(struct ast_channel *chan)
Clean up music on hold state on a given channel.
int ast_raw_answer_with_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
Answer a channel passing in a stream topology.
int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int ftimeout, char *enders)
Reads multiple digits.
int ast_channel_sendurl(struct ast_channel *chan, const char *url)
Sends a URL on a given link Send URL on link.
struct ast_channel_iterator * ast_channel_iterator_destroy(struct ast_channel_iterator *i)
Destroy a channel iterator.
int ast_queue_hangup(struct ast_channel *chan)
Queue a hangup frame for channel.
struct ast_channel * ast_channel_bridge_peer(struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
int ast_transfer_protocol(struct ast_channel *chan, char *dest, int *protocol)
Transfer a call to dest, if the channel supports transfer.
static int indicate_redirecting(struct ast_channel *chan, const void *data, size_t datalen)
static void(* ast_moh_cleanup_ptr)(struct ast_channel *)
static int set_security_requirements(const struct ast_channel *requestor, struct ast_channel *out)
static void ast_read_generator_actions(struct ast_channel *chan, struct ast_frame *f)
void ast_party_subaddress_set_init(struct ast_party_subaddress *init, const struct ast_party_subaddress *guide)
Initialize the given party subaddress structure using the given guide for a set update operation.
void ast_channel_set_connected_line(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Set the connected line information in the Asterisk channel.
int ast_senddigit_begin(struct ast_channel *chan, char digit)
Send a DTMF digit to a channel.
static int channel_has_external_vars(struct external_vars *channelvars)
int ast_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
struct ast_channel * ast_channel_get_by_uniqueid(const char *uniqueid)
Find a channel by a uniqueid.
static int party_subaddress_build_data(unsigned char *data, size_t datalen, const struct ast_party_subaddress *subaddress, const char *label, const struct ast_party_subaddress_ies *ies)
void ast_party_number_copy(struct ast_party_number *dest, const struct ast_party_number *src)
Copy the source party number information to the destination party number.
static void moh_cleanup(struct ast_channel *chan)
static int namedgroup_cmp_cb(void *obj, void *arg, int flags)
Comparison function used for named group container.
void ast_channel_unlink(struct ast_channel *chan)
Remove a channel from the global channels container.
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin)
Queue one or more frames to a channel's frame queue.
void ast_party_number_set(struct ast_party_number *dest, const struct ast_party_number *src)
Set the source party number information into the destination party number.
void ast_party_subaddress_init(struct ast_party_subaddress *init)
Initialize the given subaddress structure.
int ast_channel_has_hook_requiring_audio(struct ast_channel *chan)
Check if the channel has any active hooks that require audio.
int ast_readstring_full(struct ast_channel *c, char *s, int len, int timeout, int ftimeout, char *enders, int audiofd, int ctrlfd)
static const struct ast_datastore_info suppress_datastore_voice
void ast_party_connected_line_free(struct ast_party_connected_line *doomed)
Destroy the connected line information contents.
static const struct ast_datastore_info plc_ds_info
int64_t ast_channel_get_up_time_ms(struct ast_channel *chan)
Obtain how long it has been since the channel was answered in ms.
void ast_channel_set_manager_vars(size_t varc, char **vars)
Sets the variables to be stored in the manager_vars field of all snapshots.
int ast_sendtext_data(struct ast_channel *chan, struct ast_msg_data *msg)
Sends text to a channel in an ast_msg_data structure wrapper with ast_sendtext as fallback.
static int party_name_build_data(unsigned char *data, size_t datalen, const struct ast_party_name *name, const char *label, const struct ast_party_name_ies *ies)
int ast_set_read_format_from_cap(struct ast_channel *chan, struct ast_format_cap *cap)
Sets read format on channel chan from capabilities Set read format for channel to whichever component...
int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
void ast_channel_set_caller_event(struct ast_channel *chan, const struct ast_party_caller *caller, const struct ast_set_party_caller *update)
Set the caller id information in the Asterisk channel and generate an AMI event if the caller id name...
static char * handle_cli_core_show_channeltypes(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Show channel types - CLI command.
int ast_senddigit(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel.
#define AST_DEFAULT_EMULATE_DTMF_DURATION
void ast_party_redirecting_set(struct ast_party_redirecting *dest, const struct ast_party_redirecting *src, const struct ast_set_party_redirecting *update)
Set the redirecting information based on another redirecting source.
const struct ast_channel_tech ast_kill_tech
Kill the channel channel driver technology descriptor.
int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *peer)
Make the frame formats of two channels compatible.
int ast_channel_queryoption(struct ast_channel *chan, int option, void *data, int *datalen, int block)
Checks the value of an option.
struct varshead * ast_channel_get_ari_vars(struct ast_channel *chan)
Gets the variables for a given channel, as specified by ast_channel_set_ari_vars().
static void queue_dtmf_readq(struct ast_channel *chan, struct ast_frame *f)
static void * channel_cc_params_copy(void *data)
static int deactivate_silence_generator(struct ast_channel *chan)
static void tonepair_release(struct ast_channel *chan, void *params)
static struct varshead * channel_get_external_vars(struct external_vars *channelvars, struct ast_channel *chan)
int ast_channel_setoption(struct ast_channel *chan, int option, void *data, int datalen, int block)
Sets an option on a channel.
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
void ast_party_id_free(struct ast_party_id *doomed)
Destroy the party id contents.
void ast_channel_unregister(const struct ast_channel_tech *tech)
Unregister channel driver.
static const struct ast_datastore_info * suppress_get_datastore_information(enum ast_frame_type frametype)
void ast_party_subaddress_set(struct ast_party_subaddress *dest, const struct ast_party_subaddress *src)
Set the source party subaddress information into the destination party subaddress.
int ast_waitfor_n_fd(int *fds, int n, int *ms, int *exception)
Wait for x amount of time on a file descriptor to have input.
int ast_channel_stream_topology_changed(struct ast_channel *chan, struct ast_stream_topology *topology)
Provide notice to a channel that the stream topology has changed.
int ast_set_write_format_from_cap(struct ast_channel *chan, struct ast_format_cap *cap)
Sets write format on channel chan Set write format for channel to whichever component of "format" is ...
void ast_party_id_set(struct ast_party_id *dest, const struct ast_party_id *src, const struct ast_set_party_id *update)
Set the source party id information into the destination party id.
struct ast_channel * ast_channel_iterator_next(struct ast_channel_iterator *i)
Get the next channel for a channel iterator.
void ast_set_variables(struct ast_channel *chan, struct ast_variable *vars)
adds a list of channel variables to a channel
struct ast_namedgroups * ast_ref_namedgroups(struct ast_namedgroups *groups)
static const struct ast_channel_tech null_tech
int ast_channel_feature_hooks_replace(struct ast_channel *chan, struct ast_bridge_features *features)
Sets the channel-attached features a channel has access to upon being bridged.
static void silence_generator_release(struct ast_channel *chan, void *data)
static int namedgroup_hash_cb(const void *obj, const int flags)
Hashing function used for named group container.
struct ast_silence_generator * ast_channel_start_silence_generator(struct ast_channel *chan)
Starts a silence generator on the given channel.
int internal_channel_set_current_storage_driver(const char *driver_name)
static void(* ast_moh_stop_ptr)(struct ast_channel *)
void ast_party_connected_line_copy(struct ast_party_connected_line *dest, const struct ast_party_connected_line *src)
Copy the source connected line information to the destination connected line.
int ast_recvchar(struct ast_channel *chan, int timeout)
Receives a text character from a channel.
static struct external_vars ari_vars
struct ast_channel * ast_channel_yank(struct ast_channel *yankee)
Gain control of a channel in the system.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame.
int ast_channel_cc_params_init(struct ast_channel *chan, const struct ast_cc_config_params *base_params)
Set up datastore with CCSS parameters for a channel.
int ast_say_ordinal(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options)
says an ordinal number
void ast_channel_close_storage(void)
int ast_channel_get_intercept_mode(void)
Am I currently running an intercept dialplan routine.
void ast_party_connected_line_set(struct ast_party_connected_line *dest, const struct ast_party_connected_line *src, const struct ast_set_party_connected_line *update)
Set the connected line information based on another connected line source.
int ast_write_stream(struct ast_channel *chan, int stream_num, struct ast_frame *fr)
Write a frame to a stream This function writes the given frame to the indicated stream on the channel...
void ast_channel_stop_silence_generator(struct ast_channel *chan, struct ast_silence_generator *state)
Stops a previously-started silence generator on the given channel.
int ast_settimeout_full(struct ast_channel *c, unsigned int rate, int(*func)(const void *data), void *data, unsigned int is_ao2_obj)
static int should_skip_dtmf(struct ast_channel *chan)
Determine whether or not we should ignore DTMF in the readq.
static struct ast_channel * __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, enum ama_flags amaflag, struct ast_endpoint *endpoint, struct ast_channel_initializers *initializers, const char *file, int line, const char *function, const char *name_fmt, va_list ap)
Create a new channel structure.
void ast_party_dialed_init(struct ast_party_dialed *init)
Initialize the given dialed structure.
const char * ast_channel_get_current_storage_driver_name(void)
Get the name of the current channel storage driver.
void ast_party_caller_copy(struct ast_party_caller *dest, const struct ast_party_caller *src)
Copy the source caller information to the destination caller.
int ast_setstate(struct ast_channel *chan, enum ast_channel_state state)
Change the state of a channel.
void ast_party_redirecting_reason_set(struct ast_party_redirecting_reason *dest, const struct ast_party_redirecting_reason *src)
Set the redirecting reason information based on another redirecting reason source.
int ast_namedgroups_intersect(struct ast_namedgroups *a, struct ast_namedgroups *b)
Return TRUE if group a and b contain at least one common groupname.
int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *to)
Inherit datastores from a parent to a child.
char * ast_transfercapability2str(int transfercapability)
Gives the string form of a given transfer capability.
void ast_channel_undefer_dtmf(struct ast_channel *chan)
Unset defer DTMF flag on channel.
static void deactivate_generator_nolock(struct ast_channel *chan)
void ast_channel_req_accountcodes(struct ast_channel *chan, const struct ast_channel *requestor, enum ast_channel_requestor_relationship relationship)
Setup new channel accountcodes from the requestor channel after ast_request().
void ast_deactivate_generator(struct ast_channel *chan)
static void channel_cc_params_destroy(void *data)
void ast_party_id_merge_copy(struct ast_party_id *dest, struct ast_party_id *base, struct ast_party_id *overlay)
Copy a merge of a given party id into another given party id to a given destination party id.
struct ast_channel_iterator * ast_channel_iterator_by_exten_new(const char *exten, const char *context)
Create a new channel iterator based on extension.
int ast_check_hangup_locked(struct ast_channel *chan)
static const struct causes_map causes[]
static void plc_ds_destroy(void *data)
int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Compare a offset with when to hangup channel.
struct ast_channel * __ast_channel_alloc(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, enum ama_flags amaflag, struct ast_endpoint *endpoint, const char *file, int line, const char *function, const char *name_fmt,...)
Create a channel structure.
void ast_install_music_functions(int(*start_ptr)(struct ast_channel *, const char *, const char *), void(*stop_ptr)(struct ast_channel *), void(*cleanup_ptr)(struct ast_channel *))
char * ast_print_group(char *buf, int buflen, ast_group_t group)
Print call group and pickup group —.
static void varshead_dtor(void *obj)
Destructor for lists of variables.
struct ast_channel * ast_channel_get_by_name_prefix(const char *name, size_t name_len)
Find a channel by a name prefix.
void ast_party_redirecting_reason_set_init(struct ast_party_redirecting_reason *init, const struct ast_party_redirecting_reason *guide)
Initialize the given redirecting reason structure using the given guide for a set update operation.
int ast_set_write_format_interleaved_stereo(struct ast_channel *chan, struct ast_format *format)
Sets write format for a channel. All internal data will than be handled in an interleaved format....
void ast_party_caller_set(struct ast_party_caller *dest, const struct ast_party_caller *src, const struct ast_set_party_caller *update)
Set the caller information based on another caller source.
int ast_channel_suppress(struct ast_channel *chan, unsigned int direction, enum ast_frame_type frametype)
Suppress passing of a frame type on a channel.
int ast_channel_feature_hooks_append(struct ast_channel *chan, struct ast_bridge_features *features)
Appends to the channel-attached features a channel has access to upon being bridged.
static int safe_sleep_conditional(struct ast_channel *chan, int timeout_ms, int(*cond)(void *), void *data, unsigned int generate_silence)
Wait, look for hangups and condition arg.
static void __ast_change_name_nolink(struct ast_channel *chan, const char *newname)
this function simply changes the name of the channel and issues a manager_event with out unlinking an...
void ast_channel_softhangup_withcause_locked(struct ast_channel *chan, int causecode)
Lock the given channel, then request softhangup on the channel with the given causecode.
int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang)
says digits
int ast_undestroyed_channels(void)
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
void ast_party_connected_line_collect_caller(struct ast_party_connected_line *connected, struct ast_party_caller *caller)
Collect the caller party information into a connected line structure.
int ast_queue_control_data(struct ast_channel *chan, enum ast_control_frame_type control, const void *data, size_t datalen)
Queue a control frame with payload.
struct ast_bridge_features * ast_channel_feature_hooks_get(struct ast_channel *chan)
Gets the channel-attached features a channel has access to upon being bridged.
void ast_channel_update_connected_line(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Indicate that the connected line information has changed.
int ast_senddigit_mf_end(struct ast_channel *chan)
End sending an MF digit to a channel.
int ast_channel_move(struct ast_channel *dest, struct ast_channel *source)
Move a channel from its current location to a new location.
void ast_channel_queue_redirecting_update(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Queue a redirecting update frame on a channel.
void ast_party_redirecting_reason_init(struct ast_party_redirecting_reason *init)
Initialize the given redirecting reason structure.
int ast_senddigit_external(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel from an external thread.
int ast_sendtext(struct ast_channel *chan, const char *text)
Sends text to a channel.
struct ast_channel * ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int timeout, int *outstate, const char *cidnum, const char *cidname)
Request a channel of a given type, with data as optional information used by the low level module and...
struct ast_frame * ast_read_stream(struct ast_channel *chan)
Reads a frame, but does not filter to just the default streams.
void ast_party_caller_set_init(struct ast_party_caller *init, const struct ast_party_caller *guide)
Initialize the given caller structure using the given guide for a set update operation.
void ast_party_id_set_init(struct ast_party_id *init, const struct ast_party_id *guide)
Initialize the given party id structure using the given guide for a set update operation.
void ast_party_name_free(struct ast_party_name *doomed)
Destroy the party name contents.
void ast_channel_set_ari_vars(size_t varc, char **vars)
Sets the variables to be stored in the ari_vars field of all snapshots.
void ast_party_dialed_free(struct ast_party_dialed *doomed)
Destroy the dialed party contents.
int ast_say_money_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang)
function to pronounce monetary amounts
void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char *cid_name, const char *cid_ani)
Set caller ID number, name and ANI and generate AMI event.
int ast_channel_redirecting_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const void *redirecting_info, int is_frame)
Run a redirecting interception subroutine and update a channel's redirecting information.
void ast_channel_inherit_variables(const struct ast_channel *parent, struct ast_channel *child)
Inherits channel variable from parent to child channel.
static ast_mutex_t channel_move_lock
static int namedgroup_match(void *obj, void *arg, int flags)
int ast_queue_frame_head(struct ast_channel *chan, struct ast_frame *fin)
Queue one or more frames to the head of a channel's frame queue.
static const struct ast_datastore_info cc_channel_datastore_info
static int channel_feature_hooks_set_full(struct ast_channel *chan, struct ast_bridge_features *features, int replace)
struct ast_frame * ast_read_stream_noaudio(struct ast_channel *chan)
Reads a frame, but does not filter to just the default streams, returning AST_FRAME_NULL frame if aud...
int ast_channel_sendhtml(struct ast_channel *chan, int subclass, const char *data, int datalen)
Sends HTML on given channel Send HTML or URL on link.
struct ast_channel * __ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int timeout, int *outstate, const char *cid_num, const char *cid_name, struct outgoing_helper *oh)
Request a channel of a given type, with data as optional information used by the low level module and...
void ast_party_redirecting_set_init(struct ast_party_redirecting *init, const struct ast_party_redirecting *guide)
Initialize the given redirecting id structure using the given guide for a set update operation.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
static void free_external_channelvars(struct external_vars *channelvars)
void ast_party_name_set_init(struct ast_party_name *init, const struct ast_party_name *guide)
Initialize the given party name structure using the given guide for a set update operation.
int ast_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options)
says an enumeration
int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
Queue a hangup frame for channel.
int ast_connected_line_parse_data(const unsigned char *data, size_t datalen, struct ast_party_connected_line *connected)
Parse connected line indication frame data.
void ast_party_caller_free(struct ast_party_caller *doomed)
Destroy the caller party contents.
struct ast_channel * __ast_dummy_channel_alloc(const char *file, int line, const char *function)
const char * ast_cause2str(int cause)
Gives the string form of a given hangup cause.
const char * ast_channel_amaflags2string(enum ama_flags flag)
Convert the enum representation of an AMA flag to a string representation.
void ast_party_dialed_copy(struct ast_party_dialed *dest, const struct ast_party_dialed *src)
Copy the source dialed party information to the destination dialed party.
int ast_active_channels(void)
returns number of active/allocated channels
static struct ast_frame * kill_read(struct ast_channel *chan)
struct ast_channel * ast_request_with_stream_topology(const char *type, struct ast_stream_topology *topology, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requests a channel (specifying stream topology)
static const struct set_format_access set_format_access_write
struct ast_namedgroups * ast_get_namedgroups(const char *s)
Create an ast_namedgroups set with group names from comma separated string.
static struct ast_generator tonepair
static int generator_force(const void *data)
static void call_forward_inherit(struct ast_channel *new_chan, struct ast_channel *parent, struct ast_channel *orig)
static void adjust_frame_for_plc(struct ast_channel *chan, struct ast_frame *frame, struct ast_datastore *datastore)
void ast_uninstall_music_functions(void)
static void channel_set_intercept_mode(int in_intercept_mode)
int ast_channels_init(void)
int ast_waitfordigit_full(struct ast_channel *c, int timeout_ms, const char *breakon, int audiofd, int cmdfd)
Wait for a digit Same as ast_waitfordigit() with audio fd for outputting read audio and ctrlfd to mon...
int ast_check_hangup(struct ast_channel *chan)
Checks to see if a channel is needing hang up.
int ast_say_character_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang, enum ast_say_case_sensitivity sensitivity)
function to pronounce character and phonetic strings
static struct external_vars ami_vars
void ast_party_name_set(struct ast_party_name *dest, const struct ast_party_name *src)
Set the source party name information into the destination party name.
static void features_destroy(void *obj)
void ast_set_party_id_all(struct ast_set_party_id *update_id)
Set the update marker to update all information of a corresponding party id.
int ast_channel_is_bridged(const struct ast_channel *chan)
Determine if a channel is in a bridge.
static int kill_hangup(struct ast_channel *chan)
void ast_party_dialed_set(struct ast_party_dialed *dest, const struct ast_party_dialed *src)
Set the dialed information based on another dialed source.
const char * ast_channel_reason2str(int reason)
return an english explanation of the code returned thru __ast_request_and_dial's 'outstate' argument
struct ast_frame * ast_read_noaudio(struct ast_channel *chan)
Reads a frame, returning AST_FRAME_NULL frame if audio.
int64_t ast_channel_get_duration_ms(struct ast_channel *chan)
Obtain how long it's been, in milliseconds, since the channel was created.
struct ast_bridge * ast_channel_get_bridge(const struct ast_channel *chan)
Get the bridge associated with a channel.
static void suppress_datastore_destroy_cb(void *data)
struct ast_channel * ast_channel_release(struct ast_channel *chan)
Unlink and release reference to a channel.
int ast_channel_open_storage()
int ast_redirecting_build_data(unsigned char *data, size_t datalen, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Build the redirecting id data frame.
void ast_set_hangupsource(struct ast_channel *chan, const char *source, int force)
Set the source of the hangup in this channel and it's bridge.
void ast_channel_set_flag(struct ast_channel *chan, unsigned int flag)
Set a flag on a channel.
int ast_softhangup(struct ast_channel *chan, int cause)
Softly hangup a channel, lock.
static void send_flash_event(struct ast_channel *chan)
int ast_write_video(struct ast_channel *chan, struct ast_frame *fr)
Write video frame to a channel This function writes the given frame to the indicated channel.
static void send_dtmf_end_event(struct ast_channel *chan, enum DtmfDirection direction, const char digit, long duration_ms)
void ast_channel_name_to_dial_string(char *channel_name)
Removes the trailing identifiers from a channel name string.
void ast_channel_hangupcause_hash_set(struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code, int datalen)
Sets the HANGUPCAUSE hash and optionally the SIP_CAUSE hash on the given channel.
struct ast_channel * __ast_channel_alloc_with_initializers(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, enum ama_flags amaflag, struct ast_endpoint *endpoint, struct ast_channel_initializers *initializers, const char *file, int line, const char *function, const char *name_fmt,...)
Create a channel structure.
int ast_queue_unhold(struct ast_channel *chan)
Queue an unhold frame.
static void destroy_hooks(struct ast_channel *chan)
int ast_channel_connected_line_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const void *connected_info, int is_frame)
Run a connected line interception subroutine and update a channel's connected line information.
void ast_channel_update_redirecting(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Indicate that the redirecting id has changed.
int ast_channel_has_manager_vars(void)
Return whether or not any manager variables have been set.
void ast_party_id_reset(struct ast_party_id *id)
Destroy and initialize the given party id structure.
void ast_party_id_invalidate(struct ast_party_id *id)
Invalidate all components of the given party id.
int ast_queue_hold(struct ast_channel *chan, const char *musicclass)
Queue a hold frame.
int ast_connected_line_build_data(unsigned char *data, size_t datalen, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Build the connected line information data frame.
int ast_senddigit_end(struct ast_channel *chan, char digit, unsigned int duration)
Send a DTMF digit to a channel.
int ast_channel_has_ari_vars(void)
Return whether or not any ARI variables have been set.
int ast_channel_register(const struct ast_channel_tech *tech)
Register a new telephony channel in Asterisk.
int ast_say_phonetic_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang)
struct ast_party_id ast_party_id_merge(struct ast_party_id *base, struct ast_party_id *overlay)
Merge a given party id into another given party id.
int ast_channel_stream_topology_changed_externally(struct ast_channel *chan)
Provide notice from a channel that the topology has changed on it as a result of the remote party ren...
#define DEFAULT_EMULATE_MF_DURATION
void ast_party_number_set_init(struct ast_party_number *init, const struct ast_party_number *guide)
Initialize the given party number structure using the given guide for a set update operation.
int ast_settimeout(struct ast_channel *c, unsigned int rate, int(*func)(const void *data), void *data)
Enable or disable timer ticks for a channel.
static const struct ast_channel_tech surrogate_tech
Channel technology used to extract a channel from a running application. The channel created with thi...
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
void ast_party_id_copy(struct ast_party_id *dest, const struct ast_party_id *src)
Copy the source party id information to the destination party id.
void ast_party_number_free(struct ast_party_number *doomed)
Destroy the party number contents.
void ast_party_connected_line_init(struct ast_party_connected_line *init)
Initialize the given connected line structure.
int ast_channel_get_up_time(struct ast_channel *chan)
Obtain how long it has been since the channel was answered.
static char * complete_channeltypes(struct ast_cli_args *a)
int ast_channel_is_leaving_bridge(struct ast_channel *chan)
Determine if a channel is leaving a bridge, but not hung up.
void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Set when to hangup channel.
int ast_redirecting_parse_data(const unsigned char *data, size_t datalen, struct ast_party_redirecting *redirecting)
Parse redirecting indication frame data.
static int indicate_data_internal(struct ast_channel *chan, int _condition, const void *data, size_t datalen)
struct ast_variable * ast_channeltype_list(void)
return an ast_variable list of channeltypes
int ast_say_digits_full(struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd)
Same as ast_say_digits() with audiofd for received audio and returns 1 on ctrlfd being readable.
struct ast_bridge_channel * ast_channel_get_bridge_channel(struct ast_channel *chan)
Get a reference to the channel's bridge pointer.
int ast_senddigit_mf(struct ast_channel *chan, char digit, unsigned int duration, unsigned int durationkp, unsigned int durationst, int is_external)
Send an MF digit to a channel.
static struct ast_generator silence_generator
int ast_safe_sleep_conditional(struct ast_channel *chan, int timeout_ms, int(*cond)(void *), void *data)
Wait for a specified amount of time, looking for hangups and a condition argument.
static void suppress_framehook_destroy_cb(void *data)
static void channel_set_external_vars(struct external_vars *channelvars, size_t varc, char **vars)
int ast_transfer(struct ast_channel *chan, char *dest)
Transfer a call to dest, if the channel supports transfer.
@ AST_REDIRECTING_FROM_NAME_PRESENTATION
@ AST_REDIRECTING_TO_NAME
@ AST_REDIRECTING_VERSION
@ AST_REDIRECTING_PRIV_FROM_NAME_VALID
@ AST_REDIRECTING_PRIV_FROM_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_FROM_NUMBER_PLAN
@ AST_REDIRECTING_PRIV_TO_NAME_VALID
@ AST_REDIRECTING_ORIG_TAG
@ AST_REDIRECTING_PRIV_ORIG_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_REASON_CODE
@ AST_REDIRECTING_PRIV_TO_NUMBER_VALID
@ AST_REDIRECTING_PRIV_TO_NUMBER_PRESENTATION
@ AST_REDIRECTING_ORIG_REASON_CODE
@ AST_REDIRECTING_TO_NAME_PRESENTATION
@ AST_REDIRECTING_PRIV_TO_NAME
@ AST_REDIRECTING_PRIV_ORIG_NAME_VALID
@ AST_REDIRECTING_ORIG_NUMBER_VALID
@ AST_REDIRECTING_FROM_NUMBER_PRESENTATION
@ AST_REDIRECTING_ORIG_SUBADDRESS_VALID
@ AST_REDIRECTING_FROM_NUMBER_VALID
@ AST_REDIRECTING_TO_NAME_VALID
@ AST_REDIRECTING_PRIV_FROM_NAME
@ AST_REDIRECTING_TO_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_ORIG_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_PRIV_FROM_SUBADDRESS_TYPE
@ AST_REDIRECTING_PRIV_TO_SUBADDRESS_VALID
@ AST_REDIRECTING_PRIV_TO_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_ORIG_NAME_CHAR_SET
@ AST_REDIRECTING_PRIV_FROM_SUBADDRESS
@ AST_REDIRECTING_TO_NUMBER_PLAN
@ AST_REDIRECTING_PRIV_TO_NUMBER
@ AST_REDIRECTING_PRIV_FROM_NUMBER_VALID
@ AST_REDIRECTING_ORIG_NAME
@ AST_REDIRECTING_ORIG_SUBADDRESS
@ AST_REDIRECTING_FROM_TAG
@ AST_REDIRECTING_PRIV_ORIG_NUMBER_PLAN
@ AST_REDIRECTING_TO_NUMBER
@ AST_REDIRECTING_ORIG_SUBADDRESS_TYPE
@ AST_REDIRECTING_FROM_NAME_CHAR_SET
@ AST_REDIRECTING_PRIV_FROM_TAG
@ AST_REDIRECTING_FROM_ID_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NUMBER
@ AST_REDIRECTING_PRIV_TO_NUMBER_PLAN
@ AST_REDIRECTING_TO_NUMBER_VALID
@ AST_REDIRECTING_FROM_SUBADDRESS_VALID
@ AST_REDIRECTING_FROM_NAME_VALID
@ AST_REDIRECTING_PRIV_TO_NAME_CHAR_SET
@ AST_REDIRECTING_PRIV_ORIG_TAG
@ AST_REDIRECTING_FROM_SUBADDRESS_TYPE
@ AST_REDIRECTING_PRIV_TO_TAG
@ AST_REDIRECTING_FROM_SUBADDRESS
@ AST_REDIRECTING_PRIV_ORIG_NAME_CHAR_SET
@ AST_REDIRECTING_ORIG_NAME_VALID
@ AST_REDIRECTING_TO_ID_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NUMBER_PLAN
@ AST_REDIRECTING_PRIV_TO_NAME_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NUMBER_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NAME_PRESENTATION
@ AST_REDIRECTING_PRIV_ORIG_SUBADDRESS_TYPE
@ AST_REDIRECTING_ORIG_REASON_STR
@ AST_REDIRECTING_ORIG_NAME_PRESENTATION
@ AST_REDIRECTING_PRIV_FROM_NAME_CHAR_SET
@ AST_REDIRECTING_ORIG_NUMBER
@ AST_REDIRECTING_PRIV_ORIG_NAME
@ AST_REDIRECTING_PRIV_TO_SUBADDRESS_TYPE
@ AST_REDIRECTING_PRIV_ORIG_NUMBER_VALID
@ AST_REDIRECTING_PRIV_ORIG_NUMBER_PRESENTATION
@ AST_REDIRECTING_TO_SUBADDRESS_VALID
@ AST_REDIRECTING_PRIV_ORIG_SUBADDRESS_VALID
@ AST_REDIRECTING_TO_SUBADDRESS_TYPE
@ AST_REDIRECTING_REASON_STR
@ AST_REDIRECTING_FROM_NAME
@ AST_REDIRECTING_PRIV_ORIG_NUMBER
@ AST_REDIRECTING_PRIV_FROM_SUBADDRESS_VALID
@ AST_REDIRECTING_ORIG_NUMBER_PRESENTATION
@ AST_REDIRECTING_PRIV_TO_SUBADDRESS
@ AST_REDIRECTING_PRIV_ORIG_NAME_PRESENTATION
@ AST_REDIRECTING_TO_NUMBER_PRESENTATION
@ AST_REDIRECTING_FROM_NUMBER
@ AST_REDIRECTING_ORIG_NUMBER_PLAN
@ AST_REDIRECTING_FROM_SUBADDRESS_ODD_EVEN
@ AST_REDIRECTING_PRIV_ORIG_SUBADDRESS
@ AST_REDIRECTING_TO_SUBADDRESS
@ AST_REDIRECTING_TO_NAME_CHAR_SET
static int party_id_build_data(unsigned char *data, size_t datalen, const struct ast_party_id *id, const char *label, const struct ast_party_id_ies *ies, const struct ast_set_party_id *update)
int ast_channel_unsuppress(struct ast_channel *chan, unsigned int direction, enum ast_frame_type frametype)
Stop suppressing of a frame type on a channel.
void ast_party_redirecting_free(struct ast_party_redirecting *doomed)
Destroy the redirecting information contents.
static void free_translation(struct ast_channel *clonechan)
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
const char * ast_state2str(enum ast_channel_state state)
Gives the string form of a given channel state.
static int tech_write(struct ast_channel *chan, struct ast_stream *stream, struct ast_stream *default_stream, struct ast_frame *frame)
void ast_connected_line_copy_from_caller(struct ast_party_connected_line *dest, const struct ast_party_caller *src)
Copy the caller information to the connected line information.
int ast_softhangup_nolock(struct ast_channel *chan, int cause)
Softly hangup a channel, don't lock.
enum ama_flags ast_channel_string2amaflag(const char *flag)
Convert a string to a detail record AMA flag.
static int redirecting_reason_build_data(unsigned char *data, size_t datalen, const struct ast_party_redirecting_reason *reason, const char *label, const struct ast_party_redirecting_reason_ies *ies)
int ast_indicate_data(struct ast_channel *chan, int _condition, const void *data, size_t datalen)
Indicates condition of channel, with payload.
static struct ast_frame * suppress_framehook_event_cb(struct ast_channel *chan, struct ast_frame *frame, enum ast_framehook_event event, void *data)
static int attribute_const is_visible_indication(enum ast_control_frame_type condition)
static void ast_channel_destructor(void *obj)
Free a channel structure.
void ast_channel_req_accountcodes_precious(struct ast_channel *chan, const struct ast_channel *requestor, enum ast_channel_requestor_relationship relationship)
Setup new channel accountcodes from the requestor channel after ast_request().
static int party_number_build_data(unsigned char *data, size_t datalen, const struct ast_party_number *number, const char *label, const struct ast_party_number_ies *ies)
@ AST_CONNECTED_LINE_NUMBER_VALID
@ AST_CONNECTED_LINE_SOURCE
@ AST_CONNECTED_LINE_PRIV_SUBADDRESS_VALID
@ AST_CONNECTED_LINE_PRIV_SUBADDRESS_ODD_EVEN
@ AST_CONNECTED_LINE_PRIV_NAME_VALID
@ AST_CONNECTED_LINE_PRIV_SUBADDRESS_TYPE
@ AST_CONNECTED_LINE_PRIV_NUMBER_PRESENTATION
@ AST_CONNECTED_LINE_NAME_CHAR_SET
@ AST_CONNECTED_LINE_SUBADDRESS_VALID
@ AST_CONNECTED_LINE_SUBADDRESS_ODD_EVEN
@ AST_CONNECTED_LINE_SUBADDRESS
@ AST_CONNECTED_LINE_PRIV_NUMBER_PLAN
@ AST_CONNECTED_LINE_NUMBER
@ AST_CONNECTED_LINE_ID_PRESENTATION
@ AST_CONNECTED_LINE_PRIV_NAME_PRESENTATION
@ AST_CONNECTED_LINE_PRIV_NAME
@ AST_CONNECTED_LINE_PRIV_NUMBER_VALID
@ AST_CONNECTED_LINE_NUMBER_PRESENTATION
@ AST_CONNECTED_LINE_PRIV_NAME_CHAR_SET
@ AST_CONNECTED_LINE_NAME
@ AST_CONNECTED_LINE_NAME_PRESENTATION
@ AST_CONNECTED_LINE_SUBADDRESS_TYPE
@ AST_CONNECTED_LINE_PRIV_SUBADDRESS
@ AST_CONNECTED_LINE_PRIV_TAG
@ AST_CONNECTED_LINE_NAME_VALID
@ AST_CONNECTED_LINE_PRIV_NUMBER
@ AST_CONNECTED_LINE_NUMBER_PLAN
@ AST_CONNECTED_LINE_VERSION
int ast_set_write_format_path(struct ast_channel *chan, struct ast_format *core_format, struct ast_format *raw_format)
Set specific write path on channel.
static void apply_plc(struct ast_channel *chan, struct ast_frame *frame)
static struct ast_cli_entry cli_channel[]
int ast_pre_call(struct ast_channel *chan, const char *sub_args)
Execute a Gosub call on the channel before a call is placed.
int ast_channel_supports_html(struct ast_channel *chan)
Checks for HTML support on a channel.
int ast_queue_answer(struct ast_channel *chan, const struct ast_stream_topology *topology)
Queue an ANSWER control frame with topology.
int ast_str2cause(const char *name)
Convert a symbolic hangup cause to number.
static void * tonepair_alloc(struct ast_channel *chan, void *params)
struct ast_namedgroups * ast_unref_namedgroups(struct ast_namedgroups *groups)
void ast_party_subaddress_free(struct ast_party_subaddress *doomed)
Destroy the party subaddress contents.
static int ast_channel_softhangup_cb(void *obj, void *arg, void *data, int flags)
static void set_channel_answer_time(struct ast_channel *chan)
static void * silence_generator_alloc(struct ast_channel *chan, void *data)
int ast_channel_get_duration(struct ast_channel *chan)
Obtain how long the channel since the channel was created.
void ast_channel_queue_connected_line_update(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Queue a connected line update frame on a channel.
void ast_party_connected_line_set_init(struct ast_party_connected_line *init, const struct ast_party_connected_line *guide)
Initialize the given connected line structure using the given guide for a set update operation.
unsigned long global_fout
static struct ast_frame * __ast_read(struct ast_channel *chan, int dropaudio, int dropnondefault)
static struct ast_channel * request_channel(const char *type, struct ast_format_cap *request_cap, struct ast_stream_topology *topology, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
static int should_trigger_dtmf_emulating(struct ast_channel *chan)
Determine whether or not we have to trigger dtmf emulating using 50 fps timer events especially when ...
static int kill_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
int ast_safe_sleep_without_silence(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups, and do not generate silence.
static int __ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin, int head, struct ast_frame *after)
void ast_connected_line_copy_to_caller(struct ast_party_caller *dest, const struct ast_party_connected_line *src)
Copy the connected line information to the caller information.
const struct ast_channel_tech * ast_get_channel_tech(const char *name)
Get handle to channel driver based on name.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name or uniqueid.
int ast_channel_defer_dtmf(struct ast_channel *chan)
Set defer DTMF flag on channel.
static const struct ast_datastore_info bridge_features_info
int ast_tonepair(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
int ast_answer(struct ast_channel *chan)
Answer a channel.
void ast_change_name(struct ast_channel *chan, const char *newname)
Change channel name.
int ast_waitfor(struct ast_channel *c, int ms)
Wait for input on a channel.
ast_group_t ast_get_group(const char *s)
static const struct set_format_access set_format_access_read
int ast_channel_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
Bridge two channels together (early)
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
static const char * dtmf_direction_to_string(enum DtmfDirection direction)
int ast_is_deferrable_frame(const struct ast_frame *frame)
Should we keep this frame for later?
struct ast_channel_iterator * ast_channel_iterator_all_new(void)
Create a new channel iterator.
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait, look for hangups.
struct ast_channel * ast_request(const char *type, struct ast_format_cap *request_cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requests a channel.
static void send_wink_event(struct ast_channel *chan)
static int(* ast_moh_start_ptr)(struct ast_channel *, const char *, const char *)
struct ast_cc_config_params * ast_channel_get_cc_config_params(struct ast_channel *chan)
Get the CCSS parameters from a channel.
#define DEFAULT_AMA_FLAGS
int ast_raw_answer(struct ast_channel *chan)
Answer a channel.
void ast_party_redirecting_copy(struct ast_party_redirecting *dest, const struct ast_party_redirecting *src)
Copy the source redirecting information to the destination redirecting.
char * ast_print_namedgroups(struct ast_str **buf, struct ast_namedgroups *group)
Print named call groups and named pickup groups.
void ast_party_name_copy(struct ast_party_name *dest, const struct ast_party_name *src)
Copy the source party name information to the destination party name.
int ast_channel_get_cc_agent_type(struct ast_channel *chan, char *agent_type, size_t size)
Find the appropriate CC agent type to use given a channel.
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
void ast_party_redirecting_reason_free(struct ast_party_redirecting_reason *doomed)
Destroy the redirecting reason contents.
#define STATE2STR_BUFSIZE
void ast_party_caller_init(struct ast_party_caller *init)
Initialize the given caller structure.
void ast_tonepair_stop(struct ast_channel *chan)
struct ast_channel * ast_waitfor_n(struct ast_channel **c, int n, int *ms)
Waits for input on a group of channels Wait for input on an array of channels for a given # of millis...
int ast_channel_has_audio_frame_or_monitor(struct ast_channel *chan)
Check if the channel has active audiohooks, active framehooks, or a monitor.
static void ast_dummy_channel_destructor(void *obj)
Free a dummy channel structure.
General Asterisk PBX channel definitions.
void ast_channel_internal_alertpipe_swap(struct ast_channel *chan1, struct ast_channel *chan2)
Swap the interal alertpipe between two channels.
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
const char * ast_channel_name(const struct ast_channel *chan)
int ast_channel_tech_hangupcause(const struct ast_channel *chan)
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
struct ast_bridge * ast_channel_internal_bridge(const struct ast_channel *chan)
struct timeval ast_channel_answertime(struct ast_channel *chan)
void ast_channel_named_pickupgroups_set(struct ast_channel *chan, struct ast_namedgroups *value)
int(* ast_timing_func_t)(const void *data)
struct ast_channel * ast_channel_masq(const struct ast_channel *chan)
int ast_channel_blocker_tid(const struct ast_channel *chan)
void ast_channel_stream_set(struct ast_channel *chan, struct ast_filestream *value)
void ast_channel_visible_indication_set(struct ast_channel *chan, int value)
const char * ast_channel_blockproc(const struct ast_channel *chan)
void ast_channel_caller_set(struct ast_channel *chan, struct ast_party_caller *value)
void * ast_channel_tech_pvt(const struct ast_channel *chan)
void ast_channel_dialed_set(struct ast_channel *chan, struct ast_party_dialed *value)
struct ast_format * ast_channel_rawreadformat(struct ast_channel *chan)
void * ast_channel_music_state(const struct ast_channel *chan)
unsigned int ast_channel_fin(const struct ast_channel *chan)
const char * ast_channel_latest_musicclass(const struct ast_channel *chan)
void ast_channel_callid_cleanup(struct ast_channel *chan)
void ast_channel_set_oldwriteformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_softhangup_internal_flag_clear(struct ast_channel *chan, int value)
struct varshead * ast_channel_varshead(struct ast_channel *chan)
void ast_channel_generator_set(struct ast_channel *chan, struct ast_generator *value)
#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag,...)
Create a channel structure.
void ast_channel_sending_dtmf_digit_set(struct ast_channel *chan, char value)
void * ast_channel_timingdata(const struct ast_channel *chan)
int ast_channel_internal_alert_readfd(struct ast_channel *chan)
ast_channel_requestor_relationship
@ AST_CHANNEL_REQUESTOR_BRIDGE_PEER
@ AST_CHANNEL_REQUESTOR_REPLACEMENT
void ast_channel_dtmf_tv_set(struct ast_channel *chan, struct timeval *value)
struct ast_flags * ast_channel_snapshot_segment_flags(struct ast_channel *chan)
#define DATASTORE_INHERIT_FOREVER
#define CHECK_BLOCKING(c)
Set the blocking indication on the channel.
void ast_channel_internal_swap_endpoint_forward(struct ast_channel *a, struct ast_channel *b)
Swap endpoint_forward between two channels.
void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
const char * ast_channel_musicclass(const struct ast_channel *chan)
int ast_channel_fdno(const struct ast_channel *chan)
void ast_channel_internal_fd_clear_all(struct ast_channel *chan)
void ast_channel_internal_alertpipe_close(struct ast_channel *chan)
void ast_channel_answertime_set(struct ast_channel *chan, struct timeval *value)
void ast_channel_hold_state_set(struct ast_channel *chan, int value)
#define ast_channel_lock(chan)
struct ast_trans_pvt * ast_channel_readtrans(const struct ast_channel *chan)
struct ast_format_cap * ast_channel_nativeformats(const struct ast_channel *chan)
struct timeval ast_channel_sending_dtmf_tv(const struct ast_channel *chan)
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
struct ast_trans_pvt * ast_channel_writetrans(const struct ast_channel *chan)
void ast_channel_vstreamid_set(struct ast_channel *chan, int value)
static const char ast_stream_topology_changed_external[]
Set as the change source reason when a channel stream topology has been changed externally as a resul...
void ast_channel_timingdata_set(struct ast_channel *chan, void *value)
struct ast_cdr * ast_channel_cdr(const struct ast_channel *chan)
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
void ast_channel_redirecting_set(struct ast_channel *chan, struct ast_party_redirecting *value)
unsigned long long ast_group_t
@ AST_CHANNEL_ERROR_ID_EXISTS
int ast_channel_priority(const struct ast_channel *chan)
void ast_channel_writetrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
void ast_channel_streamid_set(struct ast_channel *chan, int value)
#define ast_channel_ref(c)
Increase channel reference count.
void ast_channel_generatordata_set(struct ast_channel *chan, void *value)
#define ast_channel_lock_both(chan1, chan2)
Lock two channels.
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
void ast_channel_softhangup_internal_flag_set(struct ast_channel *chan, int value)
ast_callid ast_channel_callid(const struct ast_channel *chan)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
const char * ast_channel_accountcode(const struct ast_channel *chan)
void ast_channel_internal_swap_endpoints(struct ast_channel *a, struct ast_channel *b)
Swap endpoints between two channels.
const char * ast_channel_context(const struct ast_channel *chan)
const char * ast_channel_userfield(const struct ast_channel *chan)
char ast_channel_dtmf_digit_to_emulate(const struct ast_channel *chan)
void ast_channel_timingfd_set(struct ast_channel *chan, int value)
#define AST_MUTE_DIRECTION_READ
void ast_channel_endpoint_set(struct ast_channel *chan, struct ast_endpoint *endpoint)
pthread_t ast_channel_blocker(const struct ast_channel *chan)
ama_flags
Channel AMA Flags.
void ast_channel_sending_dtmf_tv_set(struct ast_channel *chan, struct timeval value)
#define ast_channel_trylock(chan)
const char * ast_channel_parkinglot(const struct ast_channel *chan)
void ast_channel_internal_swap_topics(struct ast_channel *a, struct ast_channel *b)
Swap topics beteween two channels.
const char * ast_channel_peeraccount(const struct ast_channel *chan)
struct timeval ast_channel_creationtime(struct ast_channel *chan)
struct ast_bridge_channel * ast_channel_internal_bridge_channel(const struct ast_channel *chan)
struct ast_framehook_list * ast_channel_framehooks(const struct ast_channel *chan)
void ast_channel_audiohooks_set(struct ast_channel *chan, struct ast_audiohook_list *value)
int ast_channel_fd(const struct ast_channel *chan, int which)
void ast_channel_timer_set(struct ast_channel *chan, struct ast_timer *value)
void ast_channel_internal_fd_set(struct ast_channel *chan, int which, int value)
void ast_channel_fin_set(struct ast_channel *chan, unsigned int value)
void ast_channel_set_rawreadformat(struct ast_channel *chan, struct ast_format *format)
struct ast_audiohook_list * ast_channel_audiohooks(const struct ast_channel *chan)
void ast_channel_tech_pvt_set(struct ast_channel *chan, void *value)
enum ama_flags ast_channel_amaflags(const struct ast_channel *chan)
void ast_channel_readtrans_set(struct ast_channel *chan, struct ast_trans_pvt *value)
void * ast_channel_generatordata(const struct ast_channel *chan)
struct ast_format * ast_channel_rawwriteformat(struct ast_channel *chan)
void ast_channel_set_is_t38_active_nolock(struct ast_channel *chan, int is_t38_active)
Variant of ast_channel_set_is_t38_active. Use this if the channel is already locked prior to calling.
const char * ast_channel_hangupsource(const struct ast_channel *chan)
unsigned int ast_channel_fout(const struct ast_channel *chan)
struct ast_stream_topology * ast_channel_get_stream_topology(const struct ast_channel *chan)
Retrieve the topology of streams on a channel.
int ast_channel_hangupcause(const struct ast_channel *chan)
int ast_channel_timingfd(const struct ast_channel *chan)
void ast_channel_fdno_set(struct ast_channel *chan, int value)
void ast_channel_set_rawwriteformat(struct ast_channel *chan, struct ast_format *format)
struct ast_party_dialed * ast_channel_dialed(struct ast_channel *chan)
@ AST_PARTY_CHAR_SET_ISO8859_1
void ast_channel_creationtime_set(struct ast_channel *chan, struct timeval *value)
struct ast_tone_zone * ast_channel_zone(const struct ast_channel *chan)
int ast_channel_dialed_causes_add(const struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code, int datalen)
Add cause code information to the channel.
void ast_channel_named_callgroups_set(struct ast_channel *chan, struct ast_namedgroups *value)
int ast_channel_alert_write(struct ast_channel *chan)
struct ast_readq_list * ast_channel_readq(struct ast_channel *chan)
ast_timing_func_t ast_channel_timingfunc(const struct ast_channel *chan)
void ast_channel_set_readformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_dtmf_digit_to_emulate_set(struct ast_channel *chan, char value)
void ast_channel_softhangup_internal_flag_add(struct ast_channel *chan, int value)
struct timeval * ast_channel_whentohangup(struct ast_channel *chan)
#define ast_channel_unref(c)
Decrease channel reference count.
struct ast_stream * ast_channel_get_default_stream(struct ast_channel *chan, enum ast_media_type type)
Retrieve the default stream of a specific media type on a channel.
struct ast_filestream * ast_channel_vstream(const struct ast_channel *chan)
ast_alert_status_t ast_channel_internal_alert_read(struct ast_channel *chan)
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
void ast_channel_internal_swap_uniqueid_and_linkedid(struct ast_channel *a, struct ast_channel *b)
Swap uniqueid and linkedid beteween two channels.
struct ast_generator * ast_channel_generator(const struct ast_channel *chan)
int ast_channel_unbridged(struct ast_channel *chan)
This function will check if the bridge needs to be re-evaluated due to external changes.
int ast_channel_hold_state(const struct ast_channel *chan)
void ast_channel_emulate_dtmf_duration_set(struct ast_channel *chan, unsigned int value)
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
const char * ast_channel_language(const struct ast_channel *chan)
struct ast_party_connected_line * ast_channel_connected_indicated(struct ast_channel *chan)
void ast_channel_cdr_set(struct ast_channel *chan, struct ast_cdr *value)
void ast_channel_context_set(struct ast_channel *chan, const char *value)
void ast_channel_connected_set(struct ast_channel *chan, struct ast_party_connected_line *value)
@ AST_CHAN_TP_INTERNAL
Channels with this particular technology are an implementation detail of Asterisk and should generall...
@ AST_CHAN_TP_SEND_TEXT_DATA
Channels have this property if they implement send_text_data.
void ast_channel_timingfunc_set(struct ast_channel *chan, ast_timing_func_t value)
struct ast_sched_context * ast_channel_sched(const struct ast_channel *chan)
void ast_channel_state_set(struct ast_channel *chan, enum ast_channel_state)
int ast_channel_fd_count(const struct ast_channel *chan)
Retrieve the number of file decriptor positions present on the channel.
#define AST_MUTE_DIRECTION_WRITE
struct ast_frame * ast_channel_dtmff(struct ast_channel *chan)
void ast_channel_internal_swap_snapshots(struct ast_channel *a, struct ast_channel *b)
Swap snapshots beteween two channels.
unsigned int ast_channel_emulate_dtmf_duration(const struct ast_channel *chan)
static int ast_add_fd(struct pollfd *pfd, int fd)
if fd is a valid descriptor, set *pfd with the descriptor
const char * ast_channel_call_forward(const struct ast_channel *chan)
#define AST_JITTERBUFFER_FD
struct ast_filestream * ast_channel_stream(const struct ast_channel *chan)
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
void ast_channel_fout_set(struct ast_channel *chan, unsigned int value)
struct ast_autochan_list * ast_channel_autochans(struct ast_channel *chan)
void ast_channel_zone_set(struct ast_channel *chan, struct ast_tone_zone *value)
struct ast_channel * ast_channel_masqr(const struct ast_channel *chan)
int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
struct timeval * ast_channel_dtmf_tv(struct ast_channel *chan)
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
char ast_channel_sending_dtmf_digit(const struct ast_channel *chan)
int ast_channel_visible_indication(const struct ast_channel *chan)
#define FRAMECOUNT_INC(x)
@ AST_FLAG_DISABLE_DEVSTATE_CACHE
@ AST_FLAG_SNAPSHOT_STAGE
@ AST_FLAG_TIMINGDATA_IS_AO2_OBJ
struct ast_timer * ast_channel_timer(const struct ast_channel *chan)
struct ast_hangup_handler_list * ast_channel_hangup_handlers(struct ast_channel *chan)
void ast_channel_masqr_set(struct ast_channel *chan, struct ast_channel *value)
void ast_channel_callid_set(struct ast_channel *chan, ast_callid value)
void ast_channel_internal_alertpipe_clear(struct ast_channel *chan)
void ast_channel_priority_set(struct ast_channel *chan, int value)
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
void ast_channel_whentohangup_set(struct ast_channel *chan, struct timeval *value)
#define ast_channel_cleanup(c)
Cleanup a channel reference.
int ast_channel_fd_isset(const struct ast_channel *chan, int which)
void ast_channel_adsicpe_set(struct ast_channel *chan, enum ast_channel_adsicpe value)
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
int ast_channel_internal_alertpipe_init(struct ast_channel *chan)
void ast_channel_sched_set(struct ast_channel *chan, struct ast_sched_context *value)
void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
const char * ast_channel_exten(const struct ast_channel *chan)
@ AST_SOFTHANGUP_ASYNCGOTO
@ AST_SOFTHANGUP_EXPLICIT
@ AST_SOFTHANGUP_SHUTDOWN
struct ast_datastore_list * ast_channel_datastores(struct ast_channel *chan)
#define ast_channel_unlock(chan)
void ast_channel_masq_set(struct ast_channel *chan, struct ast_channel *value)
void ast_channel_set_writeformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_vstream_set(struct ast_channel *chan, struct ast_filestream *value)
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
int ast_channel_alert_writable(struct ast_channel *chan)
Internal channel functions for channel.c to use.
void ast_channel_internal_set_stream_topology_change_source(struct ast_channel *chan, void *change_source)
void ast_channel_internal_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology)
int ast_channel_internal_is_finalized(struct ast_channel *chan)
const struct ast_channelstorage_driver * current_channel_storage_driver
The current channel storage driver.
struct ast_channel * __ast_channel_internal_alloc_with_initializers(void(*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const struct ast_channel_initializers *initializers, const char *file, int line, const char *function)
struct ast_channelstorage_instance * current_channel_storage_instance
The current channel storage instance.
enum ast_channel_error ast_channel_internal_errno(void)
void ast_channel_internal_swap_stream_topology(struct ast_channel *chan1, struct ast_channel *chan2)
void ast_channel_internal_cleanup(struct ast_channel *chan)
struct ast_channel * __ast_channel_internal_alloc(void(*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *file, int line, const char *function)
int ast_channel_internal_setup_topics(struct ast_channel *chan)
void ast_channel_internal_finalize(struct ast_channel *chan)
void ast_channel_internal_errno_set(enum ast_channel_error error)
void ast_channel_name_set(struct ast_channel *chan, const char *value)
void ast_channel_name_build_va(struct ast_channel *chan, const char *fmt, va_list ap)
ast_channel_state
ast_channel states
@ AST_STATE_DIALING_OFFHOOK
struct ast_channelstorage_instance * ast_channelstorage_open(const struct ast_channelstorage_driver *storage_driver, const char *instance_name)
int ast_channelstorage_init(void)
const struct ast_channelstorage_driver * ast_channelstorage_get_driver(const char *driver_name)
void ast_channelstorage_close(struct ast_channelstorage_instance *storage_instance)
#define AST_CHANNELSTORAGE_DEFAULT_TYPE
#define CHANNELSTORAGE_API(_instance, _func,...)
static struct ast_channel * get_by_uniqueid(struct ast_channelstorage_instance *driver, const char *uniqueid)
static struct ast_channel_iterator * iterator_by_exten_new(struct ast_channelstorage_instance *driver, const char *exten, const char *context)
static struct ast_channel * iterator_next(struct ast_channelstorage_instance *driver, struct ast_channel_iterator *i)
static int active_channels(struct ast_channelstorage_instance *driver)
returns number of active/allocated channels
static struct ast_channel_iterator * iterator_destroy(struct ast_channelstorage_instance *driver, struct ast_channel_iterator *i)
static struct ast_channel_iterator * iterator_by_name_new(struct ast_channelstorage_instance *driver, const char *name, size_t name_len)
static struct ast_channel * get_by_exten(struct ast_channelstorage_instance *driver, const char *exten, const char *context)
static struct ast_channel_iterator * iterator_all_new(struct ast_channelstorage_instance *driver)
static struct ast_channel * callback(struct ast_channelstorage_instance *driver, ao2_callback_data_fn *cb_fn, void *arg, void *data, int ao2_flags)
const char * ast_var_name(const struct ast_var_t *var)
#define ast_var_assign(name, value)
const char * ast_var_full_name(const struct ast_var_t *var)
const char * ast_var_value(const struct ast_var_t *var)
void ast_var_delete(struct ast_var_t *var)
Standard Command Line Interface.
#define AST_CLI_DEFINE(fn, txt,...)
int ast_cli_completion_add(char *value)
Add a result to a request for completion options.
void ast_cli(int fd, const char *fmt,...)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
ast_media_type
Types of media.
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
#define ast_datastore_alloc(info, uid)
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
@ AST_DEVSTATE_NOT_CACHABLE
int ast_devstate_changed_literal(enum ast_device_state state, enum ast_devstate_cache cachable, const char *device)
Tells Asterisk the State for Device is changed.
static const float mf_tones[]
Call Parking and Pickup API Includes code and algorithms from the Zapata library.
Generic File Format Support. Should be included by clients of the file handling routines....
int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd)
int ast_stopstream(struct ast_channel *c)
Stops a stream.
int ast_closestream(struct ast_filestream *f)
Closes a stream.
int ast_framehook_list_contains_no_active_of_type(struct ast_framehook_list *framehooks, enum ast_frame_type type)
Determine if a framehook list is free of active framehooks consuming a specific type of frame.
int ast_framehook_attach(struct ast_channel *chan, struct ast_framehook_interface *i)
Attach an framehook onto a channel for frame interception.
ast_framehook_event
These are the types of events that the framehook's event callback can receive.
@ AST_FRAMEHOOK_EVENT_WRITE
@ AST_FRAMEHOOK_EVENT_READ
struct ast_frame * ast_framehook_list_read_event(struct ast_framehook_list *framehooks, struct ast_frame *frame)
This is used by the channel API push a frame read event to a channel's framehook list.
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
int ast_framehook_list_destroy(struct ast_channel *chan)
This is used by the channel API to detach and destroy all framehooks on a channel during channel dest...
void ast_framehook_list_fixup(struct ast_channel *old_chan, struct ast_channel *new_chan)
This is used by the channel API during a masquerade operation to move all mobile framehooks from the ...
int ast_framehook_list_contains_no_active(struct ast_framehook_list *framehooks)
Determine if a framehook list is free of active framehooks or not.
int ast_framehook_list_is_empty(struct ast_framehook_list *framehooks)
Determine if an framehook list is empty or not.
struct ast_frame * ast_framehook_list_write_event(struct ast_framehook_list *framehooks, struct ast_frame *frame)
This is used by the channel API push a frame write event to a channel's framehook list.
#define AST_FRAMEHOOK_INTERFACE_VERSION
static int replace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
globally accessible channel datastores
const struct ast_datastore_info secure_call_info
#define SCOPE_TRACE(__level,...)
struct stasis_message_type * ast_channel_masquerade_type(void)
Message type for when a channel is being masqueraded.
void ast_channel_publish_varset(struct ast_channel *chan, const char *variable, const char *value)
Publish a ast_channel_publish_varset for a channel.
struct stasis_message_type * ast_channel_hold_type(void)
Message type for when a channel is placed on hold.
struct stasis_message_type * ast_channel_dtmf_begin_type(void)
Message type for when DTMF begins on a channel.
void ast_channel_snapshot_invalidate_segment(struct ast_channel *chan, enum ast_channel_snapshot_segment_invalidation segment)
Invalidate a channel snapshot segment from being reused.
void ast_channel_publish_final_snapshot(struct ast_channel *chan)
Send the final channel snapshot for a channel, thus removing it from cache.
void ast_channel_stage_snapshot_done(struct ast_channel *chan)
Clear flag to indicate channel snapshot is being staged, and publish snapshot.
struct stasis_message_type * ast_channel_unhold_type(void)
Message type for when a channel is removed from hold.
struct stasis_message_type * ast_channel_hangup_request_type(void)
Message type for when a hangup is requested on a channel.
struct stasis_message_type * ast_channel_flash_type(void)
Message type for when a hook flash occurs on a channel.
struct stasis_message_type * ast_channel_dtmf_end_type(void)
Message type for when DTMF ends on a channel.
struct stasis_message_type * ast_channel_wink_type(void)
Message type for when a wink occurs on a channel.
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
void ast_channel_publish_blob(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Publish a channel blob message.
void ast_channel_stage_snapshot(struct ast_channel *chan)
Set flag to indicate channel snapshot is being staged.
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CONNECTED
const char * ast_msg_data_get_attribute(struct ast_msg_data *msg, enum ast_msg_data_attribute_type attribute_type)
Get attribute from ast_msg_data.
struct ast_msg_data * ast_msg_data_alloc(enum ast_msg_data_source_type source, struct ast_msg_data_attribute attributes[], size_t count)
Allocates an ast_msg_data structure.
@ AST_MSG_DATA_ATTR_CONTENT_TYPE
@ AST_MSG_DATA_SOURCE_TYPE_UNKNOWN
unsigned int option_dtmfminduration
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
@ AST_GETDATA_INTERRUPTED
@ AST_GETDATA_EMPTY_END_TERMINATED
int ast_app_run_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const char *sub_location, const char *sub_args, int ignore_hangup)
Run a subroutine on a channel, placing an optional second channel into autoservice.
int ast_app_group_update(struct ast_channel *oldchan, struct ast_channel *newchan)
Update all group counting for a channel to a new one.
int ast_app_group_discard(struct ast_channel *chan)
Discard all group counting for a channel.
int ast_app_exec_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const char *sub_args, int ignore_hangup)
Run a subroutine on a channel, placing an optional second channel into autoservice.
#define ast_variable_new(name, value, filename)
Asterisk internal frame definitions.
@ AST_T38_REQUEST_TERMINATE
@ AST_T38_REQUEST_NEGOTIATE
@ AST_FRAME_READ_ACTION_CONNECTED_LINE_MACRO
@ AST_FRAME_READ_ACTION_SEND_TEXT
@ AST_FRAME_READ_ACTION_SEND_TEXT_DATA
#define AST_OPTION_DEVICE_NAME
#define ast_frisolate(fr)
Makes a frame independent of any static storage.
void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
#define ast_frdup(fr)
Copies a frame.
#define AST_OPTION_FORMAT_WRITE
#define AST_OPTION_CC_AGENT_TYPE
#define AST_OPTION_SECURE_MEDIA
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
#define AST_OPTION_FORMAT_READ
#define AST_OPTION_SECURE_SIGNALING
ast_frame_type
Frame types.
@ AST_FRAME_BRIDGE_ACTION_SYNC
@ AST_FRAME_BRIDGE_ACTION
ast_control_frame_type
Internal control frame subtype field values.
@ AST_CONTROL_RECORD_CANCEL
@ AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED
@ AST_CONTROL_STREAM_RESTART
@ AST_CONTROL_STREAM_SUSPEND
@ AST_CONTROL_RADIO_UNKEY
@ AST_CONTROL_STREAM_TOPOLOGY_REQUEST_CHANGE
@ AST_CONTROL_STREAM_REVERSE
@ AST_CONTROL_REDIRECTING
@ AST_CONTROL_TAKEOFFHOOK
@ AST_CONTROL_T38_PARAMETERS
@ AST_CONTROL_READ_ACTION
@ AST_CONTROL_RECORD_STOP
@ AST_CONTROL_PLAYBACK_BEGIN
@ AST_CONTROL_RECORD_MUTE
@ AST_CONTROL_STREAM_STOP
@ AST_CONTROL_STREAM_TOPOLOGY_CHANGED
@ AST_CONTROL_CONNECTED_LINE
@ AST_CONTROL_STREAM_FORWARD
@ AST_CONTROL_RECORD_SUSPEND
@ AST_CONTROL_MASQUERADE_NOTIFY
@ AST_CONTROL_PVT_CAUSE_CODE
@ AST_CONTROL_UPDATE_RTP_PEER
struct ast_frame ast_null_frame
#define ast_debug(level,...)
Log a DEBUG message.
void ast_log_callid(int level, const char *file, int line, const char *function, ast_callid callid, const char *fmt,...)
Used for sending a log message with a known call_id This is a modified logger function which is funct...
#define ast_verb(level,...)
static struct ast_tone_zone_sound * ast_tone_zone_sound_unref(struct ast_tone_zone_sound *ts)
Release a reference to an ast_tone_zone_sound.
int ast_playtones_start(struct ast_channel *chan, int vol, const char *tonelist, int interruptible)
Start playing a list of tones on a channel.
void ast_playtones_stop(struct ast_channel *chan)
Stop playing tones on a channel.
struct ast_tone_zone_sound * ast_get_indication_tone(const struct ast_tone_zone *zone, const char *indication)
Locate a tone zone sound.
static struct ast_tone_zone * ast_tone_zone_unref(struct ast_tone_zone *tz)
Release a reference to an ast_tone_zone.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_json * ast_json_object_create(void)
Create a new JSON object.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_integer_create(intmax_t value)
Create a JSON integer.
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
AST_JSON_INT_T ast_json_int_t
Primarily used to cast when packing to an "I" type.
A set of macros to manage forward-linked lists.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_LIST_LAST(head)
Returns the last entry contained in a list.
#define AST_RWLIST_TRAVERSE_SAFE_BEGIN
#define AST_LIST_INSERT_LIST_AFTER(head, list, elm, field)
Inserts a whole list after a specific entry in a list.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_RWLIST_HEAD_INIT(head)
Initializes an rwlist head structure.
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
#define AST_RWLIST_REMOVE_HEAD
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
#define AST_RWLIST_HEAD(name, type)
Defines a structure to be used to hold a read/write list of specified type.
#define AST_RWLIST_TRAVERSE
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define AST_RWLIST_INSERT_HEAD
#define AST_RWLIST_INSERT_TAIL
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_APPEND_LIST(head, list, field)
Appends a whole list to the tail of a list.
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
Asterisk locking-related definitions:
#define CHANNEL_DEADLOCK_AVOIDANCE(chan)
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
#define SCOPED_LOCK(varname, lock, lockfunc, unlockfunc)
Scoped Locks.
#define SCOPED_MUTEX(varname, lock)
scoped lock specialization for mutexes
#define AST_MUTEX_DEFINE_STATIC(mutex)
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define ast_manager_event(chan, category, event, contents,...)
int ast_max_forwards_decrement(struct ast_channel *chan)
Decrement the max forwards count for a particular channel.
Out-of-call text message support.
#define ast_opt_transcode_via_slin
#define ast_opt_generic_plc_on_equal_codecs
#define ast_opt_generic_plc
char ast_defaultlanguage[]
#define ast_opt_transmit_silence
Asterisk file paths, configured in asterisk.conf.
Core PBX routines and definitions.
void ast_pbx_hangup_handler_destroy(struct ast_channel *chan)
Destroy the hangup handler container on a channel.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name.
int ast_func_read2(struct ast_channel *chan, const char *function, struct ast_str **str, ssize_t maxlen)
executes a read operation on a function
void ast_pbx_hangup_handler_init(struct ast_channel *chan)
Init the hangup handler container on a channel.
int ast_pbx_hangup_handler_run(struct ast_channel *chan)
Run all hangup handlers on the channel.
int ast_func_write(struct ast_channel *chan, const char *function, const char *value)
executes a write operation on a function
int plc_fillin(plc_state_t *s, int16_t amp[], int len)
Fill-in a block of missing audio samples.
int plc_rx(plc_state_t *s, int16_t amp[], int len)
Process a block of received audio samples.
#define ast_poll(a, b, c)
static struct stasis_subscription * sub
Statsd channel stats. Exmaple of how to subscribe to Stasis events.
Say numbers and dates (maybe words one day too)
SAY_EXTERN int(* ast_say_money_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_money_str_full)
SAY_EXTERN int(* ast_say_number_full)(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_number_full)
Same as ast_say_number() with audiofd for received audio and returns 1 on ctrlfd being readable.
SAY_EXTERN int(* ast_say_enumeration_full)(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_enumeration_full)
Same as ast_say_enumeration() with audiofd for received audio and returns 1 on ctrlfd being readable.
SAY_EXTERN int(* ast_say_ordinal_full)(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_ordinal_full)
Same as ast_say_number() with audiofd for received audio and returns 1 on ctrlfd being readable.
SAY_EXTERN int(* ast_say_character_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, enum ast_say_case_sensitivity sensitivity, int audiofd, int ctrlfd) SAY_INIT(ast_say_character_str_full)
SAY_EXTERN int(* ast_say_digit_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_digit_str_full)
Same as ast_say_digit_str() with audiofd for received audio and returns 1 on ctrlfd being readable.
ast_say_case_sensitivity
Controls how ast_say_character_str denotes the case of characters in a string.
SAY_EXTERN int(* ast_say_phonetic_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_phonetic_str_full)
Scheduler Routines (derived from cheops)
void ast_sched_context_destroy(struct ast_sched_context *c)
destroys a schedule context
struct ast_sched_context * ast_sched_context_create(void)
Create a scheduler context.
A machine to gather up arbitrary frames and convert them to raw slinear on demand.
int ast_stasis_channels_init(void)
Initialize the stasis channel topic and message types.
struct ast_stream_topology * ast_stream_topology_alloc(void)
Create a stream topology.
int ast_stream_get_position(const struct ast_stream *stream)
Get the position of the stream in the topology.
const char * ast_stream_topology_to_str(const struct ast_stream_topology *topology, struct ast_str **buf)
Get a string representing the topology for debugging/display purposes.
struct ast_stream * ast_stream_topology_get_stream(const struct ast_stream_topology *topology, unsigned int position)
Get a specific stream from the topology.
int ast_stream_topology_get_count(const struct ast_stream_topology *topology)
Get the number of streams in a topology.
enum ast_media_type ast_stream_get_type(const struct ast_stream *stream)
Get the media type of a stream.
void ast_stream_topology_free(struct ast_stream_topology *topology)
Unreference and destroy a stream topology.
struct ast_stream_topology * ast_stream_topology_create_from_format_cap(struct ast_format_cap *cap)
A helper function that, given a format capabilities structure, creates a topology and separates the m...
struct ast_format_cap * ast_stream_topology_get_formats(struct ast_stream_topology *topology)
Create a format capabilities structure representing the topology.
int ast_stream_topology_equal(const struct ast_stream_topology *left, const struct ast_stream_topology *right)
Compare two stream topologies to see if they are equal.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_tmp(init_len, __expr)
Provides a temporary ast_str and returns a copy of its buffer.
#define ast_str_alloca(init_len)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
char * ast_trim_blanks(char *str)
Trims trailing whitespace characters from a string.
char *attribute_pure ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static int force_inline attribute_pure ast_begins_with(const char *str, const char *prefix)
Checks whether a string begins with another.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
char *attribute_pure ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Structure to pass both assignedid values to channel drivers.
Structure that contains information regarding a channel in a bridge.
struct ast_channel * chan
Structure that contains features information.
Structure that contains information about a bridge.
Helper struct for initializing additional channel information on channel creation.
Structure to describe a channel "technology", ie a channel driver See for examples:
int(*const write)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format (see frame.h)
struct ast_frame *(*const read)(struct ast_channel *chan)
Read a frame (or chain of frames from the same stream), in standard format (see frame....
int(*const write_stream)(struct ast_channel *chan, int stream_num, struct ast_frame *frame)
Write a frame on a specific stream, in standard format (see frame.h)
struct ast_frame *(*const read_stream)(struct ast_channel *chan)
Read a frame (or chain of frames from the same stream), in standard format (see frame....
int(*const indicate)(struct ast_channel *c, int condition, const void *data, size_t datalen)
Indicate a particular condition (e.g. AST_CONTROL_BUSY or AST_CONTROL_RINGING or AST_CONTROL_CONGESTI...
int(*const send_text)(struct ast_channel *chan, const char *text)
Display or transmit text.
int(*const write_text)(struct ast_channel *chan, struct ast_frame *frame)
Write a text frame, in standard format.
int(*const call)(struct ast_channel *chan, const char *addr, int timeout)
Make a call.
enum ast_bridge_result(*const early_bridge)(struct ast_channel *c0, struct ast_channel *c1)
Bridge two channels of the same type together (early)
int(*const send_text_data)(struct ast_channel *chan, struct ast_msg_data *data)
Display or transmit text with data.
int(*const hangup)(struct ast_channel *chan)
Hangup (and possibly destroy) the channel.
int(*const queryoption)(struct ast_channel *chan, int option, void *data, int *datalen)
Query a given option. Called with chan locked.
int(*const setoption)(struct ast_channel *chan, int option, void *data, int datalen)
Set a given option. Called with chan locked.
int(*const answer)(struct ast_channel *chan)
Answer the channel.
const char *const description
int(* pre_call)(struct ast_channel *chan, const char *sub_args)
Execute a Gosub call on the channel in a technology specific way before a call is placed.
int(*const send_digit_end)(struct ast_channel *chan, char digit, unsigned int duration)
Stop sending a literal DTMF digit.
int(*const transfer)(struct ast_channel *chan, const char *newdest)
Blind transfer other side (see app_transfer.c and ast_transfer()
int(*const write_video)(struct ast_channel *chan, struct ast_frame *frame)
Write a frame, in standard format.
struct ast_frame *(*const exception)(struct ast_channel *chan)
Handle an exception, reading a frame.
int(*const send_html)(struct ast_channel *chan, int subclass, const char *data, int len)
Send HTML data.
int(*const answer_with_stream_topology)(struct ast_channel *chan, struct ast_stream_topology *topology)
Answer the channel with topology.
Main Channel structure associated with a channel.
struct ast_channel_id uniqueid
struct ast_party_connected_line connected
Channel Connected Line ID information.
char exten[AST_MAX_EXTENSION]
const struct ast_channel_tech * tech
struct ast_endpoint * endpoint
struct ast_format * writeformat
struct ast_party_redirecting redirecting
Redirecting/Diversion information.
struct ast_party_dialed dialed
Dialed/Called information.
char context[AST_MAX_CONTEXT]
struct ast_format * readformat
struct ast_party_caller caller
Channel Caller ID information.
descriptor for a cli entry.
unsigned int emulate_sip_cause
char chan_name[AST_CHANNEL_NAME]
enum ast_frame_read_action action
enum ast_control_t38 request_response
Structure for a data store type.
void *(* duplicate)(void *data)
void(* chan_fixup)(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
Fix up channel references on the masquerading channel.
void(* chan_breakdown)(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
Fix up channel references on the channel being masqueraded into.
Structure for a data store object.
const struct ast_datastore_info * info
struct ast_datastore::@227 entry
struct ast_format * format
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
enum ast_frame_type frametype
union ast_frame::@239 data
void(* digit)(struct ast_channel *chan, char digit)
int(* generate)(struct ast_channel *chan, void *data, int len, int samples)
void *(* alloc)(struct ast_channel *chan, void *params)
void(* release)(struct ast_channel *chan, void *data)
void(* write_format_change)(struct ast_channel *chan, void *data)
Abstract JSON element (object, array, string, int, ...).
enum ast_msg_data_attribute_type type
Structure used to transport a message through the frame core.
Caller Party information.
struct ast_party_id priv
Private caller party ID.
struct ast_party_id id
Caller party ID.
int ani2
Automatic Number Identification 2 (Info Digits)
struct ast_party_id ani
Automatic Number Identification (ANI)
Connected Line/Party information.
int source
Information about the source of an update.
struct ast_party_id priv
Private connected party ID.
struct ast_party_id id
Connected party ID.
int ani2
Automatic Number Identification 2 (Info Digits)
struct ast_party_id ani
Automatic Number Identification (ANI)
Dialed/Called Party information.
struct ast_party_subaddress subaddress
Dialed/Called subaddress.
char * str
Subscriber phone number (Malloced)
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
struct ast_party_dialed::@221 number
Dialed/Called number.
int transit_network_select
Transit Network Select.
struct ast_party_subaddress_ies subaddress
Subscriber subaddress ies.
struct ast_party_name_ies name
Subscriber name ies.
int combined_presentation
Combined name and number presentation ie.
struct ast_party_number_ies number
Subscriber phone number ies.
int tag
User party id tag ie.
Information needed to identify an endpoint in a call.
struct ast_party_subaddress subaddress
Subscriber subaddress.
char * tag
User-set "tag".
struct ast_party_name name
Subscriber name.
struct ast_party_number number
Subscriber phone number.
int char_set
Character set ie.
int presentation
presentation-indicator ie
int str
Subscriber name ie.
int valid
valid/present ie
Information needed to specify a name in a call.
int char_set
Character set the name is using.
int presentation
Q.931 encoded presentation-indicator encoded field.
unsigned char valid
TRUE if the name information is valid/present.
char * str
Subscriber name (Malloced)
int presentation
presentation-indicator ie
int str
Subscriber phone number ie.
int valid
valid/present ie
int plan
Type-Of-Number and Numbering-Plan ie.
Information needed to specify a number in a call.
int presentation
Q.931 presentation-indicator and screening-indicator encoded fields.
unsigned char valid
TRUE if the number information is valid/present.
char * str
Subscriber phone number (Malloced)
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
Redirecting reason information.
int code
enum AST_REDIRECTING_REASON value for redirection
char * str
a string value for the redirecting reason
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
struct ast_party_id priv_to
Call is redirecting to a new party (Sent to the caller) - private representation.
struct ast_party_redirecting_reason orig_reason
Reason for the redirection by the original party.
struct ast_party_redirecting_reason reason
Reason for the redirection.
struct ast_party_id priv_from
Who is redirecting the call (Sent to the party the call is redirected toward) - private representatio...
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
int count
Number of times the call was redirected.
struct ast_party_id to
Call is redirecting to a new party (Sent to the caller)
struct ast_party_id orig
Who originally redirected the call (Sent to the party the call is redirected toward)
struct ast_party_id priv_orig
Who originally redirected the call (Sent to the party the call is redirected toward) - private repres...
int odd_even_indicator
odd/even indicator ie
int valid
valid/present ie
int type
subaddress type ie
Information needed to specify a subaddress in a call.
unsigned char odd_even_indicator
TRUE if odd number of address signals.
unsigned char valid
TRUE if the subaddress information is valid/present.
char * str
Malloced subaddress string.
int type
Q.931 subaddress type.
Indicate what information in ast_party_caller should be set.
Indicate what information in ast_party_connected_line should be set.
Indicate what information in ast_party_id should be set.
Indicate what information in ast_party_redirecting should be set.
struct ast_format * old_write_format
Support for dynamic strings.
const char * data
Description of a tone.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
struct ast_var_t::@224 entries
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
the list of registered channel types
map AST_CAUSE's to readable string representations
struct chanlist::@352 list
struct ast_channel * chan
const struct ast_channel_tech * tech
List of channel variables to append to all channel-related events.
struct manager_channel_variable::@353 entry
Named group member structure.
struct ast_variable * vars
int connect_on_early_media
struct ast_channel * parent_channel
enum ast_frame_type frametype
unsigned char offset[AST_FRIENDLY_OFFSET]
struct ast_format * origwfmt
#define ast_test_suite_event_notify(s, f,...)
static const struct ast_aeap_message_handler handlers[]
Definitions to aid in the use of thread local storage.
int ast_threadstorage_set_ptr(struct ast_threadstorage *ts, void *ptr)
Set a raw pointer from threadstorage.
void * ast_threadstorage_get_ptr(struct ast_threadstorage *ts)
Retrieve a raw pointer from threadstorage.
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
#define AST_THREADSTORAGE_RAW(name)
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
int ast_tvcmp(struct timeval _a, struct timeval _b)
Compress two struct timeval instances returning -1, 0, 1 if the first arg is smaller,...
int ast_remaining_ms(struct timeval start, int max_ms)
Calculate remaining milliseconds given a starting timestamp and upper bound.
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
struct timeval ast_tvsub(struct timeval a, struct timeval b)
Returns the difference of two timevals a - b.
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Timing source management.
unsigned int ast_timer_get_max_rate(const struct ast_timer *handle)
Get maximum rate supported for a timer.
void ast_timer_close(struct ast_timer *handle)
Close an opened timing handle.
int ast_timer_ack(const struct ast_timer *handle, unsigned int quantity)
Acknowledge a timer event.
int ast_timer_set_rate(const struct ast_timer *handle, unsigned int rate)
Set the timing tick rate.
enum ast_timer_event ast_timer_get_event(const struct ast_timer *handle)
Retrieve timing event.
int ast_timer_enable_continuous(const struct ast_timer *handle)
Enable continuous mode.
const char * ast_timer_get_name(const struct ast_timer *handle)
Get name of timer in use.
int ast_timer_disable_continuous(const struct ast_timer *handle)
Disable continuous mode.
struct ast_timer * ast_timer_open(void)
Open a timer.
@ AST_TIMING_EVENT_CONTINUOUS
@ AST_TIMING_EVENT_EXPIRED
int ast_timer_fd(const struct ast_timer *handle)
Get a poll()-able file descriptor for a timer.
General Asterisk channel transcoding definitions.
#define AST_TRANS_CAP_RESTRICTED_DIGITAL
#define AST_TRANS_CAP_DIGITAL
#define AST_TRANS_CAP_DIGITAL_W_TONES
#define AST_TRANS_CAP_SPEECH
#define AST_TRANS_CAP_3_1K_AUDIO
#define AST_TRANS_CAP_VIDEO
Support for translation of data formats. translate.c.
struct ast_frame * ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, int consume)
translates one or more frames Apply an input frame into the translator and receive zero or one output...
int ast_translator_best_choice(struct ast_format_cap *dst_cap, struct ast_format_cap *src_cap, struct ast_format **dst_fmt_out, struct ast_format **src_fmt_out)
Chooses the best translation path.
void ast_translator_free_path(struct ast_trans_pvt *tr)
Frees a translator path Frees the given translator path structure.
struct ast_trans_pvt * ast_translator_build_path(struct ast_format *dest, struct ast_format *source)
Builds a translator path Build a path (possibly NULL) from source to dest.
unsigned int ast_translate_path_steps(struct ast_format *dest, struct ast_format *src)
Returns the number of steps required to convert from 'src' to 'dest'.
#define ast_test_flag(p, flag)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
int ast_get_tid(void)
Get current thread ID.
#define ast_clear_flag(p, flag)
#define ast_set_flag(p, flag)