Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff should continue working. Release announcement to follow.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jeff Peeler
2008-06-12 19:08:20 +00:00
parent 9f669a3a09
commit f9818af8dd
39 changed files with 2097 additions and 1510 deletions

View File

@@ -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;