463 sprintf(varsubst,
"${%s}",
args.varname);
469 while (
strsep(&varval, delim)) {
479 snprintf(buf, len,
"%d", fieldcount);
506 char *varsubst, *field;
508 int fieldindex = 0, res = 0;
524 ast_log(
LOG_ERROR,
"Usage: FIELDNUM(<listname>,<delimiter>,<fieldvalue>)\n");
528 sprintf(varsubst,
"${%s}",
args.varname);
539 while ((field =
strsep(&varval, delim)) !=
NULL) {
542 if (!strcasecmp(field,
args.field)) {
558 snprintf(buf, len,
"%d", fieldindex);
590 const char *begin, *cur, *next;
591 int dlen, flen,
first = 1;
593 char *delim, *varsubst;
607 ast_log(
LOG_ERROR,
"Usage: LISTFILTER(<listname>,<delimiter>,<fieldvalue>)\n");
612 sprintf(varsubst,
"${%s}",
args.listname);
639 dlen = strlen(
args.delimiter);
643 if ((dlen = strlen(delim)) == 0) {
648 flen = strlen(
args.fieldvalue);
657 next = strstr(begin, delim);
663 next = strstr(cur + dlen, delim);
665 cur = strchr(begin + dlen,
'\0');
668 if (flen == cur - begin && !strncmp(begin,
args.fieldvalue, flen)) {
670 begin += flen + dlen;
681 }
while (*cur !=
'\0');
704 .
name =
"LISTFILTER",
718 char allowed[256] =
"";
719 size_t allowedlen = 0;
730 ast_log(
LOG_WARNING,
"FILTER allowed characters includes the quote (\") character. This may not be what you want.\n");
734 for (; *(
args.allowed);) {
740 args.allowed += consumed;
742 if (*(
args.allowed) ==
'-') {
745 args.allowed += consumed + 1;
748 ast_log(
LOG_WARNING,
"Range wrapping in FILTER(%s,%s). This may not be what you want.\n", parse,
args.string);
755 for (ac = (
unsigned char) c1; ac != (
unsigned char) c2; ac++) {
756 bitfield[ac / 32] |= 1 << (ac % 32);
758 bitfield[ac / 32] |= 1 << (ac % 32);
762 ac = (
unsigned char) c1;
763 ast_debug(4,
"c1=%d, consumed=%d, args.allowed=%s\n", c1, (
int) consumed,
args.allowed - consumed);
764 bitfield[ac / 32] |= 1 << (ac % 32);
768 for (ac = 1; ac != 0; ac++) {
769 if (bitfield[ac / 32] & (1 << (ac % 32))) {
770 allowed[allowedlen++] = ac;
776 for (; *(
args.string) && (buf + len - 1 > outbuf); (
args.string)++) {
777 if (strchr(allowed, *(
args.string)))
778 *outbuf++ = *(
args.string);
797 char *strptr, *varsubst;
810 ast_log(
LOG_ERROR,
"Usage: %s(<varname>,<search-chars>[,<replace-char>])\n", cmd);
819 ast_log(
LOG_ERROR,
"The characters to search for and the variable name must not be empty.\n");
824 sprintf(varsubst,
"${%s}",
args.varname);
833 ast_debug(3,
"Characters to find: (%s)\n", find);
834 ast_debug(3,
"Character to replace with: (%s)\n", replace);
839 if (strchr(find, *strptr)) {
841 memmove(strptr, strptr + 1, strlen(strptr + 1) + 1);
865 unsigned max_matches;
891 "Usage: %s(<varname>,<find-string>[,<replace-string>,[<max-replacements>]])\n",
906 find_size = strlen(
args.find_string);
910 sprintf(varsubstr,
"${%s}",
args.varname);
914 if (!
args.max_replacements
915 || (max_matches = atoi(
args.max_replacements)) <= 0) {
922 for (count = 0; count < max_matches; ++count) {
923 end = strstr(start,
args.find_string);
932 if (
args.replace_string) {
936 start = end + find_size;
944 .
name =
"STRREPLACE",
963 if (
args.argc != 3) {
964 ast_log(
LOG_ERROR,
"Unexpected arguments: should have been in the form '\"<regex>\" <string>'\n");
967 if ((*
args.str ==
' ') || (*
args.str ==
'\t'))
972 if ((errcode = regcomp(®exbuf,
args.reg, REG_EXTENDED | REG_NOSUB))) {
973 regerror(errcode, ®exbuf, buf, len);
978 strcpy(buf, regexec(®exbuf,
args.str, 0,
NULL, 0) ?
"0" :
"1");
990 #define HASH_PREFIX "~HASH~%s~" 991 #define HASH_FORMAT HASH_PREFIX "%s~" 999 int len = strlen(prefix);
1012 snprintf(prefix,
sizeof(prefix),
HASH_PREFIX, data ? (
char *)data :
"null");
1026 char *origvar =
"", *value2, varname[256];
1034 if (!strcmp(cmd,
"HASH")) {
1058 for (i = 0; i < arg1.argc; i++) {
1059 ast_debug(1,
"array set value (%s=%s)\n", arg1.var[i],
1060 S_OR(arg2.val[i],
""));
1061 if (i < arg2.argc) {
1063 if (origvar[0] ==
'_') {
1064 if (origvar[1] ==
'_') {
1065 snprintf(varname,
sizeof(varname),
"__" HASH_FORMAT, origvar + 2, arg1.var[i]);
1067 snprintf(varname,
sizeof(varname),
"_" HASH_FORMAT, origvar + 1, arg1.var[i]);
1070 snprintf(varname,
sizeof(varname),
HASH_FORMAT, origvar, arg1.var[i]);
1081 snprintf(varname,
sizeof(varname),
HASH_FORMAT, origvar, arg1.var[i]);
1104 var_len = strlen(var_name);
1110 return var_len > (prefix_len + 1) && var_name[var_len - 1] ==
'~' &&
1111 strncmp(prefix_name, var_name, prefix_len) == 0 ? var_name + prefix_len :
NULL;
1126 memset(buf, 0, len);
1129 const char *key =
get_key(prefix, newvar);
1132 strncat(buf, key, len - strlen(buf) - 1);
1134 buf[strlen(buf) - 1] =
',';
1138 buf_len = strlen(buf);
1140 buf[buf_len - 1] =
'\0';
1158 const char *key =
get_key(prefix, newvar);
1182 if (!strchr(var,
',')) {
1184 return array(chan,
"HASH", var, value);
1188 if (arg.hashname[0] ==
'_') {
1189 if (arg.hashname[1] ==
'_') {
1190 snprintf(varname,
sizeof(varname),
"__" HASH_FORMAT, arg.hashname + 2, arg.hashkey);
1192 snprintf(varname,
sizeof(varname),
"_" HASH_FORMAT, arg.hashname + 1, arg.hashkey);
1195 snprintf(varname,
sizeof(varname),
HASH_FORMAT, arg.hashname, arg.hashkey);
1205 const char *varvalue;
1212 if (arg.argc == 2) {
1213 snprintf(varname,
sizeof(varname),
HASH_FORMAT, arg.hashname, arg.hashkey);
1219 }
else if (arg.argc == 1) {
1220 char colnames[4096];
1227 ast_log(
LOG_WARNING,
"No channel and only 1 parameter was provided to %s function.\n", cmd);
1232 hashkeys_read(chan,
"HASHKEYS", arg.hashname, colnames,
sizeof(colnames));
1239 for (i = 0; i < arg2.argc; i++) {
1240 snprintf(varname,
sizeof(varname),
HASH_FORMAT, arg.hashname, arg2.col[i]);
1242 strncat(buf, varvalue, len - strlen(buf) - 1);
1243 strncat(buf,
",", len - strlen(buf) - 1);
1247 buf[strlen(buf) - 1] =
'\0';
1272 char *bufptr =
buf, *dataptr = data;
1286 for (; bufptr < buf + len - 3; dataptr++) {
1287 if (*dataptr ==
'\\') {
1290 }
else if (*dataptr ==
'"') {
1293 }
else if (*dataptr ==
'\0') {
1296 *bufptr++ = *dataptr;
1311 char *bufptr =
buf, *dataptr = data;
1324 for (; bufptr < buf + len - 3; dataptr++){
1325 if (*dataptr ==
'"') {
1328 }
else if (*dataptr ==
'\0') {
1331 *bufptr++ = *dataptr;
1340 .
name =
"CSV_QUOTE",
1349 length = strlen(data);
1351 snprintf(buf, buflen,
"%d", length);
1363 char *
buf,
size_t buflen)
1370 struct timeval when;
1386 buf[buflen - 1] =
'\0';
1397 char *
buf,
size_t buflen)
1410 "Asterisk function STRPTIME() requires an argument.\n");
1418 "No format supplied to STRPTIME(<timestring>,<timezone>,<format>)");
1425 struct timeval when;
1427 snprintf(buf, buflen,
"%d", (
int) when.tv_sec);
1439 char *
buf,
size_t buflen)
1472 char *bufptr, *dataptr;
1474 for (bufptr = buf, dataptr = data; bufptr < buf + buflen - 1; dataptr++) {
1475 if (*dataptr ==
'\0') {
1478 }
else if (*dataptr ==
'1') {
1480 }
else if (strchr(
"AaBbCc2", *dataptr)) {
1482 }
else if (strchr(
"DdEeFf3", *dataptr)) {
1484 }
else if (strchr(
"GgHhIi4", *dataptr)) {
1486 }
else if (strchr(
"JjKkLl5", *dataptr)) {
1488 }
else if (strchr(
"MmNnOo6", *dataptr)) {
1490 }
else if (strchr(
"PpQqRrSs7", *dataptr)) {
1492 }
else if (strchr(
"TtUuVv8", *dataptr)) {
1494 }
else if (strchr(
"WwXxYyZz9", *dataptr)) {
1496 }
else if (*dataptr ==
'0') {
1500 buf[buflen - 1] =
'\0';
1506 .
name =
"KEYPADHASH",
1512 char *bufptr =
buf, *dataptr = data;
1514 while ((bufptr < buf + buflen - 1) && (*bufptr++ = toupper(*dataptr++)));
1521 char *bufptr, *dataptr = data;
1541 char *bufptr =
buf, *dataptr = data;
1543 while ((bufptr < buf + buflen - 1) && (*bufptr++ = tolower(*dataptr++)));
1550 char *bufptr, *dataptr = data;
1570 #define beginning (cmd[0] == 'S') 1571 char *after, delimiter[2] =
",", *varsubst;
1574 char *(*search_func)(
const char *s,
int c) = (
beginning ? strchr : strrchr);
1592 sprintf(varsubst,
"${%s}",
args.var);
1604 if (!(after = search_func(
ast_str_buffer(before), delimiter[0]))) {
1630 #define beginning (cmd[0] == 'U') 1631 char delimiter[2] =
",", *varsubst;
1638 const char *stripped_var;
1662 stripped_var =
args.var +
MIN(strspn(
args.var,
"_"), 2);
1663 varsubst =
ast_alloca(strlen(stripped_var) + 4);
1664 sprintf(varsubst,
"${%s}", stripped_var);
1703 #ifdef TEST_FRAMEWORK 1709 char expression[256];
1714 const char *expected;
1716 {
"abc,def,ghi,jkl",
"\\,",
"ghi",
"3"},
1717 {
"abc def ghi jkl",
" ",
"abc",
"1"},
1718 {
"abc/def/ghi/jkl",
"\\\\x2f",
"def",
"2"},
1719 {
"abc$def$ghi$jkl",
"",
"ghi",
"0"},
1720 {
"abc,def,ghi,jkl",
"-",
"",
"0"},
1721 {
"abc-def-ghi-jkl",
"-",
"mno",
"0"}
1726 info->name =
"func_FIELDNUM_test";
1727 info->category =
"/funcs/func_strings/";
1728 info->summary =
"Test FIELDNUM function";
1729 info->description =
"Verify FIELDNUM behavior";
1746 for (i = 0; i <
ARRAY_LEN(test_args); i++) {
1756 snprintf(expression,
sizeof(expression),
"${FIELDNUM(%s,%s,%s)}", var->
name, test_args[i].delim, test_args[i].field);
1781 char expression[256];
1784 const char *find_chars;
1785 const char *replace_char;
1786 const char *expected;
1788 {
"abc,def",
"\\,",
"-",
"abc-def"},
1789 {
"abc,abc",
"bc",
"a",
"aaa,aaa"},
1790 {
"abc,def",
"x",
"?",
"abc,def"},
1791 {
"abc,def",
"\\,",
"",
"abcdef"}
1796 info->name =
"func_REPLACE_test";
1797 info->category =
"/funcs/func_strings/";
1798 info->summary =
"Test REPLACE function";
1799 info->description =
"Verify REPLACE behavior";
1816 for (i = 0; i <
ARRAY_LEN(test_args); i++) {
1826 snprintf(expression,
sizeof(expression),
"${REPLACE(%s,%s,%s)}", var->
name, test_args[i].find_chars, test_args[i].replace_char);
1852 {
"\\x41-R",
"DAHDI"},
1853 {
"0-9A-Ca-c",
"0042133333A12212"},
1854 {
"0-9a-cA-C_+\\-",
"0042133333A12212"},
1860 info->name =
"func_FILTER_test";
1861 info->category =
"/funcs/func_strings/";
1862 info->summary =
"Test FILTER function";
1863 info->description =
"Verify FILTER behavior";
1869 for (i = 0; test_strings[i][0]; i++) {
1870 char tmp[256], tmp2[256] =
"";
1871 snprintf(tmp,
sizeof(tmp),
"${FILTER(%s,0042133333&DAHDI/g1/2212)}", test_strings[i][0]);
1873 if (strcmp(test_strings[i][1], tmp2)) {
1874 ast_test_status_update(
test,
"Format string '%s' substituted to '%s'. Expected '%s'.\n", test_strings[i][0], tmp2, test_strings[i][1]);
1888 {
"Weasels have eaten my telephone system",
"have eaten my",
"are eating our",
"",
"Weasels are eating our telephone system"},
1889 {
"Did you know twenty plus two is twenty-two?",
"twenty",
"thirty",
NULL,
"Did you know thirty plus two is thirty-two?"},
1890 {
"foofoofoofoofoofoofoo",
"foofoo",
"bar",
NULL,
"barbarbarfoo"},
1891 {
"My pet dog once ate a dog who sat on a dog while eating a corndog.",
"dog",
"cat",
"3",
"My pet cat once ate a cat who sat on a cat while eating a corndog."},
1892 {
"One and one and one is three",
"and",
"plus",
"1",
"One plus one and one is three"},
1893 {
"",
"fhqwagads",
"spelunker",
NULL,
""},
1894 {
"Part of this string is missing.",
"missing",
NULL,
NULL,
"Part of this string is ."},
1895 {
"'Accidentally' left off a bunch of stuff.",
NULL,
NULL,
NULL,
""},
1896 {
"This test will also error.",
"",
"",
"",
""},
1897 {
"This is an \"escape character\" test.",
"\\\"escape character\\\"",
"evil",
NULL,
"This is an evil test."}
1902 info->name =
"func_STRREPLACE_test";
1903 info->category =
"/funcs/func_strings/";
1904 info->summary =
"Test STRREPLACE function";
1905 info->description =
"Verify STRREPLACE behavior";
1922 for (i = 0; i <
ARRAY_LEN(test_strings); i++) {
1923 char tmp[512], tmp2[512] =
"";
1935 if (test_strings[i][3]) {
1936 snprintf(tmp,
sizeof(tmp),
"${STRREPLACE(%s,%s,%s,%s)}",
"test_string", test_strings[i][1], test_strings[i][2], test_strings[i][3]);
1937 }
else if (test_strings[i][2]) {
1938 snprintf(tmp,
sizeof(tmp),
"${STRREPLACE(%s,%s,%s)}",
"test_string", test_strings[i][1], test_strings[i][2]);
1939 }
else if (test_strings[i][1]) {
1940 snprintf(tmp,
sizeof(tmp),
"${STRREPLACE(%s,%s)}",
"test_string", test_strings[i][1]);
1942 snprintf(tmp,
sizeof(tmp),
"${STRREPLACE(%s)}",
"test_string");
1946 ast_test_status_update(
test,
"Format string '%s' substituted to '%s'. Expected '%s'.\n", test_strings[i][0], tmp2, test_strings[i][4]);
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
static int function_fieldqty(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
static struct ast_custom_function hashkeys_function
static const char * get_key(const struct ast_str *prefix, const struct ast_var_t *var)
static int hash_write(struct ast_channel *chan, const char *cmd, char *var, const char *value)
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
static struct ast_custom_function len_function
static int strreplace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
#define AST_MODULE_INFO_STANDARD(keystr, desc)
static int load_module(void)
Asterisk main include file. File version handling, generic pbx functions.
static int acf_strptime(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static struct ast_custom_function shift_function
static int listfilter_read(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
char * ast_get_encoded_str(const char *stream, char *result, size_t result_len)
Decode a stream of encoded control or extended ASCII characters.
static int function_fieldqty_helper(struct ast_channel *chan, const char *cmd, char *parse, char *buf, struct ast_str **sbuf, ssize_t len)
static int function_fieldnum(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
static struct ast_custom_function strftime_function
static int acf_strftime(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t buflen)
size_t ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
static struct ast_custom_function passthru_function
struct ast_channel * ast_channel_release(struct ast_channel *chan)
Unlink and release reference to a channel.
const char * ast_var_name(const struct ast_var_t *var)
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define ast_str_make_space(buf, new_len)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static void clearvar_prefix(struct ast_channel *chan, const char *prefix)
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
#define AST_TEST_REGISTER(cb)
#define AST_STANDARD_RAW_ARGS(args, parse)
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
static struct ast_custom_function eval_function
static struct ast_custom_function fieldnum_function
#define ast_str_alloca(init_len)
static struct ast_custom_function push_function
static struct ast_custom_function unshift_function
struct varshead * ast_channel_varshead(struct ast_channel *chan)
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
int ast_get_timeval(const char *src, struct timeval *tv, struct timeval _default, int *consumed)
get values from config variables.
int ast_unregister_application(const char *app)
Unregister an application.
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
static int hashkeys_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int string_toupper2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t buflen)
static int string_tolower2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t buflen)
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
static int hashkeys_read2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
char * ast_str_truncate(struct ast_str *buf, ssize_t len)
Truncates the enclosed string to the given length.
#define ast_strlen_zero(foo)
static struct ast_custom_function replace_function
Custom localtime functions for multiple timezones.
static struct ast_custom_function quote_function
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
#define ast_opt_dont_warn
#define ast_debug(level,...)
Log a DEBUG message.
static int function_eval(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static struct ast_threadstorage tmp_buf
AST_TEST_DEFINE(test_FIELDNUM)
static int exec_clearhash(struct ast_channel *chan, const char *data)
General Asterisk PBX channel definitions.
static int quote(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define ast_test_status_update(a, b, c...)
#define ast_dummy_channel_alloc()
Create a fake channel structure.
char * ast_str_append_substr(struct ast_str **buf, ssize_t maxlen, const char *src, size_t maxsrc)
Append a non-NULL terminated substring to the end of a dynamic string.
Data structure associated with a custom dialplan function.
static struct ast_custom_function listfilter_function
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int keypadhash(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static char * app_clearhash
static struct ast_custom_function toupper_function
int ast_get_encoded_char(const char *stream, char *result, size_t *consumed)
Decode an encoded control or extended ASCII character.
static struct ast_custom_function csv_quote_function
Core PBX routines and definitions.
char * ast_strptime(const char *s, const char *format, struct ast_tm *tm)
Special version of strptime(3) which places the answer in the common structure ast_tm. Also, unlike strptime(3), ast_strptime() initializes its memory prior to use.
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
static struct ast_threadstorage result_buf
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
static int string_toupper(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static int listfilter(struct ast_channel *chan, const char *cmd, char *parse, char *buf, struct ast_str **bufstr, ssize_t len)
static struct ast_custom_function filter_function
static int string_tolower(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static struct ast_custom_function regex_function
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static int array(struct ast_channel *chan, const char *cmd, char *var, const char *value)
#define AST_TEST_UNREGISTER(cb)
static int listfilter_read2(struct ast_channel *chan, const char *cmd, char *parse, struct ast_str **buf, ssize_t len)
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
void ast_var_delete(struct ast_var_t *var)
static struct ast_custom_function array_function
static int csv_quote(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
struct sla_ringing_trunk * first
static struct ast_custom_function fieldqty_function
static int unshift_push(struct ast_channel *chan, const char *cmd, char *data, const char *new_value)
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
static struct ast_custom_function keypadhash_function
static int function_fieldnum_str(struct ast_channel *chan, const char *cmd, char *parse, struct ast_str **buf, ssize_t len)
static struct ast_custom_function hash_function
struct ast_var_t::@249 entries
static int regex(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
static int shift_pop(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
#define ast_var_assign(name, value)
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm)
Special version of strftime(3) that handles fractions of a second. Takes the same arguments as strfti...
static struct ast_custom_function pop_function
static int function_fieldnum_helper(struct ast_channel *chan, const char *cmd, char *parse, char *buf, struct ast_str **sbuf, ssize_t len)
static int replace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
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...
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
char * strsep(char **str, const char *delims)
struct timeval ast_mktime(struct ast_tm *const tmp, const char *zone)
Timezone-independent version of mktime(3).
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
void ast_str_update(struct ast_str *buf)
Update the length of the buffer, after using ast_str merely as a buffer.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
static int passthru(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
static struct ast_custom_function tolower_function
static struct ast_custom_function strptime_function
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
static int function_fieldqty_str(struct ast_channel *chan, const char *cmd, char *parse, struct ast_str **buf, ssize_t len)
struct ast_str * ast_str_thread_get(struct ast_threadstorage *ts, size_t init_len)
Retrieve a thread locally stored dynamic string.
static int filter(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static snd_pcm_format_t format
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_custom_function_register(acf)
Register a custom function.
static struct ast_custom_function strreplace_function
static int function_eval2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t buflen)
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
static int unload_module(void)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
static char prefix[MAX_PREFIX]
#define AST_APP_ARG(name)
Define an application argument.
static int hash_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)