From f84b02a71d0968338c22758b24cc14e15e3864a4 Mon Sep 17 00:00:00 2001 From: jpeeler Date: Thu, 12 Jun 2008 19:08:20 +0000 Subject: 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 --- res/res_musiconhold.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'res/res_musiconhold.c') 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 #endif -#ifdef HAVE_ZAPTEL -#include -#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; -- cgit v1.2.3