|
From: <kr...@us...> - 2012-06-20 16:56:29
|
Revision: 5578
http://astlinux.svn.sourceforge.net/astlinux/?rev=5578&view=rev
Author: krisk84
Date: 2012-06-20 16:56:18 +0000 (Wed, 20 Jun 2012)
Log Message:
-----------
revert asterisk to rev 5500
Revision Links:
--------------
http://astlinux.svn.sourceforge.net/astlinux/?rev=5500&view=rev
Modified Paths:
--------------
branches/s2s/package/asterisk/asterisk-log-rtpip.patch
branches/s2s/package/asterisk/asterisk-recording.patch
branches/s2s/package/asterisk/asterisk-sounds-Makefile.patch
branches/s2s/package/asterisk/asterisk.mk
branches/s2s/package/asterisk/sounds.xml
Added Paths:
-----------
branches/s2s/package/asterisk/asterisk-1.4-bugid17688.patch
branches/s2s/package/asterisk/asterisk-chan_local.patch
branches/s2s/package/asterisk/asterisk-chansip-loop-crash.patch
Added: branches/s2s/package/asterisk/asterisk-1.4-bugid17688.patch
===================================================================
--- branches/s2s/package/asterisk/asterisk-1.4-bugid17688.patch (rev 0)
+++ branches/s2s/package/asterisk/asterisk-1.4-bugid17688.patch 2012-06-20 16:56:18 UTC (rev 5578)
@@ -0,0 +1,18 @@
+diff -urN asterisk-1.4.26.3.orig/codecs/gsm/Makefile asterisk-1.4.26.3/codecs/gsm/Makefile
+--- asterisk-1.4.26.3.orig/codecs/gsm/Makefile 2008-11-19 16:34:47.000000000 -0500
++++ asterisk-1.4.26.3/codecs/gsm/Makefile 2011-02-15 16:48:01.000000000 -0500
+@@ -37,6 +37,14 @@
+ ######### ppro's, etc, as well as the AMD K6 and K7. The compile will
+ ######### probably require gcc.
+
++# Due to the gsm codec beeing broken when compiled with gcc version 4.2
++# and optimization higher than -O2 we are checking for that version and
++# set the optimization to -O2 in this case.
++
++ifeq ($(shell $(CC) -v 2>&1 | awk '/^gcc version/ { split($$3, v, "."); printf "%s.%s\n", v[1], v[2]; }' ),4.2)
++OPTIMIZE=-O2
++endif
++
+ ifeq (, $(findstring $(OSARCH) , Darwin SunOS ))
+ ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm armv5b armeb hppa2.0 ppc powerpc ppc64 ia64 s390 bfin mipsel mips))
+ ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l s390 ))
Added: branches/s2s/package/asterisk/asterisk-chan_local.patch
===================================================================
--- branches/s2s/package/asterisk/asterisk-chan_local.patch (rev 0)
+++ branches/s2s/package/asterisk/asterisk-chan_local.patch 2012-06-20 16:56:18 UTC (rev 5578)
@@ -0,0 +1,105 @@
+diff -urN asterisk-1.4.26.3.orig/channels/chan_local.c asterisk-1.4.26.3/channels/chan_local.c
+--- asterisk-1.4.26.3.orig/channels/chan_local.c 2009-04-23 15:13:18.000000000 -0400
++++ asterisk-1.4.26.3/channels/chan_local.c 2011-11-17 10:31:14.000000000 -0500
+@@ -27,7 +27,7 @@
+
+ #include "asterisk.h"
+
+-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 190286 $")
++ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+ #include <stdio.h>
+ #include <string.h>
+@@ -120,6 +120,7 @@
+ #define LOCAL_ALREADY_MASQED (1 << 2) /*!< Already masqueraded */
+ #define LOCAL_LAUNCHED_PBX (1 << 3) /*!< PBX was launched */
+ #define LOCAL_NO_OPTIMIZATION (1 << 4) /*!< Do not optimize using masquerading */
++#define LOCAL_MOH_PASSTHRU (1 << 5) /*!< Pass through music on hold start/stop frames */
+
+ static AST_LIST_HEAD_STATIC(locals, local_pvt);
+
+@@ -204,6 +205,9 @@
+ return and destroy p. */
+ ast_mutex_unlock(&p->lock);
+ p = local_pvt_destroy(p);
++ if (other) {
++ ast_channel_unlock(other);
++ }
+ return -1;
+ }
+
+@@ -371,9 +375,9 @@
+ return -1;
+
+ /* If this is an MOH hold or unhold, do it on the Local channel versus real channel */
+- if (condition == AST_CONTROL_HOLD) {
++ if (!ast_test_flag(p, LOCAL_MOH_PASSTHRU) && condition == AST_CONTROL_HOLD) {
+ ast_moh_start(ast, data, NULL);
+- } else if (condition == AST_CONTROL_UNHOLD) {
++ } else if (!ast_test_flag(p, LOCAL_MOH_PASSTHRU) && condition == AST_CONTROL_UNHOLD) {
+ ast_moh_stop(ast);
+ } else {
+ /* Queue up a frame representing the indication as a control frame */
+@@ -570,11 +574,11 @@
+ ast_clear_flag(p, LOCAL_LAUNCHED_PBX);
+ ast_module_user_remove(p->u_chan);
+ } else {
+- p->owner = NULL;
+ ast_module_user_remove(p->u_owner);
+ while (p->chan && ast_channel_trylock(p->chan)) {
+ DEADLOCK_AVOIDANCE(&p->lock);
+ }
++ p->owner = NULL;
+ if (p->chan) {
+ ast_queue_hangup(p->chan);
+ ast_channel_unlock(p->chan);
+@@ -631,6 +635,8 @@
+ *opts++ = '\0';
+ if (strchr(opts, 'n'))
+ ast_set_flag(tmp, LOCAL_NO_OPTIMIZATION);
++ if (strchr(opts, 'm'))
++ ast_set_flag(tmp, LOCAL_MOH_PASSTHRU);
+ }
+
+ /* Look for a context */
+diff -urN asterisk-1.4.26.3.orig/main/channel.c asterisk-1.4.26.3/main/channel.c
+--- asterisk-1.4.26.3.orig/main/channel.c 2009-08-10 16:14:34.000000000 -0400
++++ asterisk-1.4.26.3/main/channel.c 2011-11-21 15:01:13.000000000 -0500
+@@ -938,22 +938,22 @@
+ }
+ }
+
+- if ((queued_frames + new_frames) > 128) {
+- ast_log(LOG_WARNING, "Exceptionally long queue length queuing to %s\n", chan->name);
+- while ((f = AST_LIST_REMOVE_HEAD(&frames, frame_list))) {
+- ast_frfree(f);
+- }
+- ast_channel_unlock(chan);
+- return 0;
+- }
+-
+- if ((queued_voice_frames + new_voice_frames) > 96) {
+- ast_log(LOG_WARNING, "Exceptionally long voice queue length queuing to %s\n", chan->name);
+- while ((f = AST_LIST_REMOVE_HEAD(&frames, frame_list))) {
+- ast_frfree(f);
++ if ((queued_frames + new_frames > 128 || queued_voice_frames + new_voice_frames > 96)) {
++ int count = 0;
++ ast_log(LOG_WARNING, "Exceptionally long %squeue length queuing to %s\n", queued_frames + new_frames > 128 ? "" : "voice ", chan->name);
++ AST_LIST_TRAVERSE_SAFE_BEGIN(&chan->readq, cur, frame_list) {
++ /* Save the most recent frame */
++ if (!AST_LIST_NEXT(cur, frame_list)) {
++ break;
++ } else if (cur->frametype == AST_FRAME_VOICE || cur->frametype == AST_FRAME_VIDEO || cur->frametype == AST_FRAME_NULL) {
++ if (++count > 64) {
++ break;
++ }
++ AST_LIST_REMOVE_CURRENT(&chan->readq, frame_list);
++ ast_frfree(cur);
++ }
+ }
+- ast_channel_unlock(chan);
+- return 0;
++ AST_LIST_TRAVERSE_SAFE_END;
+ }
+
+ if (after) {
Added: branches/s2s/package/asterisk/asterisk-chansip-loop-crash.patch
===================================================================
--- branches/s2s/package/asterisk/asterisk-chansip-loop-crash.patch (rev 0)
+++ branches/s2s/package/asterisk/asterisk-chansip-loop-crash.patch 2012-06-20 16:56:18 UTC (rev 5578)
@@ -0,0 +1,15 @@
+diff -ur asterisk-1.4.26.3.orig/channels/chan_sip.c asterisk-1.4.26.3/channels/chan_sip.c
+--- asterisk-1.4.26.3.orig/channels/chan_sip.c 2010-03-01 13:46:30.000000000 -0500
++++ asterisk-1.4.26.3/channels/chan_sip.c 2010-03-01 13:47:05.000000000 -0500
+@@ -1807,11 +1807,6 @@
+ res = XMIT_ERROR; /* Don't bother with trying to transmit again */
+ }
+
+- if (p->registry && p->registry->regstate < REG_STATE_REGISTERED) {
+- AST_SCHED_DEL(sched, p->registry->timeout);
+- p->registry->needdns = TRUE;
+- p->registry->timeout = ast_sched_add(sched, 1, sip_reg_timeout, p->registry);
+- }
+ }
+
+ if (res != len)
Modified: branches/s2s/package/asterisk/asterisk-log-rtpip.patch
===================================================================
--- branches/s2s/package/asterisk/asterisk-log-rtpip.patch 2012-06-18 16:21:44 UTC (rev 5577)
+++ branches/s2s/package/asterisk/asterisk-log-rtpip.patch 2012-06-20 16:56:18 UTC (rev 5578)
@@ -1,13 +1,23 @@
-diff -urN asterisk-1.4.44.orig/channels/chan_sip.c asterisk-1.4.44/channels/chan_sip.c
---- asterisk-1.4.44.orig/channels/chan_sip.c 2011-11-21 14:54:07.000000000 -0500
-+++ asterisk-1.4.44/channels/chan_sip.c 2012-04-06 11:30:39.000000000 -0400
-@@ -6030,8 +6030,7 @@
+diff -ur asterisk-1.4.20.orig/channels/chan_sip.c asterisk-1.4.20/channels/chan_sip.c
+--- asterisk-1.4.20.orig/channels/chan_sip.c 2008-05-14 08:51:06.000000000 -0400
++++ asterisk-1.4.20/channels/chan_sip.c 2008-05-21 00:12:25.000000000 -0400
+@@ -5216,8 +5216,7 @@
+ if (portno > 0) {
sin.sin_port = htons(portno);
- memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));
ast_rtp_set_peer(p->rtp, &sin);
- if (debug)
- ast_verbose("Peer audio RTP is at port %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
+ ast_verbose("Peer audio RTP is at port %s:%d (name=%s, callid=%s)\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), (((p->owner != NULL) && (p->owner->name != NULL)) ? p->owner->name : "unknown"), ((p->callid != NULL) ? p->callid : "unknown"));
- } else if (udptlportno > 0) {
- if (debug)
- ast_verbose("Got T.38 Re-invite without audio. Keeping RTP active during T.38 session.\n");
+ } else {
+ if (udptlportno > 0) {
+ if (debug)
+@@ -5533,8 +5532,7 @@
+ /* Setup audio port number */
+ if (p->rtp && sin.sin_port) {
+ ast_rtp_set_peer(p->rtp, &sin);
+- if (debug)
+- ast_verbose("Peer audio RTP is at port %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
++ ast_verbose("Peer audio RTP is at port %s:%d (name=%s, callid=%s)\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), (((p->owner != NULL) && (p->owner->name != NULL)) ? p->owner->name : "unknown"), ((p->callid != NULL) ? p->callid : "unknown"));
+ }
+
+ /* Setup video port number */
Modified: branches/s2s/package/asterisk/asterisk-recording.patch
===================================================================
--- branches/s2s/package/asterisk/asterisk-recording.patch 2012-06-18 16:21:44 UTC (rev 5577)
+++ branches/s2s/package/asterisk/asterisk-recording.patch 2012-06-20 16:56:18 UTC (rev 5578)
@@ -1,7 +1,7 @@
-diff -ur asterisk-1.4.44.orig/formats/format_wav.c asterisk-1.4.44/formats/format_wav.c
---- asterisk-1.4.44.orig/formats/format_wav.c 2011-04-25 15:28:41.000000000 -0400
-+++ asterisk-1.4.44/formats/format_wav.c 2012-04-06 11:36:12.000000000 -0400
-@@ -339,6 +339,8 @@
+diff -urN asterisk-1.4.26.3.orig/formats/format_wav.c asterisk-1.4.26.3/formats/format_wav.c
+--- asterisk-1.4.26.3.orig/formats/format_wav.c 2009-04-07 20:09:04.000000000 -0400
++++ asterisk-1.4.26.3/formats/format_wav.c 2011-09-19 14:24:10.000000000 -0400
+@@ -345,6 +345,8 @@
{
char zero = 0;
struct wav_desc *fs = (struct wav_desc *)s->_private;
@@ -10,7 +10,7 @@
/* Pad to even length */
if (fs->bytes & 0x1) {
if (!fwrite(&zero, 1, 1, s->f)) {
-@@ -452,8 +454,7 @@
+@@ -458,8 +460,7 @@
}
s->bytes += f->datalen;
@@ -20,10 +20,545 @@
return 0;
}
-diff -ur asterisk-1.4.44.orig/include/asterisk/file.h asterisk-1.4.44/include/asterisk/file.h
---- asterisk-1.4.44.orig/include/asterisk/file.h 2010-05-21 16:59:14.000000000 -0400
-+++ asterisk-1.4.44/include/asterisk/file.h 2012-04-06 11:36:12.000000000 -0400
-@@ -142,6 +142,7 @@
+diff -urN asterisk-1.4.26.3.orig/formats/format_wav.c.orig asterisk-1.4.26.3/formats/format_wav.c.orig
+--- asterisk-1.4.26.3.orig/formats/format_wav.c.orig 1969-12-31 19:00:00.000000000 -0500
++++ asterisk-1.4.26.3/formats/format_wav.c.orig 2009-04-07 20:09:04.000000000 -0400
+@@ -0,0 +1,531 @@
++/*
++ * Asterisk -- An open source telephony toolkit.
++ *
++ * Copyright (C) 1999 - 2005, Digium, Inc.
++ *
++ * Mark Spencer <mar...@di...>
++ *
++ * See http://www.asterisk.org for more information about
++ * the Asterisk project. Please do not directly contact
++ * any of the maintainers of this project for assistance;
++ * the project provides a web site, mailing lists and IRC
++ * channels for your use.
++ *
++ * This program is free software, distributed under the terms of
++ * the GNU General Public License Version 2. See the LICENSE file
++ * at the top of the source tree.
++ */
++
++/*! \file
++ *
++ * \brief Work with WAV in the proprietary Microsoft format.
++ * Microsoft WAV format (8000hz Signed Linear)
++ * \arg File name extension: wav (lower case)
++ * \ingroup formats
++ */
++
++#include "asterisk.h"
++
++ASTERISK_FILE_VERSION(__FILE__, "$Revision: 186841 $")
++
++#include <unistd.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <stdlib.h>
++#include <sys/time.h>
++#include <stdio.h>
++#include <errno.h>
++#include <string.h>
++
++#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 "asterisk/endian.h"
++
++/* Some Ideas for this code came from makewave.c by Jeffrey Chilton */
++
++/* Portions of the conversion code are by gu...@si... */
++
++#define WAV_BUF_SIZE 320
++
++struct wav_desc { /* format-specific parameters */
++ int bytes;
++ int needsgain;
++ int lasttimeout;
++ int maxlen;
++ struct timeval last;
++};
++
++#define BLOCKSIZE 160
++
++#define GAIN 0 /* 2^GAIN is the multiple to increase the volume by. The original value of GAIN was 2, or 4x (12 dB),
++ * but there were many reports of the clipping of loud signal peaks (issue 5823 for example). */
++
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++#define htoll(b) (b)
++#define htols(b) (b)
++#define ltohl(b) (b)
++#define ltohs(b) (b)
++#else
++#if __BYTE_ORDER == __BIG_ENDIAN
++#define htoll(b) \
++ (((((b) ) & 0xFF) << 24) | \
++ ((((b) >> 8) & 0xFF) << 16) | \
++ ((((b) >> 16) & 0xFF) << 8) | \
++ ((((b) >> 24) & 0xFF) ))
++#define htols(b) \
++ (((((b) ) & 0xFF) << 8) | \
++ ((((b) >> 8) & 0xFF) ))
++#define ltohl(b) htoll(b)
++#define ltohs(b) htols(b)
++#else
++#error "Endianess not defined"
++#endif
++#endif
++
++
++static int check_header(FILE *f)
++{
++ int type, size, formtype;
++ int fmt, hsize;
++ short format, chans, bysam, bisam;
++ int bysec;
++ int freq;
++ int data;
++ if (fread(&type, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Read failed (type)\n");
++ return -1;
++ }
++ if (fread(&size, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Read failed (size)\n");
++ return -1;
++ }
++ size = ltohl(size);
++ if (fread(&formtype, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Read failed (formtype)\n");
++ return -1;
++ }
++ if (memcmp(&type, "RIFF", 4)) {
++ ast_log(LOG_WARNING, "Does not begin with RIFF\n");
++ return -1;
++ }
++ if (memcmp(&formtype, "WAVE", 4)) {
++ ast_log(LOG_WARNING, "Does not contain WAVE\n");
++ return -1;
++ }
++ if (fread(&fmt, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Read failed (fmt)\n");
++ return -1;
++ }
++ if (memcmp(&fmt, "fmt ", 4)) {
++ ast_log(LOG_WARNING, "Does not say fmt\n");
++ return -1;
++ }
++ if (fread(&hsize, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Read failed (formtype)\n");
++ return -1;
++ }
++ if (ltohl(hsize) < 16) {
++ ast_log(LOG_WARNING, "Unexpected header size %d\n", ltohl(hsize));
++ return -1;
++ }
++ if (fread(&format, 1, 2, f) != 2) {
++ ast_log(LOG_WARNING, "Read failed (format)\n");
++ return -1;
++ }
++ if (ltohs(format) != 1) {
++ ast_log(LOG_WARNING, "Not a wav file %d\n", ltohs(format));
++ return -1;
++ }
++ if (fread(&chans, 1, 2, f) != 2) {
++ ast_log(LOG_WARNING, "Read failed (format)\n");
++ return -1;
++ }
++ if (ltohs(chans) != 1) {
++ ast_log(LOG_WARNING, "Not in mono %d\n", ltohs(chans));
++ return -1;
++ }
++ if (fread(&freq, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Read failed (freq)\n");
++ return -1;
++ }
++ if (ltohl(freq) != DEFAULT_SAMPLE_RATE) {
++ ast_log(LOG_WARNING, "Unexpected frequency %d\n", ltohl(freq));
++ return -1;
++ }
++ /* Ignore the byte frequency */
++ if (fread(&bysec, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Read failed (BYTES_PER_SECOND)\n");
++ return -1;
++ }
++ /* Check bytes per sample */
++ if (fread(&bysam, 1, 2, f) != 2) {
++ ast_log(LOG_WARNING, "Read failed (BYTES_PER_SAMPLE)\n");
++ return -1;
++ }
++ if (ltohs(bysam) != 2) {
++ ast_log(LOG_WARNING, "Can only handle 16bits per sample: %d\n", ltohs(bysam));
++ return -1;
++ }
++ if (fread(&bisam, 1, 2, f) != 2) {
++ ast_log(LOG_WARNING, "Read failed (Bits Per Sample): %d\n", ltohs(bisam));
++ return -1;
++ }
++ /* Skip any additional header */
++ if (fseek(f,ltohl(hsize)-16,SEEK_CUR) == -1 ) {
++ ast_log(LOG_WARNING, "Failed to skip remaining header bytes: %d\n", ltohl(hsize)-16 );
++ return -1;
++ }
++ /* Skip any facts and get the first data block */
++ for(;;)
++ {
++ char buf[4];
++
++ /* Begin data chunk */
++ if (fread(&buf, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Read failed (data)\n");
++ return -1;
++ }
++ /* Data has the actual length of data in it */
++ if (fread(&data, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Read failed (data)\n");
++ return -1;
++ }
++ data = ltohl(data);
++ if(memcmp(buf, "data", 4) == 0 )
++ break;
++ if(memcmp(buf, "fact", 4) != 0 ) {
++ ast_log(LOG_WARNING, "Unknown block - not fact or data\n");
++ return -1;
++ }
++ if (fseek(f,data,SEEK_CUR) == -1 ) {
++ ast_log(LOG_WARNING, "Failed to skip fact block: %d\n", data );
++ return -1;
++ }
++ }
++#if 0
++ curpos = lseek(fd, 0, SEEK_CUR);
++ truelength = lseek(fd, 0, SEEK_END);
++ lseek(fd, curpos, SEEK_SET);
++ truelength -= curpos;
++#endif
++ return data;
++}
++
++static int update_header(FILE *f)
++{
++ off_t cur,end;
++ int datalen,filelen,bytes;
++
++ cur = ftello(f);
++ fseek(f, 0, SEEK_END);
++ end = ftello(f);
++ /* data starts 44 bytes in */
++ bytes = end - 44;
++ datalen = htoll(bytes);
++ /* chunk size is bytes of data plus 36 bytes of header */
++ filelen = htoll(36 + bytes);
++
++ if (cur < 0) {
++ ast_log(LOG_WARNING, "Unable to find our position\n");
++ return -1;
++ }
++ if (fseek(f, 4, SEEK_SET)) {
++ ast_log(LOG_WARNING, "Unable to set our position\n");
++ return -1;
++ }
++ if (fwrite(&filelen, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Unable to set write file size\n");
++ return -1;
++ }
++ if (fseek(f, 40, SEEK_SET)) {
++ ast_log(LOG_WARNING, "Unable to set our position\n");
++ return -1;
++ }
++ if (fwrite(&datalen, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Unable to set write datalen\n");
++ return -1;
++ }
++ if (fseeko(f, cur, SEEK_SET)) {
++ ast_log(LOG_WARNING, "Unable to return to position\n");
++ return -1;
++ }
++ return 0;
++}
++
++static int write_header(FILE *f)
++{
++ unsigned int hz=htoll(8000);
++ unsigned int bhz = htoll(16000);
++ unsigned int hs = htoll(16);
++ unsigned short fmt = htols(1);
++ unsigned short chans = htols(1);
++ unsigned short bysam = htols(2);
++ unsigned short bisam = htols(16);
++ unsigned int size = htoll(0);
++ /* Write a wav header, ignoring sizes which will be filled in later */
++ fseek(f,0,SEEK_SET);
++ if (fwrite("RIFF", 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite(&size, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite("WAVEfmt ", 1, 8, f) != 8) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite(&hs, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite(&fmt, 1, 2, f) != 2) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite(&chans, 1, 2, f) != 2) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite(&hz, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite(&bhz, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite(&bysam, 1, 2, f) != 2) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite(&bisam, 1, 2, f) != 2) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite("data", 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ if (fwrite(&size, 1, 4, f) != 4) {
++ ast_log(LOG_WARNING, "Unable to write header\n");
++ return -1;
++ }
++ return 0;
++}
++
++static int wav_open(struct ast_filestream *s)
++{
++ /* 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 wav_desc *tmp = (struct wav_desc *)s->_private;
++ if ((tmp->maxlen = check_header(s->f)) < 0)
++ return -1;
++ return 0;
++}
++
++static int wav_rewrite(struct ast_filestream *s, const 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. */
++
++ if (write_header(s->f))
++ return -1;
++ return 0;
++}
++
++static void wav_close(struct ast_filestream *s)
++{
++ char zero = 0;
++ struct wav_desc *fs = (struct wav_desc *)s->_private;
++ /* Pad to even length */
++ if (fs->bytes & 0x1) {
++ if (!fwrite(&zero, 1, 1, s->f)) {
++ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
++ }
++ }
++}
++
++static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)
++{
++ int res;
++ int samples; /* actual samples read */
++ int x;
++ short *tmp;
++ int bytes = WAV_BUF_SIZE; /* in bytes */
++ off_t here;
++ /* Send a frame from the file to the appropriate channel */
++ struct wav_desc *fs = (struct wav_desc *)s->_private;
++
++ here = ftello(s->f);
++ if (fs->maxlen - here < bytes) /* truncate if necessary */
++ bytes = fs->maxlen - here;
++ if (bytes < 0)
++ bytes = 0;
++/* ast_log(LOG_DEBUG, "here: %d, maxlen: %d, bytes: %d\n", here, s->maxlen, bytes); */
++ s->fr.frametype = AST_FRAME_VOICE;
++ s->fr.subclass = AST_FORMAT_SLINEAR;
++ s->fr.mallocd = 0;
++ AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, bytes);
++
++ if ( (res = fread(s->fr.data, 1, s->fr.datalen, s->f)) <= 0 ) {
++ if (res)
++ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
++ return NULL;
++ }
++ s->fr.datalen = res;
++ s->fr.samples = samples = res / 2;
++
++ tmp = (short *)(s->fr.data);
++#if __BYTE_ORDER == __BIG_ENDIAN
++ /* file format is little endian so we need to swap */
++ for( x = 0; x < samples; x++)
++ tmp[x] = (tmp[x] << 8) | ((tmp[x] & 0xff00) >> 8);
++#endif
++
++ if (fs->needsgain) {
++ for (x=0; x < samples; x++) {
++ if (tmp[x] & ((1 << GAIN) - 1)) {
++ /* If it has data down low, then it's not something we've artificially increased gain
++ on, so we don't need to gain adjust it */
++ fs->needsgain = 0;
++ break;
++ }
++ }
++ if (fs->needsgain) {
++ for (x=0; x < samples; x++)
++ tmp[x] = tmp[x] >> GAIN;
++ }
++ }
++
++ *whennext = samples;
++ return &s->fr;
++}
++
++static int wav_write(struct ast_filestream *fs, struct ast_frame *f)
++{
++ int x;
++ short tmp[8000], *tmpi;
++ float tmpf;
++ struct wav_desc *s = (struct wav_desc *)fs->_private;
++ int res;
++
++ if (f->frametype != AST_FRAME_VOICE) {
++ ast_log(LOG_WARNING, "Asked to write non-voice frame!\n");
++ return -1;
++ }
++ if (f->subclass != AST_FORMAT_SLINEAR) {
++ ast_log(LOG_WARNING, "Asked to write non-SLINEAR frame (%d)!\n", f->subclass);
++ return -1;
++ }
++ if (f->datalen > sizeof(tmp)) {
++ ast_log(LOG_WARNING, "Data length is too long\n");
++ return -1;
++ }
++ if (!f->datalen)
++ return -1;
++
++#if 0
++ printf("Data Length: %d\n", f->datalen);
++#endif
++
++ tmpi = f->data;
++ /* Volume adjust here to accomodate */
++ for (x=0;x<f->datalen/2;x++) {
++ tmpf = ((float)tmpi[x]) * ((float)(1 << GAIN));
++ if (tmpf > 32767.0)
++ tmpf = 32767.0;
++ if (tmpf < -32768.0)
++ tmpf = -32768.0;
++ tmp[x] = tmpf;
++ tmp[x] &= ~((1 << GAIN) - 1);
++
++#if __BYTE_ORDER == __BIG_ENDIAN
++ tmp[x] = (tmp[x] << 8) | ((tmp[x] & 0xff00) >> 8);
++#endif
++
++ }
++ if ((res = fwrite(tmp, 1, f->datalen, fs->f)) != f->datalen ) {
++ ast_log(LOG_WARNING, "Bad write (%d): %s\n", res, strerror(errno));
++ return -1;
++ }
++
++ s->bytes += f->datalen;
++ update_header(fs->f);
++
++ return 0;
++
++}
++
++static int wav_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
++{
++ off_t min, max, cur, offset = 0, samples;
++
++ samples = sample_offset * 2; /* SLINEAR is 16 bits mono, so sample_offset * 2 = bytes */
++ min = 44; /* wav header is 44 bytes */
++ cur = ftello(fs->f);
++ fseeko(fs->f, 0, SEEK_END);
++ max = ftello(fs->f);
++ if (whence == SEEK_SET)
++ offset = samples + min;
++ else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
++ offset = samples + cur;
++ else if (whence == SEEK_END)
++ offset = max - samples;
++ if (whence != SEEK_FORCECUR) {
++ offset = (offset > max)?max:offset;
++ }
++ /* always protect the header space. */
++ offset = (offset < min)?min:offset;
++ return fseeko(fs->f, offset, SEEK_SET);
++}
++
++static int wav_trunc(struct ast_filestream *fs)
++{
++ if (ftruncate(fileno(fs->f), ftello(fs->f)))
++ return -1;
++ return update_header(fs->f);
++}
++
++static off_t wav_tell(struct ast_filestream *fs)
++{
++ off_t offset;
++ offset = ftello(fs->f);
++ /* subtract header size to get samples, then divide by 2 for 16 bit samples */
++ return (offset - 44)/2;
++}
++
++static const struct ast_format wav_f = {
++ .name = "wav",
++ .exts = "wav",
++ .format = AST_FORMAT_SLINEAR,
++ .open = wav_open,
++ .rewrite = wav_rewrite,
++ .write = wav_write,
++ .seek = wav_seek,
++ .trunc = wav_trunc,
++ .tell = wav_tell,
++ .read = wav_read,
++ .close = wav_close,
++ .buf_size = WAV_BUF_SIZE + AST_FRIENDLY_OFFSET,
++ .desc_size = sizeof(struct wav_desc),
++};
++
++static int load_module(void)
++{
++ return ast_format_register(&wav_f);
++}
++
++static int unload_module(void)
++{
++ return ast_format_unregister(wav_f.name);
++}
++
++AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Microsoft WAV format (8000Hz Signed Linear)");
+diff -urN asterisk-1.4.26.3.orig/include/asterisk/file.h asterisk-1.4.26.3/include/asterisk/file.h
+--- asterisk-1.4.26.3.orig/include/asterisk/file.h 2008-11-20 13:06:48.000000000 -0500
++++ asterisk-1.4.26.3/include/asterisk/file.h 2011-09-19 14:24:10.000000000 -0400
+@@ -140,6 +140,7 @@
#endif
};
const char *orig_chan_name;
@@ -31,10 +566,10 @@
};
#define SEEK_FORCECUR 10
-diff -ur asterisk-1.4.44.orig/main/file.c asterisk-1.4.44/main/file.c
---- asterisk-1.4.44.orig/main/file.c 2010-09-11 12:59:20.000000000 -0400
-+++ asterisk-1.4.44/main/file.c 2012-04-06 11:36:12.000000000 -0400
-@@ -335,20 +335,22 @@
+diff -urN asterisk-1.4.26.3.orig/main/file.c asterisk-1.4.26.3/main/file.c
+--- asterisk-1.4.26.3.orig/main/file.c 2009-06-26 17:16:39.000000000 -0400
++++ asterisk-1.4.26.3/main/file.c 2011-09-19 14:24:10.000000000 -0400
+@@ -334,20 +334,22 @@
ast_safe_system(cmd);
}
@@ -61,7 +596,7 @@
ast_module_unref(f->fmt->module);
}
-@@ -1155,6 +1157,10 @@
+@@ -1132,6 +1134,10 @@
}
fs->vfs = NULL;
/* If truncated, we'll be at the beginning; if not truncated, then append */
Modified: branches/s2s/package/asterisk/asterisk-sounds-Makefile.patch
===================================================================
--- branches/s2s/package/asterisk/asterisk-sounds-Makefile.patch 2012-06-18 16:21:44 UTC (rev 5577)
+++ branches/s2s/package/asterisk/asterisk-sounds-Makefile.patch 2012-06-20 16:56:18 UTC (rev 5578)
@@ -1,7 +1,7 @@
-diff -urN asterisk-1.4.44.orig/sounds/Makefile asterisk-1.4.44/sounds/Makefile
---- asterisk-1.4.44.orig/sounds/Makefile 2010-10-18 17:47:25.000000000 -0400
-+++ asterisk-1.4.44/sounds/Makefile 2012-04-06 11:39:08.000000000 -0400
-@@ -82,7 +82,7 @@
+diff -ur asterisk-1.4.26.1.orig/sounds/Makefile asterisk-1.4.26.1/sounds/Makefile
+--- asterisk-1.4.26.1.orig/sounds/Makefile 2009-03-26 18:17:32.000000000 -0400
++++ asterisk-1.4.26.1/sounds/Makefile 2009-08-11 12:56:03.000000000 -0400
+@@ -80,7 +80,7 @@
if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
@@ -9,17 +9,8 @@
+ (cd $(SOUNDS_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@
- $(SOUNDS_DIR)/.asterisk-core-sounds-en_AU-%: have_download
-@@ -90,7 +90,7 @@
- if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
- if test ! -f $${PACKAGE}; then exit 1; fi; \
- rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
-- (cd $(SOUNDS_DIR)/en_AU; cat $(PWD)/$${PACKAGE} | gzip -d | tar xof -) && \
-+ (cd $(SOUNDS_DIR)/en_AU; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
- touch $@
-
$(SOUNDS_DIR)/.asterisk-core-sounds-es-%: have_download
-@@ -98,7 +98,7 @@
+@@ -88,7 +88,7 @@
if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
@@ -28,7 +19,7 @@
touch $@
$(SOUNDS_DIR)/.asterisk-core-sounds-fr-%: have_download
-@@ -106,7 +106,7 @@
+@@ -96,7 +96,7 @@
if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
@@ -37,7 +28,7 @@
touch $@
$(SOUNDS_DIR)/.asterisk-extra-sounds-en-%: have_download
-@@ -114,7 +114,7 @@
+@@ -104,7 +104,7 @@
if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \
@@ -46,7 +37,7 @@
touch $@
$(SOUNDS_DIR)/.asterisk-extra-sounds-es-%: have_download
-@@ -122,7 +122,7 @@
+@@ -112,7 +112,7 @@
if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \
@@ -55,7 +46,7 @@
touch $@
$(SOUNDS_DIR)/.asterisk-extra-sounds-fr-%: have_download
-@@ -130,7 +130,7 @@
+@@ -120,14 +120,14 @@
if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \
@@ -64,10 +55,9 @@
touch $@
$(MOH_DIR)/.asterisk-moh-%: have_download
-@@ -138,7 +138,7 @@
+ @PACKAGE=$(subst $(MOH_DIR)/.asterisk,asterisk,$@).tar.gz; \
if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
- rm -f $(subst -$(MOH_VERSION),,$@)-* && \
- (cd $(MOH_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xof -) && \
+ (cd $(MOH_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@
Modified: branches/s2s/package/asterisk/asterisk.mk
===================================================================
--- branches/s2s/package/asterisk/asterisk.mk 2012-06-18 16:21:44 UTC (rev 5577)
+++ branches/s2s/package/asterisk/asterisk.mk 2012-06-20 16:56:18 UTC (rev 5578)
@@ -3,7 +3,7 @@
# asterisk
#
##############################################################
-ASTERISK_VERSION := 1.4.44
+ASTERISK_VERSION := 1.4.26.3
ASTERISK_SOURCE := asterisk-$(ASTERISK_VERSION).tar.gz
ASTERISK_SITE := http://downloads.digium.com/pub/asterisk/releases
ASTERISK_DIR := $(BUILD_DIR)/asterisk-$(ASTERISK_VERSION)
Modified: branches/s2s/package/asterisk/sounds.xml
===================================================================
--- branches/s2s/package/asterisk/sounds.xml 2012-06-18 16:21:44 UTC (rev 5577)
+++ branches/s2s/package/asterisk/sounds.xml 2012-06-20 16:56:18 UTC (rev 5578)
@@ -37,60 +37,34 @@
</member>
<member name="CORE-SOUNDS-FR-G722" displayname="French, G.722 format">
</member>
- <member name="CORE-SOUNDS-EN_AU-WAV" displayname="English (Australian Accent), WAV format">
- </member>
- <member name="CORE-SOUNDS-EN_AU-ULAW" displayname="English (Australian Accent), mu-Law format">
- </member>
- <member name="CORE-SOUNDS-EN_AU-ALAW" displayname="English (Australian Accent), a-Law format">
- </member>
- <member name="CORE-SOUNDS-EN_AU-GSM" displayname="English (Australian Accent), GSM format">
- </member>
- <member name="CORE-SOUNDS-EN_AU-G729" displayname="English (Australian Accent), G.729 format">
- </member>
- <member name="CORE-SOUNDS-EN_AU-G722" displayname="English (Australian Accent), G.722 format">
- </member>
</category>
<category name="MENUSELECT_MOH" displayname="Music On Hold File Packages" positive_output="yes">
- <member name="MOH-OPSOUND-WAV" displayname="opsound.org Music On Hold Files, WAV format" >
+ <member name="MOH-FREEPLAY-WAV" displayname="FreePlay Music On Hold Files, WAV format" >
</member>
- <member name="MOH-OPSOUND-ULAW" displayname="opsound.org Music On Hold Files, mu-Law format" >
+ <member name="MOH-FREEPLAY-ULAW" displayname="FreePlay Music On Hold Files, mu-Law format" >
<defaultenabled>yes</defaultenabled>
</member>
- <member name="MOH-OPSOUND-ALAW" displayname="opsound.org Music On Hold Files, a-Law format" >
+ <member name="MOH-FREEPLAY-ALAW" displayname="FreePlay Music On Hold Files, a-Law format" >
</member>
- <member name="MOH-OPSOUND-GSM" displayname="opsound.org Music On Hold Files, GSM format" >
+ <member name="MOH-FREEPLAY-GSM" displayname="FreePlay Music On Hold Files, GSM format" >
</member>
- <member name="MOH-OPSOUND-G729" displayname="opsound.org Music On Hold Files, G.729 format" >
+ <member name="MOH-FREEPLAY-G729" displayname="FreePlay Music On Hold Files, G.729 format" >
<defaultenabled>yes</defaultenabled>
</member>
- <member name="MOH-OPSOUND-G722" displayname="opsound.org Music On Hold Files, G.722 format" >
+ <member name="MOH-FREEPLAY-G722" displayname="FreePlay Music On Hold Files, G.722 format" >
</member>
- </category>
+ </category>
<category name="MENUSELECT_EXTRA_SOUNDS" displayname="Extras Sound Packages" positive_output="yes">
<member name="EXTRA-SOUNDS-EN-WAV" displayname="English, WAV format">
</member>
<member name="EXTRA-SOUNDS-EN-ULAW" displayname="English, mu-Law format">
- <defaultenabled>yes</defaultenabled>
</member>
<member name="EXTRA-SOUNDS-EN-ALAW" displayname="English, a-Law format">
</member>
<member name="EXTRA-SOUNDS-EN-GSM" displayname="English, GSM format" >
</member>
<member name="EXTRA-SOUNDS-EN-G729" displayname="English, G.729 format">
- <defaultenabled>yes</defaultenabled>
</member>
<member name="EXTRA-SOUNDS-EN-G722" displayname="English, G.722 format">
</member>
- <member name="EXTRA-SOUNDS-FR-WAV" displayname="French, WAV format">
- </member>
- <member name="EXTRA-SOUNDS-FR-ULAW" displayname="French, mu-Law format">
- </member>
- <member name="EXTRA-SOUNDS-FR-ALAW" displayname="French, a-Law format">
- </member>
- <member name="EXTRA-SOUNDS-FR-GSM" displayname="French, GSM format" >
- </member>
- <member name="EXTRA-SOUNDS-FR-G729" displayname="French, G.729 format">
- </member>
- <member name="EXTRA-SOUNDS-FR-G722" displayname="French, G.722 format">
- </member>
</category>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|