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
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
[ -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 \
#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__)
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;
#include <grp.h>
#include <pwd.h>
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined( __NetBSD__ )
#include <netdb.h>
#endif
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
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)
#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"
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); */
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);
#
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)
/*
$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
*/
-#if defined(unix) || defined(__unix__)
+#if defined(unix) || defined(__unix__) || defined(__NetBSD__)
typedef short INT16;
typedef int INT32;
#endif
#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;
#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__)
*
* 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
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";
}
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) {
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;
}
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