mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
Merge NetBSD and Courtesty tone with modifications (bug #2329)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
9
Makefile
9
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)
|
CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
|
||||||
endif # FreeBSD
|
endif # FreeBSD
|
||||||
|
|
||||||
|
ifeq (${OSARCH},NetBSD)
|
||||||
|
CFLAGS+=-pthread
|
||||||
|
INCLUDE+=-I/usr/local/include
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq (${OSARCH},OpenBSD)
|
ifeq (${OSARCH},OpenBSD)
|
||||||
CFLAGS+=-pthread
|
CFLAGS+=-pthread
|
||||||
endif
|
endif
|
||||||
@@ -184,6 +189,9 @@ endif
|
|||||||
ifeq (${OSARCH},FreeBSD)
|
ifeq (${OSARCH},FreeBSD)
|
||||||
LIBS+=-lcrypto
|
LIBS+=-lcrypto
|
||||||
endif
|
endif
|
||||||
|
ifeq (${OSARCH},NetBSD)
|
||||||
|
LIBS+=-lpthread -lcrypto -lm -L/usr/local/lib -lncurses
|
||||||
|
endif
|
||||||
ifeq (${OSARCH},OpenBSD)
|
ifeq (${OSARCH},OpenBSD)
|
||||||
LIBS=-lcrypto -lpthread -lm -lncurses
|
LIBS=-lcrypto -lpthread -lm -lncurses
|
||||||
endif
|
endif
|
||||||
@@ -511,7 +519,6 @@ mpg123:
|
|||||||
[ -d mpg123-0.59r ] || tar xfz mpg123-0.59r.tar.gz
|
[ -d mpg123-0.59r ] || tar xfz mpg123-0.59r.tar.gz
|
||||||
make -C mpg123-0.59r linux
|
make -C mpg123-0.59r linux
|
||||||
|
|
||||||
|
|
||||||
config:
|
config:
|
||||||
if [ -d /etc/rc.d/init.d ]; then \
|
if [ -d /etc/rc.d/init.d ]; then \
|
||||||
install -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
|
install -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
|
||||||
|
|||||||
2
aesopt.h
2
aesopt.h
@@ -151,7 +151,7 @@
|
|||||||
#if defined( __OpenBSD__ )
|
#if defined( __OpenBSD__ )
|
||||||
# include <machine/types.h>
|
# include <machine/types.h>
|
||||||
# include <sys/endian.h>
|
# include <sys/endian.h>
|
||||||
#elif defined( __FreeBSD__ )
|
#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/endian.h>
|
# include <sys/endian.h>
|
||||||
#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
|
#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ static void
|
|||||||
packdate (unsigned char *o, time_t w)
|
packdate (unsigned char *o, time_t w)
|
||||||
{
|
{
|
||||||
struct tm *t = localtime (&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;
|
int z = - t->tm_gmtoff / 3600 / 15;
|
||||||
#else
|
#else
|
||||||
int z = timezone / 3600 / 15;
|
int z = timezone / 3600 / 15;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__) || defined( __NetBSD__ )
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -46,15 +46,18 @@ PTLIB=-lpt_linux_x86_r
|
|||||||
H323LIB=-lh323_linux_x86_r
|
H323LIB=-lh323_linux_x86_r
|
||||||
CHANH323LIB=-ldl
|
CHANH323LIB=-ldl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (${OSARCH},Darwin)
|
|
||||||
CHANNEL_LIBS+=chan_oss.so
|
|
||||||
endif
|
|
||||||
ifeq (${OSARCH},FreeBSD)
|
ifeq (${OSARCH},FreeBSD)
|
||||||
PTLIB=-lpt_FreeBSD_x86_r
|
PTLIB=-lpt_FreeBSD_x86_r
|
||||||
H323LIB=-lh323_FreeBSD_x86_r
|
H323LIB=-lh323_FreeBSD_x86_r
|
||||||
CHANH323LIB=-pthread
|
CHANH323LIB=-pthread
|
||||||
SOLINK+=-L/usr/local/lib
|
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
|
CHANNEL_LIBS+=chan_oss.so
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -139,6 +142,10 @@ ifeq (${OSARCH},OpenBSD)
|
|||||||
chan_oss.so: chan_oss.o
|
chan_oss.so: chan_oss.o
|
||||||
$(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
|
$(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
|
||||||
endif
|
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
|
chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
|
||||||
ifeq ($(USE_MYSQL_FRIENDS),1)
|
ifeq ($(USE_MYSQL_FRIENDS),1)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
#include "answer.h"
|
#include "answer.h"
|
||||||
|
|
||||||
/* Which device to use */
|
/* Which device to use */
|
||||||
#ifdef __OpenBSD__
|
#if defined( __OpenBSD__ ) || defined( __NetBSD__ )
|
||||||
#define DEV_DSP "/dev/audio"
|
#define DEV_DSP "/dev/audio"
|
||||||
#else
|
#else
|
||||||
#define DEV_DSP "/dev/dsp"
|
#define DEV_DSP "/dev/dsp"
|
||||||
@@ -375,7 +375,7 @@ static int soundcard_setoutput(int force)
|
|||||||
return 0;
|
return 0;
|
||||||
readmode = 0;
|
readmode = 0;
|
||||||
if (force || time_has_passed()) {
|
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
|
/* Keep the same fd reserved by closing the sound device and copying stdin at the same
|
||||||
time. */
|
time. */
|
||||||
/* dup2(0, sound); */
|
/* dup2(0, sound); */
|
||||||
@@ -405,7 +405,7 @@ static int soundcard_setinput(int force)
|
|||||||
return 0;
|
return 0;
|
||||||
readmode = -1;
|
readmode = -1;
|
||||||
if (force || time_has_passed()) {
|
if (force || time_has_passed()) {
|
||||||
ioctl(sounddev, SNDCTL_DSP_RESET);
|
ioctl(sounddev, SNDCTL_DSP_RESET, 0);
|
||||||
close(sounddev);
|
close(sounddev);
|
||||||
/* dup2(0, sound); */
|
/* dup2(0, sound); */
|
||||||
fd = open(DEV_DSP, O_RDONLY | O_NONBLOCK);
|
fd = open(DEV_DSP, O_RDONLY | O_NONBLOCK);
|
||||||
|
|||||||
@@ -21,8 +21,10 @@ endif
|
|||||||
#
|
#
|
||||||
OSARCH=$(shell uname -s)
|
OSARCH=$(shell uname -s)
|
||||||
ifneq (${OSARCH},FreeBSD)
|
ifneq (${OSARCH},FreeBSD)
|
||||||
|
ifneq (${OSARCH},NetBSD)
|
||||||
CFLAGS += -march=$(shell uname -m)
|
CFLAGS += -march=$(shell uname -m)
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
CFLAGS += -DPBYTE_ORDER=PLITTLE_ENDIAN
|
CFLAGS += -DPBYTE_ORDER=PLITTLE_ENDIAN
|
||||||
|
|
||||||
ifeq (${OSARCH},Linux)
|
ifeq (${OSARCH},Linux)
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.17 2003/10/26 18:50:49 markster
|
||||||
Make it build and run on MacOS X
|
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 short INT16;
|
||||||
typedef int INT32;
|
typedef int INT32;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
#ifndef __BIT_TYPES_DEFINED__
|
#ifndef __BIT_TYPES_DEFINED__
|
||||||
#define __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 __signed char int8_t;
|
||||||
typedef unsigned char u_int8_t;
|
typedef unsigned char u_int8_t;
|
||||||
typedef short int16_t;
|
typedef short int16_t;
|
||||||
|
|||||||
2
md5.c
2
md5.c
@@ -3,7 +3,7 @@
|
|||||||
#if defined( __OpenBSD__ )
|
#if defined( __OpenBSD__ )
|
||||||
# include <machine/types.h>
|
# include <machine/types.h>
|
||||||
# include <sys/endian.h>
|
# include <sys/endian.h>
|
||||||
#elif defined( __FreeBSD__ )
|
#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/endian.h>
|
# include <sys/endian.h>
|
||||||
#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
|
#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
*
|
*
|
||||||
* Routines implementing call parking
|
* 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
|
* This program is free software, distributed under the terms of
|
||||||
* the GNU General Public License
|
* the GNU General Public License
|
||||||
@@ -61,6 +61,9 @@ static int parking_stop = 750;
|
|||||||
|
|
||||||
static int transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
|
static int transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
|
||||||
|
|
||||||
|
/* Default courtesy tone played when party joins conference */
|
||||||
|
static char courtesytone[256] = "";
|
||||||
|
|
||||||
/* Registrar for operations */
|
/* Registrar for operations */
|
||||||
static char *registrar = "res_features";
|
static char *registrar = "res_features";
|
||||||
|
|
||||||
@@ -692,6 +695,17 @@ static int park_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (peer) {
|
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);
|
ast_moh_stop(peer);
|
||||||
res = ast_channel_make_compatible(chan, peer);
|
res = ast_channel_make_compatible(chan, peer);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
@@ -850,6 +864,8 @@ int load_module(void)
|
|||||||
transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
|
transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
|
||||||
} else
|
} else
|
||||||
transferdigittimeout = transferdigittimeout * 1000;
|
transferdigittimeout = transferdigittimeout * 1000;
|
||||||
|
} else if (!strcasecmp(var->name, "courtesytone")) {
|
||||||
|
strncpy(courtesytone, var->value, sizeof(courtesytone) - 1);
|
||||||
}
|
}
|
||||||
var = var->next;
|
var = var->next;
|
||||||
}
|
}
|
||||||
|
|||||||
2
utils.c
2
utils.c
@@ -28,7 +28,7 @@
|
|||||||
static char base64[64];
|
static char base64[64];
|
||||||
static char b2a[256];
|
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... */
|
/* duh? ERANGE value copied from web... */
|
||||||
#define ERANGE 34
|
#define ERANGE 34
|
||||||
|
|||||||
Reference in New Issue
Block a user