80static char *
app =
"StoreDTMF";
106 .
type =
"dtmf_store",
123 data = datastore->
data;
145 char currentdata[512];
147 char *varname =
NULL;
151 if (!f || !framedata) {
165 varname = framedata->
rx_var;
167 varname = framedata->
tx_var;
174 sprintf(varnamesub,
"${%s}", varname);
178 ast_debug(3,
"Creating new digit store: %s\n", varname);
180 len = strlen(currentdata);
186 char newdata[
len + 2];
191 newdata[
len + 1] =
'\0';
192 ast_debug(3,
"Appending to digit store: now %s\n", newdata);
206 .disable_inheritance = 1,
222 if (!strcasecmp(
args.direction,
"remove")) {
244 digit_framehook_interface.
data =
data;
250 if (!strcasecmp(
args.direction,
"tx")) {
252 }
else if (!strcasecmp(
args.direction,
"rx")) {
264 if (
data->maxdigits < 0) {
267 }
else if (
data->maxdigits == 0) {
273 if (
data->framehook_id < 0) {
static const struct ast_datastore_info dtmf_store_datastore
The channel datastore the function uses to store state.
static struct ast_frame * dtmf_store_framehook(struct ast_channel *chan, struct ast_frame *f, enum ast_framehook_event event, void *data)
Frame hook that is called to intercept digit/undigit.
static int dtmfstore_exec(struct ast_channel *chan, const char *appdata)
static void datastore_destroy_cb(void *data)
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Technology independent async DTMF storage")
static int load_module(void)
static int unload_module(void)
static int remove_dtmf_store(struct ast_channel *chan)
Asterisk main include file. File version handling, generic pbx functions.
#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()
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from 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.
Conversion utility functions.
int ast_str_to_int(const char *str, int *res)
Convert the given string to a signed integer.
#define ast_datastore_alloc(info, uid)
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
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
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
#define AST_FRAMEHOOK_INTERFACE_VERSION
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.
#define ast_debug(level,...)
Log a DEBUG message.
#define SCOPED_CHANNELLOCK(varname, chan)
scoped lock specialization for channels.
Asterisk module definitions.
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
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.
void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Main Channel structure associated with a channel.
Structure for a data store type.
Structure for a data store object.
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
union ast_frame::@226 data
enum ast_frame_type frametype
Private data structure used with the function's datastore.