197 ast_log(
LOG_WARNING,
"Syntax: REALTIME(family,fieldmatch[,matchvalue[,delim1[,delim2]]]) - missing argument!\n");
222 resultslen += strlen(
var->name) + strlen(
var->value);
224 resultslen += n * (strlen(
args.delim1) + strlen(
args.delim2)) + 1;
226 if (resultslen >
len) {
227 ast_log(
LOG_WARNING,
"Failed to fetch. Realtime data is too large: need %zu, have %zu.\n", resultslen,
len);
260 ast_log(
LOG_WARNING,
"Syntax: %s(family,fieldmatch,matchvalue,updatecol) - missing argument!\n", cmd);
267 ast_log(
LOG_WARNING,
"Syntax: %s(family,fieldmatch,matchvalue,updatecol) - missing argument!\n", cmd);
278 ast_log(
LOG_WARNING,
"Failed to update. Check the debug log for possible data repository related entries.\n");
295 enum { rtfield, rthash } which;
303 if (!strcmp(cmd,
"REALTIME_FIELD")) {
310 ast_log(
LOG_WARNING,
"Syntax: %s(family,fieldmatch,matchvalue%s) - missing argument!\n", cmd, which == rtfield ?
",fieldname" :
"");
316 if ((which == rtfield &&
args.argc != 4) || (which == rthash &&
args.argc != 3)) {
317 ast_log(
LOG_WARNING,
"Syntax: %s(family,fieldmatch,matchvalue%s) - missing argument!\n", cmd, which == rtfield ?
",fieldname" :
"");
336 if (which == rtfield) {
338 if (!strcasecmp(
var->name,
args.fieldname)) {
343 }
else if (which == rthash) {
344 ast_debug(1,
"Setting hash key %s to value %s\n",
var->name,
var->value);
352 if (which == rthash) {
379 ast_log(
LOG_WARNING,
"Syntax: REALTIME_STORE(family,field1,field2,...,field30) - missing argument!\n");
391 a.f[0], v.v[0],
a.f[1], v.v[1],
a.f[2], v.v[2],
a.f[3], v.v[3],
a.f[4], v.v[4],
392 a.f[5], v.v[5],
a.f[6], v.v[6],
a.f[7], v.v[7],
a.f[8], v.v[8],
a.f[9], v.v[9],
393 a.f[10], v.v[10],
a.f[11], v.v[11],
a.f[12], v.v[12],
a.f[13], v.v[13],
a.f[14], v.v[14],
394 a.f[15], v.v[15],
a.f[16], v.v[16],
a.f[17], v.v[17],
a.f[18], v.v[18],
a.f[19], v.v[19],
395 a.f[20], v.v[20],
a.f[21], v.v[21],
a.f[22], v.v[22],
a.f[23], v.v[23],
a.f[24], v.v[24],
396 a.f[25], v.v[25],
a.f[26], v.v[26],
a.f[27], v.v[27],
a.f[28], v.v[28],
a.f[29], v.v[29],
SENTINEL
400 ast_log(
LOG_WARNING,
"Failed to store. Check the debug log for possible data repository related entries.\n");
402 snprintf(storeid,
sizeof(storeid),
"%d", res);
427 ast_log(
LOG_WARNING,
"Syntax: REALTIME_DESTROY(family,fieldmatch[,matchvalue[,delim1[,delim2]]]) - missing argument!\n");
453 resultslen += strlen(
var->name) + strlen(
var->value);
456 resultslen += n * (strlen(
args.delim1) + strlen(
args.delim2)) + 1;
458 if (resultslen >
len) {
463 ast_log(
LOG_WARNING,
"Failed to fetch/destroy. Realtime data is too large: need %zu, have %zu.\n", resultslen,
len);
504 .
name =
"REALTIME_FIELD",
510 .
name =
"REALTIME_HASH",
515 .
name =
"REALTIME_STORE",
520 .
name =
"REALTIME_DESTROY",
struct sla_ringing_trunk * first
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
General Asterisk PBX channel definitions.
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
int ast_autoservice_start(struct ast_channel *chan)
Automatically service a channel for us...
Generic File Format Support. Should be included by clients of the file handling routines....
static struct ast_threadstorage buf2
static int function_realtime_writedestroy(struct ast_channel *chan, const char *cmd, char *data, const char *value)
Wrapper to execute REALTIME_DESTROY from a write operation. Allows execution even if live_dangerously...
static int function_realtime_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static struct ast_custom_function realtime_store_function
static struct ast_custom_function realtime_destroy_function
static struct ast_threadstorage buf3
static struct ast_custom_function realtimehash_function
static int realtimefield_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int function_realtime_readdestroy(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int function_realtime_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int load_module(void)
static struct ast_custom_function realtime_function
static int unload_module(void)
static int function_realtime_store(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static struct ast_threadstorage buf1
static struct ast_custom_function realtimefield_function
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Configuration File Parser.
struct ast_variable * ast_load_realtime_all(const char *family,...) attribute_sentinel
int ast_destroy_realtime(const char *family, const char *keyfield, const char *lookup,...) attribute_sentinel
Destroy realtime configuration.
int ast_update_realtime(const char *family, const char *keyfield, const char *lookup,...) attribute_sentinel
Update realtime configuration.
int ast_store_realtime(const char *family,...) attribute_sentinel
Create realtime configuration.
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
#define ast_debug(level,...)
Log a DEBUG message.
Asterisk locking-related definitions:
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Core PBX routines and definitions.
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.
#define ast_custom_function_register_escalating(acf, escalation)
Register a custom function which requires escalated privileges.
#define ast_custom_function_register(acf)
Register a custom function.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
char * ast_str_set_escapecommas(struct ast_str **buf, ssize_t maxlen, const char *src, size_t maxsrc)
Set a dynamic string to a non-NULL terminated substring, with escaping of commas.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_alloca(init_len)
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
struct ast_str * ast_str_thread_get(struct ast_threadstorage *ts, size_t init_len)
Retrieve a thread locally stored dynamic string.
Main Channel structure associated with a channel.
Data structure associated with a custom dialplan function.
Support for dynamic strings.
Structure for variables, used for configurations and for channel variables.
#define AST_THREADSTORAGE(name)
Define a thread storage variable.