diff options
Diffstat (limited to 'net/asterisk12')
36 files changed, 0 insertions, 5053 deletions
diff --git a/net/asterisk12/Makefile b/net/asterisk12/Makefile deleted file mode 100644 index 60a8230c08cd..000000000000 --- a/net/asterisk12/Makefile +++ /dev/null @@ -1,102 +0,0 @@ -# New ports collection makefile for: asterisk -# Date created: 17 October 2003 -# Whom: Maxim Sobolev <sobomax@portaone.com> -# -# $FreeBSD$ -# - -PORTNAME= asterisk -PORTVERSION= 1.0.9 -PORTREVISION= 2 -CATEGORIES= net -MASTER_SITES= ftp://ftp.asterisk.org/pub/telephony/asterisk/ \ - ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/ - -PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz -PATCH_SITES= ${MASTER_SITE_LOCAL} -PATCH_SITE_SUBDIR= fjoe -PATCH_DIST_STRIP= -p1 - -MAINTAINER= sobomax@FreeBSD.org -COMMENT= An Open Source PBX and telephony toolkit - -BUILD_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123 -LIB_DEPENDS= speex.3:${PORTSDIR}/audio/speex \ - newt.51:${PORTSDIR}/devel/newt -RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123 - -ONLY_FOR_ARCHS= i386 sparc64 - -BRIVER= bristuff-0.2.0-RC8h -GNU_CONFIGURE= yes -CONFIGURE_WRKSRC= ${WRKSRC}/editline -USE_GMAKE= yes -USE_BISON= yes -USE_RC_SUBR= asterisk.sh -USE_REINPLACE= yes -MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ - PTHREAD_LIBS="${PTHREAD_LIBS}" \ - MKDIR="${MKDIR}" \ - PWLIBDIR=${WRKDIRPREFIX}${PORTSDIR}/devel/pwlib/work/pwlib \ - OPENH323DIR=${WRKDIRPREFIX}${PORTSDIR}/net/openh323/work/openh323 \ - OSVERSION=${OSVERSION} \ - CXX="${CXX}" - -MAN8= asterisk.8 - -.include <bsd.port.pre.mk> - -.if ${ARCH} != "i386" -WITHOUT_H323= 1 -WITHOUT_ZAPTEL= 1 -.endif - -.if defined(WITHOUT_H323) -PLIST_SUB+= WITH_H323="@comment " -.else -BUILD_DEPENDS+= ${NONEXISTENT}:${PORTSDIR}/devel/pwlib:build \ - ${NONEXISTENT}:${PORTSDIR}/net/openh323:build -PLIST_SUB+= WITH_H323="" -MAKE_ENV+= WITH_H323=1 -.endif - -.if defined(WITHOUT_ZAPTEL) -PLIST_SUB+= WITH_ZAPTEL="@comment " -.else -LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri -BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel -RUN_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel -PLIST_SUB+= WITH_ZAPTEL="" -MAKE_ENV+= WITH_ZAPTEL=1 -.endif - -# -# WITH_FREETDS, WITH_PGSQL and WITH_SQLITE can also be added to MAKE_ENV -# similarly -.if defined(WITHOUT_ODBC) -PLIST_SUB+= WITH_ODBC="@comment " -.else -LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC -PLIST_SUB+= WITH_ODBC="" -MAKE_ENV+= WITH_ODBC=1 -.endif - -.if !defined(WITHOUT_MYSQL) -USE_MYSQL= yes -.endif - -# -# FAX apps can't be compiled on RELENG_4 at the moment -.if defined(WITHOUT_FAX) || ${OSVERSION} < 500000 -PLIST_SUB+= WITH_FAX="@comment " -.else -MAKE_ENV+= WITH_FAX=1 -LIB_DEPENDS+= spandsp.0:${PORTSDIR}/comms/spandsp -PLIST_SUB+= WITH_FAX="" -.endif - -post-patch: - ${CP} ${FILESDIR}/chan_oss.c ${WRKSRC}/channels - ${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample - -.include <bsd.port.post.mk> diff --git a/net/asterisk12/distinfo b/net/asterisk12/distinfo deleted file mode 100644 index 9ef6daa2ce76..000000000000 --- a/net/asterisk12/distinfo +++ /dev/null @@ -1,4 +0,0 @@ -MD5 (asterisk-1.0.9.tar.gz) = 0d7f1c680ae53a739f26a069ef8b580a -SIZE (asterisk-1.0.9.tar.gz) = 9604582 -MD5 (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 42172c5b04af9080f22b883296c34002 -SIZE (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 56589 diff --git a/net/asterisk12/files/asterisk.sh.in b/net/asterisk12/files/asterisk.sh.in deleted file mode 100644 index 10f0c4275c84..000000000000 --- a/net/asterisk12/files/asterisk.sh.in +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# PROVIDE asterisk -# REQUIRE: NETWORKING SERVERS -# BEFORE: DAEMON -# KEYWORD: FreeBSD shutdown - -# -# Add the following lines to /etc/rc.conf to enable asterisk: -# -# asterisk_enable="YES" -# - -. %%RC_SUBR%% - -name=asterisk -rcvar=`set_rcvar` - -command=%%PREFIX%%/sbin/asterisk -pidfile=/var/run/asterisk.pid - -asterisk_enable=${asterisk_enable:-"NO"} - -load_rc_config $name -run_rc_command "$1" diff --git a/net/asterisk12/files/chan_oss.c b/net/asterisk12/files/chan_oss.c deleted file mode 100644 index 95a92369882d..000000000000 --- a/net/asterisk12/files/chan_oss.c +++ /dev/null @@ -1,1327 +0,0 @@ -/* - * Asterisk -- A telephony toolkit for Linux. - * - * 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 - * - * FreeBSD changes and multiple device support by Luigi Rizzo, 2005.05.02 - * note-this code best seen with ts=8 (8-spaces tabs) in the editor - */ - -#include <asterisk/lock.h> -#include <asterisk/frame.h> -#include <asterisk/logger.h> -#include <asterisk/channel.h> -#include <asterisk/module.h> -#include <asterisk/channel_pvt.h> -#include <asterisk/options.h> -#include <asterisk/pbx.h> -#include <asterisk/config.h> -#include <asterisk/cli.h> -#include <asterisk/utils.h> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> -#include <sys/ioctl.h> -#include <sys/time.h> -#include <string.h> -#include <stdlib.h> -#include <stdio.h> -#include <ctype.h> /* for isalnum */ -#ifdef __linux -#include <linux/soundcard.h> -#elif defined(__FreeBSD__) -#include <sys/soundcard.h> -#else -#include <soundcard.h> -#endif -#include "busy.h" -#include "ringtone.h" -#include "ring10.h" -#include "answer.h" - -/* - * Helper macros to parse config arguments. They will go in a common - * header file if their usage is globally accepted. In the meantime, - * we define them here. Typical usage is as below, WITHOUT ; on each line. - * - * { - * M_START(v->name, v->value) - * - * M_BOOL("dothis", x->flag1) - * M_STR("name", x->somestring) - * M_F("bar", some_c_code) - * M_END(some_final_statement) - */ -#define M_START(var, val) \ - char *__s = var; char *__val = val; -#define M_END(x) x; -#define M_F(tag, f) if (!strcasecmp((__s), tag)) { f; } else -#define M_BOOL(tag, dst) M_F(tag, (dst) = ast_true(__val) ) -#define M_UINT(tag, dst) M_F(tag, (dst) = strtoul(__val, NULL, 0) ) -#define M_STR(tag, dst) M_F(tag, strncpy(dst, __val, sizeof(dst) - 1) ) - - -/* Which device to use */ -#if defined( __OpenBSD__ ) || defined( __NetBSD__ ) -#define DEV_DSP "/dev/audio" -#else -#define DEV_DSP "/dev/dsp" -#endif - -/* - * Basic mode of operation: - * - * we have one keyboard (which receives commands from the keyboard) - * and multiple headset's connected to audio cards. Headsets are named as - * the sections of oss.conf - * - * At any time, the keyboard is attached to one headset, and you - * can switch among them using the 'console' command. - * - * The following parameters are important for the configuration of - * the device: - * - * FRAME_SIZE the size of an audio frame, in samples. - * 160 is used almost universally, so you should not change it. - * - * FRAGS the argument for the SETFRAGMENT ioctl. - * Overridden by the 'frags' parameter in oss.conf - * - * Bits 0-7 are the base-2 log of the device's block size, - * bits 16-31 are the number of blocks in the driver's queue. - * There are a lot of differences in the way this parameter - * is supported by different drivers, so you may need to - * experiment a bit with the value. - * A good default for linux is 30 blocks of 64 bytes, which - * results in 6 frames of 320 bytes (160 samples). - * FreeBSD works decently with blocks of 256 or 512 bytes, - * leaving the number unspecified. - * Note that this only refers to the device buffer size, - * this module will then try to keep the lenght of audio - * buffered within small constraints. - * - * QUEUE_SIZE The max number of blocks actually allowed in the device - * driver's buffer, irrespective of the available number. - * Overridden by the 'queuesize' parameter in oss.conf - * - * Should be >=2, and at most as large as the hw queue above - * (otherwise it will never be full). - */ - -#define FRAME_SIZE 160 -#define QUEUE_SIZE 10 - -#if defined(__FreeBSD__) -#define FRAGS 0x8 -#else -#define FRAGS ( ( (6 * 5) << 16 ) | 0x6 ) -#endif - - -/* Don't switch between read/write modes faster than every 300 ms */ -#define MIN_SWITCH_TIME 300 - - -static int usecnt; -AST_MUTEX_DEFINE_STATIC(usecnt_lock); - -static char *desc = "OSS Console Channel Driver"; -static char *tdesc = "OSS Console Channel Driver"; -static char *config = "oss.conf"; /* default config file */ - -static int oss_debug; - -/* - * Each sound is made of 'datalen' samples of sound, repeated as needed to - * generate 'samplen' samples of data, then followed by 'silencelen' samples - * of silence. The loop is repeated if 'repeat' is set. - */ -struct sound { - int ind; - char *desc; - short *data; - int datalen; - int samplen; - int silencelen; - int repeat; -}; - -static struct sound sounds[] = { - { AST_CONTROL_RINGING, "RINGING", ringtone, sizeof(ringtone)/2, 16000, 32000, 1 }, - { AST_CONTROL_BUSY, "BUSY", busy, sizeof(busy)/2, 4000, 4000, 1 }, - { AST_CONTROL_CONGESTION, "CONGESTION", busy, sizeof(busy)/2, 2000, 2000, 1 }, - { AST_CONTROL_RING, "RING10", ring10, sizeof(ring10)/2, 16000, 32000, 1 }, - { AST_CONTROL_ANSWER, "ANSWER", answer, sizeof(answer)/2, 2200, 0, 0 }, - { -1, NULL, 0, 0, 0, 0 }, /* end marker */ -}; - - -/* - * descriptor for one of our channels. - * There is one used for 'default' values (from the [general] entry in - * the configuration file, and then one instance for each device - * (the default is cloned from [general], others are only created - * if the relevant section exists. - */ -struct chan_oss_pvt { - struct chan_oss_pvt *next; - - char *type; - char *name; - /* - * cursound indicates which in struct sound we play. -1 means nothing, - * any other value is a valid sound, in which case sampsent indicates - * the next sample to send in [0..samplen + silencelen] - * nosound is set to disable the audio data from the channel - * (so we can play the tones etc.). - */ - int sndcmd[2]; /* Sound command pipe */ - int cursound; /* index of sound to send */ - int sampsent; /* # of sound samples sent */ - int nosound; /* set to block audio from the PBX */ - - int total_blocks; /* total blocks in the output device */ - int sounddev; - enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex; - int autoanswer; - int autohangup; - int hookstate; - struct timeval lasttime; /* last setformat */ - char *mixer_cmd; /* initial command to issue to the mixer */ - unsigned int queuesize; /* max fragments in queue */ - unsigned int frags; /* parameter for SETFRAGMENT */ - - int warned; /* various flags used for warnings */ -#define WARN_used_blocks 1 -#define WARN_speed 2 -#define WARN_frag 4 - int w_errors; /* overfull in the write path */ - - int silencesuppression; - int silencethreshold; - int playbackonly; - char device[64]; /* device to open */ - - pthread_t sthread; - - struct ast_channel *owner; - char ext[AST_MAX_EXTENSION]; - char ctx[AST_MAX_EXTENSION]; - char language[MAX_LANGUAGE]; - - /* buffers used in oss_write */ - char oss_write_buf[FRAME_SIZE*2]; - int oss_write_dst; - /* buffers used in oss_read - AST_FRIENDLY_OFFSET space for headers - * plus enough room for a full frame - */ - char oss_read_buf[FRAME_SIZE * 2 + AST_FRIENDLY_OFFSET]; - int readpos; /* read position above */ - struct ast_frame read_f; /* returned by oss_read */ -}; - -static struct chan_oss_pvt oss_default = { - .type = "Console", - .cursound = -1, - .sounddev = -1, - .duplex = M_UNSET, /* XXX check this */ - .autoanswer = 1, - .autohangup = 1, - .queuesize = QUEUE_SIZE, - .frags = FRAGS, - .silencethreshold = 1000, /* currently unused */ - .ext = "s", - .ctx = "default", - .readpos = AST_FRIENDLY_OFFSET, /* start here on reads */ -}; - -static char *oss_active; /* the active device */ - -/* - * returns true if too early to switch - */ -static int too_early(struct chan_oss_pvt *o) -{ - struct timeval tv; - int ms; - gettimeofday(&tv, NULL); - ms = (tv.tv_sec - o->lasttime.tv_sec) * 1000 + - (tv.tv_usec - o->lasttime.tv_usec) / 1000; - if (ms < MIN_SWITCH_TIME) - return -1; - return 0; -} - -/* - * Returns the number of blocks used in the audio output channel - */ -static int used_blocks(struct chan_oss_pvt *o) -{ - struct audio_buf_info info; - - if (ioctl(o->sounddev, SNDCTL_DSP_GETOSPACE, &info)) { - if (! (o->warned & WARN_used_blocks)) { - ast_log(LOG_WARNING, "Error reading output space\n"); - o->warned |= WARN_used_blocks; - } - return 1; - } - if (o->total_blocks == 0) { - if (0) /* debugging */ - ast_log(LOG_WARNING, "fragtotal %d size %d avail %d\n", - info.fragstotal, - info.fragsize, - info.fragments); - o->total_blocks = info.fragments; - } - return o->total_blocks - info.fragments; -} - -static int soundcard_writeframe(struct chan_oss_pvt *o, short *data) -{ - /* Write an exactly FRAME_SIZE sized frame */ - int res; - - /* - * Nothing complex to manage the audio device queue. - * If the buffer is full just drop the extra, otherwise write. - * XXX in some cases it might be useful to write anyways after - * a number of failures, to restart the output chain. - */ - res = used_blocks(o); - if (res > o->queuesize) { /* no room to write a block */ - if (o->w_errors++ == 0 && (oss_debug & 0x4)) - ast_log(LOG_WARNING, "write: used %d blocks (%d)\n", - res, o->w_errors); - return 0; - } - o->w_errors = 0; - res = write(o->sounddev, ((void *)data), FRAME_SIZE * 2); - return res; -} - -/* - * handler for 'sound writable' events from the sound thread. - * Builds a frame from the high level description of the sounds, - * and passes it to the audio device. - * The actual sound is made of 1 or more sequences of sound samples - * (s->datalen, repeated to make s->samplen samples) followed by - * s->silencelen samples of silence. The position in the sequence is stored - * in o->sampsent, which goes between 0 .. s->samplen+s->silencelen. - * In case we fail to write a frame, don't update o->sampsent. - */ -static void send_sound(struct chan_oss_pvt *o) -{ - short myframe[FRAME_SIZE]; - int ofs, l, start; - int l_sampsent = o->sampsent; - struct sound *s; - - if (o->cursound < 0) /* no sound to send */ - return; - s = &sounds[o->cursound]; - for (ofs = 0; ofs < FRAME_SIZE; ofs += l) { - l = s->samplen - l_sampsent; /* sound available */ - if (l > 0) { - start = l_sampsent % s->datalen; /* source offset */ - if (l > FRAME_SIZE - ofs) /* don't overflow the frame */ - l = FRAME_SIZE - ofs; - if (l > s->datalen - start) /* don't overflow the source */ - l = s->datalen - start; - bcopy(s->data + start, myframe + ofs, l*2); - if (0) - ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n", - l_sampsent, l, s->samplen, ofs); - l_sampsent += l; - } else { /* no sound, maybe some silence */ - static short silence[FRAME_SIZE] = {0, }; - - l += s->silencelen; - if (l > 0) { - if (l > FRAME_SIZE - ofs) - l = FRAME_SIZE - ofs; - bcopy(silence, myframe + ofs, l*2); - l_sampsent += l; - } else { /* silence is over, restart sound if loop */ - if (s->repeat == 0) { /* last block */ - o->cursound = -1; - o->nosound = 0; /* allow audio data */ - if (ofs < FRAME_SIZE) /* pad with silence */ - bcopy(silence, myframe + ofs, (FRAME_SIZE - ofs)*2); - } - l_sampsent = 0; - } - } - } - l = soundcard_writeframe(o, myframe); - if (l > 0) - o->sampsent = l_sampsent; /* update status */ -} - -static void *sound_thread(void *arg) -{ - char ign[4096]; - struct chan_oss_pvt *o = (struct chan_oss_pvt *)arg; - - /* kick the driver by trying to read from it. Ignore errors */ - read(o->sounddev, ign, sizeof(ign)); - for(;;) { - fd_set rfds, wfds; - int maxfd, res; - - FD_ZERO(&rfds); - FD_ZERO(&wfds); - maxfd = o->sndcmd[0]; /* pipe from the main process */ - FD_SET(o->sndcmd[0], &rfds); - if (!o->owner) { /* no one owns the audio, so we must drain it */ - FD_SET(o->sounddev, &rfds); - if (o->sounddev > maxfd) - maxfd = o->sounddev; - } - if (o->cursound > -1) { - FD_SET(o->sounddev, &wfds); - if (o->sounddev > maxfd) - maxfd = o->sounddev; - } - /* ast_select emulates linux behaviour in terms of timeout handling */ - res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL); - if (res < 1) { - ast_log(LOG_WARNING, "select failed: %s\n", - strerror(errno)); - continue; - } - if (FD_ISSET(o->sndcmd[0], &rfds)) { - /* read which sound to play from the pipe */ - int i, what = -1; - - read(o->sndcmd[0], &what, sizeof(what)); - for (i = 0; sounds[i].ind != -1; i++) { - if (sounds[i].ind == what) { - o->cursound = i; - o->sampsent = 0; - o->nosound = 1; /* block audio from pbx */ - break; - } - } - if (sounds[i].ind == -1) - ast_log(LOG_WARNING, "invalid sound index: %d\n", what); - } - if (FD_ISSET(o->sounddev, &rfds)) { /* read and ignore errors */ - read(o->sounddev, ign, sizeof(ign)); - } - if (FD_ISSET(o->sounddev, &wfds)) - send_sound(o); - } - /* Never reached */ - return NULL; -} - -/* - * reset and close the device if opened, - * then open and initialize it in the desired mode, - * trigger reads and writes so we can start using it. - */ -static int setformat(struct chan_oss_pvt *o, int mode) -{ - int fmt, desired, res, fd; - - if (o->sounddev >= 0) { - ioctl(o->sounddev, SNDCTL_DSP_RESET, 0); - close(o->sounddev); - o->duplex = M_UNSET; - } - fd = o->sounddev = open(o->device, mode |O_NONBLOCK); - if (o->sounddev < 0) { - ast_log(LOG_WARNING, "Unable to re-open DSP device: %s\n", - strerror(errno)); - return -1; - } - - gettimeofday(&o->lasttime, NULL); - fmt = AFMT_S16_LE; - res = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt); - if (res < 0) { - ast_log(LOG_WARNING, "Unable to set format to 16-bit signed\n"); - return -1; - } - switch (mode) { - case O_RDWR: - res = ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0); - /* Check to see if duplex set (FreeBSD Bug)*/ - res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt); - if (res == 0 && (fmt & DSP_CAP_DUPLEX)) { - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n"); - o->duplex = M_FULL; - }; - break; - case O_WRONLY: - o->duplex = M_WRITE; - break; - case O_RDONLY: - o->duplex = M_READ; - break; - } - - fmt = 0; - res = ioctl(fd, SNDCTL_DSP_STEREO, &fmt); - if (res < 0) { - ast_log(LOG_WARNING, "Failed to set audio device to mono\n"); - return -1; - } - /* 8000 Hz desired */ - desired = 8000; - fmt = desired; - res = ioctl(fd, SNDCTL_DSP_SPEED, &fmt); - - if (res < 0) { - ast_log(LOG_WARNING, "Failed to set audio device to mono\n"); - return -1; - } - if (fmt != desired) { - if (!(o->warned & WARN_speed)) { - ast_log(LOG_WARNING, - "Requested %d Hz, got %d Hz -- sound may be choppy\n", - desired, fmt); - o->warned |= WARN_speed; - } - } - /* - * on Freebsd, SETFRAGMENT does not work very well on some cards. - * Default to use 256 bytes, let the user override - */ - if (o->frags) { - fmt = o->frags; - res = ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fmt); - if (res < 0) { - if (!(o->warned & WARN_frag)) { - ast_log(LOG_WARNING, - "Unable to set fragment size -- sound may be choppy\n"); - o->warned |= WARN_frag; - } - } - } - /* XXX on some cards, we need SNDCTL_DSP_SETTRIGGER to start outputting */ - res = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT; - res = ioctl(fd, SNDCTL_DSP_SETTRIGGER, &res); - /* it may fail if we are in half duplex, never mind */ - return 0; -} - -/* - * make sure output mode is available. Returns 0 if done, - * 1 if too early to switch, -1 if error - */ -static int soundcard_setoutput(struct chan_oss_pvt *o, int force) -{ - if (o->duplex == M_FULL || (o->duplex == M_WRITE && !force)) - return 0; - if (!force && too_early(o)) - return 1; - if (setformat(o, O_WRONLY)) - return -1; - return 0; -} - -/* - * make sure input mode is available. Returns 0 if done - * 1 if too early to switch, -1 if error - */ -static int soundcard_setinput(struct chan_oss_pvt *o, int force) -{ - if (o->duplex == M_FULL || (o->duplex == M_READ && !force)) - return 0; - if (!force && too_early(o)) - return 1; - if (setformat(o, O_RDONLY)) - return -1; - return 0; -} - -/* - * some of the standard methods supported by channels. - */ -static int oss_digit(struct ast_channel *c, char digit) -{ - /* no better use for received digits than print them */ - ast_verbose( " << Console Received digit %c >> \n", digit); - return 0; -} - -static int oss_text(struct ast_channel *c, char *text) -{ - /* print received messages */ - ast_verbose( " << Console Received text %s >> \n", text); - return 0; -} - -/* Play ringtone 'x' on device 'o' */ -#define RING(o, x) { int what = x; write((o)->sndcmd[1], &what, sizeof(what)); } - -/* - * handler for incoming calls. Either autoanswer, or start ringing - */ -static int oss_call(struct ast_channel *c, char *dest, int timeout) -{ - struct chan_oss_pvt *o = c->pvt->pvt; - struct ast_frame f = { 0, }; - - ast_verbose( " << Call placed to '%s' on console >> \n", dest); - if (o->autoanswer) { - ast_verbose( " << Auto-answered >> \n" ); - f.frametype = AST_FRAME_CONTROL; - f.subclass = AST_CONTROL_ANSWER; - ast_queue_frame(c, &f); - } else { - ast_verbose(" << Type 'answer' to answer, or use 'autoanswer' for future calls >> \n"); - f.frametype = AST_FRAME_CONTROL; - f.subclass = AST_CONTROL_RINGING; - ast_queue_frame(c, &f); - RING(o, AST_CONTROL_RING); - } - return 0; -} - -/* - * remote side answered the phone - */ -static int oss_answer(struct ast_channel *c) -{ - struct chan_oss_pvt *o = c->pvt->pvt; - - ast_verbose( " << Console call has been answered >> \n"); -#if 0 - /* play an answer tone (XXX do we really need it ?) */ - RING(o, AST_CONTROL_ANSWER); -#endif - ast_setstate(c, AST_STATE_UP); - o->cursound = -1; - o->nosound=0; - return 0; -} - -static int oss_hangup(struct ast_channel *c) -{ - struct chan_oss_pvt *o = c->pvt->pvt; - - o->cursound = -1; - c->pvt->pvt = NULL; - o->owner = NULL; - ast_verbose( " << Hangup on console >> \n"); - ast_mutex_lock(&usecnt_lock); /* XXX not sure why */ - usecnt--; - ast_mutex_unlock(&usecnt_lock); - if (o->hookstate) { - if (o->autoanswer || o->autohangup) { - /* Assume auto-hangup too */ - o->hookstate = 0; - } else { - /* Make congestion noise */ - RING(o, AST_CONTROL_CONGESTION); - } - } - return 0; -} - -/* used for data coming from the network */ -static int oss_write(struct ast_channel *c, struct ast_frame *f) -{ - int res; - int src; - struct chan_oss_pvt *o = c->pvt->pvt; - - /* Immediately return if no sound is enabled */ - if (o->nosound) - return 0; - /* Stop any currently playing sound */ - o->cursound = -1; - if (o->duplex != M_FULL && !o->playbackonly) { - /* XXX check this, looks weird! */ - /* If we're half duplex, we have to switch to read mode - to honor immediate needs if necessary */ - res = soundcard_setinput(o, 1); /* force set if not full_duplex */ - if (res < 0) { - ast_log(LOG_WARNING, "Unable to set device to input mode\n"); - return -1; - } - return 0; - } - res = soundcard_setoutput(o, 0); - if (res < 0) { - ast_log(LOG_WARNING, "Unable to set output device\n"); - return -1; - } else if (res > 0) { - /* The device is still in read mode, and it's too soon to change it, - so just pretend we wrote it */ - return 0; - } - /* - * we could receive a sample which is not a multiple of our FRAME_SIZE, - * so we buffer it locally and write to the device in FRAME_SIZE - * chunks, keeping the residue stored for future use. - */ - src = 0; /* read position into f->data */ - while ( src < f->datalen ) { - /* Compute spare room in the buffer */ - int l = sizeof(o->oss_write_buf) - o->oss_write_dst; - - if (f->datalen - src >= l) { /* enough to fill a frame */ - memcpy(o->oss_write_buf + o->oss_write_dst, - f->data + src, l); - soundcard_writeframe(o, (short *)o->oss_write_buf); - src += l; - o->oss_write_dst = 0; - } else { /* copy residue */ - l = f->datalen - src; - memcpy(o->oss_write_buf + o->oss_write_dst, - f->data + src, l); - src += l; /* but really, we are done */ - o->oss_write_dst += l; - } - } - return 0; -} - -static struct ast_frame *oss_read(struct ast_channel *c) -{ - int res; - struct chan_oss_pvt *o = c->pvt->pvt; - struct ast_frame *f = &o->read_f; - - /* prepare a NULL frame in case we don't have enough data to return */ - bzero(f, sizeof(struct ast_frame)); - f->frametype = AST_FRAME_NULL; - f->src = o->type; - - res = soundcard_setinput(o, 0); - if (res < 0) { - ast_log(LOG_WARNING, "Unable to set input mode\n"); - return NULL; - } else if (res > 0) { /* too early to switch ? */ - /* Theoretically shouldn't happen, but anyway, return a NULL frame */ - return f; - } - - res = read(o->sounddev, o->oss_read_buf + o->readpos, - sizeof(o->oss_read_buf) - o->readpos); - if (res < 0) /* audio data not ready, return a NULL frame */ - return f; - - o->readpos += res; - if (o->readpos < sizeof(o->oss_read_buf)) /* not enough samples */ - return f; - - o->readpos = AST_FRIENDLY_OFFSET; /* reset read pointer for next frame */ - if (c->_state != AST_STATE_UP) /* drop data if frame is not up */ - return f; - /* ok we can build and deliver the frame to the caller */ - f->frametype = AST_FRAME_VOICE; - f->subclass = AST_FORMAT_SLINEAR; - f->samples = FRAME_SIZE; - f->datalen = FRAME_SIZE * 2; - f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET; - f->offset = AST_FRIENDLY_OFFSET; - return f; -} - -static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) -{ - struct chan_oss_pvt *o = newchan->pvt->pvt; - o->owner = newchan; - return 0; -} - -static int oss_indicate(struct ast_channel *c, int cond) -{ - struct chan_oss_pvt *o = c->pvt->pvt; - int res; - - switch(cond) { - case AST_CONTROL_BUSY: - case AST_CONTROL_CONGESTION: - case AST_CONTROL_RINGING: - res = cond; - break; - case -1: - o->cursound = -1; - return 0; - default: - ast_log(LOG_WARNING, - "Don't know how to display condition %d on %s\n", - cond, c->name); - return -1; - } - if (res > -1) - RING(o, res); - return 0; -} - -static struct ast_channel *oss_new(struct chan_oss_pvt *o, - char *ext, char *ctx, int state) -{ - struct ast_channel *c; - struct ast_channel_pvt *pvt; - - c = ast_channel_alloc(1); - if (c == NULL) - return NULL; - snprintf(c->name, sizeof(c->name), "OSS/%s", o->device + 5); - c->type = o->type; - c->fds[0] = o->sounddev; - c->nativeformats = AST_FORMAT_SLINEAR; - pvt = c->pvt; - pvt->pvt = o; - - /* relevant callbacks */ - pvt->send_digit = oss_digit; - pvt->send_text = oss_text; - pvt->hangup = oss_hangup; - pvt->answer = oss_answer; - pvt->read = oss_read; - pvt->call = oss_call; - pvt->write = oss_write; - pvt->indicate = oss_indicate; - pvt->fixup = oss_fixup; - -#define S_OVERRIDE(dst, src) \ - { if (src && src[0] != '\0') /* non-empty string */ \ - strncpy((dst), src, sizeof(dst)-1); } - S_OVERRIDE(c->context, ctx); - S_OVERRIDE(c->exten, ext); - S_OVERRIDE(c->language, o->language); - o->owner = c; - ast_setstate(c, state); - ast_mutex_lock(&usecnt_lock); - usecnt++; - ast_mutex_unlock(&usecnt_lock); - ast_update_use_count(); - if (state != AST_STATE_DOWN) { - if (ast_pbx_start(c)) { - ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name); - ast_hangup(c); - o->owner = c = NULL; - /* XXX what about the channel itself ? */ - /* XXX what about usecnt ? */ - } - } - return c; -} - -/* - * returns a pointer to the descriptor with the given name - */ -static struct chan_oss_pvt *find_desc(char *dev) -{ - struct chan_oss_pvt *o; - - for (o = oss_default.next; o && strcmp(o->name, dev) != 0; o = o->next) - ; - if (o == NULL) - ast_log(LOG_WARNING, "%s could not find <%s>\n", __func__, dev); - return o; -} - -static struct ast_channel *oss_request(char *type, int format, void *data) -{ - struct ast_channel *c; - struct chan_oss_pvt *o = find_desc(data); - - ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n", - type, data, (char *)data); - if (o == NULL) { - ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data); - /* XXX we could default to 'dsp' perhaps ? */ - return NULL; - } - if ((format & AST_FORMAT_SLINEAR) == 0) { - ast_log(LOG_NOTICE, "Format 0x%x unsupported\n", format); - return NULL; - } - if (o->owner) { - ast_log(LOG_NOTICE, "Already have a call on the OSS channel\n"); - return NULL; - } - c= oss_new(o, NULL, NULL, AST_STATE_DOWN); - if (c == NULL) { - ast_log(LOG_WARNING, "Unable to create new OSS channel\n"); - return NULL; - } - return c; -} - -static int console_autoanswer(int fd, int argc, char *argv[]) -{ - struct chan_oss_pvt *o = find_desc(oss_active); - - if ((argc != 1) && (argc != 2)) - return RESULT_SHOWUSAGE; - if (o == NULL) { - ast_log(LOG_WARNING, "Cannot find device %s (should not happen!)\n", - oss_active); - return RESULT_FAILURE; - } - if (argc == 1) { - ast_cli(fd, "Auto answer is %s.\n", o->autoanswer ? "on" : "off"); - return RESULT_SUCCESS; - } - if (!strcasecmp(argv[1], "on")) - o->autoanswer = -1; - else if (!strcasecmp(argv[1], "off")) - o->autoanswer = 0; - else - return RESULT_SHOWUSAGE; - return RESULT_SUCCESS; -} - -static char *autoanswer_complete(char *line, char *word, int pos, int state) -{ -#ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - int l = strlen(word); - - switch(state) { - case 0: - if (l && !strncasecmp(word, "on", MIN(l, 2))) - return strdup("on"); - case 1: - if (l && !strncasecmp(word, "off", MIN(l, 3))) - return strdup("off"); - default: - return NULL; - } - return NULL; -} - -static char autoanswer_usage[] = -"Usage: autoanswer [on|off]\n" -" Enables or disables autoanswer feature. If used without\n" -" argument, displays the current on/off status of autoanswer.\n" -" The default value of autoanswer is in 'oss.conf'.\n"; - -/* - * answer command from the console - */ -static int console_answer(int fd, int argc, char *argv[]) -{ - struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER }; - struct chan_oss_pvt *o = find_desc(oss_active); - - if (argc != 1) - return RESULT_SHOWUSAGE; - if (!o->owner) { - ast_cli(fd, "No one is calling us\n"); - return RESULT_FAILURE; - } - o->hookstate = 1; - o->cursound = -1; - ast_queue_frame(o->owner, &f); - RING(o, AST_CONTROL_ANSWER); - return RESULT_SUCCESS; -} - -static char sendtext_usage[] = -"Usage: send text <message>\n" -" Sends a text message for display on the remote terminal.\n"; - -static int console_sendtext(int fd, int argc, char *argv[]) -{ - struct chan_oss_pvt *o = find_desc(oss_active); - int tmparg = 2; - char text2send[256] = ""; - struct ast_frame f = { 0, }; - - if (argc < 2) - return RESULT_SHOWUSAGE; - if (!o->owner) { - ast_cli(fd, "No one is calling us\n"); - return RESULT_FAILURE; - } - if (strlen(text2send)) - ast_cli(fd, "Warning: message already waiting to be sent, overwriting\n"); - text2send[0] = '\0'; - while(tmparg < argc) { - strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1); - strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1); - } - if (strlen(text2send)) { - f.frametype = AST_FRAME_TEXT; - f.subclass = 0; - f.data = text2send; - f.datalen = strlen(text2send); - ast_queue_frame(o->owner, &f); - } - return RESULT_SUCCESS; -} - -static char answer_usage[] = -"Usage: answer\n" -" Answers an incoming call on the console (OSS) channel.\n"; - -static int console_hangup(int fd, int argc, char *argv[]) -{ - struct chan_oss_pvt *o = find_desc(oss_active); - - if (argc != 1) - return RESULT_SHOWUSAGE; - o->cursound = -1; - if (!o->owner && !o->hookstate) { - ast_cli(fd, "No call to hangup up\n"); - return RESULT_FAILURE; - } - o->hookstate = 0; - if (o->owner) { - ast_queue_hangup(o->owner); - } - return RESULT_SUCCESS; -} - -static char hangup_usage[] = -"Usage: hangup\n" -" Hangs up any call currently placed on the console.\n"; - - -static int console_flash(int fd, int argc, char *argv[]) -{ - struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH }; - struct chan_oss_pvt *o = find_desc(oss_active); - - if (argc != 1) - return RESULT_SHOWUSAGE; - o->cursound = -1; - if (!o->owner) { /* XXX maybe !o->hookstate too ? */ - ast_cli(fd, "No call to flash\n"); - return RESULT_FAILURE; - } - o->hookstate = 0; - if (o->owner) { /* XXX must be true, right ? */ - ast_queue_frame(o->owner, &f); - } - return RESULT_SUCCESS; -} - - -static char flash_usage[] = -"Usage: flash\n" -" Flashes the call currently placed on the console.\n"; - - - -static int console_dial(int fd, int argc, char *argv[]) -{ - char *tmp = NULL, *mye = NULL, *myc = NULL; - int i; - struct ast_frame f = { AST_FRAME_DTMF, 0 }; - struct chan_oss_pvt *o = find_desc(oss_active); - - if ((argc != 1) && (argc != 2)) - return RESULT_SHOWUSAGE; - if (o->owner) { /* already in a call */ - if (argc == 1) { /* argument is mandatory here */ - ast_cli(fd, "Already in a call. You can only dial digits until you hangup.\n"); - return RESULT_FAILURE; - } - mye = argv[1]; - /* send the string one char at a time */ - for (i=0; i<strlen(mye); i++) { - f.subclass = mye[i]; - ast_queue_frame(o->owner, &f); - } - return RESULT_SUCCESS; - } - /* if we have an argument split it into extension and context */ - - if (argc == 2) { - tmp = myc = strdup(argv[1]); /* make a writable copy */ - mye = strsep(&myc, "@"); /* set exten, advance to context */ - myc = strsep(&myc, "@"); /* set context */ - } - /* supply default values if needed */ - if (mye == NULL) - mye = o->ext; - if (myc == NULL) - myc = o->ctx; - if (ast_exists_extension(NULL, myc, mye, 1, NULL)) { - o->hookstate = 1; - oss_new(o, mye, myc, AST_STATE_RINGING); - } else - ast_cli(fd, "No such extension '%s' in context '%s'\n", mye, myc); - return RESULT_SUCCESS; -} - -static char dial_usage[] = -"Usage: dial [extension[@context]]\n" -" Dials a given extensison (and context if specified)\n"; - -static int console_transfer(int fd, int argc, char *argv[]) -{ - struct chan_oss_pvt *o = find_desc(oss_active); - struct ast_channel *b = NULL; - char *ext, *ctx; - - if (argc != 2) - return RESULT_SHOWUSAGE; - if (o == NULL) - return RESULT_FAILURE; - if (o->owner == NULL || (b = o->owner->bridge) == NULL) { - ast_cli(fd, "There is no call to transfer\n"); - return RESULT_SUCCESS; - } - - ext = ctx = strdup(argv[1]); /* make a writable copy */ - strsep(&ctx, "@"); /* set exten, advance to context */ - ctx = strsep(&ctx, "@"); /* strip trailing @ and the rest */ - - if (ctx == NULL) /* supply default context if needed */ - ctx = o->owner->context; - if (!ast_exists_extension(b, ctx, ext, 1, b->callerid)) { - ast_cli(fd, "No such extension exists\n"); - } else { - ast_cli(fd, "Whee, transferring %s to %s@%s.\n", b->name, ext, ctx); - if (ast_async_goto(b, ctx, ext, 1)) - ast_cli(fd, "Failed to transfer :(\n"); - } - free(ext); - return RESULT_SUCCESS; -} - -static char transfer_usage[] = -"Usage: transfer <extension>[@context]\n" -" Transfers the currently connected call to the given extension (and\n" -"context if specified)\n"; - -static int console_active(int fd, int argc, char *argv[]) -{ - if (argc == 1) { - ast_cli(fd, "active console is [%s]\n", oss_active); - } else if (argc != 2) { - return RESULT_SHOWUSAGE; - } else { - struct chan_oss_pvt *o; - if (strcmp(argv[1], "show") == 0) { - for (o = oss_default.next; o ; o = o->next) - ast_cli(fd, "device [%s] exists\n", o->name); - return RESULT_SUCCESS; - } - o = find_desc(argv[1]); - if (o == NULL) - ast_cli(fd, "No device [%s] exists\n", argv[1]); - else - oss_active = o->name; - } - return RESULT_SUCCESS; -} - -static struct ast_cli_entry myclis[] = { - { { "answer", NULL }, console_answer, "Answer an incoming console call", answer_usage }, - { { "hangup", NULL }, console_hangup, "Hangup a call on the console", hangup_usage }, - { { "flash", NULL }, console_flash, "Flash a call on the console", flash_usage }, - { { "dial", NULL }, console_dial, "Dial an extension on the console", dial_usage }, - { { "transfer", NULL }, console_transfer, "Transfer a call to a different extension", transfer_usage }, - { { "send", "text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage }, - { { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete }, - { { "console", NULL }, console_active, "Sets/displays active console", - "console foo sets foo as the console"} -}; - -/* - * store the mixer argument from the config file, filtering possibly - * invalid or dangerous values (the string is used as argument for - * system("mixer %s") - */ -static void store_mixer(struct chan_oss_pvt *o, char *s) -{ - int i; - - for (i=0; i < strlen(s); i++) { - if (!isalnum(s[i]) && index(" \t-/", s[i]) == NULL) { - ast_log(LOG_WARNING, - "Suspect char %c in mixer cmd, ignoring:\n\t%s\n", s[i], s); - return; - } - } - if (o->mixer_cmd) - free(o->mixer_cmd); - o->mixer_cmd = strdup(s); - ast_log(LOG_WARNING, "setting mixer %s\n", s); -} - -/* - * grab fields from the config file, init the descriptor and open the device. - */ -static struct chan_oss_pvt * store_config(struct ast_config *cfg, - char *ctg) -{ - struct ast_variable *v; - struct chan_oss_pvt *o; - - if (ctg == NULL) { - o = &oss_default; - o->next = NULL; /* XXX needed ? */ - ctg = "general"; - } else { - o = (struct chan_oss_pvt *)malloc(sizeof *o); - if (o == NULL) /* fail */ - return NULL; - *o = oss_default; - /* "general" is also the default thing */ - if (strcmp(ctg, "general") == 0) { - o->name = strdup("dsp"); - oss_active = o->name; - goto openit; - } - o->name = strdup(ctg); - } - ast_log(LOG_WARNING, "found category [%s]\n", ctg); - - /* fill other fields from configuration */ - v = ast_variable_browse(cfg, ctg); - while(v) { - M_START(v->name, v->value); - - M_BOOL("autoanswer", o->autoanswer) - M_BOOL("autohangup", o->autohangup) - M_BOOL("playbackonly", o->playbackonly) - M_BOOL("silencesuppression", o->silencesuppression) - M_UINT("silencethreshold", o->silencethreshold ) - M_STR("device", o->device) - M_UINT("frags", o->frags) - M_UINT("debug", oss_debug) - M_UINT("queuesize", o->queuesize) - M_STR("context", o->ctx) - M_STR("language", o->language) - M_STR("extension", o->ext) - M_F("mixer", store_mixer(o, v->value)) - M_END(;); - v=v->next; - } - if (!strlen(o->device)) - strncpy(o->device, DEV_DSP, sizeof(o->device)-1); - if (o->mixer_cmd) { - char *cmd; - - asprintf(&cmd, "mixer %s", o->mixer_cmd); - ast_log(LOG_WARNING, "running [%s]\n", cmd); - system(cmd); - free(cmd); - } - if (o == &oss_default) /* we are done with the default */ - return NULL; - -openit: - if (setformat(o, O_RDWR) < 0) { /* open device */ - if (option_verbose > 0) { - ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg); - ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding " - "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n"); - } - goto error; - } - soundcard_setinput(o, 1); /* force set if not full_duplex */ - if (o->duplex != M_FULL) - ast_log(LOG_WARNING, "XXX I don't work right with non " - "full-duplex sound cards XXX\n"); - if ( pipe(o->sndcmd) != 0 ) { - ast_log(LOG_ERROR, "Unable to create pipe\n"); - goto error; - } - ast_pthread_create(&o->sthread, NULL, sound_thread, o); - /* link into list of devices */ - if (o != &oss_default) { - o->next = oss_default.next; - oss_default.next = o; - } - return o; - -error: - if (o != &oss_default) - free(o); - return NULL; -} - -int load_module() -{ - int i; - struct ast_config *cfg; - - /* load config file */ - cfg = ast_load(config); - if (cfg != NULL) { - char *ctg; - - store_config(cfg, NULL); /* init general category */ - ctg = ast_category_browse(cfg, NULL); /* initial category */ - while (ctg != NULL) { - store_config(cfg, ctg); - ctg = ast_category_browse(cfg, ctg); - } - ast_destroy(cfg); - } - if (find_desc(oss_active) == NULL) { - ast_log(LOG_NOTICE, "Device %s not found\n", oss_active); - /* XXX we could default to 'dsp' perhaps ? */ - /* XXX should cleanup allocated memory etc. */ - return -1; - } - i = ast_channel_register(oss_default.type, tdesc, - AST_FORMAT_SLINEAR, oss_request); - if (i < 0) { - ast_log(LOG_ERROR, "Unable to register channel class '%s'\n", - oss_default.type); - /* XXX should cleanup allocated memory etc. */ - return -1; - } - for (i=0; i<sizeof(myclis)/sizeof(struct ast_cli_entry); i++) - ast_cli_register(myclis + i); - return 0; -} - - -int unload_module() -{ - int x; - struct chan_oss_pvt *o; - - /* XXX do we need a ast_channel_unregister oss_request ? */ - for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++) - ast_cli_unregister(myclis + x); - - for (o = oss_default.next; o ; o = o->next) { - close(o->sounddev); - if (o->sndcmd[0] > 0) { - close(o->sndcmd[0]); - close(o->sndcmd[1]); - } - if (o->owner) - ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD); - if (o->owner) /* XXX how ??? */ - return -1; - /* XXX what about the thread ? */ - /* XXX what about the memory allocated ? */ - } - return 0; -} - -char *description() -{ - return desc; -} - -int usecount() /* XXX is this per-device or global for the module ? */ -{ - int res; - ast_mutex_lock(&usecnt_lock); - res = usecnt; - ast_mutex_unlock(&usecnt_lock); - return res; -} - -char *key() -{ - return ASTERISK_GPL_KEY; -} diff --git a/net/asterisk12/files/patch-Makefile b/net/asterisk12/files/patch-Makefile deleted file mode 100644 index 4f02274d20ab..000000000000 --- a/net/asterisk12/files/patch-Makefile +++ /dev/null @@ -1,429 +0,0 @@ ---- Makefile.orig Tue Aug 9 17:18:53 2005 -+++ Makefile Tue Aug 9 17:33:29 2005 -@@ -45,6 +45,15 @@ - PROC=$(shell uname -m) - endif - -+ifeq (${OSARCH},FreeBSD) -+ifeq ($(PROC),sparc64) -+PROC=ultrasparc -+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi) -+OPTIONS+=$(shell if $(CC) -mcpu=v9 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v9"; fi) -+OPTIONS+=-fomit-frame-pointer -+endif -+endif -+ - # Pentium Pro Optimize - #PROC=i686 - -@@ -63,10 +72,10 @@ - #K6OPT = -DK6OPT - - #Tell gcc to optimize the asterisk's code --OPTIMIZE+=-O6 -+#OPTIMIZE+=-O6 - - #Include debug symbols in the executables (-g) and profiling info (-pg) --DEBUG=-g #-pg -+#DEBUG=-g #-pg - - # If you are running a radio application, define RADIO_RELAX so that the DTMF - # will be received more reliably -@@ -91,7 +100,7 @@ - - # Where to install asterisk after compiling - # Default -> leave empty --INSTALL_PREFIX= -+INSTALL_PREFIX=$(PREFIX) - - # Staging directory - # Files are copied here temporarily during the install process -@@ -111,23 +120,23 @@ - # Don't use together with -DBUSYDETECT_TONEONLY - BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE - --ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk --ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk -+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk -+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk - ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk --ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk --ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk --ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk -+ASTSPOOLDIR=/var/spool/asterisk -+ASTLOGDIR=/var/log/asterisk -+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk - ASTCONFPATH=$(ASTETCDIR)/asterisk.conf --ASTBINDIR=$(INSTALL_PREFIX)/usr/bin --ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin --ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run --ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man -+ASTBINDIR=$(INSTALL_PREFIX)/bin -+ASTSBINDIR=$(INSTALL_PREFIX)/sbin -+ASTVARRUNDIR=/var/run -+ASTMANDIR=$(INSTALL_PREFIX)/man - - MODULES_DIR=$(ASTLIBDIR)/modules - AGI_DIR=$(ASTVARLIBDIR)/agi-bin - - INCLUDE=-Iinclude -I../include --CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY -+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY - CFLAGS+=$(OPTIMIZE) - - ifneq ($(PROC),ultrasparc) -@@ -138,12 +147,8 @@ - CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi) - - ifeq (${OSARCH},FreeBSD) --OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) --CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi) --LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi) --INCLUDE+=-I/usr/local/include --CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi) --MPG123TARG=freebsd -+CFLAGS+=$(PTHREAD_CFLAGS) -+LIBS+=$(PTHREAD_LIBS) - endif # FreeBSD - - ifeq (${OSARCH},NetBSD) -@@ -160,7 +165,10 @@ - #CFLAGS+=-DOLD_DSP_ROUTINES - - CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi) --CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi) -+CFLAGS+=-I$(LOCALBASE)/include -+ifdef WITH_ZAPTEL -+CFLAGS+=-DZAPTEL_OPTIMIZATIONS -+endif - - LIBEDIT=editline/libedit.a - -@@ -222,7 +230,7 @@ - SOLINK=-shared -Xlinker -x - endif - --CC=gcc -+CC?=gcc - INSTALL=install - - _all: all -@@ -234,7 +242,7 @@ - @echo " + $(MAKE) install +" - @echo " +-------------------------------------------+" - --all: depend asterisk subdirs -+all: depend asterisk subdirs manpage - - editline/config.h: - cd editline && unset CFLAGS LIBS && ./configure ; \ -@@ -243,13 +251,13 @@ - cd editline && unset CFLAGS LIBS && test -f config.h || ./configure - $(MAKE) -C editline libedit.a - --db1-ast/libdb1.a: FORCE -- @if [ -d db1-ast ]; then \ -- $(MAKE) -C db1-ast libdb1.a ; \ -- else \ -- echo "You need to do a cvs update -d not just cvs update"; \ -- exit 1; \ -- fi -+#db1-ast/libdb1.a: FORCE -+# @if [ -d db1-ast ]; then \ -+# $(MAKE) -C db1-ast libdb1.a ; \ -+# else \ -+# echo "You need to do a cvs update -d not just cvs update"; \ -+# exit 1; \ -+# fi - - ifneq ($(wildcard .depend),) - include .depend -@@ -271,13 +279,10 @@ - - asterisk.o: asterisk.c build.h - --manpage: asterisk.8.gz -+manpage: asterisk.8 - --asterisk.8.gz: asterisk.sgml -- rm -f asterisk.8 -- docbook2man asterisk.sgml -- mv ./*.8 asterisk.8 -- gzip asterisk.8 -+asterisk.8: asterisk.8.gz -+ gzcat asterisk.8.gz > asterisk.8 - - ifneq ($(strip $(ASTERISKVERSION)),) - build.h: .version -@@ -295,8 +300,8 @@ - exit 1; \ - fi - --asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS) -- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS) -+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS) -+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) stdtime/libtime.a $(LIBS) - - muted: muted.o - $(CC) -o muted muted.o -@@ -315,28 +320,28 @@ - $(MAKE) -C stdtime clean - - datafiles: all -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits - for x in sounds/digits/*.gsm; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \ - else \ - echo "No description for $$x"; \ - exit 1; \ - fi; \ - done -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters - for x in sounds/letters/*.gsm; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \ - else \ - echo "No description for $$x"; \ - exit 1; \ - fi; \ - done -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic - for x in sounds/phonetic/*.gsm; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \ - else \ - echo "No description for $$x"; \ - exit 1; \ -@@ -344,18 +349,18 @@ - done - for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ - else \ - echo "No description for $$x"; \ - exit 1; \ - fi; \ - done -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/images -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images - for x in images/*.jpg; do \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \ - done -- mkdir -p $(DESTDIR)$(AGI_DIR) -+ $(MKDIR) $(DESTDIR)$(AGI_DIR) - - update: - @if [ -d CVS ]; then \ -@@ -367,127 +372,90 @@ - fi - - bininstall: all -- mkdir -p $(DESTDIR)$(MODULES_DIR) -- mkdir -p $(DESTDIR)$(ASTSBINDIR) -- mkdir -p $(DESTDIR)$(ASTETCDIR) -- mkdir -p $(DESTDIR)$(ASTBINDIR) -- mkdir -p $(DESTDIR)$(ASTSBINDIR) -- mkdir -p $(DESTDIR)$(ASTVARRUNDIR) -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp -- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/ -- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/ -- install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/ -+ $(MKDIR) $(DESTDIR)$(MODULES_DIR) -+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR) -+ $(MKDIR) $(DESTDIR)$(ASTETCDIR) -+ $(MKDIR) $(DESTDIR)$(ASTBINDIR) -+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR) -+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR) -+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail -+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp -+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/ -+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/ -+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/ - if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \ -- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\ -+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\ - fi - for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done -- install -d $(DESTDIR)$(ASTHEADERDIR) -- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR) -+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR) -+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR) - rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm -- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail -- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \ -- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \ -- else \ -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \ -- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \ -- fi -- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds -- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax -- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8 -- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -- install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -- install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8 -+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds -+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax -+ $(MKDIR) $(DESTDIR)$(ASTMANDIR)/man8 -+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -+ $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 - if [ -d contrib/firmware/iax ]; then \ -- install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \ -+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \ - else \ - echo "You need to do cvs update -d not just cvs update" ; \ - fi -- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . ) -- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . ) -- if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi -- @echo " +---- Asterisk Installation Complete -------+" -- @echo " + +" -- @echo " + YOU MUST READ THE SECURITY DOCUMENT +" -- @echo " + +" -- @echo " + Asterisk has successfully been installed. +" -- @echo " + If you would like to install the sample +" -- @echo " + configuration files (overwriting any +" -- @echo " + existing config files), run: +" -- @echo " + +" -- @echo " + $(MAKE) samples +" -- @echo " + +" -- @echo " +----------------- or ---------------------+" -- @echo " + +" -- @echo " + You can go ahead and install the asterisk +" -- @echo " + program documentation now or later run: +" -- @echo " + +" -- @echo " + $(MAKE) progdocs +" -- @echo " + +" -- @echo " + **Note** This requires that you have +" -- @echo " + doxygen installed on your local system +" -- @echo " +-------------------------------------------+" -- @echo " + +" -- @echo " + ** NOTE FOR DOWNGRADING FROM CVS HEAD ** +" -- @echo " + +" -- @echo " + If you are downgrading from CVS HEAD to +" -- @echo " + a stable release, remember to delete +" -- @echo " + everything from your asterisk modules +" -- @echo " + directory (/usr/lib/asterisk/modules/) +" -- @echo " + and the asterisk header directory +" -- @echo " + (/usr/include/asterisk/) +" -- @echo " + before doing a '$(MAKE) install'. +" -- @echo " + +" -- @echo " +-------------------------------------------+" -+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/vm . ) -+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/voicemail . ) - - --install: all datafiles bininstall -+install: all datafiles bininstall samples - - upgrade: all bininstall - - adsi: all -- mkdir -p $(DESTDIR)$(ASTETCDIR) -+ $(MKDIR) $(DESTDIR)$(ASTETCDIR) - for x in configs/*.adsi; do \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \ - if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \ -- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \ - fi ; \ - done - - samples: all datafiles adsi -- mkdir -p $(DESTDIR)$(ASTETCDIR) -- for x in configs/*.sample; do \ -- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \ -- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \ -+ $(MKDIR) $(DESTDIR)$(ASTETCDIR) -+ for x in configs/*.sample channels/h323/*.sample; do \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\ -+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\ - fi ; \ -- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\ - done -- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \ -+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \ -+ fi - for x in sounds/demo-*; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ - else \ - echo "No description for $$x"; \ - exit 1; \ - fi; \ - done - for x in sounds/*.mp3; do \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ - done - rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3 -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX -+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX - :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm - for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \ - cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \ -@@ -502,7 +470,7 @@ - @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 ) - @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 ) - install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi -- mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk -+ $(MKDIR) $(DESTDIR)$(HTTPDIR)/html/_asterisk - for x in images/*.gif; do \ - install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \ - done -@@ -522,10 +490,10 @@ - - __rpm: _version - rm -rf /tmp/asterisk ; \ -- mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \ -+ $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \ - $(MAKE) DESTDIR=/tmp/asterisk install ; \ - $(MAKE) DESTDIR=/tmp/asterisk samples ; \ -- mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \ -+ $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \ - cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \ - sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \ - rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec diff --git a/net/asterisk12/files/patch-agi::Makefile b/net/asterisk12/files/patch-agi::Makefile deleted file mode 100644 index 32efb5d2b101..000000000000 --- a/net/asterisk12/files/patch-agi::Makefile +++ /dev/null @@ -1,27 +0,0 @@ - -$FreeBSD$ - ---- agi/Makefile.orig Tue Jun 22 20:42:13 2004 -+++ agi/Makefile Tue Oct 5 21:03:40 2004 -@@ -11,15 +11,18 @@ - # the GNU General Public License - # - --AGIS=agi-test.agi eagi-test eagi-sphinx-test -+AGIS_BIN=eagi-test eagi-sphinx-test -+AGIS_SCR=agi-test.agi -+AGIS=$(AGIS_SCR) $(AGIS_BIN) - - CFLAGS+= - - all: depend $(AGIS) - - install: all -- mkdir -p $(DESTDIR)$(AGI_DIR) -- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done -+ $(MKDIR) $(DESTDIR)$(AGI_DIR) -+ for x in $(AGIS_BIN); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(AGI_DIR) ; done -+ for x in $(AGIS_SCR); do $(BSD_INSTALL_SCRIPT) $$x $(DESTDIR)$(AGI_DIR) ; done - - eagi-test: eagi-test.o - $(CC) $(CFLAGS) -o eagi-test eagi-test.o diff --git a/net/asterisk12/files/patch-apps::Makefile b/net/asterisk12/files/patch-apps::Makefile deleted file mode 100644 index 44f8495864c4..000000000000 --- a/net/asterisk12/files/patch-apps::Makefile +++ /dev/null @@ -1,61 +0,0 @@ ---- apps/Makefile.orig Wed Jun 22 14:40:11 2005 -+++ apps/Makefile Wed Jun 22 14:43:45 2005 -@@ -40,9 +40,13 @@ - #APPS+=app_rpt.so - - APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi) --APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi) -+APPS+=$(shell if [ -f $(LOCALBASE)/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi) - APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi) - -+ifdef WITH_FAX -+APPS+=$(shell if [ -f $(LOCALBASE)/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi) -+endif -+ - CFLAGS+=-fPIC - - ifeq ($(USE_POSTGRES_VM_INTERFACE),1) -@@ -65,12 +69,12 @@ - $(CC) $(SOLINK) -o $@ $< -ltonezone - - install: all -- for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done -+ for x in $(APPS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done - rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so - - app_voicemail.so : app_voicemail.o - ifeq ($(USE_MYSQL_VM_INTERFACE),1) -- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz -+ $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L$(LOCALBASE)/lib/mysql -lmysqlclient -lz - else - ifeq ($(USE_POSTGRES_VM_INTERFACE),1) - $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq -@@ -79,17 +83,25 @@ - endif - endif - -+ifdef WITH_FAX -+app_rxfax.so : app_rxfax.o -+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lspandsp -ltiff -+ -+app_txfax.so : app_txfax.o -+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lspandsp -ltiff -+endif -+ - app_sql_postgres.o: app_sql_postgres.c -- $(CC) -pipe -I/usr/local/pgsql/include $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c -+ $(CC) -I$(LOCALBASE)/include/pgsql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c - - app_sql_postgres.so: app_sql_postgres.o -- $(CC) $(SOLINK) -o $@ $< -L/usr/local/pgsql/lib -lpq -+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lpq - - app_sql_odbc.so: app_sql_odbc.o - $(CC) $(SOLINK) -o $@ $< -lodbc - - look: look.c -- $(CC) -pipe -O6 -g look.c -o look -lncurses -+ $(CC) $(CFLAGS) look.c -o look -lncurses - - ifneq ($(wildcard .depend),) - include .depend diff --git a/net/asterisk12/files/patch-apps::app_rxfax.c b/net/asterisk12/files/patch-apps::app_rxfax.c deleted file mode 100644 index c8f4e3e296dc..000000000000 --- a/net/asterisk12/files/patch-apps::app_rxfax.c +++ /dev/null @@ -1,370 +0,0 @@ ---- apps/app_rxfax.c.orig Fri Jun 17 21:13:01 2005 -+++ apps/app_rxfax.c Fri Jun 17 21:04:12 2005 -@@ -0,0 +1,367 @@ -+/* -+ * Asterisk -- A telephony toolkit for Linux. -+ * -+ * Trivial application to receive a TIFF FAX file -+ * -+ * Copyright (C) 2003, Steve Underwood -+ * -+ * Steve Underwood <steveu@coppice.org> -+ * -+ * This program is free software, distributed under the terms of -+ * the GNU General Public License -+ */ -+ -+#include <asterisk/lock.h> -+#include <asterisk/file.h> -+#include <asterisk/logger.h> -+#include <asterisk/channel.h> -+#include <asterisk/pbx.h> -+#include <asterisk/module.h> -+#include <asterisk/translate.h> -+#include <asterisk/dsp.h> -+#include <asterisk/manager.h> -+#include <string.h> -+#include <stdlib.h> -+#include <stdint.h> -+#include <pthread.h> -+#include <errno.h> -+#include <math.h> -+#include <tiffio.h> -+ -+#include <spandsp.h> -+ -+static char *tdesc = "Trivial FAX Receive Application"; -+ -+static char *app = "RxFAX"; -+ -+static char *synopsis = "Receive a FAX to a file"; -+ -+static char *descrip = -+" RxFAX(filename[|caller][|debug]): Receives a FAX from the channel into the\n" -+"given filename. If the file exists it will be overwritten. The file\n" -+"should be in TIFF/F format.\n" -+"The \"caller\" option makes the application behave as a calling machine,\n" -+"rather than the answering machine. The default behaviour is to behave as\n" -+"an answering machine.\n" -+"Uses LOCALSTATIONID to identify itself to the remote end.\n" -+" LOCALHEADERINFO to generate a header line on each page.\n" -+"Sets REMOTESTATIONID to the sender CSID.\n" -+" FAXPAGES to the number of pages received.\n" -+" FAXBITRATE to the transmition rate.\n" -+" FAXRESOLUTION to the resolution.\n" -+"Returns -1 when the user hangs up.\n" -+"Returns 0 otherwise.\n"; -+ -+STANDARD_LOCAL_USER; -+ -+LOCAL_USER_DECL; -+ -+#define MAX_BLOCK_SIZE 240 -+ -+static void t30_flush(t30_state_t *s, int which) -+{ -+ //TODO: -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static void phase_e_handler(t30_state_t *s, void *user_data, int result) -+{ -+ struct ast_channel *chan; -+ t30_stats_t t; -+ char local_ident[21]; -+ char far_ident[21]; -+ char buf[11]; -+ -+ chan = (struct ast_channel *) user_data; -+ if (result) -+ { -+ fax_get_transfer_statistics(s, &t); -+ fax_get_far_ident(s, far_ident); -+ fax_get_local_ident(s, local_ident); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ ast_log(LOG_DEBUG, "Fax successfully received.\n"); -+ ast_log(LOG_DEBUG, "Remote station id: %s\n", far_ident); -+ ast_log(LOG_DEBUG, "Local station id: %s\n", local_ident); -+ ast_log(LOG_DEBUG, "Pages transferred: %i\n", t.pages_transferred); -+ ast_log(LOG_DEBUG, "Image resolution: %i x %i\n", t.column_resolution, t.row_resolution); -+ ast_log(LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ manager_event(EVENT_FLAG_CALL, -+ "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n", -+ chan->name, -+ chan->exten, -+#if (ASTERISK_VERSION_NUM <= 011000) -+ chan->callerid, -+#else -+ (chan->cid.cid_num) ? chan->cid.cid_num : "", -+#endif -+ far_ident, -+ local_ident, -+ t.pages_transferred, -+ t.row_resolution, -+ t.bit_rate, -+ s->rx_file); -+ pbx_builtin_setvar_helper(chan, "REMOTESTATIONID", far_ident); -+ snprintf(buf, sizeof(buf), "%i", t.pages_transferred); -+ pbx_builtin_setvar_helper(chan, "FAXPAGES", buf); -+ snprintf(buf, sizeof(buf), "%i", t.row_resolution); -+ pbx_builtin_setvar_helper(chan, "FAXRESOLUTION", buf); -+ snprintf(buf, sizeof(buf), "%i", t.bit_rate); -+ pbx_builtin_setvar_helper(chan, "FAXBITRATE", buf); -+ } -+ else -+ { -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ ast_log(LOG_DEBUG, "Fax receive not successful.\n"); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ } -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static void phase_d_handler(t30_state_t *s, void *user_data, int result) -+{ -+ struct ast_channel *chan; -+ t30_stats_t t; -+ -+ chan = (struct ast_channel *) user_data; -+ if (result) -+ { -+ fax_get_transfer_statistics(s, &t); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ ast_log(LOG_DEBUG, "Pages transferred: %i\n", t.pages_transferred); -+ ast_log(LOG_DEBUG, "Image size: %i x %i\n", t.columns, t.rows); -+ ast_log(LOG_DEBUG, "Image resolution %i x %i\n", t.column_resolution, t.row_resolution); -+ ast_log(LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate); -+ ast_log(LOG_DEBUG, "Bad rows %i\n", t.bad_rows); -+ ast_log(LOG_DEBUG, "Longest bad row run %i\n", t.longest_bad_row_run); -+ ast_log(LOG_DEBUG, "Compression type %i\n", t.encoding); -+ ast_log(LOG_DEBUG, "Image size (bytes) %i\n", t.image_size); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ } -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static int rxfax_exec(struct ast_channel *chan, void *data) -+{ -+ int res = 0; -+ char template_file[256]; -+ char target_file[256]; -+ char *s; -+ char *t; -+ char *v; -+ char *x; -+ int option; -+ int len; -+ int i; -+ t30_state_t fax; -+ int calling_party; -+ int verbose; -+ int samples; -+ -+ struct localuser *u; -+ struct ast_frame *inf = NULL; -+ struct ast_frame outf; -+ -+ int original_read_fmt; -+ int original_write_fmt; -+ -+ uint8_t __buf[sizeof(uint16_t)*MAX_BLOCK_SIZE + 2*AST_FRIENDLY_OFFSET]; -+ uint8_t *buf = __buf + AST_FRIENDLY_OFFSET; -+ -+ if (chan == NULL) -+ { -+ ast_log(LOG_WARNING, "Fax receive channel is NULL. Giving up.\n"); -+ return -1; -+ } -+ -+ /* The next few lines of code parse out the filename and header from the input string */ -+ if (data == NULL) -+ { -+ /* No data implies no filename or anything is present */ -+ ast_log(LOG_WARNING, "Rxfax requires an argument (filename)\n"); -+ return -1; -+ } -+ -+ calling_party = FALSE; -+ verbose = FALSE; -+ target_file[0] = '\0'; -+ -+ for (option = 0, v = s = data; v; option++, s++) -+ { -+ t = s; -+ v = strchr(s, '|'); -+ s = (v) ? v : s + strlen(s); -+ strncpy(buf, t, s - t); -+ buf[s - t] = '\0'; -+ if (option == 0) -+ { -+ /* The first option is always the file name */ -+ len = s - t; -+ if (len > 255) -+ len = 255; -+ strncpy(target_file, t, len); -+ target_file[len] = '\0'; -+ /* Allow the use of %d in the file name for a wild card of sorts, to -+ create a new file with the specified name scheme */ -+ if ((x = strchr(target_file, '%')) && x[1] == 'd') -+ { -+ strcpy(template_file, target_file); -+ i = 0; -+ do -+ { -+ snprintf(target_file, 256, template_file, 1); -+ i++; -+ } -+ while (ast_fileexists(target_file, "", chan->language) != -1); -+ } -+ } -+ else if (strncmp("caller", t, s - t) == 0) -+ { -+ calling_party = TRUE; -+ } -+ else if (strncmp("debug", t, s - t) == 0) -+ { -+ verbose = TRUE; -+ } -+ } -+ -+ /* Done parsing */ -+ -+ LOCAL_USER_ADD(u); -+ -+ if (chan->_state != AST_STATE_UP) -+ { -+ /* Shouldn't need this, but checking to see if channel is already answered -+ * Theoretically asterisk should already have answered before running the app */ -+ res = ast_answer(chan); -+ } -+ -+ if (!res) -+ { -+ original_read_fmt = chan->readformat; -+ if (original_read_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); -+ if (res < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to set to linear read mode, giving up\n"); -+ return -1; -+ } -+ } -+ original_write_fmt = chan->writeformat; -+ if (original_write_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_write_format(chan, AST_FORMAT_SLINEAR); -+ if (res < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to set to linear write mode, giving up\n"); -+ res = ast_set_read_format(chan, original_read_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); -+ return -1; -+ } -+ } -+ fax_init(&fax, calling_party, NULL); -+ fax.verbose = verbose; -+ x = pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"); -+ if (x && x[0]) -+ fax_set_local_ident(&fax, x); -+ x = pbx_builtin_getvar_helper(chan, "LOCALHEADERINFO"); -+ if (x && x[0]) -+ fax_set_header_info(&fax, x); -+ fax_set_rx_file(&fax, target_file); -+ //fax_set_phase_b_handler(&fax, phase_b_handler, chan); -+ fax_set_phase_d_handler(&fax, phase_d_handler, chan); -+ fax_set_phase_e_handler(&fax, phase_e_handler, chan); -+ while (ast_waitfor(chan, -1) > -1) -+ { -+ inf = ast_read(chan); -+ if (inf == NULL) -+ { -+ res = -1; -+ break; -+ } -+ if (inf->frametype == AST_FRAME_VOICE) -+ { -+ if (fax_rx_process(&fax, inf->data, inf->samples)) -+ break; -+ samples = (inf->samples <= MAX_BLOCK_SIZE) ? inf->samples : MAX_BLOCK_SIZE; -+ len = fax_tx_process(&fax, (int16_t *) &buf[AST_FRIENDLY_OFFSET], samples); -+ if (len) -+ { -+ memset(&outf, 0, sizeof(outf)); -+ outf.frametype = AST_FRAME_VOICE; -+ outf.subclass = AST_FORMAT_SLINEAR; -+ outf.datalen = len*sizeof(int16_t); -+ outf.samples = len; -+ outf.data = &buf[AST_FRIENDLY_OFFSET]; -+ outf.offset = AST_FRIENDLY_OFFSET; -+ outf.src = "RxFAX"; -+ if (ast_write(chan, &outf) < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to write frame to channel; %s\n", strerror(errno)); -+ break; -+ } -+ } -+ } -+ ast_frfree(inf); -+ } -+ if (inf == NULL) -+ { -+ ast_log(LOG_DEBUG, "Got hangup\n"); -+ res = -1; -+ } -+ if (original_read_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_read_format(chan, original_read_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); -+ } -+ if (original_write_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_write_format(chan, original_write_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore write format on '%s'\n", chan->name); -+ } -+ } -+ else -+ { -+ ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name); -+ } -+ LOCAL_USER_REMOVE(u); -+ return res; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int unload_module(void) -+{ -+ STANDARD_HANGUP_LOCALUSERS; -+ return ast_unregister_application(app); -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int load_module(void) -+{ -+ return ast_register_application(app, rxfax_exec, synopsis, descrip); -+} -+ -+char *description(void) -+{ -+ return tdesc; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int usecount(void) -+{ -+ int res; -+ STANDARD_USECOUNT(res); -+ return res; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+char *key(void) -+{ -+ return ASTERISK_GPL_KEY; -+} -+/*- End of function --------------------------------------------------------*/ -+/*- End of file ------------------------------------------------------------*/ diff --git a/net/asterisk12/files/patch-apps::app_txfax.c b/net/asterisk12/files/patch-apps::app_txfax.c deleted file mode 100644 index 52bcc3fdde23..000000000000 --- a/net/asterisk12/files/patch-apps::app_txfax.c +++ /dev/null @@ -1,292 +0,0 @@ ---- apps/app_txfax.c.orig Fri Jun 17 21:13:05 2005 -+++ apps/app_txfax.c Fri Jun 17 21:00:43 2005 -@@ -0,0 +1,289 @@ -+/* -+ * Asterisk -- A telephony toolkit for Linux. -+ * -+ * Trivial application to send a TIFF file as a FAX -+ * -+ * Copyright (C) 2003, Steve Underwood -+ * -+ * Steve Underwood <steveu@coppice.org> -+ * -+ * This program is free software, distributed under the terms of -+ * the GNU General Public License -+ */ -+ -+#include <asterisk/lock.h> -+#include <asterisk/file.h> -+#include <asterisk/logger.h> -+#include <asterisk/channel.h> -+#include <asterisk/pbx.h> -+#include <asterisk/module.h> -+#include <asterisk/translate.h> -+#include <string.h> -+#include <stdlib.h> -+#include <stdint.h> -+#include <pthread.h> -+#include <errno.h> -+#include <tiffio.h> -+ -+#include <spandsp.h> -+ -+static char *tdesc = "Trivial FAX Transmit Application"; -+ -+static char *app = "TxFAX"; -+ -+static char *synopsis = "Send a FAX file"; -+ -+static char *descrip = -+" TxFAX(filename[|caller][|debug]): Send a given TIFF file to the channel as a FAX.\n" -+"The \"caller\" option makes the application behave as a calling machine,\n" -+"rather than the answering machine. The default behaviour is to behave as\n" -+"an answering machine.\n" -+"Uses LOCALSTATIONID to identify itself to the remote end.\n" -+" LOCALHEADERINFO to generate a header line on each page.\n" -+"Sets REMOTESTATIONID to the receiver CSID.\n" -+"Returns -1 when the user hangs up, or if the file does not exist.\n" -+"Returns 0 otherwise.\n"; -+ -+STANDARD_LOCAL_USER; -+ -+LOCAL_USER_DECL; -+ -+#define MAX_BLOCK_SIZE 240 -+ -+static void t30_flush(t30_state_t *s, int which) -+{ -+ //TODO: -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static void phase_e_handler(t30_state_t *s, void *user_data, int result) -+{ -+ struct ast_channel *chan; -+ char far_ident[21]; -+ -+ chan = (struct ast_channel *) user_data; -+ if (result) -+ { -+ fax_get_far_ident(s, far_ident); -+ pbx_builtin_setvar_helper(chan, "REMOTESTATIONID", far_ident); -+ } -+ else -+ { -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ ast_log(LOG_DEBUG, "Fax send not successful.\n"); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ } -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static int txfax_exec(struct ast_channel *chan, void *data) -+{ -+ int res = 0; -+ char source_file[256]; -+ char *x; -+ char *s; -+ char *t; -+ char *v; -+ int option; -+ int len; -+ t30_state_t fax; -+ int calling_party; -+ int verbose; -+ int samples; -+ -+ struct localuser *u; -+ struct ast_frame *inf = NULL; -+ struct ast_frame outf; -+ -+ int original_read_fmt; -+ int original_write_fmt; -+ -+ uint8_t __buf[sizeof(uint16_t)*MAX_BLOCK_SIZE + 2*AST_FRIENDLY_OFFSET]; -+ uint8_t *buf = __buf + AST_FRIENDLY_OFFSET; -+ -+ if (chan == NULL) -+ { -+ ast_log(LOG_WARNING, "Fax transmit channel is NULL. Giving up.\n"); -+ return -1; -+ } -+ -+ /* The next few lines of code parse out the filename and header from the input string */ -+ if (data == NULL) -+ { -+ /* No data implies no filename or anything is present */ -+ ast_log(LOG_WARNING, "Txfax requires an argument (filename)\n"); -+ return -1; -+ } -+ -+ calling_party = FALSE; -+ verbose = FALSE; -+ source_file[0] = '\0'; -+ -+ for (option = 0, v = s = data; v; option++, s++) -+ { -+ t = s; -+ v = strchr(s, '|'); -+ s = (v) ? v : s + strlen(s); -+ strncpy(buf, t, s - t); -+ buf[s - t] = '\0'; -+ if (option == 0) -+ { -+ /* The first option is always the file name */ -+ len = s - t; -+ if (len > 255) -+ len = 255; -+ strncpy(source_file, t, len); -+ source_file[len] = '\0'; -+ } -+ else if (strncmp("caller", t, s - t) == 0) -+ { -+ calling_party = TRUE; -+ } -+ else if (strncmp("debug", t, s - t) == 0) -+ { -+ verbose = TRUE; -+ } -+ } -+ -+ /* Done parsing */ -+ -+ LOCAL_USER_ADD(u); -+ -+ if (chan->_state != AST_STATE_UP) -+ { -+ /* Shouldn't need this, but checking to see if channel is already answered -+ * Theoretically asterisk should already have answered before running the app */ -+ res = ast_answer(chan); -+ } -+ -+ if (!res) -+ { -+ original_read_fmt = chan->readformat; -+ if (original_read_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); -+ if (res < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to set to linear read mode, giving up\n"); -+ return -1; -+ } -+ } -+ original_write_fmt = chan->writeformat; -+ if (original_write_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_write_format(chan, AST_FORMAT_SLINEAR); -+ if (res < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to set to linear write mode, giving up\n"); -+ res = ast_set_read_format(chan, original_read_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); -+ return -1; -+ } -+ } -+ fax_init(&fax, calling_party, NULL); -+ fax.verbose = verbose; -+ -+ x = pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"); -+ if (x && x[0]) -+ fax_set_local_ident(&fax, x); -+ x = pbx_builtin_getvar_helper(chan, "LOCALHEADERINFO"); -+ if (x && x[0]) -+ fax_set_header_info(&fax, x); -+ fax_set_tx_file(&fax, source_file); -+ //fax_set_phase_b_handler(&fax, phase_b_handler, chan); -+ //fax_set_phase_d_handler(&fax, phase_d_handler, chan); -+ fax_set_phase_e_handler(&fax, phase_e_handler, chan); -+ while (ast_waitfor(chan, -1) > -1) -+ { -+ inf = ast_read(chan); -+ if (inf == NULL) -+ { -+ res = -1; -+ break; -+ } -+ if (inf->frametype == AST_FRAME_VOICE) -+ { -+ if (fax_rx_process(&fax, inf->data, inf->samples)) -+ break; -+ samples = (inf->samples <= MAX_BLOCK_SIZE) ? inf->samples : MAX_BLOCK_SIZE; -+ len = fax_tx_process(&fax, (int16_t *) &buf[AST_FRIENDLY_OFFSET], samples); -+ if (len) -+ { -+ memset(&outf, 0, sizeof(outf)); -+ outf.frametype = AST_FRAME_VOICE; -+ outf.subclass = AST_FORMAT_SLINEAR; -+ outf.datalen = len*sizeof(int16_t); -+ outf.samples = len; -+ outf.data = &buf[AST_FRIENDLY_OFFSET]; -+ outf.offset = AST_FRIENDLY_OFFSET; -+ if (ast_write(chan, &outf) < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to write frame to channel; %s\n", strerror(errno)); -+ break; -+ } -+ } -+ } -+ ast_frfree(inf); -+ } -+ if (inf == NULL) -+ { -+ ast_log(LOG_DEBUG, "Got hangup\n"); -+ res = -1; -+ } -+ if (original_read_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_read_format(chan, original_read_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); -+ } -+ if (original_write_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_write_format(chan, original_write_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore write format on '%s'\n", chan->name); -+ } -+ } -+ else -+ { -+ ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name); -+ } -+ LOCAL_USER_REMOVE(u); -+ return res; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int unload_module(void) -+{ -+ STANDARD_HANGUP_LOCALUSERS; -+ return ast_unregister_application(app); -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int load_module(void) -+{ -+ return ast_register_application(app, txfax_exec, synopsis, descrip); -+} -+/*- End of function --------------------------------------------------------*/ -+ -+char *description(void) -+{ -+ return tdesc; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int usecount(void) -+{ -+ int res; -+ -+ STANDARD_USECOUNT(res); -+ return res; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+char *key(void) -+{ -+ return ASTERISK_GPL_KEY; -+} -+/*- End of function --------------------------------------------------------*/ -+/*- End of file ------------------------------------------------------------*/ diff --git a/net/asterisk12/files/patch-astman::Makefile b/net/asterisk12/files/patch-astman::Makefile deleted file mode 100644 index 2745860cdd36..000000000000 --- a/net/asterisk12/files/patch-astman::Makefile +++ /dev/null @@ -1,25 +0,0 @@ - -$FreeBSD$ - ---- astman/Makefile.orig Sat Jun 26 22:25:39 2004 -+++ astman/Makefile Thu Oct 14 19:14:22 2004 -@@ -5,16 +5,16 @@ - - OSARCH=$(shell uname -s) - ifeq ($(findstring BSD,${OSARCH}),BSD) --CFLAGS+=-I/usr/local/include -L/usr/local/lib -+CFLAGS+=-I$(LOCALBASE)/include -L$(LOCALBASE)/lib - endif - --TARGET=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; else echo "none" ; fi ; fi) -+TARGET=astman - all: depend $(TARGET) - - install: - if [ "$(TARGET)" != "none" ]; then \ - for x in $(TARGET); do \ -- install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \ -+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/astman; \ - done ; \ - fi - diff --git a/net/asterisk12/files/patch-cdr::Makefile b/net/asterisk12/files/patch-cdr::Makefile deleted file mode 100644 index 1d0fb2049ba2..000000000000 --- a/net/asterisk12/files/patch-cdr::Makefile +++ /dev/null @@ -1,56 +0,0 @@ ---- cdr/Makefile.orig Tue Aug 31 23:33:00 2004 -+++ cdr/Makefile Tue Aug 9 17:28:11 2005 -@@ -21,7 +21,7 @@ - OSARCH=$(shell uname -s) - - ifeq (${OSARCH},FreeBSD) --SOLINK+=-L/usr/local/lib -+SOLINK+=-L$(LOCALBASE)/lib - endif - - #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only. -@@ -37,18 +37,23 @@ - # - # unixODBC stuff... - # -+ifdef WITH_ODBC - MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi) - MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi) -+endif - - # - # FreeTDS stuff... - # -+ifdef WITH_FREETDS - MODS+=$(shell if [ -f "/usr/include/tds.h" ]; then echo "cdr_tds.so"; fi) - MODS+=$(shell if [ -f "/usr/local/include/tds.h" ]; then echo "cdr_tds.so"; fi) -+endif - - # - # PGSQL stuff... Autoconf anyone?? - # -+ifdef WITH_PGSQL - MODS+=$(shell if [ -d /usr/local/pgsql/include ] || [ -d /usr/include/pgsql ] || [ -d /usr/local/include/pgsql ] || [ -d /opt/pgsql/include ] || [ -f /usr/include/libpq-fe.h ] ; then echo "cdr_pgsql.so"; fi) - CFLAGS+=$(shell if [ -d /usr/local/pgsql/include ]; then echo "-I/usr/local/pgsql/include"; fi) - CFLAGS+=$(shell if [ -d /usr/include/pgsql ]; then echo "-I/usr/include/pgsql"; fi) -@@ -62,16 +67,19 @@ - MLFLAGS+=$(shell if [ -d /usr/local/lib/pgsql ]; then echo "-L/usr/local/lib/pgsql"; fi) - MLFLAGS+=$(shell if [ -d /opt/pgsql/lib ]; then echo "-L/opt/pgsql/lib"; fi) - MLFLAGS+=$(shell if [ -f /usr/lib/libpq.so ]; then echo "-L/usr/lib"; fi) -+endif - - # - # SQLIte stuff... - # -+ifdef WITH_SQLITE - MODS+=$(shell if [ -f "/usr/include/sqlite.h" ]; then echo "cdr_sqlite.so"; fi) -+endif - - all: depend $(MODS) - - install: all -- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done -+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done - - clean: - rm -f *.so *.o .depend diff --git a/net/asterisk12/files/patch-channels::Makefile b/net/asterisk12/files/patch-channels::Makefile deleted file mode 100644 index 7ecab67f9571..000000000000 --- a/net/asterisk12/files/patch-channels::Makefile +++ /dev/null @@ -1,97 +0,0 @@ ---- channels/Makefile.orig Tue Aug 31 23:33:00 2004 -+++ channels/Makefile Tue Aug 9 17:34:28 2005 -@@ -57,10 +57,10 @@ - - endif - ifeq (${OSARCH},FreeBSD) --PTLIB=-lpt_FreeBSD_x86_r --H323LIB=-lh323_FreeBSD_x86_r --CHANH323LIB=-pthread --SOLINK+=-L/usr/local/lib -+PTLIB=-lpt_FreeBSD_x86_r_s -+H323LIB=-lh323_FreeBSD_x86_r_s -+CHANH323LIB= -+SOLINK+=-L$(LOCALBASE)/lib - endif - ifeq (${OSARCH},NetBSD) - PTLIB=-lpt_NetBSD_x86_r -@@ -72,19 +72,23 @@ - endif - - CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so) --CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so) --CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so) -+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/ixjuser.h ] && echo chan_phone.so) -+ifdef WITH_H323 -+CHANNEL_LIBS+=chan_h323.so -+endif - - CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations - CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API") - CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so") --CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI") -+CFLAGS+=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo " -DZAPATA_PRI") - CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2") - CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR") --ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri") -+ZAPPRI=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo "-lpri") - ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2") -+ifdef WITH_ZAPTEL - CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING") --CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING") -+CFLAGS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "-DIAX_TRUNKING -I$(LOCALBASE)/include") -+endif - CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" ) - CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX") - -@@ -106,8 +110,10 @@ - - ZAPDIR=/usr/lib - -+ifdef WITH_ZAPTEL - CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so") --CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so") -+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "chan_zap.so") -+endif - - CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" ) - -@@ -156,6 +162,8 @@ - chan_oss.so: chan_oss.o - $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio - endif -+chan_oss.so: chan_oss.o -+ $(CC) $(SOLINK) -o $@ chan_oss.o - - chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o - ifeq ($(USE_MYSQL_FRIENDS),1) -@@ -175,7 +183,7 @@ - $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c - - chan_zap.so: chan_zap.o -- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone -+ $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -L$(LOCALBASE)/lib -ltonezone - - chan_sip.so: chan_sip.o - ifeq ($(USE_SIP_MYSQL_FRIENDS),1) -@@ -199,15 +207,17 @@ - chan_vpb.so: chan_vpb.o - $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl - --chan_h323.so: chan_h323.o h323/libchanh323.a -- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat -+chan_h323.so: chan_h323.o h323/ast_h323.o -+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -lcrypto -lssl -L$(LOCALBASE)/lib -lexpat -llber -lldap -lldap_r - -+h323/ast_h323.o: -+ $(MAKE) -C h323 ast_h323.o - - #chan_modem.so : chan_modem.o - # $(CC) -rdynamic -shared -Xlinker -x -o $@ $< - - install: all -- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done -+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done - if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi - - depend: .depend diff --git a/net/asterisk12/files/patch-channels::chan_h323.c b/net/asterisk12/files/patch-channels::chan_h323.c deleted file mode 100644 index de2ed3978663..000000000000 --- a/net/asterisk12/files/patch-channels::chan_h323.c +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- channels/chan_h323.c 2004/10/10 13:00:17 1.1 -+++ channels/chan_h323.c 2004/10/10 13:00:39 -@@ -26,7 +26,7 @@ - * Version Info: $Id: patch-channels::chan_h323.c,v 1.3.2.3 2004/10/14 14:30:13 sobomax Exp $ - */ - -- -+#include <sys/types.h> - #include <sys/socket.h> - #include <sys/signal.h> - #include <sys/param.h> diff --git a/net/asterisk12/files/patch-channels::chan_sip.c b/net/asterisk12/files/patch-channels::chan_sip.c deleted file mode 100644 index e634ce47c97f..000000000000 --- a/net/asterisk12/files/patch-channels::chan_sip.c +++ /dev/null @@ -1,144 +0,0 @@ - -$FreeBSD$ - ---- channels/chan_sip.c.orig Sun Feb 17 18:01:43 2002 -+++ channels/chan_sip.c Sun Feb 17 18:10:52 2002 -@@ -141,7 +141,7 @@ - - static char default_language[MAX_LANGUAGE] = ""; - --static char default_callerid[AST_MAX_EXTENSION] = "asterisk"; -+static char default_callerid[AST_MAX_EXTENSION] = "Unknown"; - - static char default_fromdomain[AST_MAX_EXTENSION] = ""; - -@@ -244,6 +244,7 @@ - struct sip_route { - struct sip_route *next; - char hop[0]; -+ int lr; - }; - - struct sip_history { -@@ -2218,7 +2219,7 @@ - if (p->owner) { - /* We already hold the channel lock */ - if (f->frametype == AST_FRAME_VOICE) { -- if (f->subclass != p->owner->nativeformats) { -+ if (!(f->subclass & p->owner->nativeformats)) { - ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass); - p->owner->nativeformats = f->subclass; - ast_set_read_format(p->owner, p->owner->readformat); -@@ -4620,6 +4621,10 @@ - /* Make a struct route */ - thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1); - if (thishop) { -+ if (strnstr(rr, ";lr", len) != NULL) -+ thishop->lr = 1; -+ else -+ thishop->lr = 0; - strncpy(thishop->hop, rr, len); /* safe */ - thishop->hop[len] = '\0'; - ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop); -@@ -4643,31 +4648,41 @@ - rr += len+1; - } - } -- /* 2nd append the Contact: if there is one */ -- /* Can be multiple Contact headers, comma separated values - we just take the first */ -- contact = get_header(req, "Contact"); -- if (!ast_strlen_zero(contact)) { -- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact); -- /* Look for <: delimited address */ -- c = strchr(contact, '<'); -- if (c) { -- /* Take to > */ -- ++c; -- len = strcspn(c, ">"); -- } else { -- /* No <> - just take the lot */ -- c = contact; len = strlen(contact); -- } -- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1); -+ /* Duplicate first route from the list */ -+ if (head && head->lr) { -+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1); - if (thishop) { -- strncpy(thishop->hop, c, len); /* safe */ -- thishop->hop[len] = '\0'; -- thishop->next = NULL; -- /* Goes at the end */ -- if (tail) -- tail->next = thishop; -- else -- head = thishop; -+ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1); -+ thishop->next = head; -+ head = thishop; -+ } -+ } else { -+ /* Append the Contact: if there is one and first route is w/o `lr' param */ -+ /* Can be multiple Contact headers, comma separated values - we just take the first */ -+ contact = get_header(req, "Contact"); -+ if (!ast_strlen_zero(contact)) { -+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact); -+ /* Look for <: delimited address */ -+ c = strchr(contact, '<'); -+ if (c) { -+ /* Take to > */ -+ ++c; -+ len = strcspn(c, ">"); -+ } else { -+ /* No <> - just take the lot */ -+ c = contact; len = strlen(contact); -+ } -+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1); -+ if (thishop) { -+ strncpy(thishop->hop, c, len); /* safe */ -+ thishop->hop[len] = '\0'; -+ thishop->next = NULL; -+ /* Goes at the end */ -+ if (tail) -+ tail->next = thishop; -+ else -+ head = thishop; -+ } - } - } - /* Store as new route */ -@@ -7338,7 +7353,11 @@ - /* Get destination right away */ - gotdest = get_destination(p, NULL); - get_rdnis(p, NULL); -- extract_uri(p, req); -+ build_route(p, req, 0); -+ if (!p->route->lr) -+ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1); -+ else -+ extract_uri(p, req); - build_contact(p); - - if (gotdest) { -@@ -7366,7 +7385,6 @@ - c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username ); - *recount = 1; - /* Save Record-Route for any later requests we make on this dialogue */ -- build_route(p, req, 0); - if (c) { - /* Pre-lock the call */ - ast_mutex_lock(&c->lock); -@@ -7426,6 +7444,14 @@ - transmit_response(p, "180 Ringing", req); - break; - case AST_STATE_UP: -+ /* Assuming this to be reinvite, process new SDP portion */ -+ if (!ast_strlen_zero(get_header(req, "Content-Type"))) { -+ process_sdp(p, req); -+ } else { -+ p->jointcapability = p->capability; -+ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n"); -+ } -+ - transmit_response_with_sdp(p, "200 OK", req, 1); - break; - default: diff --git a/net/asterisk12/files/patch-channels::chan_zap.c b/net/asterisk12/files/patch-channels::chan_zap.c deleted file mode 100644 index 458a6147d215..000000000000 --- a/net/asterisk12/files/patch-channels::chan_zap.c +++ /dev/null @@ -1,100 +0,0 @@ - -$FreeBSD$ - ---- channels/chan_zap.c.orig Sun Feb 17 18:01:44 2002 -+++ channels/chan_zap.c Sun Feb 17 18:03:26 2002 -@@ -46,7 +46,9 @@ - #include <sys/signal.h> - #include <errno.h> - #include <stdlib.h> -+#ifndef __FreeBSD__ - #include <stdint.h> -+#endif - #include <unistd.h> - #include <sys/ioctl.h> - #ifdef __linux__ -@@ -320,7 +322,7 @@ - #define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /* 300 ms */ - #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /* 500 ms */ - #define MIN_MS_SINCE_FLASH ( (2000) ) /* 2000 ms */ --#define RINGT ( (8000 * 8) / READ_SIZE) -+#define RINGT ( (8000 * 8) / READ_SIZE) /* 8000 ms */ - - struct zt_pvt; - -@@ -535,6 +537,7 @@ - int cidpos; - int cidlen; - int ringt; -+ int waitnorings; - int stripmsd; - int callwaiting; - int callwaitcas; -@@ -2134,12 +2137,20 @@ - - if (option_debug) - ast_log(LOG_DEBUG, "zt_hangup(%s)\n", ast->name); -+ - if (!ast->pvt->pvt) { - ast_log(LOG_WARNING, "Asked to hangup channel not connected\n"); - return 0; - } - - ast_mutex_lock(&p->lock); -+ -+ -+ if((p->sig == SIG_FXSGS) || (p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS)) -+ if((ast->_state == AST_STATE_RING) && (p->ringt > 1)) -+ { -+ p->waitnorings = 1; -+ } - - index = zt_get_index(ast, p, 1); - -@@ -5717,7 +5728,37 @@ - ast_setstate(chan, AST_STATE_RING); - chan->rings = 1; - p->ringt = RINGT; -+ p->waitnorings = 0; - res = ast_pbx_run(chan); -+ -+ if(p->waitnorings) -+ { -+ p->ringt = RINGT; -+ for(;;) -+ { -+ int i,j=0; -+ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT; -+ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1) -+ break; -+ -+ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1) -+ break; -+ -+ if(j == ZT_EVENT_RINGOFFHOOK) -+ p->ringt = RINGT; -+ -+ usleep(20000); -+ -+ if (p->ringt <= 0) -+ break; -+ -+ else if (p->ringt > 0) -+ p->ringt--; -+ } -+ p->ringt = 0; -+ p->waitnorings = 0; -+ } -+ - if (res) { - ast_hangup(chan); - ast_log(LOG_WARNING, "PBX exited non-zero\n"); -@@ -6018,7 +6059,7 @@ - i = iflist; - while(i) { - if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) { -- if (!i->owner && !i->subs[SUB_REAL].owner) { -+ if (!i->owner && !i->subs[SUB_REAL].owner && !i->waitnorings) { - /* This needs to be watched, as it lacks an owner */ - pfds[count].fd = i->subs[SUB_REAL].zfd; - pfds[count].events = POLLPRI; diff --git a/net/asterisk12/files/patch-channels::h323::Makefile b/net/asterisk12/files/patch-channels::h323::Makefile deleted file mode 100644 index 779096bb2267..000000000000 --- a/net/asterisk12/files/patch-channels::h323::Makefile +++ /dev/null @@ -1,39 +0,0 @@ - -$FreeBSD$ - ---- channels/h323/Makefile.orig -+++ channels/h323/Makefile -@@ -53,7 +53,7 @@ - LIBS+=-lpthread - endif - ifeq ($(findstring BSD,${OSARCH}),BSD) --CFLAGS += -pthread -+CFLAGS += $(PTHREAD_LIBS) - endif - CFLAGS += -D_REENTRANT -D_GNU_SOURCE - CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS -@@ -77,20 +77,20 @@ - ar cr libchanh323.a ast_h323.o - - ast_h323.o: ast_h323.cpp -- $(CXX) -g -c -fno-rtti -o $@ $(CFLAGS) $< -+ $(CXX) $(CXXFLAGS) -c -fno-rtti -o $@ $(CFLAGS) $< - - ifneq ($(wildcard .depend),) - include .depend - endif - - chan_h323.so: -- $(CXX) -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB) -+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB) - - chan_h323_d.so: chan_h323.o ast_h323.o -- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB) -+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB) - - chan_h323_s.so: chan_h323.o ast_h323.o -- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB) -+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB) - clean: - rm -f *.o *.so core.* libchanh323.a .depend - diff --git a/net/asterisk12/files/patch-codecs::Makefile b/net/asterisk12/files/patch-codecs::Makefile deleted file mode 100644 index 325e590423a2..000000000000 --- a/net/asterisk12/files/patch-codecs::Makefile +++ /dev/null @@ -1,44 +0,0 @@ ---- codecs/Makefile.orig Thu Mar 17 20:43:51 2005 -+++ codecs/Makefile Thu Apr 14 00:09:04 2005 -@@ -17,25 +17,23 @@ - # g723.1b) - # - #MODG723=codec_g723_1.so codec_g723_1b.so --MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so") --MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so") --MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/include/speex/speex.h ] || [ -f /usr/local/include/speex.h ] || [ -f /usr/local/include/speex/speex.h ] && echo "codec_speex.so") --MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so") -+MODG723=codec_g723_1_dummy.so -+MODG729=codec_g729_dummy.so -+MODSPEEX=codec_speex.so -+MODILBC=codec_ilbc.so - CFLAGS+=-fPIC --CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include") --CFLAGS+=$(shell [ -f /usr/local/include/speex/speex.h ] && echo "-I/usr/local/include/speex") --CFLAGS+=$(shell [ -f /usr/include/speex/speex.h ] && echo "-I/usr/include/speex") -+CFLAGS+=-I$(LOCALBASE)/include - - LIBG723=g723.1/libg723.a - LIBG723B=g723.1b/libg723b.a - LIBGSM=gsm/lib/libgsm.a - LIBGSMT=gsm/lib/libgsm.a - LIBLPC10=lpc10/liblpc10.a --LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib") -+LIBSPEEX=-L$(LOCALBASE)/lib - LIBSPEEX+=-lspeex -lm - LIBILBC=ilbc/libilbc.a - --CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \ -+CODECS+=$(MODG723) $(MODG729) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \ - codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so \ - codec_g726.so - -@@ -93,7 +91,7 @@ - endif - - install: all -- for x in $(CODECS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done -+ for x in $(CODECS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done - - depend: .depend - diff --git a/net/asterisk12/files/patch-codecs::codec_g723_1_dummy.c b/net/asterisk12/files/patch-codecs::codec_g723_1_dummy.c deleted file mode 100644 index 3ce9571013ec..000000000000 --- a/net/asterisk12/files/patch-codecs::codec_g723_1_dummy.c +++ /dev/null @@ -1,314 +0,0 @@ - -$FreeBSD$ - ---- codecs/codec_g723_1_dummy.c.orig Sun Oct 10 16:05:56 2004 -+++ codecs/codec_g723_1_dummy.c Sun Oct 10 16:07:05 2004 -@@ -0,0 +1,308 @@ -+/* -+ * Asterisk -- A telephony toolkit for Linux. -+ * -+ * Translate between signed linear and G.723.1 (dummy!) -+ * -+ * The G.723.1 code is not included in the Asterisk distribution because -+ * it is covered with patents, and in spite of statements to the contrary, -+ * the "technology" is extremely expensive to license. -+ * -+ * 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 -+ */ -+ -+#define TYPE_HIGH 0x0 -+#define TYPE_LOW 0x1 -+#define TYPE_SILENCE 0x2 -+#define TYPE_DONTSEND 0x3 -+#define TYPE_MASK 0x3 -+ -+#include <sys/types.h> -+#include <asterisk/translate.h> -+#include <asterisk/module.h> -+#include <asterisk/logger.h> -+#include <asterisk/channel.h> -+#include <pthread.h> -+#include <fcntl.h> -+#include <stdlib.h> -+#include <unistd.h> -+#include <netinet/in.h> -+#include <string.h> -+#include <stdio.h> -+ -+/* Sample frame data */ -+#include "slin_g723_ex.h" -+#include "g723_slin_ex.h" -+ -+AST_MUTEX_DEFINE_STATIC(localuser_lock); -+static int localusecnt=0; -+ -+static char *tdesc = "Dummy G.723.1/PCM16 Codec Translator"; -+ -+struct g723_encoder_pvt { -+ struct ast_frame f; -+ /* Space to build offset */ -+ char offset[AST_FRIENDLY_OFFSET]; -+ /* Buffer for our outgoing frame */ -+ char outbuf[8000]; -+ /* Enough to store a full second */ -+ short buf[8000]; -+ int tail; -+}; -+ -+struct g723_decoder_pvt { -+ struct ast_frame f; -+ /* Space to build offset */ -+ char offset[AST_FRIENDLY_OFFSET]; -+ /* Enough to store a full second */ -+ short buf[8000]; -+ int tail; -+}; -+ -+static struct ast_translator_pvt *g723tolin_new() -+{ -+ struct g723_decoder_pvt *tmp; -+ tmp = malloc(sizeof(struct g723_decoder_pvt)); -+ if (tmp) { -+ tmp->tail = 0; -+ localusecnt++; -+ ast_update_use_count(); -+ } -+ return (struct ast_translator_pvt *)tmp; -+} -+ -+static struct ast_frame *lintog723_sample() -+{ -+ static struct ast_frame f; -+ f.frametype = AST_FRAME_VOICE; -+ f.subclass = AST_FORMAT_SLINEAR; -+ f.datalen = sizeof(slin_g723_ex); -+ /* Assume 8000 Hz */ -+ f.samples = sizeof(slin_g723_ex)/16; -+ f.mallocd = 0; -+ f.offset = 0; -+ f.src = __PRETTY_FUNCTION__; -+ f.data = slin_g723_ex; -+ return &f; -+} -+ -+static struct ast_frame *g723tolin_sample() -+{ -+ static struct ast_frame f; -+ f.frametype = AST_FRAME_VOICE; -+ f.subclass = AST_FORMAT_G723_1; -+ f.datalen = sizeof(g723_slin_ex); -+ /* All frames are 30 ms long */ -+ f.samples = 30; -+ f.mallocd = 0; -+ f.offset = 0; -+ f.src = __PRETTY_FUNCTION__; -+ f.data = g723_slin_ex; -+ return &f; -+} -+ -+static struct ast_translator_pvt *lintog723_new() -+{ -+ struct g723_encoder_pvt *tmp; -+ tmp = malloc(sizeof(struct g723_encoder_pvt)); -+ if (tmp) { -+ localusecnt++; -+ ast_update_use_count(); -+ tmp->tail = 0; -+ } -+ return (struct ast_translator_pvt *)tmp; -+} -+ -+static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt) -+{ -+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt; -+ if (!tmp->tail) -+ return NULL; -+ /* Signed linear is no particular frame size, so just send whatever -+ we have in the buffer in one lump sum */ -+ tmp->f.frametype = AST_FRAME_VOICE; -+ tmp->f.subclass = AST_FORMAT_SLINEAR; -+ tmp->f.datalen = tmp->tail * 2; -+ /* Assume 8000 Hz */ -+ tmp->f.samples = tmp->tail / 8; -+ tmp->f.mallocd = 0; -+ tmp->f.offset = AST_FRIENDLY_OFFSET; -+ tmp->f.src = __PRETTY_FUNCTION__; -+ tmp->f.data = tmp->buf; -+ /* Reset tail pointer */ -+ tmp->tail = 0; -+ -+ return &tmp->f; -+} -+ -+static int g723_len(unsigned char buf) -+{ -+ switch(buf & TYPE_MASK) { -+ case TYPE_DONTSEND: -+ return 2; -+ break; -+ case TYPE_SILENCE: -+ return 4; -+ break; -+ case TYPE_HIGH: -+ return 24; -+ break; -+ case TYPE_LOW: -+ return 20; -+ break; -+ default: -+ ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", buf & TYPE_MASK); -+ } -+ return -1; -+} -+ -+static int g723tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f) -+{ -+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt; -+ int len = 0; -+ int res; -+ while(len < f->datalen) { -+ /* Assuming there's space left, decode into the current buffer at -+ the tail location */ -+ res = g723_len(((unsigned char *)f->data + len)[0]); -+ if (res < 0) { -+ ast_log(LOG_WARNING, "Invalid data\n"); -+ return -1; -+ } -+ if (res + len > f->datalen) { -+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n"); -+ return -1; -+ } -+ if (tmp->tail + 480 < sizeof(tmp->buf)/2) { -+ memset(tmp->buf + tmp->tail, 0, 480); -+ tmp->tail+=480; -+ } else { -+ ast_log(LOG_WARNING, "Out of buffer space\n"); -+ return -1; -+ } -+ len += res; -+ } -+ return 0; -+} -+ -+static int lintog723_framein(struct ast_translator_pvt *pvt, struct ast_frame *f) -+{ -+ /* Just add the frames to our stream */ -+ /* XXX We should look at how old the rest of our stream is, and if it -+ is too old, then we should overwrite it entirely, otherwise we can -+ get artifacts of earlier talk that do not belong */ -+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt; -+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) { -+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen); -+ tmp->tail += f->datalen/2; -+ } else { -+ ast_log(LOG_WARNING, "Out of buffer space\n"); -+ return -1; -+ } -+ return 0; -+} -+ -+static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt) -+{ -+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt; -+ int cnt=0; -+ /* We can't work on anything less than a frame in size */ -+ if (tmp->tail < 480) -+ return NULL; -+ tmp->f.frametype = AST_FRAME_VOICE; -+ tmp->f.subclass = AST_FORMAT_G723_1; -+ tmp->f.offset = AST_FRIENDLY_OFFSET; -+ tmp->f.src = __PRETTY_FUNCTION__; -+ tmp->f.samples = 0; -+ tmp->f.mallocd = 0; -+ while(tmp->tail >= 480) { -+ /* Encode a frame of data */ -+ if (cnt + 24 >= sizeof(tmp->outbuf)) { -+ ast_log(LOG_WARNING, "Out of buffer space\n"); -+ return NULL; -+ } -+ memset(tmp->outbuf + cnt, 0, 24); -+ /* Assume 8000 Hz */ -+ tmp->f.samples += 30; -+ cnt += 24; -+ tmp->tail -= 480; -+ /* Move the data at the end of the buffer to the front */ -+ if (tmp->tail) -+ memmove(tmp->buf, tmp->buf + 480, tmp->tail * 2); -+ } -+ tmp->f.datalen = cnt; -+ tmp->f.data = tmp->outbuf; -+ return &tmp->f; -+} -+ -+static void g723_destroy(struct ast_translator_pvt *pvt) -+{ -+ free(pvt); -+ localusecnt--; -+ ast_update_use_count(); -+} -+ -+static struct ast_translator g723tolin = -+ { "g723tolin_dummy", -+ AST_FORMAT_G723_1, AST_FORMAT_SLINEAR, -+ g723tolin_new, -+ g723tolin_framein, -+ g723tolin_frameout, -+ g723_destroy, -+ g723tolin_sample -+ }; -+ -+static struct ast_translator lintog723 = -+ { "lintog723_dummy", -+ AST_FORMAT_SLINEAR, AST_FORMAT_G723_1, -+ lintog723_new, -+ lintog723_framein, -+ lintog723_frameout, -+ g723_destroy, -+ lintog723_sample -+ }; -+ -+int unload_module(void) -+{ -+ int res; -+ ast_mutex_lock(&localuser_lock); -+ res = ast_unregister_translator(&lintog723); -+ if (!res) -+ res = ast_unregister_translator(&g723tolin); -+ if (localusecnt) -+ res = -1; -+ ast_mutex_unlock(&localuser_lock); -+ return res; -+} -+ -+int load_module(void) -+{ -+ int res; -+ res=ast_register_translator(&g723tolin); -+ if (!res) -+ res=ast_register_translator(&lintog723); -+ else -+ ast_unregister_translator(&g723tolin); -+ return res; -+} -+ -+char *description(void) -+{ -+ return tdesc; -+} -+ -+int usecount(void) -+{ -+ int res; -+ STANDARD_USECOUNT(res); -+ return res; -+} -+ -+char *key() -+{ -+ return ASTERISK_GPL_KEY; -+} diff --git a/net/asterisk12/files/patch-codecs::codec_g729_dummy.c b/net/asterisk12/files/patch-codecs::codec_g729_dummy.c deleted file mode 100644 index 9fcc7b19ca35..000000000000 --- a/net/asterisk12/files/patch-codecs::codec_g729_dummy.c +++ /dev/null @@ -1,281 +0,0 @@ - -$FreeBSD$ - ---- codecs/codec_g729_dummy.c.orig Sun Oct 10 16:05:56 2004 -+++ codecs/codec_g729_dummy.c Sun Oct 10 16:07:12 2004 -@@ -0,0 +1,275 @@ -+/* -+ * Asterisk -- A telephony toolkit for Linux. -+ * -+ * Translate between signed linear and G.729 (dummy!) -+ * -+ * The G.729 code is not included in the Asterisk distribution because -+ * it is covered with patents, and in spite of statements to the contrary, -+ * the "technology" is extremely expensive to license. -+ * -+ * 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 -+ */ -+ -+#include <sys/types.h> -+#include <asterisk/translate.h> -+#include <asterisk/module.h> -+#include <asterisk/logger.h> -+#include <asterisk/channel.h> -+#include <pthread.h> -+#include <fcntl.h> -+#include <stdlib.h> -+#include <unistd.h> -+#include <netinet/in.h> -+#include <string.h> -+#include <stdio.h> -+ -+/* Sample frame data */ -+#include "slin_g729_ex.h" -+#include "g729_slin_ex.h" -+ -+AST_MUTEX_DEFINE_STATIC(localuser_lock); -+static int localusecnt=0; -+ -+static char *tdesc = "Dummy G.729/PCM16 Codec Translator"; -+ -+struct g729_encoder_pvt { -+ struct ast_frame f; -+ /* Space to build offset */ -+ char offset[AST_FRIENDLY_OFFSET]; -+ /* Buffer for our outgoing frame */ -+ char outbuf[8000]; -+ /* Enough to store a full second */ -+ short buf[8000]; -+ int tail; -+}; -+ -+struct g729_decoder_pvt { -+ struct ast_frame f; -+ /* Space to build offset */ -+ char offset[AST_FRIENDLY_OFFSET]; -+ /* Enough to store a full second */ -+ short buf[8000]; -+ int tail; -+}; -+ -+static struct ast_translator_pvt *g729tolin_new() -+{ -+ struct g729_decoder_pvt *tmp; -+ tmp = malloc(sizeof(struct g729_decoder_pvt)); -+ if (tmp) { -+ tmp->tail = 0; -+ localusecnt++; -+ ast_update_use_count(); -+ } -+ return (struct ast_translator_pvt *)tmp; -+} -+ -+static struct ast_frame *lintog729_sample() -+{ -+ static struct ast_frame f; -+ f.frametype = AST_FRAME_VOICE; -+ f.subclass = AST_FORMAT_SLINEAR; -+ f.datalen = sizeof(slin_g729_ex); -+ /* Assume 8000 Hz */ -+ f.samples = sizeof(slin_g729_ex)/16; -+ f.mallocd = 0; -+ f.offset = 0; -+ f.src = __PRETTY_FUNCTION__; -+ f.data = slin_g729_ex; -+ return &f; -+} -+ -+static struct ast_frame *g729tolin_sample() -+{ -+ static struct ast_frame f; -+ f.frametype = AST_FRAME_VOICE; -+ f.subclass = AST_FORMAT_G729A; -+ f.datalen = sizeof(g729_slin_ex); -+ /* All frames are 10 ms long */ -+ f.samples = 10; -+ f.mallocd = 0; -+ f.offset = 0; -+ f.src = __PRETTY_FUNCTION__; -+ f.data = g729_slin_ex; -+ return &f; -+} -+ -+static struct ast_translator_pvt *lintog729_new() -+{ -+ struct g729_encoder_pvt *tmp; -+ tmp = malloc(sizeof(struct g729_encoder_pvt)); -+ if (tmp) { -+ localusecnt++; -+ ast_update_use_count(); -+ tmp->tail = 0; -+ } -+ return (struct ast_translator_pvt *)tmp; -+} -+ -+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *pvt) -+{ -+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt; -+ if (!tmp->tail) -+ return NULL; -+ /* Signed linear is no particular frame size, so just send whatever -+ we have in the buffer in one lump sum */ -+ tmp->f.frametype = AST_FRAME_VOICE; -+ tmp->f.subclass = AST_FORMAT_SLINEAR; -+ tmp->f.datalen = tmp->tail * 2; -+ /* Assume 8000 Hz */ -+ tmp->f.samples = tmp->tail / 8; -+ tmp->f.mallocd = 0; -+ tmp->f.offset = AST_FRIENDLY_OFFSET; -+ tmp->f.src = __PRETTY_FUNCTION__; -+ tmp->f.data = tmp->buf; -+ /* Reset tail pointer */ -+ tmp->tail = 0; -+ -+ return &tmp->f; -+} -+ -+static int g729tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f) -+{ -+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt; -+ int len = 0; -+ while(len < f->datalen) { -+ /* Assuming there's space left, decode into the current buffer at -+ the tail location */ -+ if (10 + len > f->datalen) { -+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n"); -+ return -1; -+ } -+ if (tmp->tail + 160 < sizeof(tmp->buf)/2) { -+ memset(tmp->buf + tmp->tail, 0, 160); -+ tmp->tail+=160; -+ } else { -+ ast_log(LOG_WARNING, "Out of buffer space\n"); -+ return -1; -+ } -+ len += 10; -+ } -+ return 0; -+} -+ -+static int lintog729_framein(struct ast_translator_pvt *pvt, struct ast_frame *f) -+{ -+ /* Just add the frames to our stream */ -+ /* XXX We should look at how old the rest of our stream is, and if it -+ is too old, then we should overwrite it entirely, otherwise we can -+ get artifacts of earlier talk that do not belong */ -+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt; -+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) { -+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen); -+ tmp->tail += f->datalen/2; -+ } else { -+ ast_log(LOG_WARNING, "Out of buffer space\n"); -+ return -1; -+ } -+ return 0; -+} -+ -+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *pvt) -+{ -+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt; -+ int cnt=0; -+ /* We can't work on anything less than a frame in size */ -+ if (tmp->tail < 160) -+ return NULL; -+ tmp->f.frametype = AST_FRAME_VOICE; -+ tmp->f.subclass = AST_FORMAT_G729A; -+ tmp->f.offset = AST_FRIENDLY_OFFSET; -+ tmp->f.src = __PRETTY_FUNCTION__; -+ tmp->f.samples = 0; -+ tmp->f.mallocd = 0; -+ while(tmp->tail >= 160) { -+ /* Encode a frame of data */ -+ if (cnt + 10 >= sizeof(tmp->outbuf)) { -+ ast_log(LOG_WARNING, "Out of buffer space\n"); -+ return NULL; -+ } -+ memset(tmp->outbuf + cnt, 0, 10); -+ /* Assume 8000 Hz */ -+ tmp->f.samples += 10; -+ cnt += 10; -+ tmp->tail -= 160; -+ /* Move the data at the end of the buffer to the front */ -+ if (tmp->tail) -+ memmove(tmp->buf, tmp->buf + 160, tmp->tail * 2); -+ } -+ tmp->f.datalen = cnt; -+ tmp->f.data = tmp->outbuf; -+ return &tmp->f; -+} -+ -+static void g729_destroy(struct ast_translator_pvt *pvt) -+{ -+ free(pvt); -+ localusecnt--; -+ ast_update_use_count(); -+} -+ -+static struct ast_translator g729tolin = -+ { "g729tolin_dummy", -+ AST_FORMAT_G729A, AST_FORMAT_SLINEAR, -+ g729tolin_new, -+ g729tolin_framein, -+ g729tolin_frameout, -+ g729_destroy, -+ g729tolin_sample -+ }; -+ -+static struct ast_translator lintog729 = -+ { "lintog729_dummy", -+ AST_FORMAT_SLINEAR, AST_FORMAT_G729A, -+ lintog729_new, -+ lintog729_framein, -+ lintog729_frameout, -+ g729_destroy, -+ lintog729_sample -+ }; -+ -+int unload_module(void) -+{ -+ int res; -+ ast_mutex_lock(&localuser_lock); -+ res = ast_unregister_translator(&lintog729); -+ if (!res) -+ res = ast_unregister_translator(&g729tolin); -+ if (localusecnt) -+ res = -1; -+ ast_mutex_unlock(&localuser_lock); -+ return res; -+} -+ -+int load_module(void) -+{ -+ int res; -+ res=ast_register_translator(&g729tolin); -+ if (!res) -+ res=ast_register_translator(&lintog729); -+ else -+ ast_unregister_translator(&g729tolin); -+ return res; -+} -+ -+char *description(void) -+{ -+ return tdesc; -+} -+ -+int usecount(void) -+{ -+ int res; -+ STANDARD_USECOUNT(res); -+ return res; -+} -+ -+char *key() -+{ -+ return ASTERISK_GPL_KEY; -+} diff --git a/net/asterisk12/files/patch-codecs::g729_slin_ex.h b/net/asterisk12/files/patch-codecs::g729_slin_ex.h deleted file mode 100644 index 44e60f2de848..000000000000 --- a/net/asterisk12/files/patch-codecs::g729_slin_ex.h +++ /dev/null @@ -1,20 +0,0 @@ - -$FreeBSD$ - ---- /dev/null Fri Jan 30 01:52:11 2004 -+++ codecs/g729_slin_ex.h Fri Jan 30 01:57:59 2004 -@@ -0,0 +1,14 @@ -+/* -+ * g729_slin_ex.h -- -+ * -+ * 8-bit G.729 data, 10 milliseconds worth at 8 kHz. -+ * -+ * Copyright (C) 2004, Maxim Sobolev <sobomax@FreeBSD.org> -+ * -+ * Distributed under the terms of the GNU General Public License -+ * -+ */ -+ -+static unsigned char g729_slin_ex[] = { -+120,82,175,64,0,250,219,0,7,214 -+}; diff --git a/net/asterisk12/files/patch-codecs::ilbc::Makefile b/net/asterisk12/files/patch-codecs::ilbc::Makefile deleted file mode 100644 index 7770e07550a4..000000000000 --- a/net/asterisk12/files/patch-codecs::ilbc::Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -$FreeBSD$ - ---- codecs/ilbc/Makefile.orig Sun Apr 27 21:13:11 2003 -+++ codecs/ilbc/Makefile Fri Jan 30 01:47:34 2004 -@@ -1,4 +1,4 @@ --CFLAGS+= -fPIC -O3 -+CFLAGS+= -fPIC - LIB=libilbc.a - - OBJS= anaFilter.o iCBSearch.o packing.o \ diff --git a/net/asterisk12/files/patch-codecs::slin_g729_ex.h b/net/asterisk12/files/patch-codecs::slin_g729_ex.h deleted file mode 100644 index e1236d2498dc..000000000000 --- a/net/asterisk12/files/patch-codecs::slin_g729_ex.h +++ /dev/null @@ -1,31 +0,0 @@ - -$FreeBSD$ - ---- /dev/null Fri Jan 30 01:52:11 2004 -+++ codecs/slin_g729_ex.h Fri Jan 30 01:57:59 2004 -@@ -0,0 +1,25 @@ -+/* -+ * slin_g729_ex.h -- -+ * -+ * Signed 16-bit audio data, 10 milliseconds worth at 8 kHz. -+ * -+ * Source: g723.example -+ * -+ * Copyright (C) 2001, Linux Support Services, Inc. -+ * -+ * Distributed under the terms of the GNU General Public License -+ * -+ */ -+ -+static signed short slin_g729_ex[] = { -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -+}; diff --git a/net/asterisk12/files/patch-db.c b/net/asterisk12/files/patch-db.c deleted file mode 100644 index 6c2bdcd443c8..000000000000 --- a/net/asterisk12/files/patch-db.c +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- db.c.orig Fri Jul 9 13:08:09 2004 -+++ db.c Sun Oct 10 15:32:33 2004 -@@ -33,7 +33,7 @@ - #include <asterisk/cli.h> - #include <asterisk/utils.h> - #include <asterisk/lock.h> --#include "db1-ast/include/db.h" -+#include <db.h> - #include "asterisk.h" - #include "astconf.h" - diff --git a/net/asterisk12/files/patch-editline::configure b/net/asterisk12/files/patch-editline::configure deleted file mode 100644 index f6b9c5b76eee..000000000000 --- a/net/asterisk12/files/patch-editline::configure +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- editline/configure.orig Sun Apr 27 21:13:11 2003 -+++ editline/configure Fri Jan 30 01:47:34 2004 -@@ -1906,7 +1906,7 @@ - CPPFLAGS="$CPPFLAGS -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG" - CPPFLAGS="$CPPFLAGS -DDEBUG_REFRESH -DDEBUG_PASTE" - else -- CFLAGS="$CFLAGS -O" -+ CFLAGS="$CFLAGS" - fi - - diff --git a/net/asterisk12/files/patch-editline::makelist b/net/asterisk12/files/patch-editline::makelist deleted file mode 100644 index cff9b3ae29e0..000000000000 --- a/net/asterisk12/files/patch-editline::makelist +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- editline/makelist -+++ editline/makelist -@@ -145,7 +145,7 @@ - # - -fh) - cat $FILES | $AWK '/el_action_t/ { print $3 }' | \ -- sort | tr '[a-z]' '[A-Z]' | $AWK ' -+ sort | tr '[:lower:]' '[:upper:]' | $AWK ' - BEGIN { - printf("/* Automatically generated file, do not edit */\n"); - printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n"); diff --git a/net/asterisk12/files/patch-formats::Makefile b/net/asterisk12/files/patch-formats::Makefile deleted file mode 100644 index dacfd7b08303..000000000000 --- a/net/asterisk12/files/patch-formats::Makefile +++ /dev/null @@ -1,23 +0,0 @@ - -$FreeBSD$ - ---- formats/Makefile.orig Tue Nov 4 04:40:09 2003 -+++ formats/Makefile Fri Jan 30 01:47:34 2004 -@@ -18,7 +18,7 @@ - # - # G723 simple frame is depricated - # --#FORMAT_LIBS+=format_g723.so -+FORMAT_LIBS+=format_g723_1.so - - GSMLIB=../codecs/gsm/lib/libgsm.a - -@@ -40,7 +40,7 @@ - $(CC) $(SOLINK) -o $@ $< -lm - - install: all -- for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done -+ for x in $(FORMAT_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done - - depend: .depend - diff --git a/net/asterisk12/files/patch-formats::format_g723_1.c b/net/asterisk12/files/patch-formats::format_g723_1.c deleted file mode 100644 index fb5eb12833dc..000000000000 --- a/net/asterisk12/files/patch-formats::format_g723_1.c +++ /dev/null @@ -1,351 +0,0 @@ - -$FreeBSD$ - ---- formats/format_g723_1.c.orig Sun Oct 10 15:59:18 2004 -+++ formats/format_g723_1.c Sun Oct 10 16:05:05 2004 -@@ -0,0 +1,345 @@ -+/* -+ * Asterisk -- A telephony toolkit for Linux. -+ * -+ * Save and read raw, headerless G723.1 Annex A data. -+ * -+ * Copyright (C) 1999, Mark Spencer <markster@linux-support.net> -+ * Copyright (C) 2003, Maxim Sobolev <sobomax@FreeBSD.org> -+ * -+ * This program is free software, distributed under the terms of -+ * the GNU General Public License -+ */ -+ -+#include <asterisk/lock.h> -+#include <asterisk/channel.h> -+#include <asterisk/file.h> -+#include <asterisk/logger.h> -+#include <asterisk/sched.h> -+#include <asterisk/module.h> -+#include <netinet/in.h> -+#include <arpa/inet.h> -+#include <stdlib.h> -+#include <sys/time.h> -+#include <stdio.h> -+#include <unistd.h> -+#include <errno.h> -+#include <string.h> -+#include <pthread.h> -+#ifdef __linux__ -+#include <endian.h> -+#else -+#include <machine/endian.h> -+#endif -+ -+/* Based on format_g729.c */ -+ -+#define TYPE_HIGH 0x0 -+#define TYPE_LOW 0x1 -+#define TYPE_SILENCE 0x2 -+#define TYPE_DONTSEND 0x3 -+#define TYPE_MASK 0x3 -+ -+struct ast_filestream { -+ void *reserved[AST_RESERVED_POINTERS]; -+ /* This is what a filestream means to us */ -+ int fd; /* Descriptor */ -+ struct ast_frame fr; /* Frame information */ -+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */ -+ char empty; /* Empty character */ -+ unsigned char g723[24]; /* One Real G723.1 Frame */ -+}; -+ -+static long g723_tell(struct ast_filestream *); -+ -+AST_MUTEX_DEFINE_STATIC(g723_lock); -+static int glistcnt = 0; -+ -+static char *name = "g723"; -+static char *desc = "Raw G723.1 Annex A data"; -+static char *exts = "g723"; -+ -+static int g723_len(unsigned char buf) -+{ -+ switch(buf & TYPE_MASK) { -+ case TYPE_DONTSEND: -+ return 2; -+ break; -+ case TYPE_SILENCE: -+ return 4; -+ break; -+ case TYPE_HIGH: -+ return 24; -+ break; -+ case TYPE_LOW: -+ return 20; -+ break; -+ default: -+ ast_log(LOG_WARNING, "Badly encoded G723.1 frame (%d)\n", buf & TYPE_MASK); -+ } -+ return -1; -+} -+ -+static struct ast_filestream *g723_open(int fd) -+{ -+ /* We don't have any header to read or anything really, but -+ if we did, it would go here. We also might want to check -+ and be sure it's a valid file. */ -+ struct ast_filestream *tmp; -+ if ((tmp = malloc(sizeof(struct ast_filestream)))) { -+ memset(tmp, 0, sizeof(struct ast_filestream)); -+ if (ast_mutex_lock(&g723_lock)) { -+ ast_log(LOG_WARNING, "Unable to lock g723 list\n"); -+ free(tmp); -+ return NULL; -+ } -+ tmp->fd = fd; -+ tmp->fr.data = tmp->g723; -+ tmp->fr.frametype = AST_FRAME_VOICE; -+ tmp->fr.subclass = AST_FORMAT_G723_1; -+ /* datalen will vary for each frame */ -+ tmp->fr.src = name; -+ tmp->fr.mallocd = 0; -+ glistcnt++; -+ ast_mutex_unlock(&g723_lock); -+ ast_update_use_count(); -+ } -+ return tmp; -+} -+ -+static struct ast_filestream *g723_rewrite(int fd, char *comment) -+{ -+ /* We don't have any header to read or anything really, but -+ if we did, it would go here. We also might want to check -+ and be sure it's a valid file. */ -+ struct ast_filestream *tmp; -+ if ((tmp = malloc(sizeof(struct ast_filestream)))) { -+ memset(tmp, 0, sizeof(struct ast_filestream)); -+ if (ast_mutex_lock(&g723_lock)) { -+ ast_log(LOG_WARNING, "Unable to lock g723 list\n"); -+ free(tmp); -+ return NULL; -+ } -+ tmp->fd = fd; -+ glistcnt++; -+ ast_mutex_unlock(&g723_lock); -+ ast_update_use_count(); -+ } else -+ ast_log(LOG_WARNING, "Out of memory\n"); -+ return tmp; -+} -+ -+static void g723_close(struct ast_filestream *s) -+{ -+ if (ast_mutex_lock(&g723_lock)) { -+ ast_log(LOG_WARNING, "Unable to lock g723 list\n"); -+ return; -+ } -+ glistcnt--; -+ ast_mutex_unlock(&g723_lock); -+ ast_update_use_count(); -+ close(s->fd); -+ free(s); -+ s = NULL; -+} -+ -+static struct ast_frame *g723_read(struct ast_filestream *s, int *whennext) -+{ -+ int res; -+ /* Send a frame from the file to the appropriate channel */ -+ s->fr.frametype = AST_FRAME_VOICE; -+ s->fr.subclass = AST_FORMAT_G723_1; -+ s->fr.offset = AST_FRIENDLY_OFFSET; -+ s->fr.samples = 240; -+ s->fr.mallocd = 0; -+ s->fr.data = s->g723; -+ if ((res = read(s->fd, s->g723, 1)) != 1) { -+ if (res) -+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno)); -+ return NULL; -+ } -+ s->fr.datalen = g723_len(s->g723[0]); -+ if (s->fr.datalen < 0) { -+ ast_log(LOG_WARNING, "Invalid G723.1 frame!\n"); -+ return NULL; -+ } -+ if (s->fr.datalen > 1 && (res = read(s->fd, s->g723 + 1, s->fr.datalen - 1)) != s->fr.datalen - 1) { -+ if (res) -+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno)); -+ return NULL; -+ } -+ *whennext = s->fr.samples; -+ return &s->fr; -+} -+ -+static int g723_write(struct ast_filestream *fs, struct ast_frame *f) -+{ -+ int res; -+ unsigned char *cp; -+ if (f->frametype != AST_FRAME_VOICE) { -+ ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); -+ return -1; -+ } -+ if (f->subclass != AST_FORMAT_G723_1) { -+ ast_log(LOG_WARNING, "Asked to write non-G723.1 frame (%d)!\n", f->subclass); -+ return -1; -+ } -+ for (cp = f->data; cp < (unsigned char *)f->data + f->datalen; cp += res) { -+ res = g723_len(cp[0]); -+ if (res < 0) { -+ ast_log(LOG_WARNING, "Asked to write invalid G723.1 frame!\n"); -+ return -1; -+ } -+ } -+ if (cp != (unsigned char *)f->data + f->datalen) { -+ ast_log(LOG_WARNING, "Invalid G723.1 data length, %d\n", f->datalen); -+ return -1; -+ } -+ if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) { -+ ast_log(LOG_WARNING, "Bad write %d: %s\n", res, strerror(errno)); -+ return -1; -+ } -+ return 0; -+} -+ -+static char *g723_getcomment(struct ast_filestream *s) -+{ -+ return NULL; -+} -+ -+static int g723_seek(struct ast_filestream *fs, long sample_offset, int whence) -+{ -+ long cur, offset, max; -+ off_t coffset, moffset, soffset; -+ int res; -+ unsigned char c; -+ -+ offset = 0; /* Shut up gcc warning */ -+ if (whence == SEEK_SET) { -+ offset = sample_offset; -+ } else if (whence == SEEK_CUR || whence == SEEK_FORCECUR) { -+ if ((cur = g723_tell(fs)) == -1) { -+ ast_log(LOG_WARNING, "Can't get current position!\n"); -+ return -1; -+ } -+ offset = cur + sample_offset; -+ } -+ if ((moffset = lseek(fs->fd, 0, SEEK_END)) == -1) { -+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n"); -+ return -1; -+ } -+ if (whence == SEEK_END) { -+ if ((max = g723_tell(fs)) == -1) { -+ ast_log(LOG_WARNING, "Can't get maximum position!\n"); -+ return -1; -+ } -+ offset = max - sample_offset; -+ } -+ if (offset < 0) -+ offset = 0; -+ soffset = -1; -+ for (coffset = 0; coffset < moffset && offset > 0; coffset += res) { -+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) { -+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset); -+ return -1; -+ } -+ if (read(fs->fd, &c, 1) != 1) { -+ ast_log(LOG_WARNING, "Can't read from offset %lli!\n", coffset); -+ return -1; -+ } -+ soffset = coffset; -+ if ((res = g723_len(c)) < 0) { -+ ast_log(LOG_WARNING, "Invalid G723.1 frame at offset %lli!\n", coffset); -+ return -1; -+ } -+ if (res > 1) -+ offset -= 240; -+ } -+ if (soffset != -1 && lseek(fs->fd, soffset, SEEK_SET) != soffset) { -+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", soffset); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+static int g723_trunc(struct ast_filestream *fs) -+{ -+ /* Truncate file to current length */ -+ if (ftruncate(fs->fd, lseek(fs->fd, 0, SEEK_CUR)) < 0) -+ return -1; -+ return 0; -+} -+ -+static long g723_tell(struct ast_filestream *fs) -+{ -+ off_t offset, coffset; -+ int res; -+ long rval; -+ unsigned char c; -+ -+ offset = lseek(fs->fd, 0, SEEK_CUR); -+ rval = 0; -+ for (coffset = 0; coffset < offset; coffset += res) { -+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) { -+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset); -+ return -1; -+ } -+ if (read(fs->fd, &c, 1) != 1) { -+ ast_log(LOG_WARNING, "Can't read from offset %llu!\n", coffset); -+ return -1; -+ } -+ if ((res = g723_len(c)) < 0) { -+ ast_log(LOG_WARNING, "Invalid G723.1 frame at offset %llu!\n", coffset); -+ return -1; -+ } -+ if (res > 1) -+ rval += 240; -+ } -+ if (lseek(fs->fd, offset, SEEK_SET) != offset) { -+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", offset); -+ return -1; -+ } -+ return rval; -+} -+ -+int load_module() -+{ -+ return ast_format_register(name, exts, AST_FORMAT_G723_1, -+ g723_open, -+ g723_rewrite, -+ g723_write, -+ g723_seek, -+ g723_trunc, -+ g723_tell, -+ g723_read, -+ g723_close, -+ g723_getcomment); -+} -+ -+int unload_module() -+{ -+ return ast_format_unregister(name); -+} -+ -+int usecount() -+{ -+ int res; -+ if (ast_mutex_lock(&g723_lock)) { -+ ast_log(LOG_WARNING, "Unable to lock g723 list\n"); -+ return -1; -+ } -+ res = glistcnt; -+ ast_mutex_unlock(&g723_lock); -+ return res; -+} -+ -+char *description() -+{ -+ return desc; -+} -+ -+ -+char *key() -+{ -+ return ASTERISK_GPL_KEY; -+} diff --git a/net/asterisk12/files/patch-formats::format_g729.c b/net/asterisk12/files/patch-formats::format_g729.c deleted file mode 100644 index 78899a3e5d43..000000000000 --- a/net/asterisk12/files/patch-formats::format_g729.c +++ /dev/null @@ -1,44 +0,0 @@ ---- formats/format_g729.c.orig Mon Feb 7 10:29:19 2005 -+++ formats/format_g729.c Wed Mar 9 06:26:36 2005 -@@ -44,7 +44,7 @@ - struct ast_frame fr; /* Frame information */ - char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */ - char empty; /* Empty character */ -- unsigned char g729[20]; /* Two Real G729 Frames */ -+ unsigned char g729[10]; /* One Real G729 Frame */ - }; - - -@@ -125,11 +125,11 @@ - s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_G729A; - s->fr.offset = AST_FRIENDLY_OFFSET; -- s->fr.samples = 160; -- s->fr.datalen = 20; -+ s->fr.samples = 80; -+ s->fr.datalen = 10; - s->fr.mallocd = 0; - s->fr.data = s->g729; -- if ((res = read(s->fd, s->g729, 20)) != 20) { -+ if ((res = read(s->fd, s->g729, 10)) != 10) { - if (res && (res != 10)) - ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno)); - return NULL; -@@ -173,7 +173,7 @@ - cur = lseek(fs->fd, 0, SEEK_CUR); - max = lseek(fs->fd, 0, SEEK_END); - -- bytes = 20 * (sample_offset / 160); -+ bytes = 10 * (sample_offset / 80); - if (whence == SEEK_SET) - offset = bytes; - else if (whence == SEEK_CUR || whence == SEEK_FORCECUR) -@@ -202,7 +202,7 @@ - { - off_t offset; - offset = lseek(fs->fd, 0, SEEK_CUR); -- return (offset/20)*160; -+ return (offset/10)*80; - } - - int load_module() diff --git a/net/asterisk12/files/patch-include::asterisk::utils.h b/net/asterisk12/files/patch-include::asterisk::utils.h deleted file mode 100644 index a06f7d065c84..000000000000 --- a/net/asterisk12/files/patch-include::asterisk::utils.h +++ /dev/null @@ -1,13 +0,0 @@ - -$FreeBSD$ - ---- include/asterisk/utils.h 2004/10/10 12:55:50 1.1 -+++ include/asterisk/utils.h 2004/10/10 12:56:43 -@@ -37,7 +37,6 @@ - #ifdef inet_ntoa - #undef inet_ntoa - #endif --#define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__ - - #ifdef LINUX - #define ast_pthread_create pthread_create diff --git a/net/asterisk12/files/patch-pbx::Makefile b/net/asterisk12/files/patch-pbx::Makefile deleted file mode 100644 index dca6672c389a..000000000000 --- a/net/asterisk12/files/patch-pbx::Makefile +++ /dev/null @@ -1,23 +0,0 @@ - -$FreeBSD$ - ---- pbx/Makefile.orig Sun Oct 26 20:50:49 2003 -+++ pbx/Makefile Fri Jan 30 01:47:34 2004 -@@ -16,7 +16,7 @@ - PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so - - # Add GTK console if appropriate --PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so") -+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so") - # Add KDE Console if appropriate - #PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so") - -@@ -62,7 +62,7 @@ - endif - - install: all -- for x in $(PBX_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done -+ for x in $(PBX_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done - - depend: .depend - diff --git a/net/asterisk12/files/patch-pbx::pbx_wilcalu.c b/net/asterisk12/files/patch-pbx::pbx_wilcalu.c deleted file mode 100644 index 41722c65568d..000000000000 --- a/net/asterisk12/files/patch-pbx::pbx_wilcalu.c +++ /dev/null @@ -1,14 +0,0 @@ ---- pbx/pbx_wilcalu.c.orig Tue Apr 26 10:00:28 2005 -+++ pbx/pbx_wilcalu.c Tue Apr 26 10:03:42 2005 -@@ -82,6 +82,11 @@ - fds[0].events = POLLIN; - poll(fds, 1, -1); - bytes=read(fd,buf,256); -+ if (bytes <= 0) { -+ /* XXX error on device, sleep a bit before retrying */ -+ sleep(1); -+ continue; -+ } - buf[(int)bytes]=0; - - if(bytes>0){ diff --git a/net/asterisk12/files/patch-res-res_watchdog.c b/net/asterisk12/files/patch-res-res_watchdog.c deleted file mode 100644 index 51e4b0ae6c71..000000000000 --- a/net/asterisk12/files/patch-res-res_watchdog.c +++ /dev/null @@ -1,13 +0,0 @@ ---- res/res_watchdog.c.orig Fri Jul 15 13:24:24 2005 -+++ res/res_watchdog.c Fri Jul 15 13:24:42 2005 -@@ -40,6 +40,10 @@ - - /* Registrar for operations */ - -+#ifndef O_SYNC -+#define O_SYNC O_FSYNC -+#endif -+ - static struct watchdog_pvt *watchdogs = NULL; - - STANDARD_LOCAL_USER; diff --git a/net/asterisk12/files/patch-res::Makefile b/net/asterisk12/files/patch-res::Makefile deleted file mode 100644 index 3e48e84189a2..000000000000 --- a/net/asterisk12/files/patch-res::Makefile +++ /dev/null @@ -1,33 +0,0 @@ ---- res/Makefile.orig Tue Aug 9 17:18:55 2005 -+++ res/Makefile Tue Aug 9 17:33:36 2005 -@@ -13,15 +13,18 @@ - - MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \ - res_agi.so res_watchdog.so --MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi) --MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi) -+#MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi) -+#MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi) - MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi) - - CRYPTO_LIBS=-lssl -lcrypto - - CFLAGS+= - CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH") --CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH") -+CFLAGS+=-I$(LOCALBASE)/include -+ifdef WITH_ZAPTEL -+CFLAGS+=-DZAPATA_MOH -+endif - # - # Work around buggy RedHat 9.0 - # -@@ -34,7 +37,7 @@ - rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h - rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so - rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so -- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done -+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done - - res_crypto.so: res_crypto.o - $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS) diff --git a/net/asterisk12/files/patch-rtp.c b/net/asterisk12/files/patch-rtp.c deleted file mode 100644 index c652add6a2f2..000000000000 --- a/net/asterisk12/files/patch-rtp.c +++ /dev/null @@ -1,23 +0,0 @@ ---- rtp.c.orig Tue Apr 26 10:00:28 2005 -+++ rtp.c Tue Apr 26 10:06:35 2005 -@@ -127,7 +127,7 @@ - { - switch(buf & TYPE_MASK) { - case TYPE_DONTSEND: -- return 0; -+ return 2; - break; - case TYPE_SILENCE: - return 4; -@@ -862,8 +858,10 @@ - /* Must be an even port number by RTP spec */ - rtp->us.sin_port = htons(x); - rtp->us.sin_addr = addr; -- if (rtp->rtcp) -+ if (rtp->rtcp) { - rtp->rtcp->us.sin_port = htons(x + 1); -+ rtp->rtcp->us.sin_addr = addr; -+ } - if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) && - (!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us)))) - break; diff --git a/net/asterisk12/pkg-descr b/net/asterisk12/pkg-descr deleted file mode 100644 index 28b7a1deb011..000000000000 --- a/net/asterisk12/pkg-descr +++ /dev/null @@ -1,5 +0,0 @@ -Asterisk is an Open Source PBX and telephony toolkit. It is, in a -sense, middleware between Internet and telephony channels on the bottom, -and Internet and telephony applications at the top. - -WWW: http://www.asteriskpbx.com diff --git a/net/asterisk12/pkg-plist b/net/asterisk12/pkg-plist deleted file mode 100644 index 019b270e64cf..000000000000 --- a/net/asterisk12/pkg-plist +++ /dev/null @@ -1,656 +0,0 @@ -@unexec if cmp -s %D/etc/asterisk/adsi.conf %D/etc/asterisk/adsi.conf-dist; then rm -f %D/etc/asterisk/adsi.conf; fi -etc/asterisk/adsi.conf-dist -@exec [ -f %B/adsi.conf ] || cp %B/%f %B/adsi.conf -@unexec if cmp -s %D/etc/asterisk/adtranvofr.conf %D/etc/asterisk/adtranvofr.conf-dist; then rm -f %D/etc/asterisk/adtranvofr.conf; fi -etc/asterisk/adtranvofr.conf-dist -@exec [ -f %B/adtranvofr.conf ] || cp %B/%f %B/adtranvofr.conf -@unexec if cmp -s %D/etc/asterisk/agents.conf %D/etc/asterisk/agents.conf-dist; then rm -f %D/etc/asterisk/agents.conf; fi -etc/asterisk/agents.conf-dist -@exec [ -f %B/agents.conf ] || cp %B/%f %B/agents.conf -@unexec if cmp -s %D/etc/asterisk/alarmreceiver.conf %D/etc/asterisk/alarmreceiver.conf-dist; then rm -f %D/etc/asterisk/alarmreceiver.conf; fi -etc/asterisk/alarmreceiver.conf-dist -@exec [ -f %B/alarmreceiver.conf ] || cp %B/%f %B/alarmreceiver.conf -@unexec if cmp -s %D/etc/asterisk/alsa.conf %D/etc/asterisk/alsa.conf-dist; then rm -f %D/etc/asterisk/alsa.conf; fi -etc/asterisk/alsa.conf-dist -@exec [ -f %B/alsa.conf ] || cp %B/%f %B/alsa.conf -@unexec if cmp -s %D/etc/asterisk/asterisk.adsi %D/etc/asterisk/asterisk.adsi-dist; then rm -f %D/etc/asterisk/asterisk.adsi; fi -etc/asterisk/asterisk.adsi-dist -@exec [ -f %B/asterisk.adsi ] || cp %B/%f %B/asterisk.adsi -@unexec if cmp -s %D/etc/asterisk/asterisk.conf %D/etc/asterisk/asterisk.conf-dist; then rm -f %D/etc/asterisk/asterisk.conf; fi -etc/asterisk/asterisk.conf-dist -@exec [ -f %B/asterisk.conf ] || cp %B/%f %B/asterisk.conf -@unexec if cmp -s %D/etc/asterisk/cdr_manager.conf %D/etc/asterisk/cdr_manager.conf-dist; then rm -f %D/etc/asterisk/cdr_manager.conf; fi -etc/asterisk/cdr_manager.conf-dist -@exec [ -f %B/cdr_manager.conf ] || cp %B/%f %B/cdr_manager.conf -@unexec if cmp -s %D/etc/asterisk/cdr_odbc.conf %D/etc/asterisk/cdr_odbc.conf-dist; then rm -f %D/etc/asterisk/cdr_odbc.conf; fi -etc/asterisk/cdr_odbc.conf-dist -@exec [ -f %B/cdr_odbc.conf ] || cp %B/%f %B/cdr_odbc.conf -@unexec if cmp -s %D/etc/asterisk/cdr_pgsql.conf %D/etc/asterisk/cdr_pgsql.conf-dist; then rm -f %D/etc/asterisk/cdr_pgsql.conf; fi -etc/asterisk/cdr_pgsql.conf-dist -@exec [ -f %B/cdr_pgsql.conf ] || cp %B/%f %B/cdr_pgsql.conf -@unexec if cmp -s %D/etc/asterisk/cdr_tds.conf %D/etc/asterisk/cdr_tds.conf-dist; then rm -f %D/etc/asterisk/cdr_tds.conf; fi -etc/asterisk/cdr_tds.conf-dist -@exec [ -f %B/cdr_tds.conf ] || cp %B/%f %B/cdr_tds.conf -@unexec if cmp -s %D/etc/asterisk/enum.conf %D/etc/asterisk/enum.conf-dist; then rm -f %D/etc/asterisk/enum.conf; fi -etc/asterisk/enum.conf-dist -@exec [ -f %B/enum.conf ] || cp %B/%f %B/enum.conf -@unexec if cmp -s %D/etc/asterisk/extconfig.conf %D/etc/asterisk/extconfig.conf-dist; then rm -f %D/etc/asterisk/extconfig.conf; fi -etc/asterisk/extconfig.conf-dist -@exec [ -f %B/extconfig.conf ] || cp %B/%f %B/extconfig.conf -@unexec if cmp -s %D/etc/asterisk/extensions.conf %D/etc/asterisk/extensions.conf-dist; then rm -f %D/etc/asterisk/extensions.conf; fi -etc/asterisk/extensions.conf-dist -@exec [ -f %B/extensions.conf ] || cp %B/%f %B/extensions.conf -@unexec if cmp -s %D/etc/asterisk/features.conf %D/etc/asterisk/features.conf-dist; then rm -f %D/etc/asterisk/features.conf; fi -etc/asterisk/features.conf-dist -@exec [ -f %B/features.conf ] || cp %B/%f %B/features.conf -@unexec if cmp -s %D/etc/asterisk/festival.conf %D/etc/asterisk/festival.conf-dist; then rm -f %D/etc/asterisk/festival.conf; fi -etc/asterisk/festival.conf-dist -@exec [ -f %B/festival.conf ] || cp %B/%f %B/festival.conf -@unexec if cmp -s %D/etc/asterisk/h323.conf %D/etc/asterisk/h323.conf-dist; then rm -f %D/etc/asterisk/h323.conf; fi -etc/asterisk/h323.conf-dist -@exec [ -f %B/h323.conf ] || cp %B/%f %B/h323.conf -@unexec if cmp -s %D/etc/asterisk/iax.conf %D/etc/asterisk/iax.conf-dist; then rm -f %D/etc/asterisk/iax.conf; fi -etc/asterisk/iax.conf-dist -@exec [ -f %B/iax.conf ] || cp %B/%f %B/iax.conf -@unexec if cmp -s %D/etc/asterisk/iaxprov.conf %D/etc/asterisk/iaxprov.conf-dist; then rm -f %D/etc/asterisk/iaxprov.conf; fi -etc/asterisk/iaxprov.conf-dist -@exec [ -f %B/iaxprov.conf ] || cp %B/%f %B/iaxprov.conf -@unexec if cmp -s %D/etc/asterisk/indications.conf %D/etc/asterisk/indications.conf-dist; then rm -f %D/etc/asterisk/indications.conf; fi -etc/asterisk/indications.conf-dist -@exec [ -f %B/indications.conf ] || cp %B/%f %B/indications.conf -@unexec if cmp -s %D/etc/asterisk/logger.conf %D/etc/asterisk/logger.conf-dist; then rm -f %D/etc/asterisk/logger.conf; fi -etc/asterisk/logger.conf-dist -@exec [ -f %B/logger.conf ] || cp %B/%f %B/logger.conf -@unexec if cmp -s %D/etc/asterisk/manager.conf %D/etc/asterisk/manager.conf-dist; then rm -f %D/etc/asterisk/manager.conf; fi -etc/asterisk/manager.conf-dist -@exec [ -f %B/manager.conf ] || cp %B/%f %B/manager.conf -@unexec if cmp -s %D/etc/asterisk/meetme.conf %D/etc/asterisk/meetme.conf-dist; then rm -f %D/etc/asterisk/meetme.conf; fi -etc/asterisk/meetme.conf-dist -@exec [ -f %B/meetme.conf ] || cp %B/%f %B/meetme.conf -@unexec if cmp -s %D/etc/asterisk/mgcp.conf %D/etc/asterisk/mgcp.conf-dist; then rm -f %D/etc/asterisk/mgcp.conf; fi -etc/asterisk/mgcp.conf-dist -@exec [ -f %B/mgcp.conf ] || cp %B/%f %B/mgcp.conf -@unexec if cmp -s %D/etc/asterisk/modem.conf %D/etc/asterisk/modem.conf-dist; then rm -f %D/etc/asterisk/modem.conf; fi -etc/asterisk/modem.conf-dist -@exec [ -f %B/modem.conf ] || cp %B/%f %B/modem.conf -@unexec if cmp -s %D/etc/asterisk/modules.conf %D/etc/asterisk/modules.conf-dist; then rm -f %D/etc/asterisk/modules.conf; fi -etc/asterisk/modules.conf-dist -@exec [ -f %B/modules.conf ] || cp %B/%f %B/modules.conf -@unexec if cmp -s %D/etc/asterisk/musiconhold.conf %D/etc/asterisk/musiconhold.conf-dist; then rm -f %D/etc/asterisk/musiconhold.conf; fi -etc/asterisk/musiconhold.conf-dist -@exec [ -f %B/musiconhold.conf ] || cp %B/%f %B/musiconhold.conf -@unexec if cmp -s %D/etc/asterisk/osp.conf %D/etc/asterisk/osp.conf-dist; then rm -f %D/etc/asterisk/osp.conf; fi -etc/asterisk/osp.conf-dist -@exec [ -f %B/osp.conf ] || cp %B/%f %B/osp.conf -@unexec if cmp -s %D/etc/asterisk/oss.conf %D/etc/asterisk/oss.conf-dist; then rm -f %D/etc/asterisk/oss.conf; fi -etc/asterisk/oss.conf-dist -@exec [ -f %B/oss.conf ] || cp %B/%f %B/oss.conf -@unexec if cmp -s %D/etc/asterisk/phone.conf %D/etc/asterisk/phone.conf-dist; then rm -f %D/etc/asterisk/phone.conf; fi -etc/asterisk/phone.conf-dist -@exec [ -f %B/phone.conf ] || cp %B/%f %B/phone.conf -@unexec if cmp -s %D/etc/asterisk/privacy.conf %D/etc/asterisk/privacy.conf-dist; then rm -f %D/etc/asterisk/privacy.conf; fi -etc/asterisk/privacy.conf-dist -@exec [ -f %B/privacy.conf ] || cp %B/%f %B/privacy.conf -@unexec if cmp -s %D/etc/asterisk/queues.conf %D/etc/asterisk/queues.conf-dist; then rm -f %D/etc/asterisk/queues.conf; fi -etc/asterisk/queues.conf-dist -@exec [ -f %B/queues.conf ] || cp %B/%f %B/queues.conf -@unexec if cmp -s %D/etc/asterisk/res_config_odbc.conf %D/etc/asterisk/res_config_odbc.conf-dist; then rm -f %D/etc/asterisk/res_config_odbc.conf; fi -etc/asterisk/res_config_odbc.conf-dist -@exec [ -f %B/res_config_odbc.conf ] || cp %B/%f %B/res_config_odbc.conf -@unexec if cmp -s %D/etc/asterisk/res_odbc.conf %D/etc/asterisk/res_odbc.conf-dist; then rm -f %D/etc/asterisk/res_odbc.conf; fi -etc/asterisk/res_odbc.conf-dist -@exec [ -f %B/res_odbc.conf ] || cp %B/%f %B/res_odbc.conf -@unexec if cmp -s %D/etc/asterisk/rpt.conf %D/etc/asterisk/rpt.conf-dist; then rm -f %D/etc/asterisk/rpt.conf; fi -etc/asterisk/rpt.conf-dist -@exec [ -f %B/rpt.conf ] || cp %B/%f %B/rpt.conf -@unexec if cmp -s %D/etc/asterisk/rtp.conf %D/etc/asterisk/rtp.conf-dist; then rm -f %D/etc/asterisk/rtp.conf; fi -etc/asterisk/rtp.conf-dist -@exec [ -f %B/rtp.conf ] || cp %B/%f %B/rtp.conf -@unexec if cmp -s %D/etc/asterisk/sip.conf %D/etc/asterisk/sip.conf-dist; then rm -f %D/etc/asterisk/sip.conf; fi -etc/asterisk/sip.conf-dist -@exec [ -f %B/sip.conf ] || cp %B/%f %B/sip.conf -@unexec if cmp -s %D/etc/asterisk/skinny.conf %D/etc/asterisk/skinny.conf-dist; then rm -f %D/etc/asterisk/skinny.conf; fi -etc/asterisk/skinny.conf-dist -@exec [ -f %B/skinny.conf ] || cp %B/%f %B/skinny.conf -@unexec if cmp -s %D/etc/asterisk/telcordia-1.adsi %D/etc/asterisk/telcordia-1.adsi-dist; then rm -f %D/etc/asterisk/telcordia-1.adsi; fi -etc/asterisk/telcordia-1.adsi-dist -@exec [ -f %B/telcordia-1.adsi ] || cp %B/%f %B/telcordia-1.adsi -@unexec if cmp -s %D/etc/asterisk/voicemail.conf %D/etc/asterisk/voicemail.conf-dist; then rm -f %D/etc/asterisk/voicemail.conf; fi -etc/asterisk/voicemail.conf-dist -@exec [ -f %B/voicemail.conf ] || cp %B/%f %B/voicemail.conf -@unexec if cmp -s %D/etc/asterisk/vpb.conf %D/etc/asterisk/vpb.conf-dist; then rm -f %D/etc/asterisk/vpb.conf; fi -etc/asterisk/vpb.conf-dist -@exec [ -f %B/vpb.conf ] || cp %B/%f %B/vpb.conf -@unexec if cmp -s %D/etc/asterisk/watchdog.conf %D/etc/asterisk/watchdog.conf-dist; then rm -f %D/etc/asterisk/watchdog.conf; fi -etc/asterisk/watchdog.conf-dist -@exec [ -f %B/watchdog.conf ] || cp %B/%f %B/watchdog.conf -@unexec if cmp -s %D/etc/asterisk/zapata.conf %D/etc/asterisk/zapata.conf-dist; then rm -f %D/etc/asterisk/zapata.conf; fi -etc/asterisk/zapata.conf-dist -@exec [ -f %B/zapata.conf ] || cp %B/%f %B/zapata.conf -include/asterisk/acl.h -include/asterisk/adsi.h -include/asterisk/aes.h -include/asterisk/agi.h -include/asterisk/alaw.h -include/asterisk/app.h -include/asterisk/ast_expr.h -include/asterisk/astdb.h -include/asterisk/astmm.h -include/asterisk/astosp.h -include/asterisk/callerid.h -include/asterisk/causes.h -include/asterisk/cdr.h -include/asterisk/channel.h -include/asterisk/channel_pvt.h -include/asterisk/chanvars.h -include/asterisk/cli.h -include/asterisk/config.h -include/asterisk/config_pvt.h -include/asterisk/crypto.h -include/asterisk/cvsid.h -include/asterisk/dlfcn-compat.h -include/asterisk/dns.h -include/asterisk/dsp.h -include/asterisk/enum.h -include/asterisk/features.h -include/asterisk/file.h -include/asterisk/frame.h -include/asterisk/fskmodem.h -include/asterisk/image.h -include/asterisk/indications.h -include/asterisk/io.h -include/asterisk/linkedlists.h -include/asterisk/localtime.h -include/asterisk/lock.h -include/asterisk/logger.h -include/asterisk/manager.h -include/asterisk/md5.h -include/asterisk/module.h -include/asterisk/monitor.h -include/asterisk/musiconhold.h -include/asterisk/options.h -include/asterisk/pbx.h -include/asterisk/poll-compat.h -include/asterisk/privacy.h -include/asterisk/res_odbc.h -include/asterisk/rtp.h -include/asterisk/say.h -include/asterisk/sched.h -include/asterisk/srv.h -include/asterisk/tdd.h -include/asterisk/term.h -include/asterisk/transcap.h -include/asterisk/translate.h -include/asterisk/ulaw.h -include/asterisk/utils.h -include/asterisk/vmodem.h -lib/asterisk/modules/app_adsiprog.so -lib/asterisk/modules/app_alarmreceiver.so -lib/asterisk/modules/app_authenticate.so -lib/asterisk/modules/app_cdr.so -lib/asterisk/modules/app_chanisavail.so -lib/asterisk/modules/app_controlplayback.so -lib/asterisk/modules/app_cut.so -lib/asterisk/modules/app_db.so -lib/asterisk/modules/app_devstate.so -lib/asterisk/modules/app_dial.so -lib/asterisk/modules/app_directory.so -lib/asterisk/modules/app_disa.so -lib/asterisk/modules/app_echo.so -lib/asterisk/modules/app_enumlookup.so -lib/asterisk/modules/app_eval.so -lib/asterisk/modules/app_exec.so -lib/asterisk/modules/app_festival.so -%%WITH_ZAPTEL%%lib/asterisk/modules/app_flash.so -lib/asterisk/modules/app_forkcdr.so -lib/asterisk/modules/app_getcpeid.so -lib/asterisk/modules/app_groupcount.so -lib/asterisk/modules/app_hasnewvoicemail.so -lib/asterisk/modules/app_ices.so -lib/asterisk/modules/app_image.so -lib/asterisk/modules/app_intercom.so -lib/asterisk/modules/app_lookupblacklist.so -lib/asterisk/modules/app_lookupcidname.so -lib/asterisk/modules/app_macro.so -%%WITH_ZAPTEL%%lib/asterisk/modules/app_meetme.so -lib/asterisk/modules/app_milliwatt.so -lib/asterisk/modules/app_mp3.so -lib/asterisk/modules/app_nbscat.so -lib/asterisk/modules/app_parkandannounce.so -lib/asterisk/modules/app_pickup.so -lib/asterisk/modules/app_playback.so -lib/asterisk/modules/app_privacy.so -lib/asterisk/modules/app_qcall.so -lib/asterisk/modules/app_queue.so -lib/asterisk/modules/app_random.so -lib/asterisk/modules/app_read.so -lib/asterisk/modules/app_record.so -%%WITH_FAX%%lib/asterisk/modules/app_rxfax.so -lib/asterisk/modules/app_sayunixtime.so -lib/asterisk/modules/app_segfault.so -lib/asterisk/modules/app_senddtmf.so -lib/asterisk/modules/app_sendtext.so -lib/asterisk/modules/app_setcallerid.so -lib/asterisk/modules/app_setcdruserfield.so -lib/asterisk/modules/app_setcidname.so -lib/asterisk/modules/app_setcidnum.so -lib/asterisk/modules/app_settransfercapability.so -lib/asterisk/modules/app_sms.so -lib/asterisk/modules/app_softhangup.so -lib/asterisk/modules/app_striplsd.so -lib/asterisk/modules/app_substring.so -lib/asterisk/modules/app_system.so -lib/asterisk/modules/app_talkdetect.so -lib/asterisk/modules/app_test.so -lib/asterisk/modules/app_transfer.so -lib/asterisk/modules/app_txtcidname.so -%%WITH_FAX%%lib/asterisk/modules/app_txfax.so -lib/asterisk/modules/app_url.so -lib/asterisk/modules/app_userevent.so -lib/asterisk/modules/app_verbose.so -lib/asterisk/modules/app_voicemail.so -lib/asterisk/modules/app_waitforring.so -lib/asterisk/modules/app_zapateller.so -%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapbarge.so -%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapras.so -%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapscan.so -lib/asterisk/modules/cdr_csv.so -lib/asterisk/modules/cdr_manager.so -%%WITH_ODBC%%lib/asterisk/modules/cdr_odbc.so -lib/asterisk/modules/chan_agent.so -%%WITH_H323%%lib/asterisk/modules/chan_h323.so -lib/asterisk/modules/chan_iax2.so -lib/asterisk/modules/chan_local.so -lib/asterisk/modules/chan_mgcp.so -lib/asterisk/modules/chan_modem.so -lib/asterisk/modules/chan_modem_aopen.so -lib/asterisk/modules/chan_modem_bestdata.so -lib/asterisk/modules/chan_modem_i4l.so -lib/asterisk/modules/chan_oss.so -lib/asterisk/modules/chan_sip.so -lib/asterisk/modules/chan_skinny.so -%%WITH_ZAPTEL%%lib/asterisk/modules/chan_zap.so -lib/asterisk/modules/codec_a_mu.so -lib/asterisk/modules/codec_adpcm.so -lib/asterisk/modules/codec_alaw.so -lib/asterisk/modules/codec_g723_1_dummy.so -lib/asterisk/modules/codec_g726.so -lib/asterisk/modules/codec_g729_dummy.so -lib/asterisk/modules/codec_gsm.so -lib/asterisk/modules/codec_ilbc.so -lib/asterisk/modules/codec_lpc10.so -lib/asterisk/modules/codec_speex.so -lib/asterisk/modules/codec_ulaw.so -lib/asterisk/modules/format_g723_1.so -lib/asterisk/modules/format_g726.so -lib/asterisk/modules/format_g729.so -lib/asterisk/modules/format_gsm.so -lib/asterisk/modules/format_h263.so -lib/asterisk/modules/format_ilbc.so -lib/asterisk/modules/format_jpeg.so -lib/asterisk/modules/format_pcm.so -lib/asterisk/modules/format_pcm_alaw.so -lib/asterisk/modules/format_sln.so -lib/asterisk/modules/format_vox.so -lib/asterisk/modules/format_wav.so -lib/asterisk/modules/format_wav_gsm.so -lib/asterisk/modules/pbx_config.so -lib/asterisk/modules/pbx_spool.so -lib/asterisk/modules/pbx_wilcalu.so -lib/asterisk/modules/res_adsi.so -lib/asterisk/modules/res_agi.so -lib/asterisk/modules/res_crypto.so -lib/asterisk/modules/res_features.so -lib/asterisk/modules/res_indications.so -lib/asterisk/modules/res_monitor.so -lib/asterisk/modules/res_musiconhold.so -lib/asterisk/modules/res_watchdog.so -sbin/asterisk -sbin/astgenkey -sbin/astman -sbin/autosupport -sbin/safe_asterisk -%%DATADIR%%/agi-bin/agi-test.agi -%%DATADIR%%/agi-bin/eagi-sphinx-test -%%DATADIR%%/agi-bin/eagi-test -%%DATADIR%%/firmware/iax/iaxy.bin -%%DATADIR%%/images/asterisk-intro.jpg -%%DATADIR%%/keys/freeworlddialup.pub -%%DATADIR%%/keys/iaxtel.pub -%%DATADIR%%/mohmp3/fpm-calm-river.mp3 -%%DATADIR%%/mohmp3/fpm-sunshine.mp3 -%%DATADIR%%/mohmp3/fpm-world-mix.mp3 -%%DATADIR%%/sounds/agent-alreadyon.gsm -%%DATADIR%%/sounds/agent-incorrect.gsm -%%DATADIR%%/sounds/agent-loggedoff.gsm -%%DATADIR%%/sounds/agent-loginok.gsm -%%DATADIR%%/sounds/agent-newlocation.gsm -%%DATADIR%%/sounds/agent-pass.gsm -%%DATADIR%%/sounds/agent-user.gsm -%%DATADIR%%/sounds/auth-incorrect.gsm -%%DATADIR%%/sounds/auth-thankyou.gsm -%%DATADIR%%/sounds/beep.gsm -%%DATADIR%%/sounds/conf-adminmenu.gsm -%%DATADIR%%/sounds/conf-enteringno.gsm -%%DATADIR%%/sounds/conf-errormenu.gsm -%%DATADIR%%/sounds/conf-getchannel.gsm -%%DATADIR%%/sounds/conf-getconfno.gsm -%%DATADIR%%/sounds/conf-getpin.gsm -%%DATADIR%%/sounds/conf-invalid.gsm -%%DATADIR%%/sounds/conf-invalidpin.gsm -%%DATADIR%%/sounds/conf-kicked.gsm -%%DATADIR%%/sounds/conf-locked.gsm -%%DATADIR%%/sounds/conf-lockednow.gsm -%%DATADIR%%/sounds/conf-muted.gsm -%%DATADIR%%/sounds/conf-noempty.gsm -%%DATADIR%%/sounds/conf-onlyperson.gsm -%%DATADIR%%/sounds/conf-unlockednow.gsm -%%DATADIR%%/sounds/conf-unmuted.gsm -%%DATADIR%%/sounds/conf-usermenu.gsm -%%DATADIR%%/sounds/demo-abouttotry.gsm -%%DATADIR%%/sounds/demo-congrats.gsm -%%DATADIR%%/sounds/demo-echodone.gsm -%%DATADIR%%/sounds/demo-echotest.gsm -%%DATADIR%%/sounds/demo-enterkeywords.gsm -%%DATADIR%%/sounds/demo-instruct.gsm -%%DATADIR%%/sounds/demo-moreinfo.gsm -%%DATADIR%%/sounds/demo-nogo.gsm -%%DATADIR%%/sounds/demo-nomatch.gsm -%%DATADIR%%/sounds/demo-thanks.gsm -%%DATADIR%%/sounds/digits/0.gsm -%%DATADIR%%/sounds/digits/1.gsm -%%DATADIR%%/sounds/digits/10.gsm -%%DATADIR%%/sounds/digits/11.gsm -%%DATADIR%%/sounds/digits/12.gsm -%%DATADIR%%/sounds/digits/13.gsm -%%DATADIR%%/sounds/digits/14.gsm -%%DATADIR%%/sounds/digits/15.gsm -%%DATADIR%%/sounds/digits/16.gsm -%%DATADIR%%/sounds/digits/17.gsm -%%DATADIR%%/sounds/digits/18.gsm -%%DATADIR%%/sounds/digits/19.gsm -%%DATADIR%%/sounds/digits/2.gsm -%%DATADIR%%/sounds/digits/20.gsm -%%DATADIR%%/sounds/digits/3.gsm -%%DATADIR%%/sounds/digits/30.gsm -%%DATADIR%%/sounds/digits/4.gsm -%%DATADIR%%/sounds/digits/40.gsm -%%DATADIR%%/sounds/digits/5.gsm -%%DATADIR%%/sounds/digits/50.gsm -%%DATADIR%%/sounds/digits/6.gsm -%%DATADIR%%/sounds/digits/60.gsm -%%DATADIR%%/sounds/digits/7.gsm -%%DATADIR%%/sounds/digits/70.gsm -%%DATADIR%%/sounds/digits/8.gsm -%%DATADIR%%/sounds/digits/80.gsm -%%DATADIR%%/sounds/digits/9.gsm -%%DATADIR%%/sounds/digits/90.gsm -%%DATADIR%%/sounds/digits/a-m.gsm -%%DATADIR%%/sounds/digits/at.gsm -%%DATADIR%%/sounds/digits/day-0.gsm -%%DATADIR%%/sounds/digits/day-1.gsm -%%DATADIR%%/sounds/digits/day-2.gsm -%%DATADIR%%/sounds/digits/day-3.gsm -%%DATADIR%%/sounds/digits/day-4.gsm -%%DATADIR%%/sounds/digits/day-5.gsm -%%DATADIR%%/sounds/digits/day-6.gsm -%%DATADIR%%/sounds/digits/dollars.gsm -%%DATADIR%%/sounds/digits/h-1.gsm -%%DATADIR%%/sounds/digits/h-10.gsm -%%DATADIR%%/sounds/digits/h-11.gsm -%%DATADIR%%/sounds/digits/h-12.gsm -%%DATADIR%%/sounds/digits/h-13.gsm -%%DATADIR%%/sounds/digits/h-14.gsm -%%DATADIR%%/sounds/digits/h-15.gsm -%%DATADIR%%/sounds/digits/h-16.gsm -%%DATADIR%%/sounds/digits/h-17.gsm -%%DATADIR%%/sounds/digits/h-18.gsm -%%DATADIR%%/sounds/digits/h-19.gsm -%%DATADIR%%/sounds/digits/h-2.gsm -%%DATADIR%%/sounds/digits/h-20.gsm -%%DATADIR%%/sounds/digits/h-3.gsm -%%DATADIR%%/sounds/digits/h-30.gsm -%%DATADIR%%/sounds/digits/h-4.gsm -%%DATADIR%%/sounds/digits/h-5.gsm -%%DATADIR%%/sounds/digits/h-6.gsm -%%DATADIR%%/sounds/digits/h-7.gsm -%%DATADIR%%/sounds/digits/h-8.gsm -%%DATADIR%%/sounds/digits/h-9.gsm -%%DATADIR%%/sounds/digits/hundred.gsm -%%DATADIR%%/sounds/digits/million.gsm -%%DATADIR%%/sounds/digits/minus.gsm -%%DATADIR%%/sounds/digits/mon-0.gsm -%%DATADIR%%/sounds/digits/mon-1.gsm -%%DATADIR%%/sounds/digits/mon-10.gsm -%%DATADIR%%/sounds/digits/mon-11.gsm -%%DATADIR%%/sounds/digits/mon-2.gsm -%%DATADIR%%/sounds/digits/mon-3.gsm -%%DATADIR%%/sounds/digits/mon-4.gsm -%%DATADIR%%/sounds/digits/mon-5.gsm -%%DATADIR%%/sounds/digits/mon-6.gsm -%%DATADIR%%/sounds/digits/mon-7.gsm -%%DATADIR%%/sounds/digits/mon-8.gsm -%%DATADIR%%/sounds/digits/mon-9.gsm -%%DATADIR%%/sounds/digits/oclock.gsm -%%DATADIR%%/sounds/digits/oh.gsm -%%DATADIR%%/sounds/digits/p-m.gsm -%%DATADIR%%/sounds/digits/pound.gsm -%%DATADIR%%/sounds/digits/star.gsm -%%DATADIR%%/sounds/digits/thousand.gsm -%%DATADIR%%/sounds/digits/today.gsm -%%DATADIR%%/sounds/digits/tomorrow.gsm -%%DATADIR%%/sounds/digits/yesterday.gsm -%%DATADIR%%/sounds/dir-instr.gsm -%%DATADIR%%/sounds/dir-intro-fn.gsm -%%DATADIR%%/sounds/dir-intro.gsm -%%DATADIR%%/sounds/dir-nomatch.gsm -%%DATADIR%%/sounds/dir-nomore.gsm -%%DATADIR%%/sounds/invalid.gsm -%%DATADIR%%/sounds/letters/a.gsm -%%DATADIR%%/sounds/letters/at.gsm -%%DATADIR%%/sounds/letters/b.gsm -%%DATADIR%%/sounds/letters/c.gsm -%%DATADIR%%/sounds/letters/d.gsm -%%DATADIR%%/sounds/letters/dash.gsm -%%DATADIR%%/sounds/letters/dollar.gsm -%%DATADIR%%/sounds/letters/dot.gsm -%%DATADIR%%/sounds/letters/e.gsm -%%DATADIR%%/sounds/letters/equals.gsm -%%DATADIR%%/sounds/letters/exclaimation-point.gsm -%%DATADIR%%/sounds/letters/f.gsm -%%DATADIR%%/sounds/letters/g.gsm -%%DATADIR%%/sounds/letters/h.gsm -%%DATADIR%%/sounds/letters/i.gsm -%%DATADIR%%/sounds/letters/j.gsm -%%DATADIR%%/sounds/letters/k.gsm -%%DATADIR%%/sounds/letters/l.gsm -%%DATADIR%%/sounds/letters/m.gsm -%%DATADIR%%/sounds/letters/n.gsm -%%DATADIR%%/sounds/letters/o.gsm -%%DATADIR%%/sounds/letters/p.gsm -%%DATADIR%%/sounds/letters/plus.gsm -%%DATADIR%%/sounds/letters/q.gsm -%%DATADIR%%/sounds/letters/r.gsm -%%DATADIR%%/sounds/letters/s.gsm -%%DATADIR%%/sounds/letters/slash.gsm -%%DATADIR%%/sounds/letters/space.gsm -%%DATADIR%%/sounds/letters/t.gsm -%%DATADIR%%/sounds/letters/u.gsm -%%DATADIR%%/sounds/letters/v.gsm -%%DATADIR%%/sounds/letters/w.gsm -%%DATADIR%%/sounds/letters/x.gsm -%%DATADIR%%/sounds/letters/y.gsm -%%DATADIR%%/sounds/letters/z.gsm -%%DATADIR%%/sounds/letters/zed.gsm -%%DATADIR%%/sounds/pbx-invalid.gsm -%%DATADIR%%/sounds/pbx-invalidpark.gsm -%%DATADIR%%/sounds/pbx-transfer.gsm -%%DATADIR%%/sounds/phonetic/9_p.gsm -%%DATADIR%%/sounds/phonetic/a_p.gsm -%%DATADIR%%/sounds/phonetic/b_p.gsm -%%DATADIR%%/sounds/phonetic/c_p.gsm -%%DATADIR%%/sounds/phonetic/d_p.gsm -%%DATADIR%%/sounds/phonetic/e_p.gsm -%%DATADIR%%/sounds/phonetic/f_p.gsm -%%DATADIR%%/sounds/phonetic/g_p.gsm -%%DATADIR%%/sounds/phonetic/h_p.gsm -%%DATADIR%%/sounds/phonetic/i_p.gsm -%%DATADIR%%/sounds/phonetic/j_p.gsm -%%DATADIR%%/sounds/phonetic/k_p.gsm -%%DATADIR%%/sounds/phonetic/l_p.gsm -%%DATADIR%%/sounds/phonetic/m_p.gsm -%%DATADIR%%/sounds/phonetic/n_p.gsm -%%DATADIR%%/sounds/phonetic/o_p.gsm -%%DATADIR%%/sounds/phonetic/p_p.gsm -%%DATADIR%%/sounds/phonetic/q_p.gsm -%%DATADIR%%/sounds/phonetic/r_p.gsm -%%DATADIR%%/sounds/phonetic/s_p.gsm -%%DATADIR%%/sounds/phonetic/t_p.gsm -%%DATADIR%%/sounds/phonetic/u_p.gsm -%%DATADIR%%/sounds/phonetic/v_p.gsm -%%DATADIR%%/sounds/phonetic/w_p.gsm -%%DATADIR%%/sounds/phonetic/x_p.gsm -%%DATADIR%%/sounds/phonetic/y_p.gsm -%%DATADIR%%/sounds/phonetic/z_p.gsm -%%DATADIR%%/sounds/privacy-incorrect.gsm -%%DATADIR%%/sounds/privacy-prompt.gsm -%%DATADIR%%/sounds/privacy-thankyou.gsm -%%DATADIR%%/sounds/privacy-unident.gsm -%%DATADIR%%/sounds/queue-callswaiting.gsm -%%DATADIR%%/sounds/queue-holdtime.gsm -%%DATADIR%%/sounds/queue-less-than.gsm -%%DATADIR%%/sounds/queue-minutes.gsm -%%DATADIR%%/sounds/queue-seconds.gsm -%%DATADIR%%/sounds/queue-thankyou.gsm -%%DATADIR%%/sounds/queue-thereare.gsm -%%DATADIR%%/sounds/queue-youarenext.gsm -%%DATADIR%%/sounds/ss-noservice.gsm -%%DATADIR%%/sounds/transfer.gsm -%%DATADIR%%/sounds/tt-allbusy.gsm -%%DATADIR%%/sounds/tt-monkeys.gsm -%%DATADIR%%/sounds/tt-monkeysintro.gsm -%%DATADIR%%/sounds/tt-somethingwrong.gsm -%%DATADIR%%/sounds/tt-weasels.gsm -%%DATADIR%%/sounds/vm -%%DATADIR%%/sounds/vm-Cust1.gsm -%%DATADIR%%/sounds/vm-Cust2.gsm -%%DATADIR%%/sounds/vm-Cust3.gsm -%%DATADIR%%/sounds/vm-Cust4.gsm -%%DATADIR%%/sounds/vm-Cust5.gsm -%%DATADIR%%/sounds/vm-Family.gsm -%%DATADIR%%/sounds/vm-Friends.gsm -%%DATADIR%%/sounds/vm-INBOX.gsm -%%DATADIR%%/sounds/vm-Old.gsm -%%DATADIR%%/sounds/vm-Work.gsm -%%DATADIR%%/sounds/vm-advopts.gsm -%%DATADIR%%/sounds/vm-and.gsm -%%DATADIR%%/sounds/vm-calldiffnum.gsm -%%DATADIR%%/sounds/vm-changeto.gsm -%%DATADIR%%/sounds/vm-delete.gsm -%%DATADIR%%/sounds/vm-deleted.gsm -%%DATADIR%%/sounds/vm-dialout.gsm -%%DATADIR%%/sounds/vm-enter-num-to-call.gsm -%%DATADIR%%/sounds/vm-extension.gsm -%%DATADIR%%/sounds/vm-first.gsm -%%DATADIR%%/sounds/vm-for.gsm -%%DATADIR%%/sounds/vm-forwardoptions.gsm -%%DATADIR%%/sounds/vm-from-extension.gsm -%%DATADIR%%/sounds/vm-from-phonenumber.gsm -%%DATADIR%%/sounds/vm-from.gsm -%%DATADIR%%/sounds/vm-goodbye.gsm -%%DATADIR%%/sounds/vm-helpexit.gsm -%%DATADIR%%/sounds/vm-incorrect-mailbox.gsm -%%DATADIR%%/sounds/vm-incorrect.gsm -%%DATADIR%%/sounds/vm-instructions.gsm -%%DATADIR%%/sounds/vm-intro.gsm -%%DATADIR%%/sounds/vm-isonphone.gsm -%%DATADIR%%/sounds/vm-isunavail.gsm -%%DATADIR%%/sounds/vm-last.gsm -%%DATADIR%%/sounds/vm-leavemsg.gsm -%%DATADIR%%/sounds/vm-login.gsm -%%DATADIR%%/sounds/vm-mailboxfull.gsm -%%DATADIR%%/sounds/vm-message.gsm -%%DATADIR%%/sounds/vm-messages.gsm -%%DATADIR%%/sounds/vm-mismatch.gsm -%%DATADIR%%/sounds/vm-msginstruct.gsm -%%DATADIR%%/sounds/vm-msgsaved.gsm -%%DATADIR%%/sounds/vm-newpassword.gsm -%%DATADIR%%/sounds/vm-next.gsm -%%DATADIR%%/sounds/vm-no.gsm -%%DATADIR%%/sounds/vm-nobodyavail.gsm -%%DATADIR%%/sounds/vm-nobox.gsm -%%DATADIR%%/sounds/vm-nomore.gsm -%%DATADIR%%/sounds/vm-nonumber.gsm -%%DATADIR%%/sounds/vm-num-i-have.gsm -%%DATADIR%%/sounds/vm-onefor.gsm -%%DATADIR%%/sounds/vm-options.gsm -%%DATADIR%%/sounds/vm-opts.gsm -%%DATADIR%%/sounds/vm-passchanged.gsm -%%DATADIR%%/sounds/vm-password.gsm -%%DATADIR%%/sounds/vm-press.gsm -%%DATADIR%%/sounds/vm-prev.gsm -%%DATADIR%%/sounds/vm-reachoper.gsm -%%DATADIR%%/sounds/vm-rec-busy.gsm -%%DATADIR%%/sounds/vm-rec-name.gsm -%%DATADIR%%/sounds/vm-rec-unv.gsm -%%DATADIR%%/sounds/vm-received.gsm -%%DATADIR%%/sounds/vm-reenterpassword.gsm -%%DATADIR%%/sounds/vm-repeat.gsm -%%DATADIR%%/sounds/vm-review.gsm -%%DATADIR%%/sounds/vm-saved.gsm -%%DATADIR%%/sounds/vm-savedto.gsm -%%DATADIR%%/sounds/vm-savefolder.gsm -%%DATADIR%%/sounds/vm-savemessage.gsm -%%DATADIR%%/sounds/vm-saveoper.gsm -%%DATADIR%%/sounds/vm-sorry.gsm -%%DATADIR%%/sounds/vm-star-cancel.gsm -%%DATADIR%%/sounds/vm-starmain.gsm -%%DATADIR%%/sounds/vm-then-pound.gsm -%%DATADIR%%/sounds/vm-theperson.gsm -%%DATADIR%%/sounds/vm-tocallback.gsm -%%DATADIR%%/sounds/vm-tocallnum.gsm -%%DATADIR%%/sounds/vm-tocancel.gsm -%%DATADIR%%/sounds/vm-tocancelmsg.gsm -%%DATADIR%%/sounds/vm-toenternumber.gsm -%%DATADIR%%/sounds/vm-toforward.gsm -%%DATADIR%%/sounds/vm-tohearenv.gsm -%%DATADIR%%/sounds/vm-tomakecall.gsm -%%DATADIR%%/sounds/vm-tooshort.gsm -%%DATADIR%%/sounds/vm-toreply.gsm -%%DATADIR%%/sounds/vm-torerecord.gsm -%%DATADIR%%/sounds/vm-undelete.gsm -%%DATADIR%%/sounds/vm-undeleted.gsm -%%DATADIR%%/sounds/vm-unknown-caller.gsm -%%DATADIR%%/sounds/vm-whichbox.gsm -%%DATADIR%%/sounds/vm-youhave.gsm -%%DATADIR%%/sounds/voicemail -@dirrm %%DATADIR%%/sounds/phonetic -@dirrm %%DATADIR%%/sounds/letters -@dirrm %%DATADIR%%/sounds/digits -@dirrm %%DATADIR%%/sounds -@dirrm %%DATADIR%%/mohmp3 -@dirrm %%DATADIR%%/keys -@dirrm %%DATADIR%%/images -@dirrm %%DATADIR%%/firmware/iax -@dirrm %%DATADIR%%/firmware -@dirrm %%DATADIR%%/agi-bin -@dirrm %%DATADIR%% -@dirrm lib/asterisk/modules -@dirrm lib/asterisk -@dirrm include/asterisk -@dirrm etc/asterisk -@unexec rm -f %D/%%DATADIR%%/astdb -@cwd /var -spool/asterisk/vm -spool/asterisk/voicemail/default/1234/busy.gsm -spool/asterisk/voicemail/default/1234/unavail.gsm -@exec mkdir -p %D/log/asterisk/cdr-csv -@exec mkdir -p %D/spool/asterisk/voicemail/default/1234/INBOX -@dirrm spool/asterisk/voicemail/default/1234/INBOX -@dirrm spool/asterisk/voicemail/default/1234 -@dirrm spool/asterisk/voicemail/default -@dirrm spool/asterisk/voicemail -@dirrm spool/asterisk/tmp -@dirrm spool/asterisk -@dirrm log/asterisk/cdr-csv -@dirrm log/asterisk |