37 #include <sys/types.h> 69 if (!strcasecmp(file,
"timeleft")) {
78 if ((remaining / 60) > 1) {
106 const char *latest_musicclass;
162 if (!feature_limits) {
176 feature_limits->duration,
178 ast_log(
LOG_ERROR,
"Failed to schedule the duration limiter to the bridge channel.\n");
190 if (feature_limits->warning && feature_limits->warning < feature_limits->duration) {
193 feature_limits->duration - feature_limits->warning,
195 ast_log(
LOG_WARNING,
"Failed to schedule warning sound playback to the bridge channel.\n");
#define ast_channel_lock(chan)
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
Structure that contains features information.
const ast_string_field duration_sound
#define ast_test_flag(p, flag)
ast_bridge_hook_remove_flags
static int bridge_features_duration_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
static void bridge_features_limits_dtor(void *vdoomed)
void __ao2_cleanup(void *obj)
static void bridge_features_limits_copy(struct ast_bridge_features_limits *dst, struct ast_bridge_features_limits *src)
int ast_bridge_interval_register(enum ast_bridge_builtin_interval interval, ast_bridge_builtin_set_limits_fn callback)
Register a handler for a built in interval feature.
static int unload_module(void)
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define ao2_alloc_options(data_size, destructor_fn, options)
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
struct timeval quitting_time
void ast_bridge_features_limits_destroy(struct ast_bridge_features_limits *limits)
Destructor function for ast_bridge_features_limits.
#define ast_module_unref(mod)
Release a reference to the module.
#define ast_strlen_zero(foo)
static int bridge_features_warning_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
const char * ast_channel_latest_musicclass(const struct ast_channel *chan)
General Asterisk PBX channel definitions.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define AST_CAUSE_NORMAL_CLEARING
#define ao2_ref(o, delta)
struct timeval ast_samp2tv(unsigned int _nsamp, unsigned int _rate)
Returns a timeval corresponding to the duration of n samples at rate r. Useful to convert samples to ...
#define ast_strdupa(s)
duplicate a string in memory from the stack
int ast_bridge_interval_hook(struct ast_bridge_features *features, enum ast_bridge_hook_timer_option flags, unsigned int interval, ast_bridge_hook_callback callback, void *hook_pvt, ast_bridge_hook_pvt_destructor destructor, enum ast_bridge_hook_remove_flags remove_flags)
Attach an interval hook to a bridge features structure.
int ast_bridge_interval_unregister(enum ast_bridge_builtin_interval interval)
static int bridge_features_connect_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
static int load_module(void)
#define ast_test_suite_event_notify(s, f,...)
#define ast_string_fields_copy(copy, orig)
Copy all string fields from one instance to another of the same structure.
int ast_bridge_features_limits_construct(struct ast_bridge_features_limits *limits)
Constructor function for ast_bridge_features_limits.
Structure that contains configuration information for the limits feature.
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
void ast_bridge_channel_leave_bridge(struct ast_bridge_channel *bridge_channel, enum bridge_channel_state new_state, int cause)
Set bridge channel state to leave bridge (if not leaving already).
#define ast_channel_unlock(chan)
const ast_string_field warning_sound
static void limits_interval_playback(struct ast_bridge_channel *bridge_channel, struct ast_bridge_features_limits *limits, const char *file)
int ast_stream_and_wait(struct ast_channel *chan, const char *file, const char *digits)
stream file until digit If the file name is non-empty, try to play it.
const ast_string_field connect_sound
struct ast_channel * chan
Structure that contains information regarding a channel in a bridge.
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says a number
const char * ast_channel_name(const struct ast_channel *chan)
Internal Asterisk hangup causes.
const char * ast_channel_language(const struct ast_channel *chan)
static int bridge_builtin_set_limits(struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, enum ast_bridge_hook_remove_flags remove_flags)
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
Say numbers and dates (maybe words one day too)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_module_ref(mod)
Hold a reference to the module.