/*** MODULEINFO
<conflict>win32</conflict>
<use>dahdi</use>
- <depend>working_fork</depend>
***/
#include "asterisk.h"
.generate = moh_files_generator,
};
+#ifdef HAVE_WORKING_FORK
static int spawn_mp3(struct mohclass *class)
{
int fds[2];
}
return NULL;
}
+#endif
static int moh0_exec(struct ast_channel *chan, void *data)
{
return 0;
}
+#ifdef HAVE_WORKING_FORK
static int init_app_class(struct mohclass *class)
{
#ifdef HAVE_DAHDI
return 0;
}
+#endif
/*!
* \note This function owns the reference it gets to moh
} 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);