aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.cleancount2
-rwxr-xr-x.cvsignore2
-rwxr-xr-xMakefile58
-rwxr-xr-xapp.c1
-rwxr-xr-xapps/app_adsiprog.c1
-rwxr-xr-xapps/app_chanspy.c4
-rwxr-xr-xapps/app_directory.c1
-rwxr-xr-xapps/app_hasnewvoicemail.c2
-rwxr-xr-xapps/app_ices.c2
-rwxr-xr-xapps/app_math.c2
-rwxr-xr-xapps/app_meetme.c1
-rwxr-xr-xapps/app_queue.c2
-rwxr-xr-xapps/app_sms.c2
-rwxr-xr-xapps/app_test.c2
-rwxr-xr-xapps/app_voicemail.c1
-rwxr-xr-xasterisk.c13
-rwxr-xr-xcdr/cdr_csv.c1
-rwxr-xr-xcdr/cdr_custom.c1
-rwxr-xr-xcdr/cdr_manager.c1
-rwxr-xr-xchannels/chan_iax2.c2
-rwxr-xr-xcli.c6
-rwxr-xr-xconfig.c3
-rwxr-xr-xdb.c1
-rwxr-xr-xfile.c1
-rwxr-xr-ximage.c1
-rwxr-xr-xinclude/astconf.h32
-rwxr-xr-xinclude/asterisk.h30
-rwxr-xr-xloader.c1
-rwxr-xr-xlogger.c1
-rwxr-xr-xmake_build_h8
-rwxr-xr-xpbx/pbx_config.c1
-rwxr-xr-xpbx/pbx_spool.c2
-rwxr-xr-xres/res_agi.c1
-rwxr-xr-xres/res_crypto.c1
-rwxr-xr-xres/res_monitor.c19
-rwxr-xr-xres/res_musiconhold.c1
36 files changed, 78 insertions, 132 deletions
diff --git a/.cleancount b/.cleancount
index 7ed6ff82d..1e8b31496 100755
--- a/.cleancount
+++ b/.cleancount
@@ -1 +1 @@
-5
+6
diff --git a/.cvsignore b/.cvsignore
index 26fff1228..3fe629253 100755
--- a/.cvsignore
+++ b/.cvsignore
@@ -20,3 +20,5 @@ update.out
tags
TAGS
vercomp
+version.h
+defaults.h
diff --git a/Makefile b/Makefile
index 0a9baab8a..f15e5ebb5 100755
--- a/Makefile
+++ b/Makefile
@@ -211,22 +211,10 @@ CFLAGS+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h ]; th
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)
@@ -327,12 +315,7 @@ ifneq ($(wildcard .tags-depend),)
include .tags-depend
endif
-.PHONY: _version ast_expr
-
-_version:
- if [ -d CVS ] && [ ! -f .version ]; then echo $(ASTERISKVERSION) > .version; fi
-
-.version: _version
+.PHONY: ast_expr
vercomp: vercomp.c
$(HOST_CC) -o $@ $<
@@ -382,10 +365,6 @@ ast_expr.a: $(FLEXOBJS)
ar r $@ $(FLEXOBJS)
ranlib $@
-cli.o: cli.c build.h
-
-asterisk.o: asterisk.c build.h
-
testexpr2 :
flex ast_expr2.fl
bison -v -d --name-prefix=ast_yy -o ast_expr2.c ast_expr2.y
@@ -415,13 +394,26 @@ asterisk.html: asterisk.sgml
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 \
@@ -443,7 +435,9 @@ subdirs:
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 ast_expr.h ast_expr.output
rm -f ast_expr2.c ast_expr2f.c ast_expr2.h ast_expr2.output
rm -f ast_expr.a vercomp
@@ -758,7 +752,7 @@ dont-optimize:
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:
diff --git a/app.c b/app.c
index 9f4267f34..a21e3b2b1 100755
--- a/app.c
+++ b/app.c
@@ -34,7 +34,6 @@
#include "asterisk/lock.h"
#include "asterisk/indications.h"
#include "asterisk.h"
-#include "astconf.h"
#define MAX_OTHER_FORMATS 10
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c
index c6b451a30..fbd6c927e 100755
--- a/apps/app_adsiprog.c
+++ b/apps/app_adsiprog.c
@@ -31,7 +31,6 @@
#include <errno.h>
#include "asterisk.h"
-#include "astconf.h"
static char *tdesc = "Asterisk ADSI Programming Application";
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 292a1518a..656b76947 100755
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -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 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
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;
diff --git a/apps/app_directory.c b/apps/app_directory.c
index b73e53979..870fd5a69 100755
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <stdio.h>
#include "asterisk.h"
-#include "astconf.h"
static char *tdesc = "Extension Directory";
static char *app = "Directory";
diff --git a/apps/app_hasnewvoicemail.c b/apps/app_hasnewvoicemail.c
index 63102de08..7dc3980a4 100755
--- a/apps/app_hasnewvoicemail.c
+++ b/apps/app_hasnewvoicemail.c
@@ -45,7 +45,7 @@
#include <stdlib.h>
#include <dirent.h>
-#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";
diff --git a/apps/app_ices.c b/apps/app_ices.c
index c5ffa45fd..6e1629d41 100755
--- a/apps/app_ices.c
+++ b/apps/app_ices.c
@@ -27,7 +27,7 @@
#include <fcntl.h>
#include <sys/time.h>
#include <errno.h>
-#include "astconf.h"
+#include "asterisk.h"
#define ICES "/usr/bin/ices"
#define LOCAL_ICES "/usr/local/bin/ices"
diff --git a/apps/app_math.c b/apps/app_math.c
index 0e0b6304d..9d040ff5e 100755
--- a/apps/app_math.c
+++ b/apps/app_math.c
@@ -38,7 +38,7 @@
#include "asterisk/translate.h"
#include <ctype.h>
#include <sys/file.h>
-#include "astconf.h"
+#include "asterisk.h"
static char *tdesc = "Basic Math Functions";
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index afd39f279..c7b1c920d 100755
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -33,7 +33,6 @@
#include <stdlib.h>
#include <sys/ioctl.h>
#include "asterisk.h"
-#include "astconf.h"
#ifdef __linux__
#include <linux/zaptel.h>
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 9add78a4d..0e759aa24 100755
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -67,7 +67,7 @@
#include <sys/signal.h>
#include <netinet/in.h>
-#include "astconf.h"
+#include "asterisk.h"
#define QUEUE_STRATEGY_RINGALL 0
#define QUEUE_STRATEGY_ROUNDROBIN 1
diff --git a/apps/app_sms.c b/apps/app_sms.c
index f2a6c7569..93b7d15c2 100755
--- a/apps/app_sms.c
+++ b/apps/app_sms.c
@@ -27,7 +27,7 @@
#include <sys/stat.h>
#include <dirent.h>
#include <ctype.h>
-#include "astconf.h"
+#include "asterisk.h"
/* output using Alaw rather than linear */
/* #define OUTALAW */
diff --git a/apps/app_test.c b/apps/app_test.c
index 370c547fd..2d9a075a2 100755
--- a/apps/app_test.c
+++ b/apps/app_test.c
@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
-#include "astconf.h"
+#include "asterisk.h"
static char *tdesc = "Interface Test Application";
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 39ab1cc8b..57f06e1df 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -48,7 +48,6 @@
#include <dirent.h>
#include "asterisk.h"
-#include "astconf.h"
#define COMMAND_TIMEOUT 5000
diff --git a/asterisk.c b/asterisk.c
index 94f1f341c..1c0ba53d0 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -33,6 +33,7 @@
#include <netdb.h>
#endif
+#include "asterisk.h"
#include "asterisk/logger.h"
#include "asterisk/options.h"
#include "asterisk/cli.h"
@@ -56,8 +57,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
@@ -128,6 +132,7 @@ char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
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];
@@ -395,7 +400,7 @@ static int ast_makesocket(void)
int x;
struct ast_config *cfg;
- char *config = ASTCONFPATH;
+ char *config = AST_CONFIG_FILE;
char *owner;
char *group;
char *perms;
@@ -1547,7 +1552,7 @@ static void ast_readconfig(void) {
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);
@@ -1561,6 +1566,7 @@ static void ast_readconfig(void) {
ast_copy_string((char *)ast_config_AST_CONFIG_DIR,AST_CONFIG_DIR,sizeof(ast_config_AST_CONFIG_DIR));
ast_copy_string((char *)ast_config_AST_SPOOL_DIR,AST_SPOOL_DIR,sizeof(ast_config_AST_SPOOL_DIR));
ast_copy_string((char *)ast_config_AST_MODULE_DIR,AST_MODULE_DIR,sizeof(ast_config_AST_VAR_DIR));
+ snprintf((char *)ast_config_AST_MONITOR_DIR,sizeof(ast_config_AST_MONITOR_DIR)-1,"%s/monitor",ast_config_AST_SPOOL_DIR);
ast_copy_string((char *)ast_config_AST_VAR_DIR,AST_VAR_DIR,sizeof(ast_config_AST_VAR_DIR));
ast_copy_string((char *)ast_config_AST_LOG_DIR,AST_LOG_DIR,sizeof(ast_config_AST_LOG_DIR));
ast_copy_string((char *)ast_config_AST_AGI_DIR,AST_AGI_DIR,sizeof(ast_config_AST_AGI_DIR));
@@ -1588,6 +1594,7 @@ static void ast_readconfig(void) {
ast_copy_string((char *)ast_config_AST_CONFIG_DIR,v->value,sizeof(ast_config_AST_CONFIG_DIR));
} else if (!strcasecmp(v->name, "astspooldir")) {
ast_copy_string((char *)ast_config_AST_SPOOL_DIR,v->value,sizeof(ast_config_AST_SPOOL_DIR));
+ snprintf((char *)ast_config_AST_MONITOR_DIR,sizeof(ast_config_AST_MONITOR_DIR)-1,"%s/monitor",v->value);
} else if (!strcasecmp(v->name, "astvarlibdir")) {
ast_copy_string((char *)ast_config_AST_VAR_DIR,v->value,sizeof(ast_config_AST_VAR_DIR));
snprintf((char *)ast_config_AST_DB,sizeof(ast_config_AST_DB),"%s/%s",v->value,"astdb");
diff --git a/cdr/cdr_csv.c b/cdr/cdr_csv.c
index ca5b96370..aa95fa1a0 100755
--- a/cdr/cdr_csv.c
+++ b/cdr/cdr_csv.c
@@ -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"
diff --git a/cdr/cdr_custom.c b/cdr/cdr_custom.c
index 69b6f2c51..cbb6d970b 100755
--- a/cdr/cdr_custom.c
+++ b/cdr/cdr_custom.c
@@ -23,7 +23,6 @@
#include "asterisk/logger.h"
#include "asterisk/utils.h"
#include "asterisk.h"
-#include "astconf.h"
#define CUSTOM_LOG_DIR "/cdr_custom"
diff --git a/cdr/cdr_manager.c b/cdr/cdr_manager.c
index d8421783c..556358287 100755
--- a/cdr/cdr_manager.c
+++ b/cdr/cdr_manager.c
@@ -17,7 +17,6 @@
#include "asterisk/manager.h"
#include "asterisk/config.h"
#include "asterisk.h"
-#include "astconf.h"
#include <strings.h>
#include <unistd.h>
#include <time.h>
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 232f6f2fb..bd64da658 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -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 */
diff --git a/cli.c b/cli.c
index 8e1357365..18aadd871 100755
--- a/cli.c
+++ b/cli.c
@@ -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;
diff --git a/config.c b/config.c
index d8675e27c..916dc0c83 100755
--- a/config.c
+++ b/config.c
@@ -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 ";--"
@@ -687,7 +686,7 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
int blanklines = 0;
if (configfile[0] == '/') {
- strncpy(fn, configfile, sizeof(fn)-1);
+ ast_copy_string(fn, configfile, sizeof(fn));
} else {
snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, configfile);
}
diff --git a/db.c b/db.c
index 063d298ee..29603d1db 100755
--- a/db.c
+++ b/db.c
@@ -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);
diff --git a/file.c b/file.c
index cbe72801e..52e81716d 100755
--- a/file.c
+++ b/file.c
@@ -34,7 +34,6 @@
#include "asterisk/lock.h"
#include "asterisk/app.h"
#include "asterisk.h"
-#include "astconf.h"
struct ast_format {
/* Name of format */
diff --git a/image.c b/image.c
index 7fa2141f1..804c2d87c 100755
--- a/image.c
+++ b/image.c
@@ -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);
diff --git a/include/astconf.h b/include/astconf.h
deleted file mode 100755
index da3301f6d..000000000
--- a/include/astconf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * General Definitions for Asterisk top level program
- *
- * Copyright (C) 1999, Mark Spencer
- *
- * Mark Spencer <markster@linux-support.net>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- */
-
-#ifndef _ASTCONF_H
-#define _ASTCONF_H
-
-#define AST_CONFIG_MAX_PATH 255
-
-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_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];
-
-#endif
diff --git a/include/asterisk.h b/include/asterisk.h
index 09410fdb6..b4b26a775 100755
--- a/include/asterisk.h
+++ b/include/asterisk.h
@@ -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);
diff --git a/loader.c b/loader.c
index 71626c065..4403652e4 100755
--- a/loader.c
+++ b/loader.c
@@ -35,7 +35,6 @@
#endif
#include "asterisk/md5.h"
#include "asterisk.h"
-#include "astconf.h"
#ifndef RTLD_NOW
#define RTLD_NOW 0
diff --git a/logger.c b/logger.c
index bd7c258c4..9e31cd585 100755
--- a/logger.c
+++ b/logger.c
@@ -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,
diff --git a/make_build_h b/make_build_h
index f98f54991..fda1cea38 100755
--- a/make_build_h
+++ b/make_build_h
@@ -4,9 +4,8 @@ KERNEL=`uname -r`
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 @@ cat > build.h << END
#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
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index 4b53dfa39..1e5bd49bd 100755
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -26,7 +26,6 @@
#include <errno.h>
/* For where to put dynamic tables */
#include "asterisk.h"
-#include "astconf.h"
#ifdef __AST_DEBUG_MALLOC
static void FREE(void *ptr)
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index 4551c0cf8..c30888dc4 100755
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -31,7 +31,7 @@
#include <string.h>
#include <stdio.h>
#include <unistd.h>
-#include "astconf.h"
+#include "asterisk.h"
/*
* pbx_spool is similar in spirit to qcall, but with substantially enhanced functionality...
diff --git a/res/res_agi.c b/res/res_agi.c
index f1837b5f0..726c54951 100755
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -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
diff --git a/res/res_crypto.c b/res/res_crypto.c
index 13e4c2dbc..0ca1b9e11 100755
--- a/res/res_crypto.c
+++ b/res/res_crypto.c
@@ -33,7 +33,6 @@
#include <unistd.h>
#include <fcntl.h>
#include "asterisk.h"
-#include "astconf.h"
/*
* Asterisk uses RSA keys with SHA-1 message digests for its
diff --git a/res/res_monitor.c b/res/res_monitor.c
index 62d35dd1d..1053e9aea 100755
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -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 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec,
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 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec,
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 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec,
*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 @@ int ast_monitor_stop(struct ast_channel *chan, int need_lock)
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 @@ int ast_monitor_change_fname(struct ast_channel *chan, const char *fname_base, i
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\n", chan->name, fname_base);
}
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 3b8c5b098..33609c442 100755
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -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"