Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 Jan 2006 22:31:14 -0500
From:      Diane Bruce <db@db.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        sobomax@FreeBSD.org
Subject:   ports/91544: [PATCH] net/asterisk: update to 1.2.1
Message-ID:  <E1EvnkY-0004vk-4u@heceta.db.net>
Resent-Message-ID: <200601090330.k093UAwX034528@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         91544
>Category:       ports
>Synopsis:       [PATCH] net/asterisk: update to 1.2.1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 09 03:30:10 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Diane Bruce
>Release:        FreeBSD 4.11-RELEASE-p9 i386
>Organization:
>Environment:
System: FreeBSD heceta.db.net 4.11-RELEASE-p9 FreeBSD 4.11-RELEASE-p9 #4: Tue May 17 16:07:52 EDT 2005
>Description:
- Update to 1.2.1

This port will not compile until the previously submitted libpri update
is committed as well.

Removed file(s):
- files/chan_oss.c
- files/patch-agi::Makefile
- files/patch-apps::Makefile
- files/patch-apps::app_rxfax.c
- files/patch-apps::app_txfax.c
- files/patch-astman::Makefile
- files/patch-cdr::Makefile
- files/patch-channels::Makefile
- files/patch-channels::chan_h323.c
- files/patch-channels::chan_sip.c
- files/patch-channels::chan_zap.c
- files/patch-channels::h323::Makefile
- files/patch-codecs::Makefile
- files/patch-codecs::codec_g723_1_dummy.c
- files/patch-codecs::codec_g729_dummy.c
- files/patch-codecs::g729_slin_ex.h
- files/patch-codecs::ilbc::Makefile
- files/patch-codecs::slin_g729_ex.h
- files/patch-db.c
- files/patch-editline::configure
- files/patch-editline::makelist
- files/patch-formats::Makefile
- files/patch-formats::format_g723_1.c
- files/patch-formats::format_g729.c
- files/patch-include::asterisk::utils.h
- files/patch-pbx::Makefile
- files/patch-pbx::pbx_wilcalu.c
- files/patch-res-res_watchdog.c
- files/patch-res::Makefile
- files/patch-rtp.c

