69 if (!strcasecmp(
file,
"timeleft")) {
78 if ((remaining / 60) > 1) {
106 const char *latest_musicclass;
128 return limits->frequency ?: -1;
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");
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
@ AO2_ALLOC_OPT_LOCK_NOLOCK
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
void __ao2_cleanup(void *obj)
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)
static void bridge_features_limits_copy(struct ast_bridge_features_limits *dst, struct ast_bridge_features_limits *src)
static int bridge_features_warning_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
static int bridge_features_duration_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
static int bridge_features_connect_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
static void limits_interval_playback(struct ast_bridge_channel *bridge_channel, struct ast_bridge_features_limits *limits, const char *file)
static void bridge_features_limits_dtor(void *vdoomed)
static int load_module(void)
static int unload_module(void)
@ BRIDGE_CHANNEL_STATE_END
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).
int ast_bridge_features_limits_construct(struct ast_bridge_features_limits *limits)
Constructor function for ast_bridge_features_limits.
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.
ast_bridge_hook_remove_flags
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.
int ast_bridge_interval_unregister(enum ast_bridge_builtin_interval interval)
Unregisters a handler for a built in interval feature.
@ AST_BRIDGE_HOOK_TIMER_OPTION_MEDIA
void ast_bridge_features_limits_destroy(struct ast_bridge_features_limits *limits)
Destructor function for ast_bridge_features_limits.
@ AST_BRIDGE_BUILTIN_INTERVAL_LIMITS
Internal Asterisk hangup causes.
#define AST_CAUSE_NORMAL_CLEARING
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
const char * ast_channel_latest_musicclass(const struct ast_channel *chan)
#define ast_channel_lock(chan)
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
const char * ast_channel_language(const struct ast_channel *chan)
#define ast_channel_unlock(chan)
Generic File Format Support. Should be included by clients of the file handling routines....
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.
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
Asterisk module definitions.
#define ast_module_unref(mod)
Release a reference to the module.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ast_module_ref(mod)
Hold a reference to the module.
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
Say numbers and dates (maybe words one day too)
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says a number
#define ast_string_fields_copy(copy, orig)
Copy all string fields from one instance to another of the same structure.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Structure that contains information regarding a channel in a bridge.
struct ast_channel * chan
Structure that contains configuration information for the limits feature.
struct timeval quitting_time
Structure that contains features information.
#define ast_test_suite_event_notify(s, f,...)
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 ...
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define ast_test_flag(p, flag)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.