diff --git a/ChangeLog b/ChangeLog index 4d95026..2b51ada 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 0.5.0 ===== + 18-Nov-2003: - readconfig.c: include sysconfdir to the list of locations + where siproxd will search for its config file 14-Nov-2003: - rtpproxy.c: sys/types.h needed for *BSD - tested: siproxd builds on FreeBSD 4.9 2-Nov-2003: - rtpproxy bugfix: On repetitive INVITES, the UDP media diff --git a/config.h.in b/config.h.in index 6806cfd..f139cfe 100644 --- a/config.h.in +++ b/config.h.in @@ -166,3 +166,6 @@ /* typedef socklen_t available */ #undef socklen_t +/* will search for config file here */ +#undef SIPROXDCONFPATH + diff --git a/configure.in b/configure.in index b7ec641..6159d02 100644 --- a/configure.in +++ b/configure.in @@ -17,6 +17,7 @@ dnl 1-Sep-2003 tries check for IPCHAINS dnl 5-Sep-2003 tries test for pthreads before libosip stuff dnl 19-Sep-2003 tries DMALLOC support dnl 1-Nov-2003 tries check for NETFILTER (IPTABLES) +dnl 18-Nov-2003 tries include sysconfdir to search for config dnl dnl dnl @@ -281,6 +282,19 @@ AC_CHECK_FUNCS(strncpy strchr strstr sprintf vfprintf vsnprintf) AC_CHECK_FUNCS(fgets sscanf hstrerror) +dnl +dnl sysconfdir +dnl +SIPROXDCONFPATH="" +tmpset="$sysconfdir" +while test "x$tmpset" != "x$SIPROXDCONFPATH"; do + SIPROXDCONFPATH="$tmpset" + eval tmpset="$tmpset" +done +AC_DEFINE_UNQUOTED(SIPROXDCONFPATH,"$SIPROXDCONFPATH", + [will search for config file here]) + + AC_SUBST(CPPFLAGS) AC_SUBST(LIBS) diff --git a/src/readconf.c b/src/readconf.c index 3f2474c..6783c22 100644 --- a/src/readconf.c +++ b/src/readconf.c @@ -60,6 +60,7 @@ int read_config(char *name, int search) { char tmp[256]; const char *completion[] = { "%s/.%src", /* this one is special... (idx=0)*/ + SIPROXDCONFPATH "/%s.conf", "/etc/%s.conf", "/usr/etc/%s.conf", "/usr/local/etc/%s.conf",