Port maintainer (sobomax@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- asterisk-1.2.1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/net/asterisk/Makefile /usr/home/db/asterisk/Makefile
--- /usr/ports/net/asterisk/Makefile	Wed Dec 28 13:44:38 2005
+++ /usr/home/db/asterisk/Makefile	Sun Jan  8 22:16:40 2006
@@ -2,23 +2,17 @@
 # Date created:				17 October 2003
 # Whom:					Maxim Sobolev <sobomax@portaone.com>
 #
-# $FreeBSD: ports/net/asterisk/Makefile,v 1.42 2005/12/17 07:00:19 lawrance Exp $
+# $FreeBSD: ports/net/asterisk/Makefile,v 1.41 2005/11/07 21:06:12 sobomax Exp $
 #
 
 PORTNAME=	asterisk
-PORTVERSION=	1.0.9
-PORTREVISION=	2
+PORTVERSION=	1.2.1
 CATEGORIES=	net
 MASTER_SITES=	http://ftp.digium.com/pub/asterisk/ \
 		http://ftp.digium.com/pub/asterisk/old-releases/ \
 		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
 
@@ -29,7 +23,6 @@
 
 ONLY_FOR_ARCHS=	i386 sparc64 amd64
 
-BRIVER=		bristuff-0.2.0-RC8h
 GNU_CONFIGURE=	yes
 CONFIGURE_WRKSRC=	${WRKSRC}/editline
 USE_GMAKE=	yes
@@ -48,27 +41,28 @@
 
 .include <bsd.port.pre.mk>
 
-PWLIBDIR!=	cd ${PORTSDIR}/devel/pwlib; make -V WRKSRC
-OPENH323DIR!=	cd ${PORTSDIR}/net/openh323; make -V WRKSRC
+#PWLIBDIR!=	cd ${PORTSDIR}/devel/pwlib; make -V WRKSRC
+#OPENH323DIR!=	cd ${PORTSDIR}/net/openh323; make -V WRKSRC
 
 .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_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+= libpri>=1.2.0:${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=""
@@ -90,16 +84,8 @@
 USE_MYSQL=	yes
 .endif
 
-.if defined(WITHOUT_FAX)
-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
+#	${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 -ruN --exclude=CVS /usr/ports/net/asterisk/distinfo /usr/home/db/asterisk/distinfo
--- /usr/ports/net/asterisk/distinfo	Mon Jul 18 10:45:36 2005
+++ /usr/home/db/asterisk/distinfo	Sun Jan  8 22:16:40 2006
@@ -1,4 +1,3 @@
-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
+MD5 (asterisk-1.2.1.tar.gz) = 04657086791e80f319c0d728af705001
+SHA256 (asterisk-1.2.1.tar.gz) = f0d3ed36353c1f5726225d2794bea7d1d1a92c9e58336b02b293f43dd4b97948
+SIZE (asterisk-1.2.1.tar.gz) = 10517194
diff -ruN --exclude=CVS /usr/ports/net/asterisk/files/chan_oss.c /usr/home/db/asterisk/files/chan_oss.c
--- /usr/ports/net/asterisk/files/chan_oss.c	Wed Jul  6 20:32:36 2005
+++ /usr/home/db/asterisk/files/chan_oss.c	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-Makefile /usr/home/db/asterisk/files/patch-Makefile
--- /usr/ports/net/asterisk/files/patch-Makefile	Sat Nov 12 12:02:19 2005
+++ /usr/home/db/asterisk/files/patch-Makefile	Sun Jan  8 22:16:40 2006
@@ -1,219 +1,163 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-Makefile,v 1.11 2005/11/07 21:06:12 sobomax Exp $
-
---- Makefile.orig
-+++ Makefile
-@@ -45,6 +45,19 @@
- 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
-+ifeq ($(PROC),amd64)
-+PROC=k8
-+OPTIONS+=-m64
-+endif
-+endif
-+
- # Pentium Pro Optimize
- #PROC=i686
- 
-@@ -63,10 +76,10 @@
+--- Makefile.orig	Mon Dec  5 01:47:51 2005
++++ Makefile	Sun Jan  8 21:49:19 2006
+@@ -19,8 +19,8 @@
+ # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
+ # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
+ # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
+-CC=$(CROSS_COMPILE)gcc
+-HOST_CC=gcc
++CC?=$(CROSS_COMPILE)gcc
++HOST_CC=${CC}
+ # CROSS_ARCH=Linux
+ # CROSS_PROC=arm
+ # SUB_PROC=xscale # or maverick
+@@ -44,14 +44,14 @@
  #K6OPT  = -DK6OPT
  
- #Tell gcc to optimize the asterisk's code
+ #Tell gcc to optimize the code
 -OPTIMIZE+=-O6
 +#OPTIMIZE+=-O6
+ endif
  
- #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 +104,7 @@
+ #Overwite config files on "make samples"
+ OVERWRITE=y
+ 
+ #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
+-DEBUG=-g3 #-pg
++#DEBUG=-g3 #-pg
+ 
+ #Set NOCRYPTO to yes if you do not want to have crypto support or 
+ #dependencies
+@@ -83,7 +83,7 @@
  
  # Where to install asterisk after compiling
  # Default -> leave empty
--INSTALL_PREFIX=
+-INSTALL_PREFIX?=
 +INSTALL_PREFIX=$(PREFIX)
  
  # Staging directory
  # Files are copied here temporarily during the install process
-@@ -111,23 +124,23 @@
- # Don't use together with -DBUSYDETECT_TONEONLY
+@@ -106,17 +106,17 @@
  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 +151,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 +169,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
+ ifneq ($(OSARCH),SunOS)
+-  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
+ else
+@@ -219,7 +219,7 @@
+ 
+ INCLUDE+=-Iinclude -I../include
+ ASTCFLAGS+=-pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
+-ASTCFLAGS+=$(OPTIMIZE)
++#ASTCFLAGS+=$(OPTIMIZE)
+ ASTOBJ=-o asterisk
+ 
+ ifeq ($(findstring BSD,$(OSARCH)),BSD)
+@@ -252,20 +252,17 @@
+   endif
+   MPG123TARG=freebsd
+ 
+-  # XXX FreeBSD paths
+-  PREFIX?=/usr/local
+-  ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
+-  ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
+-  ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
+-  ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+-  ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+-  ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
++  ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++  ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
++  ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
++  ASTSPOOLDIR=/var/spool/asterisk
++  ASTLOGDIR=/var/log/asterisk
++  ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+   ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+-  ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
+-  ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
+-  ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+-  ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
+-  # XXX end FreeBSD paths
++  ASTBINDIR=$(INSTALL_PREFIX)/bin
++  ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++  ASTVARRUNDIR=/var/run
++  ASTMANDIR=$(INSTALL_PREFIX)/man
  
- LIBEDIT=editline/libedit.a
- 
-@@ -222,7 +234,7 @@
- SOLINK=-shared -Xlinker -x
- endif
- 
--CC=gcc
-+CC?=gcc
- INSTALL=install
- 
- _all: all
-@@ -234,7 +246,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 +255,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 +283,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 +304,8 @@
- 		exit 1; \
- 	fi
+ endif # FreeBSD
  
--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 +324,28 @@
- 	$(MAKE) -C stdtime clean
+@@ -539,38 +536,38 @@
  
  datafiles: all
+ 	if [ x`whoami` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
 -	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
-+	$(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+-	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
  	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 ; \
+ 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+-			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
++			$(BSD_INSTALL_DATA) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ 		else \
+ 			echo "No description for $$x"; \
+ 			exit 1; \
+ 		fi; \
+ 	done
+-	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
+ 	for x in sounds/dictate/*.gsm; do \
+ 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+-			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
++			$(BSD_INSTALL_DATA) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
  		else \
  			echo "No description for $$x"; \
  			exit 1; \
  		fi; \
  	done
 -	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
-+	$(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
++	$(MKDIR) -p $(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 ; \
+ 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+-			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
++			$(BSD_INSTALL_DATA) -m 644 $$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
++	$(MKDIR) -p $(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 ; \
+ 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+-			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
++			$(BSD_INSTALL_DATA) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
  		else \
  			echo "No description for $$x"; \
  			exit 1; \
-@@ -344,18 +353,18 @@
+@@ -578,18 +575,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 ; \
+ 	for x in sounds/demo-* 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-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
+ 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+-			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++			$(BSD_INSTALL_DATA) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
  		else \
  			echo "No description for $$x"; \
  			exit 1; \
@@ -221,216 +165,191 @@
  	done
 -	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
 -	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/images
-+	$(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
-+	$(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/images
  	for x in images/*.jpg; do \
--		install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
-+		$(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+-		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
++		$(BSD_INSTALL_DATA) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
  	done
 -	mkdir -p $(DESTDIR)$(AGI_DIR)
-+	$(MKDIR) $(DESTDIR)$(AGI_DIR)
++	$(MKDIR) -p $(DESTDIR)$(AGI_DIR)
  
  update: 
- 	@if [ -d CVS ]; then \
-@@ -367,127 +376,90 @@
- 	fi
+ 	@if [ -d .svn ]; then \
+@@ -618,49 +615,49 @@
+ OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
  
  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)/dictate
+-	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
 -	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)/
+-	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
+-	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
+-	if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
+-	if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
+-	if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
++	$(MKDIR) -p $(DESTDIR)$(MODULES_DIR)
++	$(MKDIR) -p $(DESTDIR)$(ASTSBINDIR)
++	$(MKDIR) -p $(DESTDIR)$(ASTETCDIR)
++	$(MKDIR) -p $(DESTDIR)$(ASTBINDIR)
++	$(MKDIR) -p $(DESTDIR)$(ASTVARRUNDIR)
++	$(MKDIR) -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
++	$(MKDIR) -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
++	$(MKDIR) -p $(DESTDIR)$(ASTSPOOLDIR)/system
++	$(MKDIR) -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
++	$(MKDIR) -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
++	$(MKDIR) -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
++	if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
++	if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
++	if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ 	ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
+-	$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+-	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/	
++	$(BSD_INSTALL_SCRIPT) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
++	$(BSD_INSTALL_SCRIPT) -m 755 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)/ ;\
+ 		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+ 		chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
  	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
+-	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
+-	$(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
++	$(BSD_INSTALL_DATA) -d $(DESTDIR)$(ASTHEADERDIR)
++	$(BSD_INSTALL_DATA) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ 	if [ -n "$(OLDHEADERS)" ]; then \
+ 		rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+ 	fi
+ 	rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
 -	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
 -	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
+-	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
 -	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
+-	$(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+-	$(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+-	$(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+-	$(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+-	$(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+-	$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
++	$(MKDIR) -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
++	$(MKDIR) -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/keys
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
++	$(MKDIR) -p $(DESTDIR)$(ASTMANDIR)/man8
++	$(BSD_INSTALL_DATA) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
++	$(BSD_INSTALL_DATA) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
++	$(BSD_INSTALL_DATA) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
++	$(BSD_INSTALL_DATA) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
++	$(BSD_INSTALL_DATA) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
++	$(BSD_INSTALL_DATA) -m 644 contrib/scripts/safe_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; \
+-		$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
++		$(BSD_INSTALL_DATA) -m 644 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 . )
- 
+@@ -710,7 +707,7 @@
+ 		echo " WARNING WARNING WARNING" ;\
+ 	fi
  
 -install: all datafiles bininstall
 +install: all datafiles bininstall samples
- 
+ 	@if [ -x /usr/sbin/asterisk-post-install ]; then \
+ 		/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
+ 	fi
+@@ -718,16 +715,19 @@
  upgrade: all bininstall
  
- adsi: all
+ adsi:
 -	mkdir -p $(DESTDIR)$(ASTETCDIR)
-+	$(MKDIR) $(DESTDIR)$(ASTETCDIR)
++	$(MKDIR) -p $(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` ; \
+ 		if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+-			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
++			$(BSD_INSTALL_DATA) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
  		fi ; \
  	done
  
- samples: all datafiles adsi
+ samples: 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 \
++	echo ADSI INSTALL $(BSD_INSTALL_DATA)
++	$(MKDIR) -p $(DESTDIR)$(ASTETCDIR)
+ 	for x in configs/*.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` ;\
+ 		if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
+ 			if [ "$(OVERWRITE)" = "y" ]; then \
+ 				if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
+@@ -740,7 +740,7 @@
+ 				continue; \
+ 			fi ;\
  		fi ; \
--		install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+-		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
++		$(BSD_INSTALL_DATA) -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
+ 	if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ 		( \
+@@ -759,25 +759,25 @@
+ 		echo ";astctlowner = root" ; \
+ 		echo ";astctlgroup = apache" ; \
+ 		echo ";astctl = asterisk.ctl" ; \
+-		) > $(DESTDIR)$(ASTCONFPATH) ; \
++		) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ 	else \
+ 		echo "Skipping asterisk.conf creation"; \
+ 	fi
+-	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
  	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 ; \
+ 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+-			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++			$(BSD_INSTALL_DATA) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
  		else \
  			echo "No description for $$x"; \
  			exit 1; \
  		fi; \
  	done
+-	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
++	$(MKDIR) -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
  	for x in sounds/*.mp3; do \
--		install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
-+		$(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+-		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
++		$(BSD_INSTALL_DATA) -m 644 $$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
++	$(MKDIR) -p $(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 +474,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
+@@ -791,7 +791,7 @@
+ 	@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+ 	@[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+ 	$(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
+-	mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
++	$(MKDIR) -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
  	for x in images/*.gif; do \
- 		install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
+ 		$(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
  	done
-@@ -522,10 +494,10 @@
+@@ -820,10 +820,10 @@
  
- __rpm: _version
+ __rpm: include/asterisk/version.h spec
  	rm -rf /tmp/asterisk ; \
 -	mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
-+	$(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \
++	$(MKDIR) -p /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 ; \
++	$(MKDIR) -p /tmp/asterisk/etc/rc.d/init.d ; \
+ 	cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
  	rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
+ 
diff -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-agi::Makefile /usr/home/db/asterisk/files/patch-agi::Makefile
--- /usr/ports/net/asterisk/files/patch-agi::Makefile	Fri Oct 22 12:44:16 2004
+++ /usr/home/db/asterisk/files/patch-agi::Makefile	Wed Dec 31 19:00:00 1969
@@ -1,27 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-agi::Makefile,v 1.4 2004/10/17 18:00:02 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-apps::Makefile /usr/home/db/asterisk/files/patch-apps::Makefile
--- /usr/ports/net/asterisk/files/patch-apps::Makefile	Mon Jul 18 10:45:36 2005
+++ /usr/home/db/asterisk/files/patch-apps::Makefile	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-apps::app_rxfax.c /usr/home/db/asterisk/files/patch-apps::app_rxfax.c
--- /usr/ports/net/asterisk/files/patch-apps::app_rxfax.c	Thu Oct 20 12:45:24 2005
+++ /usr/home/db/asterisk/files/patch-apps::app_rxfax.c	Wed Dec 31 19:00:00 1969
@@ -1,377 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-apps::app_rxfax.c,v 1.2 2005/08/29 14:12:28 sobomax Exp $
-
---- apps/app_rxfax.c.orig
-+++ apps/app_rxfax.c
-@@ -0,0 +1,371 @@
-+/*
-+ * 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>
-+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
-+#include <inttypes.h>
-+#else
-+#include <stdint.h>
-+#endif
-+#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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-apps::app_txfax.c /usr/home/db/asterisk/files/patch-apps::app_txfax.c
--- /usr/ports/net/asterisk/files/patch-apps::app_txfax.c	Thu Oct 20 12:45:24 2005
+++ /usr/home/db/asterisk/files/patch-apps::app_txfax.c	Wed Dec 31 19:00:00 1969
@@ -1,299 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-apps::app_txfax.c,v 1.2 2005/08/29 14:12:28 sobomax Exp $
-
---- apps/app_txfax.c.orig
-+++ apps/app_txfax.c
-@@ -0,0 +1,293 @@
-+/*
-+ * 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>
-+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
-+#include <inttypes.h>
-+#else
-+#include <stdint.h>
-+#endif
-+#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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-astman::Makefile /usr/home/db/asterisk/files/patch-astman::Makefile
--- /usr/ports/net/asterisk/files/patch-astman::Makefile	Fri Oct 22 12:44:16 2004
+++ /usr/home/db/asterisk/files/patch-astman::Makefile	Wed Dec 31 19:00:00 1969
@@ -1,25 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-astman::Makefile,v 1.4 2004/10/17 18:00:02 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-cdr::Makefile /usr/home/db/asterisk/files/patch-cdr::Makefile
--- /usr/ports/net/asterisk/files/patch-cdr::Makefile	Thu Oct 20 12:45:24 2005
+++ /usr/home/db/asterisk/files/patch-cdr::Makefile	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-channels::Makefile /usr/home/db/asterisk/files/patch-channels::Makefile
--- /usr/ports/net/asterisk/files/patch-channels::Makefile	Thu Oct 20 12:45:24 2005
+++ /usr/home/db/asterisk/files/patch-channels::Makefile	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-channels::chan_h323.c /usr/home/db/asterisk/files/patch-channels::chan_h323.c
--- /usr/ports/net/asterisk/files/patch-channels::chan_h323.c	Fri Oct 22 12:44:16 2004
+++ /usr/home/db/asterisk/files/patch-channels::chan_h323.c	Wed Dec 31 19:00:00 1969
@@ -1,14 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-channels::chan_h323.c,v 1.4 2004/10/17 18:00:02 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-channels::chan_sip.c /usr/home/db/asterisk/files/patch-channels::chan_sip.c
--- /usr/ports/net/asterisk/files/patch-channels::chan_sip.c	Tue May 17 12:26:03 2005
+++ /usr/home/db/asterisk/files/patch-channels::chan_sip.c	Wed Dec 31 19:00:00 1969
@@ -1,144 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-channels::chan_sip.c,v 1.3 2005/05/03 13:58:26 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-channels::chan_zap.c /usr/home/db/asterisk/files/patch-channels::chan_zap.c
--- /usr/ports/net/asterisk/files/patch-channels::chan_zap.c	Tue May 17 12:26:03 2005
+++ /usr/home/db/asterisk/files/patch-channels::chan_zap.c	Wed Dec 31 19:00:00 1969
@@ -1,100 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-channels::chan_zap.c,v 1.3 2005/05/03 13:58:26 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-channels::h323::Makefile /usr/home/db/asterisk/files/patch-channels::h323::Makefile
--- /usr/ports/net/asterisk/files/patch-channels::h323::Makefile	Tue May 17 12:26:03 2005
+++ /usr/home/db/asterisk/files/patch-channels::h323::Makefile	Wed Dec 31 19:00:00 1969
@@ -1,39 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-channels::h323::Makefile,v 1.5 2005/01/08 17:04:12 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-codecs::Makefile /usr/home/db/asterisk/files/patch-codecs::Makefile
--- /usr/ports/net/asterisk/files/patch-codecs::Makefile	Tue May 17 12:26:03 2005
+++ /usr/home/db/asterisk/files/patch-codecs::Makefile	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-codecs::codec_g723_1_dummy.c /usr/home/db/asterisk/files/patch-codecs::codec_g723_1_dummy.c
--- /usr/ports/net/asterisk/files/patch-codecs::codec_g723_1_dummy.c	Fri Oct 22 12:44:17 2004
+++ /usr/home/db/asterisk/files/patch-codecs::codec_g723_1_dummy.c	Wed Dec 31 19:00:00 1969
@@ -1,314 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-codecs::codec_g723_1_dummy.c,v 1.3 2004/10/17 18:00:02 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-codecs::codec_g729_dummy.c /usr/home/db/asterisk/files/patch-codecs::codec_g729_dummy.c
--- /usr/ports/net/asterisk/files/patch-codecs::codec_g729_dummy.c	Fri Oct 22 12:44:17 2004
+++ /usr/home/db/asterisk/files/patch-codecs::codec_g729_dummy.c	Wed Dec 31 19:00:00 1969
@@ -1,281 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-codecs::codec_g729_dummy.c,v 1.3 2004/10/17 18:00:02 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-codecs::g729_slin_ex.h /usr/home/db/asterisk/files/patch-codecs::g729_slin_ex.h
--- /usr/ports/net/asterisk/files/patch-codecs::g729_slin_ex.h	Wed May 19 09:32:38 2004
+++ /usr/home/db/asterisk/files/patch-codecs::g729_slin_ex.h	Wed Dec 31 19:00:00 1969
@@ -1,20 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-codecs::g729_slin_ex.h,v 1.2 2004/04/30 05:21:08 sobomax Exp $
-
---- /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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-codecs::ilbc::Makefile /usr/home/db/asterisk/files/patch-codecs::ilbc::Makefile
--- /usr/ports/net/asterisk/files/patch-codecs::ilbc::Makefile	Wed May 19 09:32:38 2004
+++ /usr/home/db/asterisk/files/patch-codecs::ilbc::Makefile	Wed Dec 31 19:00:00 1969
@@ -1,11 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-codecs::ilbc::Makefile,v 1.3 2004/04/30 05:21:08 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-codecs::slin_g729_ex.h /usr/home/db/asterisk/files/patch-codecs::slin_g729_ex.h
--- /usr/ports/net/asterisk/files/patch-codecs::slin_g729_ex.h	Wed May 19 09:32:38 2004
+++ /usr/home/db/asterisk/files/patch-codecs::slin_g729_ex.h	Wed Dec 31 19:00:00 1969
@@ -1,31 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-codecs::slin_g729_ex.h,v 1.2 2004/04/30 05:21:08 sobomax Exp $
-
---- /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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-db.c /usr/home/db/asterisk/files/patch-db.c
--- /usr/ports/net/asterisk/files/patch-db.c	Fri Oct 22 12:44:18 2004
+++ /usr/home/db/asterisk/files/patch-db.c	Wed Dec 31 19:00:00 1969
@@ -1,14 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-db.c,v 1.4 2004/10/17 18:00:02 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-editline::configure /usr/home/db/asterisk/files/patch-editline::configure
--- /usr/ports/net/asterisk/files/patch-editline::configure	Wed May 19 09:32:38 2004
+++ /usr/home/db/asterisk/files/patch-editline::configure	Wed Dec 31 19:00:00 1969
@@ -1,14 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-editline::configure,v 1.3 2004/04/30 05:21:08 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-editline::makelist /usr/home/db/asterisk/files/patch-editline::makelist
--- /usr/ports/net/asterisk/files/patch-editline::makelist	Sat Jun 18 14:38:33 2005
+++ /usr/home/db/asterisk/files/patch-editline::makelist	Wed Dec 31 19:00:00 1969
@@ -1,14 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-editline::makelist,v 1.1 2005/06/18 18:38:33 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-formats::Makefile /usr/home/db/asterisk/files/patch-formats::Makefile
--- /usr/ports/net/asterisk/files/patch-formats::Makefile	Wed May 19 09:32:38 2004
+++ /usr/home/db/asterisk/files/patch-formats::Makefile	Wed Dec 31 19:00:00 1969
@@ -1,23 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-formats::Makefile,v 1.3 2004/04/30 05:21:08 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-formats::format_g723_1.c /usr/home/db/asterisk/files/patch-formats::format_g723_1.c
--- /usr/ports/net/asterisk/files/patch-formats::format_g723_1.c	Fri Oct 22 12:44:18 2004
+++ /usr/home/db/asterisk/files/patch-formats::format_g723_1.c	Wed Dec 31 19:00:00 1969
@@ -1,351 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-formats::format_g723_1.c,v 1.3 2004/10/17 18:00:02 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-formats::format_g729.c /usr/home/db/asterisk/files/patch-formats::format_g729.c
--- /usr/ports/net/asterisk/files/patch-formats::format_g729.c	Tue May 17 12:26:03 2005
+++ /usr/home/db/asterisk/files/patch-formats::format_g729.c	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-include::asterisk::utils.h /usr/home/db/asterisk/files/patch-include::asterisk::utils.h
--- /usr/ports/net/asterisk/files/patch-include::asterisk::utils.h	Sun Oct 17 14:00:02 2004
+++ /usr/home/db/asterisk/files/patch-include::asterisk::utils.h	Wed Dec 31 19:00:00 1969
@@ -1,13 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-include::asterisk::utils.h,v 1.1 2004/10/17 18:00:02 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-pbx::Makefile /usr/home/db/asterisk/files/patch-pbx::Makefile
--- /usr/ports/net/asterisk/files/patch-pbx::Makefile	Wed May 19 09:32:39 2004
+++ /usr/home/db/asterisk/files/patch-pbx::Makefile	Wed Dec 31 19:00:00 1969
@@ -1,23 +0,0 @@
-
-$FreeBSD: ports/net/asterisk/files/patch-pbx::Makefile,v 1.3 2004/04/30 05:21:08 sobomax Exp $
-
---- 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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-pbx::pbx_wilcalu.c /usr/home/db/asterisk/files/patch-pbx::pbx_wilcalu.c
--- /usr/ports/net/asterisk/files/patch-pbx::pbx_wilcalu.c	Tue May  3 09:39:48 2005
+++ /usr/home/db/asterisk/files/patch-pbx::pbx_wilcalu.c	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-res-res_watchdog.c /usr/home/db/asterisk/files/patch-res-res_watchdog.c
--- /usr/ports/net/asterisk/files/patch-res-res_watchdog.c	Fri Jul 15 08:21:58 2005
+++ /usr/home/db/asterisk/files/patch-res-res_watchdog.c	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-res::Makefile /usr/home/db/asterisk/files/patch-res::Makefile
--- /usr/ports/net/asterisk/files/patch-res::Makefile	Thu Oct 20 12:45:24 2005
+++ /usr/home/db/asterisk/files/patch-res::Makefile	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/files/patch-rtp.c /usr/home/db/asterisk/files/patch-rtp.c
--- /usr/ports/net/asterisk/files/patch-rtp.c	Mon Jul 18 10:45:36 2005
+++ /usr/home/db/asterisk/files/patch-rtp.c	Wed Dec 31 19:00:00 1969
@@ -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 -ruN --exclude=CVS /usr/ports/net/asterisk/pkg-plist /usr/home/db/asterisk/pkg-plist
--- /usr/ports/net/asterisk/pkg-plist	Thu Oct 20 12:45:24 2005
+++ /usr/home/db/asterisk/pkg-plist	Sun Jan  8 22:16:40 2006
@@ -19,6 +19,12 @@
 @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.conf %D/etc/asterisk/cdr.conf-dist; then rm -f %D/etc/asterisk/cdr.conf; fi
+etc/asterisk/cdr.conf-dist
+@exec [ -f %B/cdr.conf ] || cp %B/%f %B/cdr.conf
+@unexec if cmp -s %D/etc/asterisk/cdr_custom.conf %D/etc/asterisk/cdr_custom.conf-dist; then rm -f %D/etc/asterisk/cdr_custom.conf; fi
+etc/asterisk/cdr_custom.conf-dist
+@exec [ -f %B/cdr_custom.conf ] || cp %B/%f %B/cdr_custom.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
@@ -31,9 +37,21 @@
 @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/codecs.conf %D/etc/asterisk/codecs.conf-dist; then rm -f %D/etc/asterisk/codecs.conf; fi
+etc/asterisk/codecs.conf-dist
+@exec [ -f %B/codecs.conf ] || cp %B/%f %B/codecs.conf
+@unexec if cmp -s %D/etc/asterisk/dnsmgr.conf %D/etc/asterisk/dnsmgr.conf-dist; then rm -f %D/etc/asterisk/dnsmgr.conf; fi
+etc/asterisk/dnsmgr.conf-dist
+@exec [ -f %B/dnsmgr.conf ] || cp %B/%f %B/dmsmgr.conf
+@unexec if cmp -s %D/etc/asterisk/dundi.conf %D/etc/asterisk/dundi.conf-dist; then rm -f %D/etc/asterisk/dundi.conf; fi
+etc/asterisk/dundi.conf-dist
+@exec [ -f %B/dundi.conf ] || cp %B/%f %B/dundi.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/extensions.ael %D/etc/asterisk/extensions.ael-dist; then rm -f %D/etc/asterisk/extensions.ael; fi
+etc/asterisk/extensions.ael-dist
+@exec [ -f %B/extensions.ael ] || cp %B/%f %B/extensions.ael
 @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
@@ -46,9 +64,6 @@
 @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
@@ -70,6 +85,9 @@
 @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/misdn.conf %D/etc/asterisk/misdn.conf-dist; then rm -f %D/etc/asterisk/misdn.conf; fi
+etc/asterisk/misdn.conf-dist
+@exec [ -f %B/misdn.conf ] || cp %B/%f %B/misdn.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
@@ -94,8 +112,6 @@
 @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
@@ -109,6 +125,9 @@
 @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/sip_notify.conf %D/etc/asterisk/sip_notify.conf-dist; then rm -f %D/etc/asterisk/sip_notify.conf; fi
+etc/asterisk/sip_notify.conf-dist
+@exec [ -f %B/sip_notify.conf ] || cp %B/%f %B/sip_notify.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
@@ -121,9 +140,6 @@
 @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
@@ -136,28 +152,36 @@
 include/asterisk/ast_expr.h
 include/asterisk/astdb.h
 include/asterisk/astmm.h
+include/asterisk/astobj.h
 include/asterisk/astosp.h
+include/asterisk/build.h
 include/asterisk/callerid.h
 include/asterisk/causes.h
 include/asterisk/cdr.h
 include/asterisk/channel.h
-include/asterisk/channel_pvt.h
+include/asterisk/chanspy.h
 include/asterisk/chanvars.h
 include/asterisk/cli.h
+include/asterisk/compat.h
 include/asterisk/config.h
-include/asterisk/config_pvt.h
+include/asterisk/compiler.h
 include/asterisk/crypto.h
-include/asterisk/cvsid.h
+include/asterisk/devicestate.h
 include/asterisk/dlfcn-compat.h
 include/asterisk/dns.h
+include/asterisk/dnsmgr.h
+include/asterisk/doxyref.h
 include/asterisk/dsp.h
+include/asterisk/dundi.h
 include/asterisk/enum.h
+include/asterisk/endian.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/inline_api.h
 include/asterisk/io.h
 include/asterisk/linkedlists.h
 include/asterisk/localtime.h
@@ -168,38 +192,49 @@
 include/asterisk/module.h
 include/asterisk/monitor.h
 include/asterisk/musiconhold.h
+include/asterisk/netsock.h
 include/asterisk/options.h
 include/asterisk/pbx.h
+include/asterisk/plc.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/slinfactory.h
 include/asterisk/srv.h
+include/asterisk/strings.h
 include/asterisk/tdd.h
 include/asterisk/term.h
+include/asterisk/time.h
 include/asterisk/transcap.h
 include/asterisk/translate.h
 include/asterisk/ulaw.h
+include/asterisk/unaligned.h
 include/asterisk/utils.h
+include/asterisk/version.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_chanspy.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_dictate.so
+lib/asterisk/modules/app_directed_pickup.so
 lib/asterisk/modules/app_directory.so
 lib/asterisk/modules/app_disa.so
+lib/asterisk/modules/app_dumpchan.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_externalivr.so
 lib/asterisk/modules/app_festival.so
 %%WITH_ZAPTEL%%lib/asterisk/modules/app_flash.so
 lib/asterisk/modules/app_forkcdr.so
@@ -208,64 +243,63 @@
 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
+lib/asterisk/modules/app_math.so
+lib/asterisk/modules/app_md5.so
 %%WITH_ZAPTEL%%lib/asterisk/modules/app_meetme.so
 lib/asterisk/modules/app_milliwatt.so
+lib/asterisk/modules/app_mixmonitor.so
 lib/asterisk/modules/app_mp3.so
 lib/asterisk/modules/app_nbscat.so
+lib/asterisk/modules/app_page.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_readfile.so
+lib/asterisk/modules/app_realtime.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_setrdnis.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_stack.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_waitforsilence.so
+lib/asterisk/modules/app_while.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_custom.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_features.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
@@ -273,15 +307,14 @@
 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_au.so
+lib/asterisk/modules/format_g723.so
 lib/asterisk/modules/format_g726.so
 lib/asterisk/modules/format_g729.so
 lib/asterisk/modules/format_gsm.so
@@ -294,17 +327,25 @@
 lib/asterisk/modules/format_vox.so
 lib/asterisk/modules/format_wav.so
 lib/asterisk/modules/format_wav_gsm.so
+lib/asterisk/modules/func_callerid.so
+lib/asterisk/modules/func_enum.so
+lib/asterisk/modules/func_uri.so
+lib/asterisk/modules/pbx_ael.so
 lib/asterisk/modules/pbx_config.so
+lib/asterisk/modules/pbx_dundi.so
+lib/asterisk/modules/pbx_functions.so
+lib/asterisk/modules/pbx_loopback.so
+lib/asterisk/modules/pbx_realtime.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_config_odbc.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_odbc.so
 lib/asterisk/modules/res_musiconhold.so
-lib/asterisk/modules/res_watchdog.so
 sbin/asterisk
 sbin/astgenkey
 sbin/astman
@@ -330,23 +371,34 @@
 %%DATADIR%%/sounds/auth-incorrect.gsm
 %%DATADIR%%/sounds/auth-thankyou.gsm
 %%DATADIR%%/sounds/beep.gsm
+%%DATADIR%%/sounds/beeperr.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-hasjoin.gsm
+%%DATADIR%%/sounds/conf-hasleft.gsm
 %%DATADIR%%/sounds/conf-invalid.gsm
 %%DATADIR%%/sounds/conf-invalidpin.gsm
 %%DATADIR%%/sounds/conf-kicked.gsm
+%%DATADIR%%/sounds/conf-leaderhasleft.gsm
 %%DATADIR%%/sounds/conf-locked.gsm
 %%DATADIR%%/sounds/conf-lockednow.gsm
 %%DATADIR%%/sounds/conf-muted.gsm
 %%DATADIR%%/sounds/conf-noempty.gsm
+%%DATADIR%%/sounds/conf-onlyone.gsm
 %%DATADIR%%/sounds/conf-onlyperson.gsm
+%%DATADIR%%/sounds/conf-otherinparty.gsm
+%%DATADIR%%/sounds/conf-placeintoconf.gsm
+%%DATADIR%%/sounds/conf-thereare.gsm
 %%DATADIR%%/sounds/conf-unlockednow.gsm
 %%DATADIR%%/sounds/conf-unmuted.gsm
 %%DATADIR%%/sounds/conf-usermenu.gsm
+%%DATADIR%%/sounds/conf-userswilljoin.gsm
+%%DATADIR%%/sounds/conf-userwilljoin.gsm
+%%DATADIR%%/sounds/conf-waitforleader.gsm
 %%DATADIR%%/sounds/demo-abouttotry.gsm
 %%DATADIR%%/sounds/demo-congrats.gsm
 %%DATADIR%%/sounds/demo-echodone.gsm
@@ -357,6 +409,18 @@
 %%DATADIR%%/sounds/demo-nogo.gsm
 %%DATADIR%%/sounds/demo-nomatch.gsm
 %%DATADIR%%/sounds/demo-thanks.gsm
+%%DATADIR%%/sounds/dictate/both_help.gsm
+%%DATADIR%%/sounds/dictate/enter_filename.gsm
+%%DATADIR%%/sounds/dictate/forhelp.gsm
+%%DATADIR%%/sounds/dictate/pause.gsm
+%%DATADIR%%/sounds/dictate/paused.gsm
+%%DATADIR%%/sounds/dictate/play_help.gsm
+%%DATADIR%%/sounds/dictate/playback.gsm
+%%DATADIR%%/sounds/dictate/playback_mode.gsm
+%%DATADIR%%/sounds/dictate/record.gsm
+%%DATADIR%%/sounds/dictate/record_help.gsm
+%%DATADIR%%/sounds/dictate/record_mode.gsm
+%%DATADIR%%/sounds/dictate/truncating_audio.gsm
 %%DATADIR%%/sounds/digits/0.gsm
 %%DATADIR%%/sounds/digits/1.gsm
 %%DATADIR%%/sounds/digits/10.gsm
@@ -445,6 +509,7 @@
 %%DATADIR%%/sounds/dir-intro.gsm
 %%DATADIR%%/sounds/dir-nomatch.gsm
 %%DATADIR%%/sounds/dir-nomore.gsm
+%%DATADIR%%/sounds/hello-world.gsm
 %%DATADIR%%/sounds/invalid.gsm
 %%DATADIR%%/sounds/letters/a.gsm
 %%DATADIR%%/sounds/letters/at.gsm
@@ -512,6 +577,10 @@
 %%DATADIR%%/sounds/phonetic/x_p.gsm
 %%DATADIR%%/sounds/phonetic/y_p.gsm
 %%DATADIR%%/sounds/phonetic/z_p.gsm
+%%DATADIR%%/sounds/priv-callee-options.gsm
+%%DATADIR%%/sounds/priv-callpending.gsm
+%%DATADIR%%/sounds/priv-introsaved.gsm
+%%DATADIR%%/sounds/priv-recordintro.gsm
 %%DATADIR%%/sounds/privacy-incorrect.gsm
 %%DATADIR%%/sounds/privacy-prompt.gsm
 %%DATADIR%%/sounds/privacy-thankyou.gsm
@@ -520,10 +589,21 @@
 %%DATADIR%%/sounds/queue-holdtime.gsm
 %%DATADIR%%/sounds/queue-less-than.gsm
 %%DATADIR%%/sounds/queue-minutes.gsm
+%%DATADIR%%/sounds/queue-periodic-announce.gsm
+%%DATADIR%%/sounds/queue-reporthold.gsm
 %%DATADIR%%/sounds/queue-seconds.gsm
 %%DATADIR%%/sounds/queue-thankyou.gsm
 %%DATADIR%%/sounds/queue-thereare.gsm
 %%DATADIR%%/sounds/queue-youarenext.gsm
+%%DATADIR%%/sounds/screen-callee-options.gsm
+%%DATADIR%%/sounds/spy-agent.gsm
+%%DATADIR%%/sounds/spy-h323.gsm
+%%DATADIR%%/sounds/spy-iax.gsm
+%%DATADIR%%/sounds/spy-iax2.gsm
+%%DATADIR%%/sounds/spy-mgcp.gsm
+%%DATADIR%%/sounds/spy-sip.gsm
+%%DATADIR%%/sounds/spy-skinny.gsm
+%%DATADIR%%/sounds/spy-zap.gsm
 %%DATADIR%%/sounds/ss-noservice.gsm
 %%DATADIR%%/sounds/transfer.gsm
 %%DATADIR%%/sounds/tt-allbusy.gsm
@@ -531,7 +611,6 @@
 %%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
@@ -553,6 +632,7 @@
 %%DATADIR%%/sounds/vm-extension.gsm
 %%DATADIR%%/sounds/vm-first.gsm
 %%DATADIR%%/sounds/vm-for.gsm
+%%DATADIR%%/sounds/vm-forward.gsm
 %%DATADIR%%/sounds/vm-forwardoptions.gsm
 %%DATADIR%%/sounds/vm-from-extension.gsm
 %%DATADIR%%/sounds/vm-from-phonenumber.gsm
@@ -571,10 +651,12 @@
 %%DATADIR%%/sounds/vm-mailboxfull.gsm
 %%DATADIR%%/sounds/vm-message.gsm
 %%DATADIR%%/sounds/vm-messages.gsm
+%%DATADIR%%/sounds/vm-minutes.gsm
 %%DATADIR%%/sounds/vm-mismatch.gsm
 %%DATADIR%%/sounds/vm-msginstruct.gsm
 %%DATADIR%%/sounds/vm-msgsaved.gsm
 %%DATADIR%%/sounds/vm-newpassword.gsm
+%%DATADIR%%/sounds/vm-newuser.gsm
 %%DATADIR%%/sounds/vm-next.gsm
 %%DATADIR%%/sounds/vm-no.gsm
 %%DATADIR%%/sounds/vm-nobodyavail.gsm
@@ -592,6 +674,7 @@
 %%DATADIR%%/sounds/vm-reachoper.gsm
 %%DATADIR%%/sounds/vm-rec-busy.gsm
 %%DATADIR%%/sounds/vm-rec-name.gsm
+%%DATADIR%%/sounds/vm-rec-temp.gsm
 %%DATADIR%%/sounds/vm-rec-unv.gsm
 %%DATADIR%%/sounds/vm-received.gsm
 %%DATADIR%%/sounds/vm-reenterpassword.gsm
@@ -605,6 +688,9 @@
 %%DATADIR%%/sounds/vm-sorry.gsm
 %%DATADIR%%/sounds/vm-star-cancel.gsm
 %%DATADIR%%/sounds/vm-starmain.gsm
+%%DATADIR%%/sounds/vm-tempgreeting.gsm
+%%DATADIR%%/sounds/vm-tempgreeting2.gsm
+%%DATADIR%%/sounds/vm-tempremoved.gsm
 %%DATADIR%%/sounds/vm-then-pound.gsm
 %%DATADIR%%/sounds/vm-theperson.gsm
 %%DATADIR%%/sounds/vm-tocallback.gsm
@@ -624,9 +710,11 @@
 %%DATADIR%%/sounds/vm-whichbox.gsm
 %%DATADIR%%/sounds/vm-youhave.gsm
 %%DATADIR%%/sounds/voicemail
+@dirrm %%DATADIR%%/sounds/dictate
 @dirrm %%DATADIR%%/sounds/phonetic
 @dirrm %%DATADIR%%/sounds/letters
 @dirrm %%DATADIR%%/sounds/digits
+@dirrm %%DATADIR%%/sounds/priv-callerintros
 @dirrm %%DATADIR%%/sounds
 @dirrm %%DATADIR%%/mohmp3
 @dirrm %%DATADIR%%/keys
@@ -641,11 +729,14 @@
 @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/dictate
+@dirrm spool/asterisk/meetme
+@dirrm spool/asterisk/monitor
+@dirrm spool/asterisk/system
 @dirrm spool/asterisk/voicemail/default/1234/INBOX
 @dirrm spool/asterisk/voicemail/default/1234
 @dirrm spool/asterisk/voicemail/default
@@ -653,4 +744,6 @@
 @dirrm spool/asterisk/tmp
 @dirrm spool/asterisk
 @dirrm log/asterisk/cdr-csv
+@dirrm log/asterisk/cdr-custom
 @dirrm log/asterisk
+
--- asterisk-1.2.1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1EvnkY-0004vk-4u>