Asterisk - The Open Source Telephony Project
18.5.0
|
Routines implementing music on hold. More...
#include "asterisk.h"
#include <ctype.h>
#include <signal.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <sys/stat.h>
#include <dirent.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
#include "asterisk/translate.h"
#include "asterisk/say.h"
#include "asterisk/musiconhold.h"
#include "asterisk/config.h"
#include "asterisk/utils.h"
#include "asterisk/cli.h"
#include "asterisk/stringfields.h"
#include "asterisk/linkedlists.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/paths.h"
#include "asterisk/astobj2.h"
#include "asterisk/timing.h"
#include "asterisk/time.h"
#include "asterisk/poll-compat.h"
Go to the source code of this file.
Data Structures | |
struct | moh_files_state |
struct | mohclass |
struct | mohdata |
Macros | |
#define | DONT_UNREF 0 |
#define | get_mohbyname(a, b, c) _get_mohbyname(a,b,c,__FILE__,__LINE__,__PRETTY_FUNCTION__) |
#define | HANDLE_REF 1 |
#define | INITIAL_NUM_FILES 8 |
#define | LOCAL_MPG_123 "/usr/local/bin/mpg123" |
#define | MAX_MP3S 256 |
#define | MOH_ANNOUNCEMENT (1 << 6) |
#define | MOH_CACHERTCLASSES (1 << 5) |
#define | moh_class_malloc() _moh_class_malloc(__FILE__,__LINE__,__PRETTY_FUNCTION__) |
#define | MOH_CUSTOM (1 << 2) |
#define | MOH_MS_INTERVAL 100 |
#define | MOH_NOTDELETED (1 << 30) |
#define | MOH_PREFERCHANNELCLASS (1 << 7) |
#define | MOH_QUIET (1 << 0) |
#define | MOH_RANDOMIZE (1 << 3) |
#define | MOH_RANDSTART (MOH_RANDOMIZE | MOH_SORTALPHA) |
#define | MOH_REALTIME (1 << 31) |
#define | moh_register(moh, reload, unref) _moh_register(moh, reload, unref, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | MOH_SINGLE (1 << 1) |
#define | MOH_SORTALPHA (1 << 4) |
#define | MOH_SORTMODE (3 << 3) |
#define | moh_unregister(a) _moh_unregister(a,__FILE__,__LINE__,__PRETTY_FUNCTION__) |
#define | mohclass_ref(class, string) (ao2_t_ref((class), +1, (string)), class) |
#define | mohclass_unref(class, string) _mohclass_unref(class, string, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
#define | MPG_123 "/usr/bin/mpg123" |
Enumerations | |
enum | kill_methods { KILL_METHOD_PROCESS_GROUP = 0, KILL_METHOD_PROCESS } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static struct mohclass * | _get_mohbyname (const char *name, int warn, int flags, const char *file, int lineno, const char *funcname) |
static struct mohclass * | _moh_class_malloc (const char *file, int line, const char *funcname) |
static int | _moh_register (struct mohclass *moh, int reload, int unref, const char *file, int line, const char *funcname) |
static int | _moh_unregister (struct mohclass *moh, const char *file, int line, const char *funcname) |
static struct mohclass * | _mohclass_unref (struct mohclass *class, const char *tag, const char *file, int line, const char *funcname) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void | ast_moh_destroy (void) |
static int | ast_moh_files_next (struct ast_channel *chan) |
static char * | complete_mohclass_realtime (const char *line, const char *word, int pos, int state) |
Support routing for 'moh unregister class' CLI This is in charge of generating all strings that match a prefix in the given position. As many functions of this kind, each invokation has O(state) time complexity so be careful in using it. More... | |
static struct mohclass * | get_mohbydigit (char digit) |
static char * | handle_cli_moh_reload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_moh_show_classes (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_moh_show_files (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_moh_unregister_class (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | init_app_class (struct mohclass *class) |
static int | init_files_class (struct mohclass *class) |
static int | killer (pid_t pid, int signum, enum kill_methods kill_method) |
static void | killpid (int pid, size_t delay, enum kill_methods kill_method) |
static int | load_module (void) |
Load the module. More... | |
static int | load_moh_classes (int reload) |
static struct ast_variable * | load_realtime_musiconhold (const char *name) |
static void | local_ast_moh_cleanup (struct ast_channel *chan) |
static int | local_ast_moh_start (struct ast_channel *chan, const char *mclass, const char *interpclass) |
static void | local_ast_moh_stop (struct ast_channel *chan) |
static void * | moh_alloc (struct ast_channel *chan, void *params) |
static int | moh_class_cmp (void *obj, void *arg, int flags) |
static void | moh_class_destructor (void *obj) |
static int | moh_class_hash (const void *obj, const int flags) |
static int | moh_class_inuse (void *obj, void *arg, int flags) |
static int | moh_class_mark (void *obj, void *arg, int flags) |
static int | moh_classes_delete_marked (void *obj, void *arg, int flags) |
static int | moh_diff (struct mohclass *old, struct mohclass *new) |
static int | moh_digit_match (void *obj, void *arg, int flags) |
static struct ast_vector_string * | moh_file_vector_alloc (int initial_capacity) |
static void | moh_file_vector_destructor (void *obj) |
static int | moh_filename_strcasecmp (const void *a, const void *b) |
static void * | moh_files_alloc (struct ast_channel *chan, void *params) |
static int | moh_files_generator (struct ast_channel *chan, void *data, int len, int samples) |
static struct ast_frame * | moh_files_readframe (struct ast_channel *chan) |
static void | moh_files_release (struct ast_channel *chan, void *data) |
static void | moh_files_write_format_change (struct ast_channel *chan, void *data) |
static int | moh_generate (struct ast_channel *chan, void *data, int len, int samples) |
static void | moh_handle_digit (struct ast_channel *chan, char digit) |
static void | moh_parse_options (struct ast_variable *var, struct mohclass *mohclass) |
static void | moh_post_start (struct ast_channel *chan, const char *moh_class_name) |
static void | moh_post_stop (struct ast_channel *chan) |
static void | moh_release (struct ast_channel *chan, void *data) |
static void | moh_rescan_files (void) |
static int | moh_scan_files (struct mohclass *class) |
static struct mohdata * | mohalloc (struct mohclass *cl) |
static void * | monmp3thread (void *data) |
static int | on_moh_file (const char *directory, const char *filename, void *obj) |
static int | play_moh_exec (struct ast_channel *chan, const char *data) |
static int | reload (void) |
static int | spawn_mp3 (struct mohclass *class) |
static int | start_moh_exec (struct ast_channel *chan, const char *data) |
static int | stop_moh_exec (struct ast_channel *chan, const char *data) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Music On Hold Resource" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_CHANNEL_DEPEND, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_cli_entry | cli_moh [] |
static struct ast_flags | global_flags [1] = {{0}} |
static struct ast_generator | moh_file_stream |
static struct ao2_container * | mohclasses |
static struct ast_generator | mohgen |
static const char | play_moh [] = "MusicOnHold" |
static int | respawn_time = 20 |
static const char | start_moh [] = "StartMusicOnHold" |
static const char | stop_moh [] = "StopMusicOnHold" |
Routines implementing music on hold.
Definition in file res_musiconhold.c.
#define DONT_UNREF 0 |
Definition at line 78 of file res_musiconhold.c.
Referenced by local_ast_moh_start().
Definition at line 934 of file res_musiconhold.c.
Referenced by local_ast_moh_start().
#define HANDLE_REF 1 |
Definition at line 77 of file res_musiconhold.c.
Referenced by load_moh_classes().
#define INITIAL_NUM_FILES 8 |
Definition at line 76 of file res_musiconhold.c.
#define LOCAL_MPG_123 "/usr/local/bin/mpg123" |
Definition at line 208 of file res_musiconhold.c.
Referenced by spawn_mp3().
#define MAX_MP3S 256 |
Definition at line 210 of file res_musiconhold.c.
Referenced by spawn_mp3().
#define MOH_ANNOUNCEMENT (1 << 6) |
Do we play announcement files between songs on this channel?
Definition at line 153 of file res_musiconhold.c.
Referenced by ast_moh_files_next(), handle_cli_moh_show_classes(), and moh_parse_options().
#define MOH_CACHERTCLASSES (1 << 5) |
Should we use a separate instance of MOH for each user or not
Definition at line 152 of file res_musiconhold.c.
Referenced by load_moh_classes(), and local_ast_moh_start().
#define moh_class_malloc | ( | ) | _moh_class_malloc(__FILE__,__LINE__,__PRETTY_FUNCTION__) |
Definition at line 1583 of file res_musiconhold.c.
Referenced by load_moh_classes(), and local_ast_moh_start().
#define MOH_CUSTOM (1 << 2) |
Definition at line 146 of file res_musiconhold.c.
Referenced by handle_cli_moh_show_classes(), init_app_class(), local_ast_moh_start(), and spawn_mp3().
#define MOH_MS_INTERVAL 100 |
Referenced by monmp3thread().
#define MOH_NOTDELETED (1 << 30) |
Find only records that aren't deleted?
Definition at line 157 of file res_musiconhold.c.
Referenced by _moh_register(), and moh_class_cmp().
#define MOH_PREFERCHANNELCLASS (1 << 7) |
Should queue moh override channel moh
Definition at line 154 of file res_musiconhold.c.
Referenced by load_moh_classes(), and local_ast_moh_start().
#define MOH_QUIET (1 << 0) |
Definition at line 144 of file res_musiconhold.c.
Referenced by init_app_class(), local_ast_moh_start(), and spawn_mp3().
#define MOH_RANDOMIZE (1 << 3) |
Definition at line 147 of file res_musiconhold.c.
Referenced by ast_moh_files_next(), local_ast_moh_start(), moh_files_alloc(), and moh_parse_options().
#define MOH_RANDSTART (MOH_RANDOMIZE | MOH_SORTALPHA) |
Sorted but start at random position
Definition at line 149 of file res_musiconhold.c.
Referenced by moh_parse_options().
#define MOH_REALTIME (1 << 31) |
Find only records that are realtime
Definition at line 158 of file res_musiconhold.c.
Referenced by load_moh_classes(), and moh_class_mark().
#define moh_register | ( | moh, | |
reload, | |||
unref | |||
) | _moh_register(moh, reload, unref, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Definition at line 1410 of file res_musiconhold.c.
Referenced by load_moh_classes(), and local_ast_moh_start().
#define MOH_SINGLE (1 << 1) |
Definition at line 145 of file res_musiconhold.c.
Referenced by init_app_class(), local_ast_moh_start(), and spawn_mp3().
#define MOH_SORTALPHA (1 << 4) |
Definition at line 148 of file res_musiconhold.c.
Referenced by moh_parse_options(), and moh_scan_files().
#define MOH_SORTMODE (3 << 3) |
Definition at line 150 of file res_musiconhold.c.
Referenced by ast_moh_files_next().
#define moh_unregister | ( | a | ) | _moh_unregister(a,__FILE__,__LINE__,__PRETTY_FUNCTION__) |
Definition at line 1478 of file res_musiconhold.c.
Referenced by handle_cli_moh_unregister_class().
Definition at line 215 of file res_musiconhold.c.
Referenced by local_ast_moh_start(), moh_alloc(), moh_files_alloc(), and mohalloc().
#define mohclass_unref | ( | class, | |
string | |||
) | _mohclass_unref(class, string, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
Definition at line 220 of file res_musiconhold.c.
Referenced by _moh_register(), complete_mohclass_realtime(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_moh_unregister_class(), load_moh_classes(), local_ast_moh_cleanup(), local_ast_moh_start(), moh_alloc(), moh_files_alloc(), moh_files_release(), moh_handle_digit(), moh_release(), and unload_module().
#define MPG_123 "/usr/bin/mpg123" |
Definition at line 209 of file res_musiconhold.c.
Referenced by spawn_mp3().
enum kill_methods |
Enumerator | |
---|---|
KILL_METHOD_PROCESS_GROUP | |
KILL_METHOD_PROCESS |
Definition at line 162 of file res_musiconhold.c.
|
static |
Definition at line 2298 of file res_musiconhold.c.
|
static |
Definition at line 2298 of file res_musiconhold.c.
|
static |
Definition at line 936 of file res_musiconhold.c.
References __ao2_find(), ast_copy_string(), ast_log, mohclass::flags, LOG_WARNING, mohclass::name, and NULL.
Referenced by _moh_register().
|
static |
Definition at line 1585 of file res_musiconhold.c.
References __ao2_alloc(), AO2_ALLOC_OPT_LOCK_MUTEX, ao2_bump, ao2_ref, ast_format_slin, moh_files_state::class, mohclass::files, moh_class_destructor(), moh_file_vector_alloc(), and NULL.
|
static |
Definition at line 1411 of file res_musiconhold.c.
References _get_mohbyname(), ao2_lock, ao2_t_link, ao2_unlock, ast_log, AST_VECTOR_SIZE, mohclass::files, init_app_class(), init_files_class(), LOG_WARNING, mohclass::mode, moh_diff(), MOH_NOTDELETED, mohclass_unref, mohclass::name, NULL, respawn_time, and mohclass::start.
|
static |
Definition at line 1479 of file res_musiconhold.c.
References ao2_t_unlink.
|
static |
Definition at line 221 of file res_musiconhold.c.
References __ao2_ref(), ao2_callback, ao2_match_by_addr(), ao2_ref, ast_log, moh_files_state::class, LOG_WARNING, mohclass::name, NULL, and OBJ_POINTER.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 2298 of file res_musiconhold.c.
|
static |
Definition at line 2066 of file res_musiconhold.c.
References ao2_ref, ao2_t_callback, ast_verb, NULL, OBJ_MULTIPLE, OBJ_NODATA, and OBJ_UNLINK.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 313 of file res_musiconhold.c.
References moh_files_state::announcement, mohclass::announcement, ao2_bump, ao2_lock, ao2_ref, ao2_unlock, ast_channel_language(), ast_channel_music_state(), ast_channel_name(), ast_channel_stream(), ast_channel_stream_set(), ast_closestream(), ast_copy_string(), ast_debug, ast_fileexists(), ast_log, ast_openstream_full(), ast_random(), ast_seekstream(), ast_strlen_zero, ast_tellstream(), ast_test_flag, AST_VECTOR_GET, AST_VECTOR_SIZE, moh_files_state::class, errno, mohclass::files, LOG_WARNING, MOH_ANNOUNCEMENT, MOH_RANDOMIZE, MOH_SORTMODE, mohclass::name, NULL, moh_files_state::pos, moh_files_state::samples, moh_files_state::save_pos, and moh_files_state::save_pos_filename.
Referenced by moh_files_readframe().
|
static |
Support routing for 'moh unregister class' CLI This is in charge of generating all strings that match a prefix in the given position. As many functions of this kind, each invokation has O(state) time complexity so be careful in using it.
Definition at line 1510 of file res_musiconhold.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_t_iterator_next, ast_strdup, c, mohclass_unref, mohclass::name, NULL, and mohclass::realtime.
Referenced by handle_cli_moh_unregister_class().
|
static |
Definition at line 557 of file res_musiconhold.c.
References ao2_t_callback, and moh_digit_match().
Referenced by moh_handle_digit().
|
static |
Definition at line 2076 of file res_musiconhold.c.
References ast_cli_args::argc, ast_cli_entry::args, ast_module_reload(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 2142 of file res_musiconhold.c.
References mohclass::announcement, ao2_iterator_destroy(), ao2_iterator_init(), ao2_t_iterator_next, ast_cli_args::argc, mohclass::args, ast_cli_entry::args, ast_cli(), ast_format_get_name(), ast_test_flag, moh_files_state::class, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, mohclass::dir, ast_cli_args::fd, mohclass::format, mohclass::kill_delay, mohclass::kill_method, KILL_METHOD_PROCESS, mohclass::mode, MOH_ANNOUNCEMENT, MOH_CUSTOM, mohclass_unref, mohclass::name, NULL, S_OR, and ast_cli_entry::usage.
|
static |
Definition at line 2099 of file res_musiconhold.c.
References ao2_bump, ao2_iterator_destroy(), ao2_iterator_init(), ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_cli_args::argc, ast_cli_entry::args, ast_cli(), AST_VECTOR_GET, AST_VECTOR_SIZE, moh_files_state::class, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, mohclass::files, mohclass_unref, mohclass::name, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1536 of file res_musiconhold.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_t_iterator_next, ast_cli_args::argc, ast_cli_args::argv, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_mohclass_realtime(), ast_cli_args::fd, len(), ast_cli_args::line, moh_class_destructor(), moh_unregister, mohclass_unref, ast_cli_args::n, mohclass::name, NULL, ast_cli_args::pos, mohclass::realtime, ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Definition at line 1371 of file res_musiconhold.c.
References ast_log, ast_pthread_create_background, ast_set_flag, ast_timer_close(), ast_timer_open(), ast_timer_set_rate(), moh_files_state::class, errno, LOG_WARNING, mohclass::mode, MOH_CUSTOM, MOH_QUIET, MOH_SINGLE, monmp3thread(), NULL, mohclass::thread, and mohclass::timer.
Referenced by _moh_register().
|
static |
Definition at line 1317 of file res_musiconhold.c.
References ast_verb, moh_files_state::class, mohclass::dir, moh_scan_files(), and mohclass::name.
Referenced by _moh_register().
|
static |
Definition at line 725 of file res_musiconhold.c.
References KILL_METHOD_PROCESS, and KILL_METHOD_PROCESS_GROUP.
Referenced by killpid().
|
static |
Definition at line 737 of file res_musiconhold.c.
References ast_debug, ast_log, errno, KILL_METHOD_PROCESS_GROUP, killer(), and LOG_WARNING.
Referenced by moh_class_destructor(), and monmp3thread().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 2217 of file res_musiconhold.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_t_container_alloc_hash, ARRAY_LEN, ast_check_realtime(), ast_cli_register_multiple, ast_install_music_functions(), ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_moh_destroy(), ast_register_application_xml, ast_register_atexit(), load_moh_classes(), local_ast_moh_cleanup(), local_ast_moh_start(), local_ast_moh_stop(), LOG_WARNING, moh_class_cmp(), moh_class_hash(), NULL, play_moh, play_moh_exec(), start_moh, start_moh_exec(), stop_moh, and stop_moh_exec().
Referenced by unload_module().
|
static |
Definition at line 1972 of file res_musiconhold.c.
References ao2_t_callback, mohclass::args, ast_category_browse(), ast_check_realtime(), ast_clear_flag, ast_config_destroy(), ast_config_load, ast_copy_string(), AST_FLAGS_ALL, ast_log, ast_set2_flag, ast_strlen_zero, ast_true(), ast_variable_browse(), moh_files_state::class, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, CONFIG_STATUS_FILEUNCHANGED, mohclass::dir, HANDLE_REF, LOG_WARNING, mohclass::mode, MOH_CACHERTCLASSES, moh_class_malloc, moh_class_mark(), moh_classes_delete_marked(), moh_parse_options(), MOH_PREFERCHANNELCLASS, MOH_REALTIME, moh_register, moh_rescan_files(), mohclass_unref, ast_variable::name, mohclass::name, ast_variable::next, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, ast_variable::value, and var.
Referenced by load_module(), and reload().
|
static |
Definition at line 1607 of file res_musiconhold.c.
References ast_category_browse(), ast_config_destroy(), ast_load_realtime(), ast_load_realtime_multientry(), ast_log, ast_strings_equal(), ast_variable_find_in_list(), ast_variable_list_append, ast_variable_new, ast_variable_retrieve(), ast_variables_destroy(), LOG_WARNING, NULL, SENTINEL, and var.
Referenced by local_ast_moh_start().
|
static |
Definition at line 1485 of file res_musiconhold.c.
References ao2_cleanup, ast_channel_music_state(), ast_channel_music_state_set(), ast_free, ast_log, ast_module_unref, moh_files_state::class, LOG_WARNING, mohclass_unref, moh_files_state::mohwfmt, NULL, moh_files_state::origwfmt, and ast_module_info::self.
Referenced by load_module(), and reload().
|
static |
Definition at line 1651 of file res_musiconhold.c.
References ao2_lock, ao2_unlock, mohclass::args, ARRAY_LEN, ast_activate_generator(), ast_channel_flags(), ast_channel_lock, ast_channel_music_state(), ast_channel_musicclass(), ast_channel_unlock, ast_check_realtime(), AST_FLAG_MOH, ast_log, ast_pthread_create_background, ast_set_flag, ast_strlen_zero, ast_test_flag, ast_timer_close(), ast_timer_open(), ast_timer_set_rate(), ast_variables_destroy(), AST_VECTOR_SIZE, moh_files_state::class, mohclass::dir, DONT_UNREF, errno, mohclass::files, get_mohbyname, load_realtime_musiconhold(), LOG_NOTICE, LOG_WARNING, mohclass::mode, MOH_CACHERTCLASSES, moh_class_malloc, MOH_CUSTOM, moh_parse_options(), MOH_PREFERCHANNELCLASS, MOH_QUIET, MOH_RANDOMIZE, moh_register, moh_scan_files(), MOH_SINGLE, mohclass_ref, mohclass_unref, monmp3thread(), mohclass::name, NULL, mohclass::realtime, respawn_time, mohclass::srcfd, mohclass::start, mohclass::thread, mohclass::timer, and var.
Referenced by load_module(), and reload().
|
static |
Definition at line 1878 of file res_musiconhold.c.
References ast_channel_flags(), ast_channel_lock, ast_channel_music_state(), ast_channel_stream(), ast_channel_stream_set(), ast_channel_unlock, ast_clear_flag, ast_closestream(), ast_deactivate_generator(), AST_FLAG_MOH, and NULL.
Referenced by load_module(), and reload().
|
static |
Definition at line 1018 of file res_musiconhold.c.
References ao2_bump, ao2_cleanup, ast_calloc, ast_channel_music_state(), ast_channel_music_state_set(), ast_channel_name(), ast_channel_writeformat(), ast_format_get_name(), ast_log, ast_module_ref, ast_set_write_format(), moh_files_state::class, mohclass::format, LOG_WARNING, moh_post_start(), moh_release(), mohalloc(), mohclass_ref, mohclass_unref, moh_files_state::mohwfmt, mohclass::name, NULL, moh_files_state::origwfmt, mohdata::origwfmt, ast_module_info::self, and state.
|
static |
Definition at line 2198 of file res_musiconhold.c.
References moh_files_state::class, CMP_MATCH, CMP_STOP, mohclass::delete, MOH_NOTDELETED, and mohclass::name.
Referenced by load_module().
|
static |
Definition at line 1893 of file res_musiconhold.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_debug, ast_free, AST_LIST_REMOVE_HEAD, AST_PTHREADT_NULL, ast_timer_close(), ast_wait_for_input(), buff, moh_files_state::class, mohclass::files, mohclass::format, mohclass::kill_delay, mohclass::kill_method, killpid(), mohdata::list, mohclass::members, mohclass::name, NULL, mohclass::pid, mohclass::srcfd, mohclass::thread, and mohclass::timer.
Referenced by _moh_class_malloc(), and handle_cli_moh_unregister_class().
|
static |
Definition at line 2191 of file res_musiconhold.c.
References ast_str_case_hash(), moh_files_state::class, and mohclass::name.
Referenced by load_module().
|
static |
Definition at line 2256 of file res_musiconhold.c.
References AST_LIST_EMPTY, moh_files_state::class, CMP_MATCH, CMP_STOP, and mohclass::members.
Referenced by unload_module().
|
static |
Definition at line 1954 of file res_musiconhold.c.
References moh_files_state::class, mohclass::delete, MOH_REALTIME, and mohclass::realtime.
Referenced by load_moh_classes().
|
static |
Definition at line 1965 of file res_musiconhold.c.
References CMP_MATCH, and mohclass::delete.
Referenced by load_moh_classes().
Definition at line 1352 of file res_musiconhold.c.
References mohclass::args, mohclass::dir, mohclass::flags, and mohclass::mode.
Referenced by _moh_register().
|
static |
Definition at line 548 of file res_musiconhold.c.
References moh_files_state::class, CMP_MATCH, CMP_STOP, digit, and mohclass::digit.
Referenced by get_mohbydigit().
|
static |
Definition at line 1099 of file res_musiconhold.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, AST_VECTOR_INIT, and moh_file_vector_destructor().
Referenced by _moh_class_malloc(), moh_parse_options(), and moh_scan_files().
|
static |
Definition at line 1092 of file res_musiconhold.c.
References ast_free, AST_VECTOR_FREE, and AST_VECTOR_RESET.
Referenced by moh_file_vector_alloc().
|
static |
|
static |
Definition at line 500 of file res_musiconhold.c.
References ao2_cleanup, ao2_lock, ao2_replace, ao2_unlock, ast_calloc, ast_channel_music_state(), ast_channel_music_state_set(), ast_channel_writeformat(), ast_copy_string(), ast_log, ast_module_ref, ast_random(), ast_test_flag, AST_VECTOR_SIZE, moh_files_state::class, mohclass::files, LOG_WARNING, moh_post_start(), MOH_RANDOMIZE, mohclass_ref, mohclass_unref, moh_files_state::mohwfmt, moh_files_state::name, mohclass::name, NULL, moh_files_state::origwfmt, moh_files_state::pos, moh_files_state::save_total, ast_module_info::self, and state.
|
static |
Definition at line 457 of file res_musiconhold.c.
References moh_files_state::announcement, ao2_replace, ast_channel_lock, ast_channel_music_state(), ast_channel_name(), ast_channel_unlock, ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_frfree, ast_log, ast_write(), errno, ast_frame_subclass::format, LOG_WARNING, moh_files_readframe(), moh_files_state::mohwfmt, NULL, moh_files_state::sample_queue, moh_files_state::samples, ast_frame::samples, and ast_frame::subclass.
|
static |
Definition at line 409 of file res_musiconhold.c.
References ast_channel_stream(), ast_moh_files_next(), and ast_readframe().
Referenced by moh_files_generator().
|
static |
Definition at line 281 of file res_musiconhold.c.
References moh_files_state::announcement, ao2_cleanup, ao2_ref, ast_channel_music_state(), ast_channel_name(), ast_channel_stream(), ast_channel_stream_set(), ast_closestream(), ast_format_get_name(), ast_log, ast_set_write_format(), moh_files_state::class, LOG_WARNING, moh_post_stop(), mohclass_unref, moh_files_state::mohwfmt, NULL, moh_files_state::origwfmt, moh_files_state::pos, moh_files_state::save_pos, and state.
|
static |
Definition at line 438 of file res_musiconhold.c.
References ao2_bump, ao2_replace, ast_channel_music_state(), ast_channel_writeformat(), ast_set_write_format(), moh_files_state::mohwfmt, NULL, moh_files_state::origwfmt, and tmp().
|
static |
Definition at line 1057 of file res_musiconhold.c.
References ast_channel_name(), ast_codec_samples_count(), ast_format_determine_length(), AST_FRIENDLY_OFFSET, ast_log, ast_write(), buf, ast_frame::data, ast_frame::datalen, errno, mohdata::f, mohclass::format, LOG_WARNING, mohdata::parent, mohdata::pipe, ast_frame::ptr, and ast_frame::samples.
|
static |
Definition at line 562 of file res_musiconhold.c.
References ast_moh_start(), ast_moh_stop(), ast_strdupa, moh_files_state::class, get_mohbydigit(), mohclass_unref, mohclass::name, and NULL.
|
static |
Definition at line 1111 of file res_musiconhold.c.
References mohclass::announcement, ao2_bump, ao2_cleanup, ao2_ref, mohclass::args, ast_begins_with(), ast_copy_string(), ast_format_cache_get, ast_format_slin, ast_log, ast_set2_flag, ast_set_flag, ast_strdup, ast_strlen_zero, ast_true(), AST_VECTOR_APPEND, AST_VECTOR_COMPACT, mohclass::digit, mohclass::dir, mohclass::files, mohclass::format, mohclass::kill_delay, mohclass::kill_method, KILL_METHOD_PROCESS, KILL_METHOD_PROCESS_GROUP, LOG_ERROR, LOG_NOTICE, LOG_WARNING, mohclass::mode, MOH_ANNOUNCEMENT, moh_file_vector_alloc(), MOH_RANDOMIZE, MOH_RANDSTART, MOH_SORTALPHA, ast_variable::name, mohclass::name, ast_variable::next, NULL, ast_variable::value, and var.
Referenced by load_moh_classes(), and local_ast_moh_start().
|
static |
Definition at line 239 of file res_musiconhold.c.
References ao2_cleanup, ast_assert, ast_channel_blob_create_from_cache(), ast_channel_moh_start_type(), ast_channel_name(), ast_channel_topic(), ast_channel_uniqueid(), ast_json_pack(), ast_json_unref(), ast_verb, NULL, stasis_message_data(), and stasis_publish().
Referenced by moh_alloc(), and moh_files_alloc().
|
static |
Definition at line 264 of file res_musiconhold.c.
References ao2_cleanup, ast_assert, ast_channel_blob_create_from_cache(), ast_channel_moh_stop_type(), ast_channel_name(), ast_channel_topic(), ast_channel_uniqueid(), ast_verb, NULL, stasis_message_data(), and stasis_publish().
Referenced by moh_files_release(), and moh_release().
|
static |
Definition at line 981 of file res_musiconhold.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_channel_music_state(), ast_channel_name(), ast_format_get_name(), ast_free, AST_LIST_REMOVE, ast_log, ast_set_write_format(), moh_files_state::class, LOG_WARNING, mohclass::members, moh_post_stop(), mohclass_unref, mohdata::origwfmt, mohdata::parent, mohdata::pipe, and state.
Referenced by moh_alloc().
|
static |
Definition at line 1336 of file res_musiconhold.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, c, mohclass::mode, and moh_scan_files().
Referenced by load_moh_classes().
|
static |
Definition at line 1279 of file res_musiconhold.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_config_AST_DATA_DIR, ast_copy_string(), ast_debug, ast_file_read_dir, ast_test_flag, AST_VECTOR_COMPACT, AST_VECTOR_SIZE, AST_VECTOR_SORT, moh_files_state::class, mohclass::dir, mohclass::files, moh_file_vector_alloc(), moh_filename_strcasecmp(), MOH_SORTALPHA, mohclass::name, on_moh_file(), and PATH_MAX.
Referenced by init_files_class(), local_ast_moh_start(), and moh_rescan_files().
Definition at line 955 of file res_musiconhold.c.
References ao2_lock, ao2_unlock, ast_calloc, AST_FRAME_VOICE, ast_free, AST_FRIENDLY_OFFSET, AST_LIST_INSERT_HEAD, ast_log, ast_pipe_nonblock, errno, mohdata::f, ast_frame_subclass::format, mohclass::format, ast_frame::frametype, mohdata::list, LOG_WARNING, mohclass::members, mohclass_ref, NULL, ast_frame::offset, mohdata::parent, mohdata::pipe, and ast_frame::subclass.
Referenced by moh_alloc().
|
static |
Definition at line 770 of file res_musiconhold.c.
References ao2_lock, ao2_unlock, ast_debug, ast_format_determine_length(), ast_format_get_sample_rate(), AST_LIST_EMPTY, AST_LIST_TRAVERSE, ast_log, ast_poll, ast_samp2tv(), ast_timer_ack(), ast_timer_fd(), ast_tvadd(), ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), moh_files_state::class, mohclass::dir, errno, mohclass::format, mohclass::kill_delay, mohclass::kill_method, killpid(), len(), LOG_ERROR, LOG_NOTICE, LOG_WARNING, mohclass::members, MOH_MS_INTERVAL, NULL, mohclass::pid, mohdata::pipe, spawn_mp3(), mohclass::srcfd, and mohclass::timer.
Referenced by init_app_class(), and local_ast_moh_start().
|
static |
Definition at line 1217 of file res_musiconhold.c.
References ast_asprintf, ast_debug, ast_free, AST_VECTOR_APPEND, and AST_VECTOR_GET_CMP.
Referenced by moh_scan_files().
|
static |
Definition at line 868 of file res_musiconhold.c.
References args, AST_APP_ARG, ast_channel_name(), AST_DECLARE_APP_ARGS, ast_log, ast_moh_start(), ast_moh_stop(), ast_safe_sleep(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero, LOG_WARNING, parse(), S_OR, and timeout.
Referenced by load_module().
|
static |
Definition at line 2246 of file res_musiconhold.c.
References ast_install_music_functions(), AST_MODULE_LOAD_SUCCESS, load_moh_classes(), local_ast_moh_cleanup(), local_ast_moh_start(), and local_ast_moh_stop().
Referenced by unload_module().
|
static |
Definition at line 584 of file res_musiconhold.c.
References mohclass::args, ast_close_fds_above_n(), ast_copy_string(), ast_log, ast_opt_high_priority, ast_safe_fork(), ast_set_priority(), ast_strlen_zero, ast_test_flag, moh_files_state::class, mohclass::dir, errno, LOCAL_MPG_123, LOG_WARNING, MAX_MP3S, MOH_CUSTOM, MOH_QUIET, MOH_SINGLE, MPG_123, NULL, mohclass::pid, respawn_time, mohclass::start, and strsep().
Referenced by monmp3thread().
|
static |
Definition at line 908 of file res_musiconhold.c.
References args, AST_APP_ARG, ast_channel_name(), AST_DECLARE_APP_ARGS, ast_log, ast_moh_start(), AST_STANDARD_APP_ARGS, ast_strdupa, LOG_WARNING, parse(), and S_OR.
Referenced by load_module().
|
static |
Definition at line 927 of file res_musiconhold.c.
References ast_moh_stop().
Referenced by load_module().
|
static |
Definition at line 2263 of file res_musiconhold.c.
References ao2_t_callback, ARRAY_LEN, ast_cli_unregister_multiple(), ast_log, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CHANNEL_DEPEND, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_moh_destroy(), ast_uninstall_music_functions(), ast_unregister_application(), ast_unregister_atexit(), ASTERISK_GPL_KEY, load_module(), LOG_WARNING, moh_class_inuse(), mohclass_unref, NULL, play_moh, reload(), start_moh, and stop_moh.
|
static |
Definition at line 2298 of file res_musiconhold.c.
|
static |
Definition at line 2298 of file res_musiconhold.c.
|
static |
Definition at line 2184 of file res_musiconhold.c.
|
static |
global MOH_ flags
Definition at line 160 of file res_musiconhold.c.
|
static |
Definition at line 576 of file res_musiconhold.c.
|
static |
Definition at line 206 of file res_musiconhold.c.
|
static |
Definition at line 1085 of file res_musiconhold.c.
|
static |
Definition at line 123 of file res_musiconhold.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 127 of file res_musiconhold.c.
Referenced by _moh_register(), local_ast_moh_start(), and spawn_mp3().
|
static |
Definition at line 124 of file res_musiconhold.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 125 of file res_musiconhold.c.
Referenced by load_module(), and unload_module().