aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-09 21:19:17 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-09 21:19:17 +0000
commit074670f31886b9accd933dbe99cd48fb581bfd66 (patch)
tree2b0aa2b616a849d7c86edd545746ae54e891270d /res
parentd2637d9efb324caae0d069b757185ad2d311ab13 (diff)
Let systems without a working fork() use res_musiconhold.
Files mode doesn't require anything special, so that can still be used just fine. AST-357 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@269426 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_musiconhold.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 308d5220c..cb50b4c58 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -28,7 +28,6 @@
/*** MODULEINFO
<conflict>win32</conflict>
<use>dahdi</use>
- <depend>working_fork</depend>
***/
#include "asterisk.h"
@@ -353,6 +352,7 @@ static struct ast_generator moh_file_stream = {
.generate = moh_files_generator,
};
+#ifdef HAVE_WORKING_FORK
static int spawn_mp3(struct mohclass *class)
{
int fds[2];
@@ -605,6 +605,7 @@ static void *monmp3thread(void *data)
}
return NULL;
}
+#endif
static int moh0_exec(struct ast_channel *chan, void *data)
{
@@ -917,6 +918,7 @@ static int init_files_class(struct mohclass *class)
return 0;
}
+#ifdef HAVE_WORKING_FORK
static int init_app_class(struct mohclass *class)
{
#ifdef HAVE_DAHDI
@@ -959,6 +961,7 @@ static int init_app_class(struct mohclass *class)
return 0;
}
+#endif
/*!
* \note This function owns the reference it gets to moh
@@ -988,10 +991,16 @@ static int moh_register(struct mohclass *moh, int reload)
} 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")) {
+#ifdef HAVE_WORKING_FORK
if (init_app_class(moh)) {
moh = mohclass_unref(moh);
return -1;
}
+#else
+ ast_log(LOG_WARNING, "Cannot use mode '%s' music on hold, as there is no working fork().\n", moh->mode);
+ moh = mohclass_unref(moh);
+ return -1;
+#endif
} else {
ast_log(LOG_WARNING, "Don't know how to do a mode '%s' music on hold\n", moh->mode);
moh = mohclass_unref(moh);