diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-19 19:48:00 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-19 19:48:00 +0000 |
commit | f2eeca3bed9fef3110ee1946504e3b382341d7fc (patch) | |
tree | f32d0af75adb1ba287d025ed312df096422a910a /include | |
parent | a78774210ab8a62f2f675688748a02a227f67aef (diff) |
(closes issue #13480)
Reported by: tzafrir
Replace a bunch of if defined checks for Zaptel/DAHDI through several new defines in dahdi_compat.h. This removes a lot of code duplication. Example from bug:
#ifdef HAVE_ZAPTEL
fd = open("/dev/zap/pseudo", O_RDWR);
#else
fd = open("/dev/dahdi/pseudo", O_RDWR);
#endif
is replaced with:
fd = open(DAHDI_FILE_PSEUDO, O_RDRW);
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@165991 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/dahdi_compat.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asterisk/dahdi_compat.h b/include/asterisk/dahdi_compat.h index b1dc8d02c..a8f602af1 100644 --- a/include/asterisk/dahdi_compat.h +++ b/include/asterisk/dahdi_compat.h @@ -26,10 +26,16 @@ #include <dahdi/user.h> +#define DAHDI_DIR_NAME "/dev/dahdi" +#define DAHDI_NAME "DAHDI" + #elif defined(HAVE_ZAPTEL) #include <zaptel/zaptel.h> +#define DAHDI_DIR_NAME "/dev/zap" +#define DAHDI_NAME "DAHDI" + /* Compiling against Zaptel instead of DAHDI */ #if defined(__ZT_SIG_FXO) @@ -443,4 +449,10 @@ #endif +#define DAHDI_FILE_CHANNEL DAHDI_DIR_NAME "/channel" +#define DAHDI_FILE_CTL DAHDI_DIR_NAME "/ctl" +#define DAHDI_FILE_PSEUDO DAHDI_DIR_NAME "/pseudo" +#define DAHDI_FILE_TIMER DAHDI_DIR_NAME "/timer" +#define DAHDI_FILE_TRANSCODE DAHDI_DIR_NAME "/transcode" + #endif /* DAHDI_COMPAT_H */ |