From 67751c3992e39e1652d9a2ac150a49b62695a9c3 Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Thu, 11 Jul 2002 16:49:29 +0000
Subject: [PATCH] Version 0.2.0 from FTP

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 formats/format_g723.c     | 2 +-
 formats/format_gsm.c      | 2 +-
 formats/format_mp3.c      | 2 +-
 formats/format_pcm.c      | 2 +-
 formats/format_vox.c      | 2 +-
 formats/format_wav_gsm.c  | 2 +-
 include/asterisk/module.h | 2 +-
 loader.c                  | 5 +++--
 res/res_musiconhold.c     | 9 ++++++---
 9 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/formats/format_g723.c b/formats/format_g723.c
index c54a640b3c..195815a46c 100755
--- a/formats/format_g723.c
+++ b/formats/format_g723.c
@@ -325,7 +325,7 @@ int unload_module()
 	tmp = glist;
 	while(tmp) {
 		if (tmp->owner)
-			ast_softhangup(tmp->owner);
+			ast_softhangup(tmp->owner, AST_SOFTHANGUP_APPUNLOAD);
 		tmpl = tmp;
 		tmp = tmp->next;
 		free(tmpl);
diff --git a/formats/format_gsm.c b/formats/format_gsm.c
index 1ac9869341..1ac981f7f4 100755
--- a/formats/format_gsm.c
+++ b/formats/format_gsm.c
@@ -271,7 +271,7 @@ int unload_module()
 	tmp = glist;
 	while(tmp) {
 		if (tmp->owner)
-			ast_softhangup(tmp->owner);
+			ast_softhangup(tmp->owner, AST_SOFTHANGUP_APPUNLOAD);
 		tmpl = tmp;
 		tmp = tmp->next;
 		free(tmpl);
diff --git a/formats/format_mp3.c b/formats/format_mp3.c
index e1ee086519..5c730f098c 100755
--- a/formats/format_mp3.c
+++ b/formats/format_mp3.c
@@ -269,7 +269,7 @@ int unload_module()
 	tmp = glist;
 	while(tmp) {
 		if (tmp->owner)
-			ast_softhangup(tmp->owner);
+			ast_softhangup(tmp->owner, AST_SOFTHANGUP_APPUNLOAD);
 		tmpl = tmp;
 		tmp = tmp->next;
 		free(tmpl);
diff --git a/formats/format_pcm.c b/formats/format_pcm.c
index befa05698a..8576f69957 100755
--- a/formats/format_pcm.c
+++ b/formats/format_pcm.c
@@ -266,7 +266,7 @@ int unload_module()
 	tmp = glist;
 	while(tmp) {
 		if (tmp->owner)
-			ast_softhangup(tmp->owner);
+			ast_softhangup(tmp->owner, AST_SOFTHANGUP_APPUNLOAD);
 		tmpl = tmp;
 		tmp = tmp->next;
 		free(tmpl);
diff --git a/formats/format_vox.c b/formats/format_vox.c
index 67934219a3..94957e7d72 100755
--- a/formats/format_vox.c
+++ b/formats/format_vox.c
@@ -390,7 +390,7 @@ int unload_module()
 	tmp = glist;
 	while(tmp) {
 		if (tmp->owner)
-			ast_softhangup(tmp->owner);
+			ast_softhangup(tmp->owner, AST_SOFTHANGUP_APPUNLOAD);
 		tmpl = tmp;
 		tmp = tmp->next;
 		free(tmpl);
diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c
index b1a8020d93..d7f718f6d7 100755
--- a/formats/format_wav_gsm.c
+++ b/formats/format_wav_gsm.c
@@ -563,7 +563,7 @@ int unload_module()
 	tmp = glist;
 	while(tmp) {
 		if (tmp->owner)
-			ast_softhangup(tmp->owner);
+			ast_softhangup(tmp->owner, AST_SOFTHANGUP_APPUNLOAD);
 		tmpl = tmp;
 		tmp = tmp->next;
 		free(tmpl);
diff --git a/include/asterisk/module.h b/include/asterisk/module.h
index b270c111cd..93d059d95b 100755
--- a/include/asterisk/module.h
+++ b/include/asterisk/module.h
@@ -194,7 +194,7 @@ void ast_module_reload(void);
 	pthread_mutex_lock(&localuser_lock); \
 	u = localusers; \
 	while(u) { \
-		ast_softhangup(u->chan); \
+		ast_softhangup(u->chan, AST_SOFTHANGUP_APPUNLOAD); \
 		ul = u; \
 		u = u->next; \
 		free(ul); \
diff --git a/loader.c b/loader.c
index 03b6b018b0..6835fd8d0a 100755
--- a/loader.c
+++ b/loader.c
@@ -22,6 +22,7 @@
 #include <asterisk/logger.h>
 #include <asterisk/channel.h>
 #include <asterisk/term.h>
+#include <asterisk/manager.h>
 #include <dlfcn.h>
 #include <asterisk/md5.h>
 #define __USE_GNU
@@ -137,8 +138,8 @@ void ast_module_reload(void)
 {
 	struct module *m;
 
-	/* We'll do the logger the favor of calling its reload here first */
-	
+	/* We'll do the logger and manager the favor of calling its reload here first */
+	reload_manager();
 
 	ast_pthread_mutex_lock(&modlock);
 	m = module_list;
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index c696bd55a5..2630ba7c22 100755
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -100,8 +100,9 @@ static pthread_mutex_t moh_lock = AST_MUTEX_INITIALIZER;
 static void child_handler(int sig)
 {
 	int status;
-	if (wait4(-1,&status, WNOHANG, NULL)<1)		
-		ast_log(LOG_NOTICE, "Huh?  Child handler, but nobody there?\n");
+	if (wait4(-1,&status, WNOHANG, NULL)<1)	
+		if (option_debug)	
+			ast_log(LOG_DEBUG, "Huh?  Child handler, but nobody there?\n");
 }
 
 static int spawn_mp3(struct mohclass *class)
@@ -126,7 +127,9 @@ static int spawn_mp3(struct mohclass *class)
 	argv[3] = "--mono";
 	argv[4] = "-r";
 	argv[5] = "8000";
-	argc = 6;
+	argv[6] = "-b";
+	argv[7] = "2048";
+	argc = 8;
 	if (class->quiet) {
 		argv[argc++] = "-f";
 		argv[argc++] = "8192";
-- 
GitLab