69 static char *
app =
"StoreDTMF";
112 data = datastore->
data;
134 char currentdata[512];
136 char *varname =
NULL;
140 if (!f || !framedata) {
154 varname = framedata->
rx_var;
156 varname = framedata->
tx_var;
163 sprintf(varnamesub,
"${%s}", varname);
167 ast_debug(3,
"Creating new digit store: %s\n", varname);
169 len = strlen(currentdata);
175 char newdata[len + 2];
180 newdata[len + 1] =
'\0';
181 ast_debug(3,
"Appending to digit store: now %s\n", newdata);
195 .disable_inheritance = 1,
211 if (!strcasecmp(
args.direction,
"remove")) {
233 digit_framehook_interface.
data =
data;
239 if (!strcasecmp(
args.direction,
"tx")) {
241 }
else if (!strcasecmp(
args.direction,
"rx")) {
static int dtmfstore_exec(struct ast_channel *chan, const char *appdata)
Main Channel structure associated with a channel.
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.
Asterisk main include file. File version handling, generic pbx functions.
static int load_module(void)
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
ast_framehook_event
These are the types of events that the framehook's event callback can receive.
static int remove_dtmf_store(struct ast_channel *chan)
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
Structure for a data store type.
#define ast_strdup(str)
A wrapper for strdup()
Structure for a data store object.
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.
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Technology independent async DTMF storage")
int ast_unregister_application(const char *app)
Unregister an application.
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
struct ast_frame_subclass subclass
#define ast_strlen_zero(foo)
int ast_framehook_attach(struct ast_channel *chan, struct ast_framehook_interface *i)
Attach an framehook onto a channel for frame interception.
static const struct ast_datastore_info dtmf_store_datastore
The channel datastore the function uses to store state.
#define ast_debug(level,...)
Log a DEBUG message.
#define SCOPED_CHANNELLOCK(varname, chan)
scoped lock specialization for channels.
General Asterisk PBX channel definitions.
Conversion utility functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
Core PBX routines and definitions.
int ast_str_to_int(const char *str, int *res)
Convert the given string to a signed integer.
#define AST_FRAMEHOOK_INTERFACE_VERSION
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
Private data structure used with the function's datastore.
static void parse(struct mgcp_request *req)
#define ast_calloc(num, len)
A wrapper for calloc()
static void datastore_destroy_cb(void *data)
static int unload_module(void)
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_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
const char * ast_channel_name(const struct ast_channel *chan)
void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
Data structure associated with a single frame of data.
#define ast_datastore_alloc(info, uid)
union ast_frame::@263 data
enum ast_frame_type frametype
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
#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...
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.