aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xMakefile9
-rwxr-xr-xaesopt.h2
-rwxr-xr-xapps/app_sms.c2
-rwxr-xr-xasterisk.c2
-rwxr-xr-xchannels/Makefile15
-rwxr-xr-xchannels/chan_oss.c6
-rwxr-xr-xchannels/h323/Makefile2
-rwxr-xr-xcodecs/lpc10/lpc10.h5
-rwxr-xr-xdb1-ast/include/db.h2
-rwxr-xr-xmd5.c2
-rwxr-xr-xres/res_features.c20
-rwxr-xr-xutils.c2
12 files changed, 52 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 96c6c2019..c92295748 100755
--- a/Makefile
+++ b/Makefile
@@ -137,6 +137,11 @@ INCLUDE+=-I/usr/local/include
CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
endif # FreeBSD
+ifeq (${OSARCH},NetBSD)
+CFLAGS+=-pthread
+INCLUDE+=-I/usr/local/include
+endif
+
ifeq (${OSARCH},OpenBSD)
CFLAGS+=-pthread
endif
@@ -184,6 +189,9 @@ endif
ifeq (${OSARCH},FreeBSD)
LIBS+=-lcrypto
endif
+ifeq (${OSARCH},NetBSD)
+LIBS+=-lpthread -lcrypto -lm -L/usr/local/lib -lncurses
+endif
ifeq (${OSARCH},OpenBSD)
LIBS=-lcrypto -lpthread -lm -lncurses
endif
@@ -510,7 +518,6 @@ mpg123:
[ -f mpg123-0.59r.tar.gz ] || wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz
[ -d mpg123-0.59r ] || tar xfz mpg123-0.59r.tar.gz
make -C mpg123-0.59r linux
-
config:
if [ -d /etc/rc.d/init.d ]; then \
diff --git a/aesopt.h b/aesopt.h
index 571b7c452..94e3e47f1 100755
--- a/aesopt.h
+++ b/aesopt.h
@@ -151,7 +151,7 @@
#if defined( __OpenBSD__ )
# include <machine/types.h>
# include <sys/endian.h>
-#elif defined( __FreeBSD__ )
+#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
# include <sys/types.h>
# include <sys/endian.h>
#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
diff --git a/apps/app_sms.c b/apps/app_sms.c
index 0f23ebce2..a7b55bd46 100755
--- a/apps/app_sms.c
+++ b/apps/app_sms.c
@@ -203,7 +203,7 @@ static void
packdate (unsigned char *o, time_t w)
{
struct tm *t = localtime (&w);
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__)
int z = - t->tm_gmtoff / 3600 / 15;
#else
int z = timezone / 3600 / 15;
diff --git a/asterisk.c b/asterisk.c
index db54f330b..fc1d2363c 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -54,7 +54,7 @@
#include <grp.h>
#include <pwd.h>
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined( __NetBSD__ )
#include <netdb.h>
#endif
diff --git a/channels/Makefile b/channels/Makefile
index a2d49cbb7..d9b670999 100755
--- a/channels/Makefile
+++ b/channels/Makefile
@@ -46,15 +46,18 @@ PTLIB=-lpt_linux_x86_r
H323LIB=-lh323_linux_x86_r
CHANH323LIB=-ldl
endif
-
-ifneq (${OSARCH},Darwin)
-CHANNEL_LIBS+=chan_oss.so
-endif
ifeq (${OSARCH},FreeBSD)
PTLIB=-lpt_FreeBSD_x86_r
H323LIB=-lh323_FreeBSD_x86_r
CHANH323LIB=-pthread
SOLINK+=-L/usr/local/lib
+endif
+ifeq (${OSARCH},NetBSD)
+PTLIB=-lpt_NetBSD_x86_r
+H323LIB=-lh323_NetBSD_x86_r
+SOLINK+=-L/usr/local/lib
+endif
+ifneq (${OSARCH},Darwin)
CHANNEL_LIBS+=chan_oss.so
endif
@@ -139,6 +142,10 @@ ifeq (${OSARCH},OpenBSD)
chan_oss.so: chan_oss.o
$(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
endif
+ifeq (${OSARCH},NetBSD)
+chan_oss.so: chan_oss.o
+ $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
+endif
chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
ifeq ($(USE_MYSQL_FRIENDS),1)
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index abf399ad1..a74a9d847 100755
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -47,7 +47,7 @@
#include "answer.h"
/* Which device to use */
-#ifdef __OpenBSD__
+#if defined( __OpenBSD__ ) || defined( __NetBSD__ )
#define DEV_DSP "/dev/audio"
#else
#define DEV_DSP "/dev/dsp"
@@ -375,7 +375,7 @@ static int soundcard_setoutput(int force)
return 0;
readmode = 0;
if (force || time_has_passed()) {
- ioctl(sounddev, SNDCTL_DSP_RESET);
+ ioctl(sounddev, SNDCTL_DSP_RESET, 0);
/* Keep the same fd reserved by closing the sound device and copying stdin at the same
time. */
/* dup2(0, sound); */
@@ -405,7 +405,7 @@ static int soundcard_setinput(int force)
return 0;
readmode = -1;
if (force || time_has_passed()) {
- ioctl(sounddev, SNDCTL_DSP_RESET);
+ ioctl(sounddev, SNDCTL_DSP_RESET, 0);
close(sounddev);
/* dup2(0, sound); */
fd = open(DEV_DSP, O_RDONLY | O_NONBLOCK);
diff --git a/channels/h323/Makefile b/channels/h323/Makefile
index fa9c8ea11..52004c1fd 100755
--- a/channels/h323/Makefile
+++ b/channels/h323/Makefile
@@ -21,8 +21,10 @@ endif
#
OSARCH=$(shell uname -s)
ifneq (${OSARCH},FreeBSD)
+ifneq (${OSARCH},NetBSD)
CFLAGS += -march=$(shell uname -m)
endif
+endif
CFLAGS += -DPBYTE_ORDER=PLITTLE_ENDIAN
ifeq (${OSARCH},Linux)
diff --git a/codecs/lpc10/lpc10.h b/codecs/lpc10/lpc10.h
index 0f751c6de..99c64c624 100755
--- a/codecs/lpc10/lpc10.h
+++ b/codecs/lpc10/lpc10.h
@@ -1,6 +1,9 @@
/*
$Log$
+Revision 1.18 2004/08/31 13:32:11 markster
+Merge NetBSD and Courtesty tone with modifications (bug #2329)
+
Revision 1.17 2003/10/26 18:50:49 markster
Make it build and run on MacOS X
@@ -41,7 +44,7 @@ Add broken lpc10 code... It's not too far from working I don't think...
*/
-#if defined(unix) || defined(__unix__)
+#if defined(unix) || defined(__unix__) || defined(__NetBSD__)
typedef short INT16;
typedef int INT32;
#endif
diff --git a/db1-ast/include/db.h b/db1-ast/include/db.h
index 06ae36b82..d1258d2a6 100755
--- a/db1-ast/include/db.h
+++ b/db1-ast/include/db.h
@@ -51,7 +51,7 @@
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
-#if (!defined(__FreeBSD__) && !defined(__APPLE__))
+#if (!defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__))
typedef __signed char int8_t;
typedef unsigned char u_int8_t;
typedef short int16_t;
diff --git a/md5.c b/md5.c
index 9388a820e..17a00c6fc 100755
--- a/md5.c
+++ b/md5.c
@@ -3,7 +3,7 @@
#if defined( __OpenBSD__ )
# include <machine/types.h>
# include <sys/endian.h>
-#elif defined( __FreeBSD__ )
+#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
# include <sys/types.h>
# include <sys/endian.h>
#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
diff --git a/res/res_features.c b/res/res_features.c
index 4d219298a..7cab65b10 100755
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -3,9 +3,9 @@
*
* Routines implementing call parking
*
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
*
- * Mark Spencer <markster@linux-support.net>
+ * Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -61,6 +61,9 @@ static int parking_stop = 750;
static int transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
+/* Default courtesy tone played when party joins conference */
+static char courtesytone[256] = "";
+
/* Registrar for operations */
static char *registrar = "res_features";
@@ -692,6 +695,17 @@ static int park_exec(struct ast_channel *chan, void *data)
}
if (peer) {
+ /* Play a courtesy beep in the calling channel to prefix the bridge connecting */
+ if (!ast_strlen_zero(courtesytone)) {
+ if (!ast_streamfile(chan, courtesytone, chan->language)) {
+ if (ast_waitstream(chan, "") < 0) {
+ ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
+ ast_hangup(peer);
+ return -1;
+ }
+ }
+ }
+
ast_moh_stop(peer);
res = ast_channel_make_compatible(chan, peer);
if (res < 0) {
@@ -850,6 +864,8 @@ int load_module(void)
transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
} else
transferdigittimeout = transferdigittimeout * 1000;
+ } else if (!strcasecmp(var->name, "courtesytone")) {
+ strncpy(courtesytone, var->value, sizeof(courtesytone) - 1);
}
var = var->next;
}
diff --git a/utils.c b/utils.c
index 756cdfd19..fc2a0b419 100755
--- a/utils.c
+++ b/utils.c
@@ -28,7 +28,7 @@
static char base64[64];
static char b2a[256];
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__)
/* duh? ERANGE value copied from web... */
#define ERANGE 34