164 static const char app[] =
"ControlPlayback";
183 return key == 35 || key == 42 || (key >= 48 && key <= 57);
191 if (strchr(haystack, needle))
231 skipms =
args.skip ? (atoi(
args.skip) ? atoi(
args.skip) : 3000) : 3000;
264 if (res > 0 &&
args.stop && strchr(
args.stop, res)) {
266 snprintf(stopkeybuf,
sizeof(stopkeybuf),
"%c", res);
280 snprintf(offsetbuf,
sizeof(offsetbuf),
"%ld", offsetms);
308 if (!strcasecmp(control_type,
"stop")) {
310 }
else if (!strcasecmp(control_type,
"forward")) {
312 }
else if (!strcasecmp(control_type,
"reverse")) {
314 }
else if (!strcasecmp(control_type,
"pause")) {
316 }
else if (!strcasecmp(control_type,
"restart")) {
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame without payload.
struct ast_channel * chan
#define ast_channel_unref(c)
Decrease channel reference count.
#define ast_test_flag(p, flag)
static int controlplayback_manager(struct mansession *s, const struct message *m)
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static int load_module(void)
void astman_send_ack(struct mansession *s, const struct message *m, char *msg)
Send ack in manager transaction.
int ast_control_streamfile(struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *pause, const char *restart, int skipms, long *offsetms)
Stream a file with fast forward, pause, reverse, restart.
static int is_argument(const char *haystack, int needle)
int ast_unregister_application(const char *app)
Unregister an application.
const char * astman_get_header(const struct message *m, char *var)
Get header from mananger transaction.
#define ast_strlen_zero(foo)
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
#define ast_debug(level,...)
Log a DEBUG message.
In case you didn't read that giant block of text above the mansession_session struct, the struct mansession is named this solely to keep the API the same in Asterisk. This structure really represents data that is different from Manager action to Manager action. The mansession_session pointer contained within points to session-specific data.
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int is_on_phonepad(char key)
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
Core PBX routines and definitions.
int ast_manager_unregister(const char *action)
Unregister a registered manager command.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define AST_APP_OPTION_ARG(option, flagno, argno)
Declares an application option that accepts an argument.
Structure used to handle boolean flags.
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...
static int unload_module(void)
static const struct ast_app_option cpb_opts[128]
#define ast_manager_register_xml(action, authority, func)
Register a manager callback using XML documentation to describe the manager.
#define ASTERISK_GPL_KEY
The text the key() function should return.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
void astman_send_error(struct mansession *s, const struct message *m, char *error)
Send error in manager transaction.
Asterisk module definitions.
#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...
static int controlplayback_exec(struct ast_channel *chan, const char *data)
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.