137static const char *
app =
"StasisBroadcast";
140#define DEFAULT_TIMEOUT_MS 500
143#define MAX_TIMEOUT_MS 60000
146#define MAX_STASIS_ARGS 128
153 const char *app_filter =
NULL;
154 const char *stasis_args_raw =
NULL;
179 if (sscanf(
args.timeout,
"%d", &timeout_ms) != 1
182 "Channel %s: invalid timeout value '%s' (must be 0-%dms), using default %dms\n",
189 app_filter =
args.app_filter;
193 stasis_args_raw =
args.stasis_args;
197 flags &= ~STASIS_BROADCAST_FLAG_SUPPRESS_CLAIMED;
212 stasis_argv[stasis_argc++] = arg;
216 ast_debug(3,
"Broadcasting channel %s (timeout=%dms, filter=%s, args=%d)\n",
239 ast_debug(3,
"Channel %s claimed by %s, entering Stasis\n",
281 "Stasis application broadcast",
285 .
requires =
"res_stasis,res_stasis_broadcast",
static int stasis_broadcast_exec(struct ast_channel *chan, const char *data)
StasisBroadcast dialplan application callback.
static const char * app
Dialplan application name.
#define MAX_TIMEOUT_MS
Maximum timeout in milliseconds.
static int load_module(void)
static int unload_module(void)
#define MAX_STASIS_ARGS
Maximum number of Stasis arguments.
#define DEFAULT_TIMEOUT_MS
Default timeout in milliseconds.
char * strsep(char **str, const char *delims)
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
const char * ast_channel_name(const struct ast_channel *chan)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
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.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_EXTENDED
#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.
#define AST_OPTIONAL_API_UNAVAILABLE
A common value for optional API stub functions to 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.
Stasis Application Broadcast API.
void AST_OPTIONAL_API_NAME() stasis_app_broadcast_cleanup(const char *channel_id)
Clean up broadcast context for a channel.
int AST_OPTIONAL_API_NAME() stasis_app_broadcast_wait(struct ast_channel *chan, int timeout_ms)
Wait for a broadcast channel to be claimed.
#define STASIS_BROADCAST_FLAG_SUPPRESS_CLAIMED
Suppress CallClaimed event for this broadcast.
int AST_OPTIONAL_API_NAME() stasis_app_broadcast_channel(struct ast_channel *chan, int timeout_ms, const char *app_filter, unsigned int flags)
Start a broadcast for a channel.
char *AST_OPTIONAL_API_NAME() stasis_app_broadcast_winner(const char *channel_id)
Get the winner app name for a broadcast channel.
Backend API for implementing components of res_stasis.
int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc, char *argv[])
Control a channel using stasis_app.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Main Channel structure associated with a channel.