? Makefile.save ? make_defaults_h ? make_version_h ? include/asterisk/.cvsignore Index: .cvsignore =================================================================== RCS file: /usr/cvsroot/asterisk/.cvsignore,v retrieving revision 1.8 diff -u -r1.8 .cvsignore --- .cvsignore 1 Apr 2005 21:28:40 -0000 1.8 +++ .cvsignore 2 May 2005 14:31:26 -0000 @@ -14,3 +14,4 @@ tags TAGS *.os +defaults.h Index: Makefile =================================================================== RCS file: /usr/cvsroot/asterisk/Makefile,v retrieving revision 1.152 diff -u -r1.152 Makefile --- Makefile 1 May 2005 01:43:44 -0000 1.152 +++ Makefile 2 May 2005 14:31:26 -0000 @@ -211,22 +211,10 @@ LIBEDIT=editline/libedit.a -ASTERISKVERSION=$(shell if [ -f .version ]; then cat .version; else if [ -d CVS ]; then if [ -f CVS/Tag ] ; then echo "CVS-`sed 's/^T//g' CVS/Tag`-`date +"%D-%T"`"; else echo "CVS-HEAD-`date +"%D-%T"`"; fi; fi; fi) +ASTERISKVERSION=$(shell if [ -f .version ]; then cat .version; else if [ -d CVS ]; then if [ -f CVS/Tag ] ; then echo "CVS-`sed 's/^T//g' CVS/Tag`-`date +"%D-%T"`"; else echo "CVS-HEAD"; fi; fi; fi) ASTERISKVERSIONNUM=$(shell if [ -d CVS ]; then echo 999999 ; else if [ -f .version ] ; then awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version ; else echo 000000 ; fi ; fi) HTTPDIR=$(shell if [ -d $(CROSS_COMPILE_TARGET)/var/www ]; then echo "/var/www"; else echo "/home/httpd"; fi) RPMVERSION=$(shell if [ -f .version ]; then sed 's/[-\/:]/_/g' .version; else echo "unknown" ; fi) -CFLAGS+=-DASTERISK_VERSION=\"$(ASTERISKVERSION)\" -CFLAGS+=-DASTERISK_VERSION_NUM=$(ASTERISKVERSIONNUM) -CFLAGS+=-DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\" -CFLAGS+=-DASTETCDIR=\"$(ASTETCDIR)\" -CFLAGS+=-DASTLIBDIR=\"$(ASTLIBDIR)\" -CFLAGS+=-DASTVARLIBDIR=\"$(ASTVARLIBDIR)\" -CFLAGS+=-DASTVARRUNDIR=\"$(ASTVARRUNDIR)\" -CFLAGS+=-DASTSPOOLDIR=\"$(ASTSPOOLDIR)\" -CFLAGS+=-DASTLOGDIR=\"$(ASTLOGDIR)\" -CFLAGS+=-DASTCONFPATH=\"$(ASTCONFPATH)\" -CFLAGS+=-DASTMODDIR=\"$(MODULES_DIR)\" -CFLAGS+=-DASTAGIDIR=\"$(AGI_DIR)\" CFLAGS+= $(DEBUG_THREADS) CFLAGS+= $(TRACE_FRAMES) @@ -326,22 +314,11 @@ include .tags-depend endif -.PHONY: _version - -_version: - if [ -d CVS ] && [ ! -f .version ]; then echo $(ASTERISKVERSION) > .version; fi - -.version: _version - .y.c: bison $< --name-prefix=ast_yy -o $@ ast_expr.o: ast_expr.c -cli.o: cli.c build.h - -asterisk.o: asterisk.c build.h - manpage: asterisk.8.gz asterisk.8.gz: asterisk.sgml @@ -363,13 +340,26 @@ asterisk.txt: asterisk.sgml docbook2txt asterisk.sgml -ifneq ($(strip $(ASTERISKVERSION)),) -build.h: .version - ./make_build_h -else -build.h: - ./make_build_h -endif +defaults.h: FORCE + ./make_defaults_h > $@.tmp + if ! cmp -s $@.tmp $@ ; then \ + mv $@.tmp $@ ; \ + fi + rm -f $@.tmp + +include/asterisk/build.h: FORCE + ./make_build_h > $@.tmp + if ! cmp -s $@.tmp $@ ; then \ + mv $@.tmp $@ ; \ + fi + rm -f $@.tmp + +include/asterisk/version.h: FORCE + ./make_version_h > $@.tmp + if ! cmp -s $@.tmp $@ ; then \ + mv $@.tmp $@ ; \ + fi + rm -f $@.tmp stdtime/libtime.a: FORCE @if [ -d stdtime ]; then \ @@ -391,7 +381,9 @@ clean: for x in $(SUBDIRS); do $(MAKE) -C $$x clean || exit 1 ; done rm -f *.o *.so asterisk .depend - rm -f build.h + rm -f defaults.h + rm -f include/asterisk/build.h + rm -f include/asterisk/version.h rm -f ast_expr.c rm -f .version rm -f .tags-depend .tags-sources tags TAGS @@ -694,7 +686,7 @@ valgrind: dont-optimize -depend: .depend +depend: .depend defaults.h include/asterisk/build.h include/asterisk/version.h for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done .depend: Index: app.c =================================================================== RCS file: /usr/cvsroot/asterisk/app.c,v retrieving revision 1.58 diff -u -r1.58 app.c --- app.c 29 Apr 2005 17:00:33 -0000 1.58 +++ app.c 2 May 2005 14:31:27 -0000 @@ -34,7 +34,6 @@ #include "asterisk/lock.h" #include "asterisk/indications.h" #include "asterisk.h" -#include "astconf.h" #define MAX_OTHER_FORMATS 10 Index: asterisk.c =================================================================== RCS file: /usr/cvsroot/asterisk/asterisk.c,v retrieving revision 1.151 diff -u -r1.151 asterisk.c --- asterisk.c 29 Apr 2005 17:24:58 -0000 1.151 +++ asterisk.c 2 May 2005 14:31:27 -0000 @@ -33,6 +33,7 @@ #include #endif +#include "asterisk.h" #include "asterisk/logger.h" #include "asterisk/options.h" #include "asterisk/cli.h" @@ -55,8 +56,11 @@ #include "asterisk/io.h" #include "asterisk/lock.h" #include "editline/histedit.h" -#include "asterisk.h" #include "asterisk/config.h" +#include "asterisk/version.h" +#include "asterisk/build.h" + +#include "defaults.h" #ifndef AF_LOCAL #define AF_LOCAL AF_UNIX @@ -125,6 +129,7 @@ char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH]; char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH]; char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH]; +char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH]; char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH]; char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH]; char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH]; @@ -392,7 +397,7 @@ int x; struct ast_config *cfg; - char *config = ASTCONFPATH; + char *config = AST_CONFIG_FILE; char *owner; char *group; char *perms; @@ -1554,7 +1559,7 @@ struct ast_config *cfg; struct ast_variable *v; struct ast_variable *v_ctlfile; - char *config = ASTCONFPATH; + char *config = AST_CONFIG_FILE; if (option_overrideconfig == 1) { cfg = ast_config_load((char *)ast_config_AST_CONFIG_FILE); @@ -1567,6 +1572,7 @@ /* init with buildtime config */ strncpy((char *)ast_config_AST_CONFIG_DIR,AST_CONFIG_DIR,sizeof(ast_config_AST_CONFIG_DIR)-1); strncpy((char *)ast_config_AST_SPOOL_DIR,AST_SPOOL_DIR,sizeof(ast_config_AST_SPOOL_DIR)-1); + snprintf((char *)ast_config_AST_MONITOR_DIR,sizeof(ast_config_AST_MONITOR_DIR)-1,"%s/monitor",ast_config_AST_SPOOL_DIR); strncpy((char *)ast_config_AST_MODULE_DIR,AST_MODULE_DIR,sizeof(ast_config_AST_VAR_DIR)-1); strncpy((char *)ast_config_AST_VAR_DIR,AST_VAR_DIR,sizeof(ast_config_AST_VAR_DIR)-1); strncpy((char *)ast_config_AST_LOG_DIR,AST_LOG_DIR,sizeof(ast_config_AST_LOG_DIR)-1); @@ -1595,6 +1601,7 @@ strncpy((char *)ast_config_AST_CONFIG_DIR,v->value,sizeof(ast_config_AST_CONFIG_DIR)-1); } else if (!strcasecmp(v->name, "astspooldir")) { strncpy((char *)ast_config_AST_SPOOL_DIR,v->value,sizeof(ast_config_AST_SPOOL_DIR)-1); + snprintf((char *)ast_config_AST_MONITOR_DIR,sizeof(ast_config_AST_MONITOR_DIR)-1,"%s/monitor",v->value); } else if (!strcasecmp(v->name, "astvarlibdir")) { strncpy((char *)ast_config_AST_VAR_DIR,v->value,sizeof(ast_config_AST_VAR_DIR)-1); snprintf((char *)ast_config_AST_DB,sizeof(ast_config_AST_DB),"%s/%s",v->value,"astdb"); Index: cli.c =================================================================== RCS file: /usr/cvsroot/asterisk/cli.c,v retrieving revision 1.79 diff -u -r1.79 cli.c --- cli.c 29 Apr 2005 17:00:33 -0000 1.79 +++ cli.c 2 May 2005 14:31:27 -0000 @@ -32,11 +32,11 @@ #include "editline/readline/readline.h" /* For module directory */ #include "asterisk.h" -#include "build.h" -#include "astconf.h" +#include "asterisk/version.h" +#include "asterisk/build.h" #define VERSION_INFO "Asterisk " ASTERISK_VERSION " built by " BUILD_USER "@" BUILD_HOSTNAME \ - " on a " BUILD_MACHINE " running " BUILD_OS + " on a " BUILD_MACHINE " running " BUILD_OS " on " BUILD_DATE extern unsigned long global_fin, global_fout; Index: config.c =================================================================== RCS file: /usr/cvsroot/asterisk/config.c,v retrieving revision 1.61 diff -u -r1.61 config.c --- config.c 22 Apr 2005 13:11:34 -0000 1.61 +++ config.c 2 May 2005 14:31:27 -0000 @@ -34,7 +34,6 @@ #include "asterisk/channel.h" #include "asterisk/app.h" #include "asterisk.h" -#include "astconf.h" #define MAX_NESTED_COMMENTS 128 #define COMMENT_START ";--" @@ -689,7 +688,7 @@ if (configfile[0] == '/') { strncpy(fn, configfile, sizeof(fn)-1); } else { - snprintf(fn, sizeof(fn), "%s/%s", AST_CONFIG_DIR, configfile); + snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, configfile); } time(&t); strncpy(date, ctime(&t), sizeof(date) - 1); Index: db.c =================================================================== RCS file: /usr/cvsroot/asterisk/db.c,v retrieving revision 1.16 diff -u -r1.16 db.c --- db.c 22 Apr 2005 13:11:34 -0000 1.16 +++ db.c 2 May 2005 14:31:27 -0000 @@ -37,7 +37,6 @@ #include "asterisk/manager.h" #include "db1-ast/include/db.h" #include "asterisk.h" -#include "astconf.h" static DB *astdb; AST_MUTEX_DEFINE_STATIC(dblock); Index: file.c =================================================================== RCS file: /usr/cvsroot/asterisk/file.c,v retrieving revision 1.62 diff -u -r1.62 file.c --- file.c 22 Apr 2005 13:11:34 -0000 1.62 +++ file.c 2 May 2005 14:31:27 -0000 @@ -34,7 +34,6 @@ #include "asterisk/lock.h" #include "asterisk/app.h" #include "asterisk.h" -#include "astconf.h" struct ast_format { /* Name of format */ Index: image.c =================================================================== RCS file: /usr/cvsroot/asterisk/image.c,v retrieving revision 1.13 diff -u -r1.13 image.c --- image.c 22 Apr 2005 13:11:34 -0000 1.13 +++ image.c 2 May 2005 14:31:27 -0000 @@ -30,7 +30,6 @@ #include "asterisk/cli.h" #include "asterisk/lock.h" #include "asterisk.h" -#include "astconf.h" static struct ast_imager *list; AST_MUTEX_DEFINE_STATIC(listlock); Index: loader.c =================================================================== RCS file: /usr/cvsroot/asterisk/loader.c,v retrieving revision 1.40 diff -u -r1.40 loader.c --- loader.c 22 Apr 2005 13:11:34 -0000 1.40 +++ loader.c 2 May 2005 14:31:27 -0000 @@ -34,7 +34,6 @@ #endif #include "asterisk/md5.h" #include "asterisk.h" -#include "astconf.h" #ifndef RTLD_NOW #define RTLD_NOW 0 Index: logger.c =================================================================== RCS file: /usr/cvsroot/asterisk/logger.c,v retrieving revision 1.66 diff -u -r1.66 logger.c --- logger.c 22 Apr 2005 13:11:34 -0000 1.66 +++ logger.c 2 May 2005 14:31:27 -0000 @@ -34,7 +34,6 @@ #include "asterisk/utils.h" #include "asterisk/manager.h" #include "asterisk.h" -#include "astconf.h" static int syslog_level_map[] = { LOG_DEBUG, Index: make_build_h =================================================================== RCS file: /usr/cvsroot/asterisk/make_build_h,v retrieving revision 1.1 diff -u -r1.1 make_build_h --- make_build_h 9 May 2001 03:08:02 -0000 1.1 +++ make_build_h 2 May 2005 14:31:27 -0000 @@ -4,9 +4,8 @@ MACHINE=`uname -m` OS=`uname -s` USER=`whoami` -VERSION=`cat .version` -rm -f build.h -cat > build.h << END +DATE=`date --utc "+%Y-%m-%d %H:%M:%S"` +cat << END /* * build.h * Automatically generated @@ -15,6 +14,7 @@ #define BUILD_KERNEL "${KERNEL}" #define BUILD_MACHINE "${MACHINE}" #define BUILD_OS "${OS}" -#define BUILD_VERSION "${VERSION}" +#define BUILD_DATE "${DATE}" #define BUILD_USER "${USER}" + END Index: apps/app_adsiprog.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_adsiprog.c,v retrieving revision 1.10 diff -u -r1.10 app_adsiprog.c --- apps/app_adsiprog.c 21 Apr 2005 06:02:43 -0000 1.10 +++ apps/app_adsiprog.c 2 May 2005 14:31:27 -0000 @@ -31,7 +31,6 @@ #include #include "asterisk.h" -#include "astconf.h" static char *tdesc = "Asterisk ADSI Programming Application"; Index: apps/app_chanspy.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_chanspy.c,v retrieving revision 1.15 diff -u -r1.15 app_chanspy.c --- apps/app_chanspy.c 21 Apr 2005 06:30:23 -0000 1.15 +++ apps/app_chanspy.c 2 May 2005 14:31:27 -0000 @@ -30,8 +30,6 @@ #include "asterisk/module.h" #include "asterisk/lock.h" -#define AST_MONITOR_DIR AST_SPOOL_DIR "/monitor" - AST_MUTEX_DEFINE_STATIC(modlock); #define ast_fit_in_short(in) (in < -32768 ? -32768 : in > 32767 ? 32767 : in) @@ -704,7 +702,7 @@ if (recbase) { char filename[512]; - snprintf(filename,sizeof(filename),"%s/%s.%ld.raw",AST_MONITOR_DIR, recbase, time(NULL)); + snprintf(filename,sizeof(filename),"%s/%s.%ld.raw",ast_config_AST_MONITOR_DIR, recbase, time(NULL)); if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC)) <= 0) { ast_log(LOG_WARNING, "Cannot open %s for recording\n", filename); fd = 0; Index: apps/app_directory.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_directory.c,v retrieving revision 1.35 diff -u -r1.35 app_directory.c --- apps/app_directory.c 21 Apr 2005 06:02:43 -0000 1.35 +++ apps/app_directory.c 2 May 2005 14:31:27 -0000 @@ -25,7 +25,6 @@ #include #include #include "asterisk.h" -#include "astconf.h" static char *tdesc = "Extension Directory"; static char *app = "Directory"; Index: apps/app_hasnewvoicemail.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_hasnewvoicemail.c,v retrieving revision 1.12 diff -u -r1.12 app_hasnewvoicemail.c --- apps/app_hasnewvoicemail.c 21 Apr 2005 06:02:43 -0000 1.12 +++ apps/app_hasnewvoicemail.c 2 May 2005 14:31:27 -0000 @@ -45,7 +45,7 @@ #include #include -#include "astconf.h" +#include "asterisk.h" static char *tdesc = "Indicator for whether a voice mailbox has messages in a given folder."; static char *app_hasvoicemail = "HasVoicemail"; Index: apps/app_ices.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_ices.c,v retrieving revision 1.5 diff -u -r1.5 app_ices.c --- apps/app_ices.c 21 Apr 2005 06:02:43 -0000 1.5 +++ apps/app_ices.c 2 May 2005 14:31:27 -0000 @@ -27,7 +27,7 @@ #include #include #include -#include "astconf.h" +#include "asterisk.h" #define ICES "/usr/bin/ices" #define LOCAL_ICES "/usr/local/bin/ices" Index: apps/app_math.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_math.c,v retrieving revision 1.7 diff -u -r1.7 app_math.c --- apps/app_math.c 21 Apr 2005 06:02:43 -0000 1.7 +++ apps/app_math.c 2 May 2005 14:31:27 -0000 @@ -38,7 +38,7 @@ #include "asterisk/translate.h" #include #include -#include "astconf.h" +#include "asterisk.h" static char *tdesc = "Basic Math Functions"; Index: apps/app_meetme.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v retrieving revision 1.96 diff -u -r1.96 app_meetme.c --- apps/app_meetme.c 29 Apr 2005 17:00:33 -0000 1.96 +++ apps/app_meetme.c 2 May 2005 14:31:27 -0000 @@ -33,7 +33,6 @@ #include #include #include "asterisk.h" -#include "astconf.h" #ifdef __linux__ #include Index: apps/app_queue.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_queue.c,v retrieving revision 1.136 diff -u -r1.136 app_queue.c --- apps/app_queue.c 21 Apr 2005 06:02:43 -0000 1.136 +++ apps/app_queue.c 2 May 2005 14:31:27 -0000 @@ -67,7 +67,7 @@ #include #include -#include "astconf.h" +#include "asterisk.h" #define QUEUE_STRATEGY_RINGALL 0 #define QUEUE_STRATEGY_ROUNDROBIN 1 Index: apps/app_sms.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_sms.c,v retrieving revision 1.20 diff -u -r1.20 app_sms.c --- apps/app_sms.c 29 Apr 2005 16:13:04 -0000 1.20 +++ apps/app_sms.c 2 May 2005 14:31:27 -0000 @@ -27,7 +27,7 @@ #include #include #include -#include "astconf.h" +#include "asterisk.h" /* output using Alaw rather than linear */ /* #define OUTALAW */ Index: apps/app_test.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_test.c,v retrieving revision 1.8 diff -u -r1.8 app_test.c --- apps/app_test.c 21 Apr 2005 06:02:43 -0000 1.8 +++ apps/app_test.c 2 May 2005 14:31:27 -0000 @@ -26,7 +26,7 @@ #include #include #include -#include "astconf.h" +#include "asterisk.h" static char *tdesc = "Interface Test Application"; Index: apps/app_voicemail.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v retrieving revision 1.209 diff -u -r1.209 app_voicemail.c --- apps/app_voicemail.c 29 Apr 2005 17:00:33 -0000 1.209 +++ apps/app_voicemail.c 2 May 2005 14:31:28 -0000 @@ -47,7 +47,6 @@ #include #include "asterisk.h" -#include "astconf.h" #define COMMAND_TIMEOUT 5000 Index: cdr/cdr_csv.c =================================================================== RCS file: /usr/cvsroot/asterisk/cdr/cdr_csv.c,v retrieving revision 1.14 diff -u -r1.14 cdr_csv.c --- cdr/cdr_csv.c 21 Apr 2005 06:02:43 -0000 1.14 +++ cdr/cdr_csv.c 2 May 2005 14:31:28 -0000 @@ -21,7 +21,6 @@ #include "asterisk/logger.h" #include "asterisk/utils.h" #include "asterisk.h" -#include "astconf.h" #define CSV_LOG_DIR "/cdr-csv" #define CSV_MASTER "/Master.csv" Index: cdr/cdr_custom.c =================================================================== RCS file: /usr/cvsroot/asterisk/cdr/cdr_custom.c,v retrieving revision 1.9 diff -u -r1.9 cdr_custom.c --- cdr/cdr_custom.c 21 Apr 2005 06:02:43 -0000 1.9 +++ cdr/cdr_custom.c 2 May 2005 14:31:28 -0000 @@ -23,7 +23,6 @@ #include "asterisk/logger.h" #include "asterisk/utils.h" #include "asterisk.h" -#include "astconf.h" #define CUSTOM_LOG_DIR "/cdr_custom" Index: cdr/cdr_manager.c =================================================================== RCS file: /usr/cvsroot/asterisk/cdr/cdr_manager.c,v retrieving revision 1.3 diff -u -r1.3 cdr_manager.c --- cdr/cdr_manager.c 21 Apr 2005 06:02:43 -0000 1.3 +++ cdr/cdr_manager.c 2 May 2005 14:31:28 -0000 @@ -17,7 +17,6 @@ #include "asterisk/manager.h" #include "asterisk/config.h" #include "asterisk.h" -#include "astconf.h" #include #include #include Index: channels/chan_iax2.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v retrieving revision 1.277 diff -u -r1.277 chan_iax2.c --- channels/chan_iax2.c 2 May 2005 01:34:21 -0000 1.277 +++ channels/chan_iax2.c 2 May 2005 14:31:28 -0000 @@ -69,7 +69,7 @@ #include "iax2.h" #include "iax2-parser.h" #include "iax2-provision.h" -#include "astconf.h" +#include "asterisk.h" /* Define NEWJB to use the new channel independent jitterbuffer, * otherwise, use the old jitterbuffer */ Index: include/asterisk.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk.h,v retrieving revision 1.1 diff -u -r1.1 asterisk.h --- include/asterisk.h 21 Apr 2005 06:02:44 -0000 1.1 +++ include/asterisk.h 2 May 2005 14:31:28 -0000 @@ -17,23 +17,21 @@ #define DEFAULT_LANGUAGE "en" #define AST_CONFIG_MAX_PATH 255 -#define AST_CONFIG_DIR ASTETCDIR -#define AST_RUN_DIR ASTVARRUNDIR -#define AST_SOCKET ASTVARRUNDIR "/asterisk.ctl" -#define AST_PID ASTVARRUNDIR "/asterisk.pid" -#define AST_MODULE_DIR ASTMODDIR -#define AST_SPOOL_DIR ASTSPOOLDIR -#define AST_VAR_DIR ASTVARLIBDIR -#define AST_LOG_DIR ASTLOGDIR -#define AST_AGI_DIR ASTAGIDIR -#define AST_KEY_DIR ASTVARLIBDIR "/keys" -#define AST_DB ASTVARLIBDIR "/astdb" -#define AST_TMP_DIR ASTSPOOLDIR "/tmp" -#define AST_CONFIG_FILE ASTCONFPATH - -#define AST_SOUNDS AST_VAR_DIR "/sounds" -#define AST_IMAGES AST_VAR_DIR "/images" +/* provided in asterisk.c */ +extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_DB[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_PID[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH]; /* Provided by module.c */ extern int load_modules(void); Index: pbx/pbx_config.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v retrieving revision 1.59 diff -u -r1.59 pbx_config.c --- pbx/pbx_config.c 29 Apr 2005 17:00:33 -0000 1.59 +++ pbx/pbx_config.c 2 May 2005 14:31:28 -0000 @@ -25,7 +25,6 @@ #include /* For where to put dynamic tables */ #include "asterisk.h" -#include "astconf.h" #ifdef __AST_DEBUG_MALLOC static void FREE(void *ptr) Index: pbx/pbx_spool.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx/pbx_spool.c,v retrieving revision 1.22 diff -u -r1.22 pbx_spool.c --- pbx/pbx_spool.c 21 Apr 2005 06:02:44 -0000 1.22 +++ pbx/pbx_spool.c 2 May 2005 14:31:29 -0000 @@ -31,7 +31,7 @@ #include #include #include -#include "astconf.h" +#include "asterisk.h" /* * pbx_spool is similar in spirit to qcall, but with substantially enhanced functionality... Index: res/res_agi.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v retrieving revision 1.34 diff -u -r1.34 res_agi.c --- res/res_agi.c 27 Apr 2005 01:42:33 -0000 1.34 +++ res/res_agi.c 2 May 2005 14:31:29 -0000 @@ -47,7 +47,6 @@ #include "asterisk/lock.h" #include "asterisk/agi.h" #include "asterisk.h" -#include "astconf.h" #ifdef SOLARIS #include "asterisk/astmm.h" #endif Index: res/res_crypto.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_crypto.c,v retrieving revision 1.20 diff -u -r1.20 res_crypto.c --- res/res_crypto.c 21 Apr 2005 06:02:44 -0000 1.20 +++ res/res_crypto.c 2 May 2005 14:31:29 -0000 @@ -33,7 +33,6 @@ #include #include #include "asterisk.h" -#include "astconf.h" /* * Asterisk uses RSA keys with SHA-1 message digests for its Index: res/res_monitor.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_monitor.c,v retrieving revision 1.32 diff -u -r1.32 res_monitor.c --- res/res_monitor.c 21 Apr 2005 06:02:44 -0000 1.32 +++ res/res_monitor.c 2 May 2005 14:31:29 -0000 @@ -19,9 +19,6 @@ #include "asterisk/utils.h" #include "asterisk/config.h" #include "asterisk.h" -#include "astconf.h" - -#define AST_MONITOR_DIR AST_SPOOL_DIR "/monitor" AST_MUTEX_DEFINE_STATIC(monitorlock); @@ -83,7 +80,7 @@ char *channel_name, *p; /* Create monitoring directory if needed */ - if (mkdir(AST_MONITOR_DIR, 0770) < 0) { + if (mkdir(ast_config_AST_MONITOR_DIR, 0770) < 0) { if (errno != EEXIST) { ast_log(LOG_WARNING, "Unable to create audio monitor directory: %s\n", strerror(errno)); @@ -109,16 +106,16 @@ ast_safe_system(tmp); } snprintf(monitor->read_filename, FILENAME_MAX, "%s/%s-in", - directory ? "" : AST_MONITOR_DIR, fname_base); + directory ? "" : ast_config_AST_MONITOR_DIR, fname_base); snprintf(monitor->write_filename, FILENAME_MAX, "%s/%s-out", - directory ? "" : AST_MONITOR_DIR, fname_base); + directory ? "" : ast_config_AST_MONITOR_DIR, fname_base); strncpy(monitor->filename_base, fname_base, sizeof(monitor->filename_base) - 1); } else { ast_mutex_lock(&monitorlock); snprintf(monitor->read_filename, FILENAME_MAX, "%s/audio-in-%ld", - AST_MONITOR_DIR, seq); + ast_config_AST_MONITOR_DIR, seq); snprintf(monitor->write_filename, FILENAME_MAX, "%s/audio-out-%ld", - AST_MONITOR_DIR, seq); + ast_config_AST_MONITOR_DIR, seq); seq++; ast_mutex_unlock(&monitorlock); @@ -127,7 +124,7 @@ *p = '-'; } snprintf(monitor->filename_base, FILENAME_MAX, "%s/%ld-%s", - AST_MONITOR_DIR, time(NULL),channel_name); + ast_config_AST_MONITOR_DIR, time(NULL),channel_name); monitor->filename_changed = 1; } else { ast_log(LOG_ERROR,"Failed to allocate Memory\n"); @@ -236,7 +233,7 @@ char *format = !strcasecmp(chan->monitor->format,"wav49") ? "WAV" : chan->monitor->format; char *name = chan->monitor->filename_base; int directory = strchr(name, '/') ? 1 : 0; - char *dir = directory ? "" : AST_MONITOR_DIR; + char *dir = directory ? "" : ast_config_AST_MONITOR_DIR; /* Set the execute application */ execute = pbx_builtin_getvar_helper(chan, "MONITOR_EXEC"); @@ -295,7 +292,7 @@ ast_safe_system(tmp); } - snprintf(chan->monitor->filename_base, FILENAME_MAX, "%s/%s", directory ? "" : AST_MONITOR_DIR, fname_base); + snprintf(chan->monitor->filename_base, FILENAME_MAX, "%s/%s", directory ? "" : ast_config_AST_MONITOR_DIR, fname_base); } else { ast_log(LOG_WARNING, "Cannot change monitor filename of channel %s to %s, monitoring not started", chan->name, fname_base); } Index: res/res_musiconhold.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_musiconhold.c,v retrieving revision 1.58 diff -u -r1.58 res_musiconhold.c --- res/res_musiconhold.c 21 Apr 2005 06:02:44 -0000 1.58 +++ res/res_musiconhold.c 2 May 2005 14:31:29 -0000 @@ -16,7 +16,6 @@ #include "asterisk/logger.h" #include "asterisk/channel.h" #include "asterisk/pbx.h" -#include "astconf.h" #include "asterisk/options.h" #include "asterisk/module.h" #include "asterisk/translate.h"