aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_musiconhold.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-12 19:08:20 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-12 19:08:20 +0000
commitf84b02a71d0968338c22758b24cc14e15e3864a4 (patch)
tree464a2032e05934a867493f45e5a2605929fceb8a /res/res_musiconhold.c
parentac54a25ad7440165f775131b2859ab56aa3c5a92 (diff)
Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff should continue working. Release announcement to follow.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@122314 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r--res/res_musiconhold.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index faab84cae..476c7d120 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -52,10 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <thread.h>
#endif
-#ifdef HAVE_ZAPTEL
-#include <zaptel/zaptel.h>
-#endif
-
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/logger.h"
@@ -72,6 +68,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/stringfields.h"
#include "asterisk/linkedlists.h"
+#include "asterisk/dahdi_compat.h"
+
#define INITIAL_NUM_FILES 8
static char *app0 = "MusicOnHold";
@@ -865,7 +863,7 @@ static int moh_scan_files(struct mohclass *class) {
static int moh_register(struct mohclass *moh, int reload)
{
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
int x;
#endif
struct mohclass *mohclass = NULL;
@@ -909,15 +907,19 @@ static int moh_register(struct mohclass *moh, int reload)
ast_set_flag(moh, MOH_QUIET);
moh->srcfd = -1;
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
/* Open /dev/zap/pseudo for timing... Is
there a better, yet reliable way to do this? */
+#ifdef HAVE_ZAPTEL
moh->pseudofd = open("/dev/zap/pseudo", O_RDONLY);
+#else
+ moh->pseudofd = open("/dev/dahdi/pseudo", O_RDONLY);
+#endif
if (moh->pseudofd < 0) {
ast_log(LOG_WARNING, "Unable to open pseudo channel for timing... Sound may be choppy.\n");
} else {
x = 320;
- ioctl(moh->pseudofd, ZT_SET_BLOCKSIZE, &x);
+ ioctl(moh->pseudofd, DAHDI_SET_BLOCKSIZE, &x);
}
#else
moh->pseudofd = -1;