summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/app_playback.c4
-rw-r--r--funcs/func_periodic_hook.c10
-rw-r--r--main/file.c4
-rw-r--r--tests/test_message.c9
4 files changed, 9 insertions, 18 deletions
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 678757319..e5df79445 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -490,7 +490,9 @@ static int playback_exec(struct ast_channel *chan, const char *data)
ast_stopstream(chan);
}
if (res) {
- ast_log(LOG_WARNING, "Playback failed on %s for %s\n", ast_channel_name(chan), (char *)data);
+ if (!ast_check_hangup(chan)) {
+ ast_log(LOG_WARNING, "Playback failed on %s for %s\n", ast_channel_name(chan), (char *)data);
+ }
res = 0;
mres = 1;
}
diff --git a/funcs/func_periodic_hook.c b/funcs/func_periodic_hook.c
index ce5aac054..cb019b41e 100644
--- a/funcs/func_periodic_hook.c
+++ b/funcs/func_periodic_hook.c
@@ -446,13 +446,9 @@ static struct ast_custom_function hook_function = {
.write = hook_write,
};
-static struct ast_context *func_periodic_hook_context;
-
static int unload_module(void)
{
- if (func_periodic_hook_context) {
- ast_context_destroy(func_periodic_hook_context, AST_MODULE);
- }
+ ast_context_destroy(NULL, AST_MODULE);
return ast_custom_function_unregister(&hook_function);
}
@@ -461,9 +457,7 @@ static int load_module(void)
{
int res;
- func_periodic_hook_context = ast_context_find_or_create(NULL, NULL,
- context_name, AST_MODULE);
- if (!func_periodic_hook_context) {
+ if (!ast_context_find_or_create(NULL, NULL, context_name, AST_MODULE)) {
ast_log(LOG_ERROR, "Failed to create %s dialplan context.\n", context_name);
return AST_MODULE_LOAD_DECLINE;
}
diff --git a/main/file.c b/main/file.c
index b0d5011cf..64406bf85 100644
--- a/main/file.c
+++ b/main/file.c
@@ -902,7 +902,7 @@ static enum fsread_res ast_readaudio_callback(struct ast_filestream *s)
if (!fr /* stream complete */ || ast_write(s->owner, fr) /* error writing */) {
if (fr) {
- ast_log(LOG_WARNING, "Failed to write frame\n");
+ ast_debug(2, "Failed to write frame\n");
ast_frfree(fr);
}
goto return_failure;
@@ -959,7 +959,7 @@ static enum fsread_res ast_readvideo_callback(struct ast_filestream *s)
if (!fr /* stream complete */ || ast_write(s->owner, fr) /* error writing */) {
if (fr) {
- ast_log(LOG_WARNING, "Failed to write frame\n");
+ ast_debug(2, "Failed to write frame\n");
ast_frfree(fr);
}
ast_channel_vstreamid_set(s->owner, -1);
diff --git a/tests/test_message.c b/tests/test_message.c
index 5db0ed044..285905d8c 100644
--- a/tests/test_message.c
+++ b/tests/test_message.c
@@ -51,8 +51,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
/*! \brief The number of user events we should get in a dialplan test */
#define DEFAULT_EXPECTED_EVENTS 4
-static struct ast_context *test_message_context;
-
/*! \brief The current number of received user events */
static int received_user_events;
@@ -822,9 +820,7 @@ static int unload_module(void)
AST_TEST_UNREGISTER(test_message_has_destination_handler);
AST_TEST_UNREGISTER(test_message_msg_send);
- if (test_message_context) {
- ast_context_destroy(test_message_context, AST_MODULE);
- }
+ ast_context_destroy(NULL, AST_MODULE);
ast_manager_unregister_hook(&user_event_hook);
@@ -835,8 +831,7 @@ static int create_test_dialplan(void)
{
int res = 0;
- test_message_context = ast_context_find_or_create(NULL, NULL, TEST_CONTEXT, AST_MODULE);
- if (!test_message_context) {
+ if (!ast_context_find_or_create(NULL, NULL, TEST_CONTEXT, AST_MODULE)) {
return -1;
}