summaryrefslogtreecommitdiff
path: root/res/res_musiconhold.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r--res/res_musiconhold.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 57d12789e..0afacf53c 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -19,7 +19,7 @@
/*! \file
*
* \brief Routines implementing music on hold
- *
+ *
* \author Mark Spencer <markster@digium.com>
*/
@@ -27,7 +27,7 @@
* \addtogroup configuration_file Configuration Files
*/
-/*!
+/*!
* \page musiconhold.conf musiconhold.conf
* \verbinclude musiconhold.conf.sample
*/
@@ -312,7 +312,7 @@ static void moh_files_release(struct ast_channel *chan, void *data)
state->class = mohclass_unref(state->class, "Unreffing channel's music class upon deactivation of generator");
}
-static int ast_moh_files_next(struct ast_channel *chan)
+static int ast_moh_files_next(struct ast_channel *chan)
{
struct moh_files_state *state = ast_channel_music_state(chan);
int tries;
@@ -559,7 +559,7 @@ static int spawn_mp3(struct mohclass *class)
DIR *dir = NULL;
struct dirent *de;
-
+
if (!strcasecmp(class->dir, "nodir")) {
files = 1;
} else {
@@ -577,19 +577,19 @@ static int spawn_mp3(struct mohclass *class)
argv[argc++] = "--mono";
argv[argc++] = "-r";
argv[argc++] = "8000";
-
+
if (!ast_test_flag(class, MOH_SINGLE)) {
argv[argc++] = "-b";
argv[argc++] = "2048";
}
-
+
argv[argc++] = "-f";
-
+
if (ast_test_flag(class, MOH_QUIET))
argv[argc++] = "4096";
else
argv[argc++] = "8192";
-
+
/* Look for extra arguments and add them to the list */
ast_copy_string(xargs, class->args, sizeof(xargs));
argptr = xargs;
@@ -613,9 +613,9 @@ static int spawn_mp3(struct mohclass *class)
files++;
} else if (dir) {
while ((de = readdir(dir)) && (files < MAX_MP3S)) {
- if ((strlen(de->d_name) > 3) &&
- ((ast_test_flag(class, MOH_CUSTOM) &&
- (!strcasecmp(de->d_name + strlen(de->d_name) - 4, ".raw") ||
+ if ((strlen(de->d_name) > 3) &&
+ ((ast_test_flag(class, MOH_CUSTOM) &&
+ (!strcasecmp(de->d_name + strlen(de->d_name) - 4, ".raw") ||
!strcasecmp(de->d_name + strlen(de->d_name) - 4, ".sln"))) ||
!strcasecmp(de->d_name + strlen(de->d_name) - 4, ".mp3"))) {
ast_copy_string(fns[files], de->d_name, sizeof(fns[files]));
@@ -628,7 +628,7 @@ static int spawn_mp3(struct mohclass *class)
if (dir) {
closedir(dir);
}
- if (pipe(fds)) {
+ if (pipe(fds)) {
ast_log(LOG_WARNING, "Pipe failed\n");
return -1;
}
@@ -884,7 +884,7 @@ static int start_moh_exec(struct ast_channel *chan, const char *data)
AST_STANDARD_APP_ARGS(args, parse);
class = S_OR(args.class, NULL);
- if (ast_moh_start(chan, class, NULL))
+ if (ast_moh_start(chan, class, NULL))
ast_log(LOG_WARNING, "Unable to start music on hold class '%s' on channel %s\n", class, ast_channel_name(chan));
return 0;
@@ -948,7 +948,7 @@ static struct mohdata *mohalloc(struct mohclass *cl)
ao2_lock(cl);
AST_LIST_INSERT_HEAD(&cl->members, moh, list);
ao2_unlock(cl);
-
+
return moh;
}
@@ -959,9 +959,9 @@ static void moh_release(struct ast_channel *chan, void *data)
struct ast_format *oldwfmt;
ao2_lock(class);
- AST_LIST_REMOVE(&moh->parent->members, moh, list);
+ AST_LIST_REMOVE(&moh->parent->members, moh, list);
ao2_unlock(class);
-
+
close(moh->pipe[0]);
close(moh->pipe[1]);
@@ -1292,8 +1292,8 @@ static int _moh_register(struct mohclass *moh, int reload, int unref, const char
}
return -1;
}
- } else if (!strcasecmp(moh->mode, "mp3") || !strcasecmp(moh->mode, "mp3nb") ||
- !strcasecmp(moh->mode, "quietmp3") || !strcasecmp(moh->mode, "quietmp3nb") ||
+ } else if (!strcasecmp(moh->mode, "mp3") || !strcasecmp(moh->mode, "mp3nb") ||
+ !strcasecmp(moh->mode, "quietmp3") || !strcasecmp(moh->mode, "quietmp3nb") ||
!strcasecmp(moh->mode, "httpmp3") || !strcasecmp(moh->mode, "custom")) {
if (init_app_class(moh)) {
if (unref) {
@@ -1435,7 +1435,7 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
if (!strcasecmp(tmp->name, "name"))
ast_copy_string(mohclass->name, tmp->value, sizeof(mohclass->name));
else if (!strcasecmp(tmp->name, "mode"))
- ast_copy_string(mohclass->mode, tmp->value, sizeof(mohclass->mode));
+ ast_copy_string(mohclass->mode, tmp->value, sizeof(mohclass->mode));
else if (!strcasecmp(tmp->name, "directory"))
ast_copy_string(mohclass->dir, tmp->value, sizeof(mohclass->dir));
else if (!strcasecmp(tmp->name, "application"))
@@ -1446,7 +1446,7 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
ast_set2_flag(mohclass, ast_true(tmp->value), MOH_RANDOMIZE);
else if (!strcasecmp(tmp->name, "sort") && !strcasecmp(tmp->value, "random"))
ast_set_flag(mohclass, MOH_RANDOMIZE);
- else if (!strcasecmp(tmp->name, "sort") && !strcasecmp(tmp->value, "alpha"))
+ else if (!strcasecmp(tmp->name, "sort") && !strcasecmp(tmp->value, "alpha"))
ast_set_flag(mohclass, MOH_SORTALPHA);
else if (!strcasecmp(tmp->name, "format")) {
ao2_cleanup(mohclass->format);
@@ -1639,7 +1639,7 @@ static void moh_class_destructor(void *obj)
stime = time(NULL) + 2;
killpid(class->pid, class->kill_delay, class->kill_method);
- while ((ast_wait_for_input(class->srcfd, 100) > 0) &&
+ while ((ast_wait_for_input(class->srcfd, 100) > 0) &&
(bytes = read(class->srcfd, buff, 8192)) && time(NULL) < stime) {
tbytes = tbytes + bytes;
}
@@ -1740,7 +1740,7 @@ static int load_moh_classes(int reload)
}
}
/* These names were deprecated in 1.4 and should not be used until after the next major release. */
- if (!strcasecmp(cat, "classes") || !strcasecmp(cat, "moh_files") ||
+ if (!strcasecmp(cat, "classes") || !strcasecmp(cat, "moh_files") ||
!strcasecmp(cat, "general")) {
continue;
}
@@ -1822,7 +1822,7 @@ static int load_moh_classes(int reload)
ast_config_destroy(cfg);
- ao2_t_callback(mohclasses, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE,
+ ao2_t_callback(mohclasses, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE,
moh_classes_delete_marked, NULL, "Purge marked classes");
return numclasses;
@@ -1969,8 +1969,8 @@ static int moh_class_cmp(void *obj, void *arg, int flags)
* 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
+ * 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.
*/
static int load_module(void)