From e0d4e807e849edd9fbbdb7fc9b010fd4e3d85e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 16 Dec 2011 08:44:26 +0200 Subject: main/asterisk: upgrade to 10.0.0 ... and delete the testing version. --- main/asterisk/APKBUILD | 16 +- main/asterisk/ASTERISK-18976.patch | 142 ++++++++++++ main/asterisk/ASTERISK-18977.patch | 63 ++++++ main/asterisk/ASTERISK-18994.patch | 28 +++ main/asterisk/ASTERISK-18995.patch | 358 +++++++++++++++++++++++++++++++ testing/asterisk/100-uclibc-daemon.patch | 44 ---- testing/asterisk/101-caps-uclibc.patch | 17 -- testing/asterisk/102-gsm-pic.patch | 54 ----- testing/asterisk/400-bug-227.patch | 15 -- testing/asterisk/APKBUILD | 176 --------------- testing/asterisk/ASTERISK-18976.patch | 142 ------------ testing/asterisk/ASTERISK-18977.patch | 63 ------ testing/asterisk/ASTERISK-18994.patch | 28 --- testing/asterisk/ASTERISK-18995.patch | 358 ------------------------------- testing/asterisk/asterisk.confd | 91 -------- testing/asterisk/asterisk.initd | 251 ---------------------- testing/asterisk/asterisk.logrotate | 17 -- testing/asterisk/asterisk.post-install | 11 - testing/asterisk/asterisk.pre-install | 12 -- testing/asterisk/asterisk.pre-upgrade | 12 -- 20 files changed, 603 insertions(+), 1295 deletions(-) create mode 100644 main/asterisk/ASTERISK-18976.patch create mode 100644 main/asterisk/ASTERISK-18977.patch create mode 100644 main/asterisk/ASTERISK-18994.patch create mode 100644 main/asterisk/ASTERISK-18995.patch delete mode 100644 testing/asterisk/100-uclibc-daemon.patch delete mode 100644 testing/asterisk/101-caps-uclibc.patch delete mode 100644 testing/asterisk/102-gsm-pic.patch delete mode 100644 testing/asterisk/400-bug-227.patch delete mode 100644 testing/asterisk/APKBUILD delete mode 100644 testing/asterisk/ASTERISK-18976.patch delete mode 100644 testing/asterisk/ASTERISK-18977.patch delete mode 100644 testing/asterisk/ASTERISK-18994.patch delete mode 100644 testing/asterisk/ASTERISK-18995.patch delete mode 100644 testing/asterisk/asterisk.confd delete mode 100644 testing/asterisk/asterisk.initd delete mode 100644 testing/asterisk/asterisk.logrotate delete mode 100644 testing/asterisk/asterisk.post-install delete mode 100644 testing/asterisk/asterisk.pre-install delete mode 100644 testing/asterisk/asterisk.pre-upgrade diff --git a/main/asterisk/APKBUILD b/main/asterisk/APKBUILD index db6362ac99..b6bb6e6b4b 100644 --- a/main/asterisk/APKBUILD +++ b/main/asterisk/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Timo Teras # Maintainer: Timo Teras pkgname=asterisk -pkgver=1.8.8.0_rc5 +pkgver=10.0.0 pkgrel=0 pkgdesc="Asterisk: A Module Open Source PBX System" url="http://www.asterisk.org/" @@ -11,7 +11,7 @@ depends= makedepends="autoconf automake libtool ncurses-dev popt-dev newt-dev zlib-dev postgresql-dev unixodbc-dev dahdi-tools-dev libpri-dev tar freetds-dev openssl-dev lua-dev alsa-lib-dev spandsp-dev tiff-dev - libresample sqlite-dev wget speex-dev" + libresample sqlite-dev wget speex-dev libogg-dev" install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-install" subpackages="$pkgname-dev $pkgname-doc $pkgname-pgsql $pkgname-odbc $pkgname-tds $pkgname-fax $pkgname-sample-config:sample $pkgname-sqlite @@ -20,6 +20,10 @@ source="http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-$ 100-uclibc-daemon.patch 101-caps-uclibc.patch 400-bug-227.patch + ASTERISK-18976.patch + ASTERISK-18977.patch + ASTERISK-18994.patch + ASTERISK-18995.patch asterisk.initd asterisk.confd asterisk.logrotate" @@ -28,7 +32,7 @@ _builddir="$srcdir/$pkgname-${pkgver/_/-}" prepare() { cd "$_builddir" - for i in ../[1-9]*.patch; do + for i in ../[1-9A]*.patch; do msg "Apply $i" patch -p1 < $i || return 1 done @@ -159,10 +163,14 @@ sound_en() { _move_dir var/lib/asterisk/sounds/en } -md5sums="737c309d970112b39c44ea246e4c9b21 asterisk-1.8.8.0-rc5.tar.gz +md5sums="6b52336b9dc01eeecb9de2eb2818e127 asterisk-10.0.0.tar.gz b00c9d98ce2ad445501248a197c6e436 100-uclibc-daemon.patch 6e1129e30c4fd2c25c86c81685a485a9 101-caps-uclibc.patch 79e9634b5054bceb3b8dc246654bb243 400-bug-227.patch +da5a3c500192dee4275aae5235d25f97 ASTERISK-18976.patch +1ddadef41aa7120e168738b6f3ed8917 ASTERISK-18977.patch +0af5e797f0a99d0f81f95e3710baf5b6 ASTERISK-18994.patch +bc6713f5434e07b79d3afdd155461d72 ASTERISK-18995.patch 0ce3219e05f55af884a7dc6b99c2b276 asterisk.initd ed31d7ba37bcf8b0346dcf8593c395f0 asterisk.confd 3e65172275684373e1a25c8a11224411 asterisk.logrotate" diff --git a/main/asterisk/ASTERISK-18976.patch b/main/asterisk/ASTERISK-18976.patch new file mode 100644 index 0000000000..36c613ff4f --- /dev/null +++ b/main/asterisk/ASTERISK-18976.patch @@ -0,0 +1,142 @@ +--- a/pbx/pbx_lua.c.orig 2011-12-08 08:28:31.000000000 +0200 ++++ b/pbx/pbx_lua.c 2011-12-08 08:54:22.000000000 +0200 +@@ -94,7 +94,6 @@ + static void lua_create_application_metatable(lua_State *L); + static void lua_create_autoservice_functions(lua_State *L); + static void lua_create_hangup_function(lua_State *L); +-static void lua_detect_goto(lua_State *L); + static void lua_concat_args(lua_State *L, int start, int nargs); + + static void lua_state_destroy(void *data); +@@ -213,19 +212,10 @@ + chan = lua_touserdata(L, -1); + lua_pop(L, 1); + ++ context = ast_strdupa(chan->context); ++ exten = ast_strdupa(chan->exten); ++ priority = chan->priority; + +- lua_getfield(L, LUA_REGISTRYINDEX, "context"); +- context = ast_strdupa(lua_tostring(L, -1)); +- lua_pop(L, 1); +- +- lua_getfield(L, LUA_REGISTRYINDEX, "exten"); +- exten = ast_strdupa(lua_tostring(L, -1)); +- lua_pop(L, 1); +- +- lua_getfield(L, LUA_REGISTRYINDEX, "priority"); +- priority = lua_tointeger(L, -1); +- lua_pop(L, 1); +- + lua_concat_args(L, 2, nargs); + data = lua_tostring(L, -1); + +@@ -256,75 +246,51 @@ + return lua_error(L); + } + +- lua_detect_goto(L); +- +- return 0; +-} +- +-/*! +- * \brief Detect if a Goto or other dialplan jump has been executed and return +- * control to the pbx engine. +- */ +-static void lua_detect_goto(lua_State *L) +-{ +- struct ast_channel *chan; +- +- lua_getfield(L, LUA_REGISTRYINDEX, "channel"); +- chan = lua_touserdata(L, -1); +- lua_pop(L, 1); +- +- /* check context */ +- lua_getfield(L, LUA_REGISTRYINDEX, "context"); +- lua_pushstring(L, chan->context); +- if (!lua_equal(L, -1, -2)) { ++ if (strcmp(context, chan->context)) { ++ lua_pushstring(L, context); ++ lua_pushstring(L, chan->context); + lua_pushliteral(L, "context"); +- goto e_goto_detected; +- } +- lua_pop(L, 2); +- +- /* check exten */ +- lua_getfield(L, LUA_REGISTRYINDEX, "exten"); +- lua_pushstring(L, chan->exten); +- if (!lua_equal(L, -1, -2)) { ++ } else if (strcmp(exten, chan->exten)) { ++ lua_pushstring(L, exten); ++ lua_pushstring(L, chan->exten); + lua_pushliteral(L, "exten"); +- goto e_goto_detected; +- } +- lua_pop(L, 2); +- +- /* check priority */ +- lua_getfield(L, LUA_REGISTRYINDEX, "priority"); +- lua_pushinteger(L, chan->priority); +- if (!lua_equal(L, -1, -2)) { ++ } else if (priority != chan->priority) { ++ lua_pushinteger(L, priority); ++ lua_pushinteger(L, chan->priority); + lua_pushliteral(L, "priority"); +- goto e_goto_detected; ++ } else { ++ /* no goto - restore the original position back ++ * to lua state, in case this was a recursive dialplan ++ * call (a dialplan application re-entering dialplan) */ ++ lua_update_registry(L, context, exten, priority); ++ return 0; + } +- lua_pop(L, 2); +- return; +- +-e_goto_detected: +- /* format our debug message */ +- lua_insert(L, -3); + +- lua_pushliteral(L, " changed from "); ++ /* goto detected - construct error message */ + lua_insert(L, -3); +- +- lua_pushliteral(L, " to "); +- lua_insert(L, -2); +- +- lua_concat(L, 5); +- +- ast_debug(2, "Goto detected: %s\n", lua_tostring(L, -1)); +- lua_pop(L, 1); +- +- /* let the lua engine know it needs to return control to the pbx */ +- lua_pushinteger(L, LUA_GOTO_DETECTED); ++ ++ lua_pushliteral(L, " changed from "); ++ lua_insert(L, -3); ++ ++ lua_pushliteral(L, " to "); ++ lua_insert(L, -2); ++ ++ lua_concat(L, 5); ++ ++ ast_debug(2, "Goto detected: %s\n", lua_tostring(L, -1)); ++ lua_pop(L, 1); ++ ++ /* let the lua engine know it needs to return control to the pbx */ ++ lua_pushinteger(L, LUA_GOTO_DETECTED); + lua_error(L); ++ ++ return 0; + } + + /*! + * \brief [lua_CFunction] Used to get the value of a variable or dialplan + * function (for access from lua, don't call directly) +- * ++ * + * The value of the variable or function is returned. This function is the + * 'get()' function in the following example as would be seen in + * extensions.lua. diff --git a/main/asterisk/ASTERISK-18977.patch b/main/asterisk/ASTERISK-18977.patch new file mode 100644 index 0000000000..fffce032cd --- /dev/null +++ b/main/asterisk/ASTERISK-18977.patch @@ -0,0 +1,63 @@ +--- a/res/res_musiconhold.c.orig ++++ b/res/res_musiconhold.c +@@ -158,6 +158,7 @@ + char name[MAX_MUSICCLASS]; + struct ast_format origwfmt; + struct ast_format mohwfmt; ++ int announcement; + int samples; + int sample_queue; + int pos; +@@ -173,6 +174,7 @@ + #define MOH_SORTALPHA (1 << 4) + + #define MOH_CACHERTCLASSES (1 << 5) /*!< Should we use a separate instance of MOH for each user or not */ ++#define MOH_ANNOUNCEMENT (1 << 6) + + /* Custom astobj2 flag */ + #define MOH_NOTDELETED (1 << 30) /*!< Find only records that aren't deleted? */ +@@ -183,6 +185,7 @@ + char name[MAX_MUSICCLASS]; + char dir[256]; + char args[256]; ++ char announcement[80]; + char mode[80]; + char digit; + /*! A dynamically sized array to hold the list of filenames in "files" mode */ +@@ -278,6 +281,7 @@ + } + + state->save_pos = state->pos; ++ state->announcement = 0; + + state->class = mohclass_unref(state->class, "Unreffing channel's music class upon deactivation of generator"); + } +@@ -293,6 +297,16 @@ + chan->stream = NULL; + } + ++ if (ast_test_flag(state->class, MOH_ANNOUNCEMENT) && state->announcement == 0) { ++ state->announcement = 1; ++ if (ast_openstream_full(chan, state->class->announcement, chan->language, 1)) { ++ ast_debug(1, "%s Opened announcement '%s'\n", chan->name, state->class->announcement); ++ return 0; ++ } ++ } else { ++ state->announcement = 0; ++ } ++ + if (!state->class->total_files) { + ast_log(LOG_WARNING, "No files available for class '%s'\n", state->class->name); + return -1; +@@ -1731,7 +1745,10 @@ + ast_copy_string(class->dir, var->value, sizeof(class->dir)); + else if (!strcasecmp(var->name, "application")) + ast_copy_string(class->args, var->value, sizeof(class->args)); +- else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value))) ++ else if (!strcasecmp(var->name, "announcement")) { ++ ast_copy_string(class->announcement, var->value, sizeof(class->announcement)); ++ ast_set_flag(class, MOH_ANNOUNCEMENT); ++ } else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value))) + class->digit = *var->value; + else if (!strcasecmp(var->name, "random")) + ast_set2_flag(class, ast_true(var->value), MOH_RANDOMIZE); diff --git a/main/asterisk/ASTERISK-18994.patch b/main/asterisk/ASTERISK-18994.patch new file mode 100644 index 0000000000..702e91375d --- /dev/null +++ b/main/asterisk/ASTERISK-18994.patch @@ -0,0 +1,28 @@ +--- a/main/file.c.orig 2011-12-09 11:32:05.000000000 +0200 ++++ b/main/file.c 2011-12-09 11:35:22.000000000 +0200 +@@ -1005,6 +1005,7 @@ + struct ast_filestream *fs; + struct ast_filestream *vfs=NULL; + char fmt[256]; ++ off_t pos; + int seekattempt; + int res; + +@@ -1017,12 +1018,14 @@ + /* check to see if there is any data present (not a zero length file), + * done this way because there is no where for ast_openstream_full to + * return the file had no data. */ +- seekattempt = fseek(fs->f, -1, SEEK_END); ++ pos = ftello(fs->f); ++ seekattempt = fseeko(fs->f, -1, SEEK_END); + if (seekattempt && errno == EINVAL) { + /* Zero-length file, as opposed to a pipe */ + return 0; +- } else { +- ast_seekstream(fs, 0, SEEK_SET); ++ } ++ if (seekattempt == 0) { ++ fseeko(fs->f, pos, SEEK_SET); + } + + vfs = ast_openvstream(chan, filename, preflang); diff --git a/main/asterisk/ASTERISK-18995.patch b/main/asterisk/ASTERISK-18995.patch new file mode 100644 index 0000000000..cd144847be --- /dev/null +++ b/main/asterisk/ASTERISK-18995.patch @@ -0,0 +1,358 @@ +--- /dev/null 2011-11-29 09:02:40.279581283 +0200 ++++ b/formats/format_ogg_speex.c 2011-12-08 15:57:12.000000000 +0200 +@@ -0,0 +1,355 @@ ++/* ++ * Asterisk -- An open source telephony toolkit. ++ * ++ * Copyright (C) 2011, Timo Teräs ++ * ++ * 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 OGG/Speex streams. ++ * \arg File name extension: spx ++ * \ingroup formats ++ */ ++ ++/*** MODULEINFO ++ speex ++ ogg ++ extended ++ ***/ ++ ++#include "asterisk.h" ++ ++ASTERISK_FILE_VERSION(__FILE__, "$Revision$") ++ ++#include "asterisk/mod_format.h" ++#include "asterisk/module.h" ++ ++#include ++#include ++ ++#define BLOCK_SIZE 4096 /* buffer size for feeding OGG routines */ ++#define BUF_SIZE 200 ++ ++struct speex_desc { /* format specific parameters */ ++ /* structures for handling the Ogg container */ ++ ogg_sync_state oy; ++ ogg_stream_state os; ++ ogg_page og; ++ ogg_packet op; ++ ++ int format_id; ++ int serialno; ++ ++ /*! \brief Indicates whether an End of Stream condition has been detected. */ ++ int eos; ++}; ++ ++static int read_packet(struct ast_filestream *fs) ++{ ++ struct speex_desc *s = (struct speex_desc *)fs->_private; ++ char *buffer; ++ int result; ++ size_t bytes; ++ ++ while (1) { ++ /* Get one packet */ ++ result = ogg_stream_packetout(&s->os, &s->op); ++ if (result > 0) { ++ if (s->op.bytes>=5 && !memcmp(s->op.packet, "Speex", 5)) ++ s->serialno = s->os.serialno; ++ if (s->serialno == -1 || s->os.serialno != s->serialno) ++ continue; ++ return 0; ++ } ++ ++ if (result < 0) ++ ast_log(LOG_WARNING, ++ "Corrupt or missing data at this page position; continuing...\n"); ++ ++ /* No more packets left in the current page... */ ++ if (s->eos) { ++ /* No more pages left in the stream */ ++ return -1; ++ } ++ ++ while (!s->eos) { ++ /* See if OGG has any pages in it's internal buffers */ ++ result = ogg_sync_pageout(&s->oy, &s->og); ++ if (result > 0) { ++ /* Read all streams. */ ++ if (ogg_page_serialno(&s->og) != s->os.serialno) ++ ogg_stream_reset_serialno(&s->os, ogg_page_serialno(&s->og)); ++ /* Yes, OGG has more pages in it's internal buffers, ++ add the page to the stream state */ ++ result = ogg_stream_pagein(&s->os, &s->og); ++ if (result == 0) { ++ /* Yes, got a new,valid page */ ++ if (ogg_page_eos(&s->og) && ++ ogg_page_serialno(&s->og) == s->serialno) ++ s->eos = 1; ++ break; ++ } ++ ast_log(LOG_WARNING, ++ "Invalid page in the bitstream; continuing...\n"); ++ } ++ ++ if (result < 0) ++ ast_log(LOG_WARNING, ++ "Corrupt or missing data in bitstream; continuing...\n"); ++ ++ /* No, we need to read more data from the file descrptor */ ++ /* get a buffer from OGG to read the data into */ ++ buffer = ogg_sync_buffer(&s->oy, BLOCK_SIZE); ++ bytes = fread(buffer, 1, BLOCK_SIZE, fs->f); ++ ogg_sync_wrote(&s->oy, bytes); ++ if (bytes == 0) ++ s->eos = 1; ++ } ++ } ++} ++ ++/*! ++ * \brief Create a new OGG/Speex filestream and set it up for reading. ++ * \param fs File that points to on disk storage of the OGG/Speex data. ++ * \param expected_rate The expected Speex format (sampling rate). ++ * \return The new filestream. ++ */ ++static int ogg_speex_open(struct ast_filestream *fs, int format_id, int expected_rate) ++{ ++ char *buffer; ++ size_t bytes; ++ struct speex_desc *s = (struct speex_desc *)fs->_private; ++ SpeexHeader *hdr = NULL; ++ int i, result; ++ ++ s->format_id = format_id; ++ s->serialno = -1; ++ ogg_sync_init(&s->oy); ++ ++ buffer = ogg_sync_buffer(&s->oy, BLOCK_SIZE); ++ bytes = fread(buffer, 1, BLOCK_SIZE, fs->f); ++ ogg_sync_wrote(&s->oy, bytes); ++ ++ result = ogg_sync_pageout(&s->oy, &s->og); ++ if (result != 1) { ++ if(bytes < BLOCK_SIZE) { ++ ast_log(LOG_ERROR, "Run out of data...\n"); ++ } else { ++ ast_log(LOG_ERROR, "Input does not appear to be an Ogg bitstream.\n"); ++ } ++ ogg_sync_clear(&s->oy); ++ return -1; ++ } ++ ++ ogg_stream_init(&s->os, ogg_page_serialno(&s->og)); ++ if (ogg_stream_pagein(&s->os, &s->og) < 0) { ++ ast_log(LOG_ERROR, "Error reading first page of Ogg bitstream data.\n"); ++ goto error; ++ } ++ ++ if (read_packet(fs) < 0) { ++ ast_log(LOG_ERROR, "Error reading initial header packet.\n"); ++ goto error; ++ } ++ ++ hdr = speex_packet_to_header((char*)s->op.packet, s->op.bytes); ++ if (memcmp(hdr->speex_string, "Speex ", 8)) { ++ ast_log(LOG_ERROR, "OGG container does not contain Speex audio!\n"); ++ goto error; ++ } ++ if (hdr->frames_per_packet != 1) { ++ ast_log(LOG_ERROR, "Only one frame-per-packet OGG/Speex files are currently supported!\n"); ++ goto error; ++ } ++ if (hdr->nb_channels != 1) { ++ ast_log(LOG_ERROR, "Only monophonic OGG/Speex files are currently supported!\n"); ++ goto error; ++ } ++ if (hdr->rate != expected_rate) { ++ ast_log(LOG_ERROR, "Unexpected sampling rate (%d != %d)!\n", ++ hdr->rate, expected_rate); ++ goto error; ++ } ++ ++ /* this packet is the comment */ ++ if (read_packet(fs) < 0) { ++ ast_log(LOG_ERROR, "Error reading comment packet.\n"); ++ goto error; ++ } ++ for (i = 0; i < hdr->extra_headers; i++) { ++ if (read_packet(fs) < 0) { ++ ast_log(LOG_ERROR, "Error reading extra header packet %d.\n", i+1); ++ goto error; ++ } ++ } ++ free(hdr); ++ ++ return 0; ++error: ++ if (hdr) ++ free(hdr); ++ ogg_stream_clear(&s->os); ++ ogg_sync_clear(&s->oy); ++ return -1; ++} ++ ++/*! ++ * \brief Close a OGG/Speex filestream. ++ * \param fs A OGG/Speex filestream. ++ */ ++static void ogg_speex_close(struct ast_filestream *fs) ++{ ++ struct speex_desc *s = (struct speex_desc *)fs->_private; ++ ++ ogg_stream_clear(&s->os); ++ ogg_sync_clear(&s->oy); ++} ++ ++/*! ++ * \brief Read a frame full of audio data from the filestream. ++ * \param fs The filestream. ++ * \param whennext Number of sample times to schedule the next call. ++ * \return A pointer to a frame containing audio data or NULL ifthere is no more audio data. ++ */ ++static struct ast_frame *ogg_speex_read(struct ast_filestream *fs, ++ int *whennext) ++{ ++ struct speex_desc *s = (struct speex_desc *)fs->_private; ++ ++ if (read_packet(fs) < 0) ++ return NULL; ++ ++ fs->fr.frametype = AST_FRAME_VOICE; ++ ast_format_set(&fs->fr.subclass.format, s->format_id, 0); ++ fs->fr.mallocd = 0; ++ AST_FRAME_SET_BUFFER(&fs->fr, fs->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); ++ memcpy(fs->fr.data.ptr, s->op.packet, s->op.bytes); ++ fs->fr.datalen = s->op.bytes; ++ fs->fr.samples = *whennext = ast_codec_get_samples(&fs->fr); ++ ++ return &fs->fr; ++} ++ ++/*! ++ * \brief Trucate an OGG/Speex filestream. ++ * \param s The filestream to truncate. ++ * \return 0 on success, -1 on failure. ++ */ ++ ++static int ogg_speex_trunc(struct ast_filestream *s) ++{ ++ ast_log(LOG_WARNING, "Truncation is not supported on OGG/Speex streams!\n"); ++ return -1; ++} ++ ++/*! ++ * \brief Seek to a specific position in an OGG/Speex filestream. ++ * \param s The filestream to truncate. ++ * \param sample_offset New position for the filestream, measured in 8KHz samples. ++ * \param whence Location to measure ++ * \return 0 on success, -1 on failure. ++ */ ++static int ogg_speex_seek(struct ast_filestream *s, off_t sample_offset, int whence) ++{ ++ ast_log(LOG_WARNING, "Seeking is not supported on OGG/Speex streams!\n"); ++ return -1; ++} ++ ++static off_t ogg_speex_tell(struct ast_filestream *s) ++{ ++ ast_log(LOG_WARNING, "Telling is not supported on OGG/Speex streams!\n"); ++ return -1; ++} ++ ++static int ogg_speex_open_nb(struct ast_filestream *fs) ++{ ++ return ogg_speex_open(fs, AST_FORMAT_SPEEX, 8000); ++} ++ ++static struct ast_format_def speex_f = { ++ .name = "ogg_speex", ++ .exts = "spx", ++ .open = ogg_speex_open_nb, ++ .seek = ogg_speex_seek, ++ .trunc = ogg_speex_trunc, ++ .tell = ogg_speex_tell, ++ .read = ogg_speex_read, ++ .close = ogg_speex_close, ++ .buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET, ++ .desc_size = sizeof(struct speex_desc), ++}; ++ ++static int ogg_speex_open_wb(struct ast_filestream *fs) ++{ ++ return ogg_speex_open(fs, AST_FORMAT_SPEEX16, 16000); ++} ++ ++static struct ast_format_def speex16_f = { ++ .name = "ogg_speex16", ++ .exts = "spx16", ++ .open = ogg_speex_open_wb, ++ .seek = ogg_speex_seek, ++ .trunc = ogg_speex_trunc, ++ .tell = ogg_speex_tell, ++ .read = ogg_speex_read, ++ .close = ogg_speex_close, ++ .buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET, ++ .desc_size = sizeof(struct speex_desc), ++}; ++ ++static int ogg_speex_open_uwb(struct ast_filestream *fs) ++{ ++ return ogg_speex_open(fs, AST_FORMAT_SPEEX32, 32000); ++} ++ ++static struct ast_format_def speex32_f = { ++ .name = "ogg_speex32", ++ .exts = "spx32", ++ .open = ogg_speex_open_uwb, ++ .seek = ogg_speex_seek, ++ .trunc = ogg_speex_trunc, ++ .tell = ogg_speex_tell, ++ .read = ogg_speex_read, ++ .close = ogg_speex_close, ++ .buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET, ++ .desc_size = sizeof(struct speex_desc), ++}; ++ ++static int load_module(void) ++{ ++ ast_format_set(&speex_f.format, AST_FORMAT_SPEEX, 0); ++ ast_format_set(&speex16_f.format, AST_FORMAT_SPEEX16, 0); ++ ast_format_set(&speex32_f.format, AST_FORMAT_SPEEX32, 0); ++ ++ if (ast_format_def_register(&speex_f) || ++ ast_format_def_register(&speex16_f) || ++ ast_format_def_register(&speex32_f)) ++ return AST_MODULE_LOAD_FAILURE; ++ ++ return AST_MODULE_LOAD_SUCCESS; ++} ++ ++static int unload_module(void) ++{ ++ int res = 0; ++ res |= ast_format_def_unregister(speex_f.name); ++ res |= ast_format_def_unregister(speex16_f.name); ++ res |= ast_format_def_unregister(speex32_f.name); ++ return res; ++} ++ ++AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "OGG/Speex audio", ++ .load = load_module, ++ .unload = unload_module, ++ .load_pri = AST_MODPRI_APP_DEPEND ++); diff --git a/testing/asterisk/100-uclibc-daemon.patch b/testing/asterisk/100-uclibc-daemon.patch deleted file mode 100644 index 4956791d4d..0000000000 --- a/testing/asterisk/100-uclibc-daemon.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -Nru asterisk-1.6.1-beta4.org/main/asterisk.c asterisk-1.6.1-beta4/main/asterisk.c ---- asterisk-1.6.1-beta4.org/main/asterisk.c 2008-12-12 23:05:58.000000000 +0100 -+++ asterisk-1.6.1-beta4/main/asterisk.c 2008-12-23 15:28:21.000000000 +0100 -@@ -3295,9 +3295,40 @@ - #if HAVE_WORKING_FORK - if (ast_opt_always_fork || !ast_opt_no_fork) { - #ifndef HAVE_SBIN_LAUNCHD -+#ifndef __UCLIBC__ - if (daemon(1, 0) < 0) { - ast_log(LOG_ERROR, "daemon() failed: %s\n", strerror(errno)); - } -+#else -+ /* -+ * workaround for uClibc-0.9.29 mipsel bug: -+ * recursive mutexes do not work if uClibc daemon() function has been called, -+ * if parent thread locks a mutex -+ * the child thread cannot acquire a lock with the same name -+ * (same code works if daemon() is not called) -+ * but duplication of uClibc daemon.c code in here does work. -+ */ -+ int fd; -+ switch (fork()) { -+ case -1: -+ exit(1); -+ case 0: -+ break; -+ default: -+ _exit(0); -+ } -+ if (setsid() == -1) -+ exit(1); -+ if (fork()) -+ _exit(0); -+ if ((fd = open("/dev/null", O_RDWR, 0)) != -1) { -+ dup2(fd, STDIN_FILENO); -+ dup2(fd, STDOUT_FILENO); -+ dup2(fd, STDERR_FILENO); -+ if (fd > 2) -+ close(fd); -+ } -+#endif - ast_mainpid = getpid(); - /* Blindly re-write pid file since we are forking */ - unlink(ast_config_AST_PID); diff --git a/testing/asterisk/101-caps-uclibc.patch b/testing/asterisk/101-caps-uclibc.patch deleted file mode 100644 index bb32d1ece1..0000000000 --- a/testing/asterisk/101-caps-uclibc.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- asterisk-1.6.0.18/configure.ac.orig Mon Oct 26 23:13:28 2009 -+++ asterisk-1.6.0.18/configure.ac Fri Nov 27 21:42:36 2009 -@@ -627,9 +627,11 @@ - - AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h]) - --if test "x${OSARCH}" = "xlinux-gnu" ; then -- AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h]) --fi -+case "${OSARCH}" in -+ linux*) -+ AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h]) -+ ;; -+esac - - AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h]) - diff --git a/testing/asterisk/102-gsm-pic.patch b/testing/asterisk/102-gsm-pic.patch deleted file mode 100644 index 71370ec0b7..0000000000 --- a/testing/asterisk/102-gsm-pic.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- a/codecs/gsm/Makefile.org 2008-03-29 11:33:09.000000000 +0100 -+++ b/codecs/gsm/Makefile 2008-03-29 11:44:40.000000000 +0100 -@@ -37,23 +37,6 @@ - ######### ppro's, etc, as well as the AMD K6 and K7. The compile will - ######### probably require gcc. - --ifeq (, $(findstring $(OSARCH) , Darwin SunOS )) --ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm armv5b armeb ppc powerpc ppc64 ia64 s390 bfin mipsel mips)) --ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l s390 )) --OPTIMIZE+=-march=$(PROC) --endif --endif --endif -- --#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only. --#This works for even old (2.96) versions of gcc and provides a small boost either way. --#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it. --#So we go lowest common available by gcc and go a step down, still a step up from --#the default as we now have a better instruction set to work with. - Belgarath --ifeq ($(PROC),ultrasparc) --OPTIMIZE+=-mcpu=v8 -mtune=$(PROC) -O3 --endif -- - PG = - #PG = -g -pg - ######### Profiling flags. If you don't know what that means, leave it blank. -@@ -208,12 +191,10 @@ - # XXX Keep a space after each findstring argument - # XXX should merge with GSM_OBJECTS - ifeq ($(OSARCH),linux-gnu) --ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc s390 )) --ifeq (,$(findstring $(PROC) , arm armv5b armeb powerpc ia64 s390 bfin mipsel mips )) -+ifneq ($(K6OPT),) - GSM_SOURCES+= $(SRC)/k6opt.s - endif - endif --endif - - TOAST_SOURCES = $(SRC)/toast.c \ - $(SRC)/toast_lin.c \ -@@ -260,12 +241,10 @@ - $(SRC)/table.o - - ifeq ($(OSARCH),linux-gnu) --ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc )) --ifeq (,$(findstring $(PROC) , arm armv5b armeb powerpc ia64 bfin mipsel mips )) -+ifneq ($(K6OPT),) - GSM_OBJECTS+= $(SRC)/k6opt.o - endif - endif --endif - - TOAST_OBJECTS = $(SRC)/toast.o \ - $(SRC)/toast_lin.o \ diff --git a/testing/asterisk/400-bug-227.patch b/testing/asterisk/400-bug-227.patch deleted file mode 100644 index f8187379e1..0000000000 --- a/testing/asterisk/400-bug-227.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: channels/chan_sip.c -=================================================================== ---- a/channels/chan_sip.c (revision 212243) -+++ b/channels/chan_sip.c (working copy) -@@ -3675,8 +3675,8 @@ - char method_str[31]; - ast_debug(3, "Re-scheduled destruction of SIP call %s\n", p->callid ? p->callid : ""); - append_history(p, "ReliableXmit", "timeout"); -- if (sscanf(p->lastmsg, "Tx: %30s", method_str) == 1 || sscanf(p->lastmsg, "Rx: %30s", method_str) == 1) { -- if (method_match(SIP_CANCEL, method_str) || method_match(SIP_BYE, method_str)) { -+ if (sscanf(p->lastmsg, "Tx: %30s", method_str) == 1 || sscanf(p->lastmsg, "Rx: %30s", method_str) == 1 || sscanf(p->lastmsg, "Init: %30s", method_str) == 1) { -+ if (method_match(SIP_CANCEL, method_str) || method_match(SIP_BYE, method_str) || method_match(SIP_INVITE, method_str)) { - pvt_set_needdestroy(p, "autodestruct"); - } - } diff --git a/testing/asterisk/APKBUILD b/testing/asterisk/APKBUILD deleted file mode 100644 index 4a258fb401..0000000000 --- a/testing/asterisk/APKBUILD +++ /dev/null @@ -1,176 +0,0 @@ -# Contributor: Timo Teras -# Maintainer: Timo Teras -pkgname=asterisk -pkgver=10.0.0_rc3 -pkgrel=0 -pkgdesc="Asterisk: A Module Open Source PBX System" -url="http://www.asterisk.org/" -arch="all" -license="GPL" -depends= -makedepends="autoconf automake libtool ncurses-dev popt-dev newt-dev zlib-dev - postgresql-dev unixodbc-dev dahdi-tools-dev libpri-dev tar - freetds-dev openssl-dev lua-dev alsa-lib-dev spandsp-dev tiff-dev - libresample sqlite-dev wget speex-dev libogg-dev" -install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-install" -subpackages="$pkgname-dev $pkgname-doc $pkgname-pgsql $pkgname-odbc - $pkgname-tds $pkgname-fax $pkgname-sample-config:sample $pkgname-sqlite - $pkgname-sounds-moh:sound_moh $pkgname-sounds-en:sound_en" -source="http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${pkgver/_/-}.tar.gz - 100-uclibc-daemon.patch - 101-caps-uclibc.patch - 400-bug-227.patch - ASTERISK-18976.patch - ASTERISK-18977.patch - ASTERISK-18994.patch - ASTERISK-18995.patch - asterisk.initd - asterisk.confd - asterisk.logrotate" - -_builddir="$srcdir/$pkgname-${pkgver/_/-}" - -prepare() { - cd "$_builddir" - for i in ../[1-9A]*.patch; do - msg "Apply $i" - patch -p1 < $i || return 1 - done - - sed -i -e 's:lua5.1/::' pbx/pbx_lua.c - sed -i -e 's/PBX_ICONV=1/PBX_ICONV=0/g' configure.ac - - ./bootstrap.sh -} - -build() { - cd "$_builddir" - SHA1SUM="$PWD"/build_tools/sha1sum-sh ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --libdir=/usr/lib \ - --localstatedir=/var \ - --disable-xmldoc --with-gsm=internal \ - --without-iconv --with-popt --with-z --with-newt \ - --with-odbc --with-postgres --with-tds \ - --with-dahdi --with-pri --with-tonezone \ - --with-resample \ - --with-sqlite3 \ - --with-speex \ - --with-asound \ - --without-x11 \ - --with-spandsp \ - || return 1 - - # and figure out which modules to build - rm menuselect.makeopts - make menuselect.makeopts - make ASTLDFLAGS="$LDFLAGS" || return 1 -} - -package() { - cd "$_builddir" - make -j1 DESTDIR="$pkgdir" install - - install -d "$pkgdir"/var/run/asterisk - install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname - install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname - install -m644 -D "$srcdir"/$pkgname.logrotate \ - "$pkgdir"/etc/logrotate.d/$pkgname -} - -_move_dir() { - for DIR in "$@"; do - local dest=`dirname "$subpkgdir/$DIR"` - echo mkdir -p $dest - mkdir -p "$dest" - echo mv "$pkgdir"/$DIR $dest - mv "$pkgdir"/"$DIR" "$dest" - done -} - -_find_and_move() { - local pattern="$1" - cd "$pkgdir" || return 1 - find -name "$pattern" -type f | while read f; do - local dest="$subpkgdir/${f%/*}" - mkdir -p "$dest" - mv "$f" "$dest" - done -} - -doc() { - default_doc -} - -dev() { - default_dev - depends="asterisk" -} - -pgsql() { - depends= - install= - _find_and_move '*_pgsql*' -} - -sqlite() { - depends= - install= - _find_and_move '*_sqlite*' -} - -odbc() { - depends= - install= - _find_and_move '*odbc*' -} - -tds() { - depends= - install= - _find_and_move '*_tds*' -} - -fax() { - depends= - install= - _find_and_move '*_fax*' -} - -sample() { - arch="noarch" - pkgdesc="Sample configuration files for asterisk" - cd "$_builddir" - mkdir -p "$subpkgdir"/var/lib/asterisk/phoneprov - make -j1 samples DESTDIR="$subpkgdir" -} - -sound_moh() { - arch="noarch" - pkgdesc="Default on-hold music files for asterisk" - depends= - install= - _move_dir var/lib/asterisk/moh -} - -sound_en() { - arch="noarch" - pkgdesc="English sound files for asterisk" - depends= - install= - _move_dir var/lib/asterisk/sounds/en -} - -md5sums="c0cfc71a26d56487ffa570fd3169919c asterisk-10.0.0-rc3.tar.gz -b00c9d98ce2ad445501248a197c6e436 100-uclibc-daemon.patch -6e1129e30c4fd2c25c86c81685a485a9 101-caps-uclibc.patch -79e9634b5054bceb3b8dc246654bb243 400-bug-227.patch -da5a3c500192dee4275aae5235d25f97 ASTERISK-18976.patch -1ddadef41aa7120e168738b6f3ed8917 ASTERISK-18977.patch -0af5e797f0a99d0f81f95e3710baf5b6 ASTERISK-18994.patch -bc6713f5434e07b79d3afdd155461d72 ASTERISK-18995.patch -0ce3219e05f55af884a7dc6b99c2b276 asterisk.initd -ed31d7ba37bcf8b0346dcf8593c395f0 asterisk.confd -3e65172275684373e1a25c8a11224411 asterisk.logrotate" diff --git a/testing/asterisk/ASTERISK-18976.patch b/testing/asterisk/ASTERISK-18976.patch deleted file mode 100644 index 36c613ff4f..0000000000 --- a/testing/asterisk/ASTERISK-18976.patch +++ /dev/null @@ -1,142 +0,0 @@ ---- a/pbx/pbx_lua.c.orig 2011-12-08 08:28:31.000000000 +0200 -+++ b/pbx/pbx_lua.c 2011-12-08 08:54:22.000000000 +0200 -@@ -94,7 +94,6 @@ - static void lua_create_application_metatable(lua_State *L); - static void lua_create_autoservice_functions(lua_State *L); - static void lua_create_hangup_function(lua_State *L); --static void lua_detect_goto(lua_State *L); - static void lua_concat_args(lua_State *L, int start, int nargs); - - static void lua_state_destroy(void *data); -@@ -213,19 +212,10 @@ - chan = lua_touserdata(L, -1); - lua_pop(L, 1); - -+ context = ast_strdupa(chan->context); -+ exten = ast_strdupa(chan->exten); -+ priority = chan->priority; - -- lua_getfield(L, LUA_REGISTRYINDEX, "context"); -- context = ast_strdupa(lua_tostring(L, -1)); -- lua_pop(L, 1); -- -- lua_getfield(L, LUA_REGISTRYINDEX, "exten"); -- exten = ast_strdupa(lua_tostring(L, -1)); -- lua_pop(L, 1); -- -- lua_getfield(L, LUA_REGISTRYINDEX, "priority"); -- priority = lua_tointeger(L, -1); -- lua_pop(L, 1); -- - lua_concat_args(L, 2, nargs); - data = lua_tostring(L, -1); - -@@ -256,75 +246,51 @@ - return lua_error(L); - } - -- lua_detect_goto(L); -- -- return 0; --} -- --/*! -- * \brief Detect if a Goto or other dialplan jump has been executed and return -- * control to the pbx engine. -- */ --static void lua_detect_goto(lua_State *L) --{ -- struct ast_channel *chan; -- -- lua_getfield(L, LUA_REGISTRYINDEX, "channel"); -- chan = lua_touserdata(L, -1); -- lua_pop(L, 1); -- -- /* check context */ -- lua_getfield(L, LUA_REGISTRYINDEX, "context"); -- lua_pushstring(L, chan->context); -- if (!lua_equal(L, -1, -2)) { -+ if (strcmp(context, chan->context)) { -+ lua_pushstring(L, context); -+ lua_pushstring(L, chan->context); - lua_pushliteral(L, "context"); -- goto e_goto_detected; -- } -- lua_pop(L, 2); -- -- /* check exten */ -- lua_getfield(L, LUA_REGISTRYINDEX, "exten"); -- lua_pushstring(L, chan->exten); -- if (!lua_equal(L, -1, -2)) { -+ } else if (strcmp(exten, chan->exten)) { -+ lua_pushstring(L, exten); -+ lua_pushstring(L, chan->exten); - lua_pushliteral(L, "exten"); -- goto e_goto_detected; -- } -- lua_pop(L, 2); -- -- /* check priority */ -- lua_getfield(L, LUA_REGISTRYINDEX, "priority"); -- lua_pushinteger(L, chan->priority); -- if (!lua_equal(L, -1, -2)) { -+ } else if (priority != chan->priority) { -+ lua_pushinteger(L, priority); -+ lua_pushinteger(L, chan->priority); - lua_pushliteral(L, "priority"); -- goto e_goto_detected; -+ } else { -+ /* no goto - restore the original position back -+ * to lua state, in case this was a recursive dialplan -+ * call (a dialplan application re-entering dialplan) */ -+ lua_update_registry(L, context, exten, priority); -+ return 0; - } -- lua_pop(L, 2); -- return; -- --e_goto_detected: -- /* format our debug message */ -- lua_insert(L, -3); - -- lua_pushliteral(L, " changed from "); -+ /* goto detected - construct error message */ - lua_insert(L, -3); -- -- lua_pushliteral(L, " to "); -- lua_insert(L, -2); -- -- lua_concat(L, 5); -- -- ast_debug(2, "Goto detected: %s\n", lua_tostring(L, -1)); -- lua_pop(L, 1); -- -- /* let the lua engine know it needs to return control to the pbx */ -- lua_pushinteger(L, LUA_GOTO_DETECTED); -+ -+ lua_pushliteral(L, " changed from "); -+ lua_insert(L, -3); -+ -+ lua_pushliteral(L, " to "); -+ lua_insert(L, -2); -+ -+ lua_concat(L, 5); -+ -+ ast_debug(2, "Goto detected: %s\n", lua_tostring(L, -1)); -+ lua_pop(L, 1); -+ -+ /* let the lua engine know it needs to return control to the pbx */ -+ lua_pushinteger(L, LUA_GOTO_DETECTED); - lua_error(L); -+ -+ return 0; - } - - /*! - * \brief [lua_CFunction] Used to get the value of a variable or dialplan - * function (for access from lua, don't call directly) -- * -+ * - * The value of the variable or function is returned. This function is the - * 'get()' function in the following example as would be seen in - * extensions.lua. diff --git a/testing/asterisk/ASTERISK-18977.patch b/testing/asterisk/ASTERISK-18977.patch deleted file mode 100644 index fffce032cd..0000000000 --- a/testing/asterisk/ASTERISK-18977.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/res/res_musiconhold.c.orig -+++ b/res/res_musiconhold.c -@@ -158,6 +158,7 @@ - char name[MAX_MUSICCLASS]; - struct ast_format origwfmt; - struct ast_format mohwfmt; -+ int announcement; - int samples; - int sample_queue; - int pos; -@@ -173,6 +174,7 @@ - #define MOH_SORTALPHA (1 << 4) - - #define MOH_CACHERTCLASSES (1 << 5) /*!< Should we use a separate instance of MOH for each user or not */ -+#define MOH_ANNOUNCEMENT (1 << 6) - - /* Custom astobj2 flag */ - #define MOH_NOTDELETED (1 << 30) /*!< Find only records that aren't deleted? */ -@@ -183,6 +185,7 @@ - char name[MAX_MUSICCLASS]; - char dir[256]; - char args[256]; -+ char announcement[80]; - char mode[80]; - char digit; - /*! A dynamically sized array to hold the list of filenames in "files" mode */ -@@ -278,6 +281,7 @@ - } - - state->save_pos = state->pos; -+ state->announcement = 0; - - state->class = mohclass_unref(state->class, "Unreffing channel's music class upon deactivation of generator"); - } -@@ -293,6 +297,16 @@ - chan->stream = NULL; - } - -+ if (ast_test_flag(state->class, MOH_ANNOUNCEMENT) && state->announcement == 0) { -+ state->announcement = 1; -+ if (ast_openstream_full(chan, state->class->announcement, chan->language, 1)) { -+ ast_debug(1, "%s Opened announcement '%s'\n", chan->name, state->class->announcement); -+ return 0; -+ } -+ } else { -+ state->announcement = 0; -+ } -+ - if (!state->class->total_files) { - ast_log(LOG_WARNING, "No files available for class '%s'\n", state->class->name); - return -1; -@@ -1731,7 +1745,10 @@ - ast_copy_string(class->dir, var->value, sizeof(class->dir)); - else if (!strcasecmp(var->name, "application")) - ast_copy_string(class->args, var->value, sizeof(class->args)); -- else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value))) -+ else if (!strcasecmp(var->name, "announcement")) { -+ ast_copy_string(class->announcement, var->value, sizeof(class->announcement)); -+ ast_set_flag(class, MOH_ANNOUNCEMENT); -+ } else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value))) - class->digit = *var->value; - else if (!strcasecmp(var->name, "random")) - ast_set2_flag(class, ast_true(var->value), MOH_RANDOMIZE); diff --git a/testing/asterisk/ASTERISK-18994.patch b/testing/asterisk/ASTERISK-18994.patch deleted file mode 100644 index 702e91375d..0000000000 --- a/testing/asterisk/ASTERISK-18994.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/main/file.c.orig 2011-12-09 11:32:05.000000000 +0200 -+++ b/main/file.c 2011-12-09 11:35:22.000000000 +0200 -@@ -1005,6 +1005,7 @@ - struct ast_filestream *fs; - struct ast_filestream *vfs=NULL; - char fmt[256]; -+ off_t pos; - int seekattempt; - int res; - -@@ -1017,12 +1018,14 @@ - /* check to see if there is any data present (not a zero length file), - * done this way because there is no where for ast_openstream_full to - * return the file had no data. */ -- seekattempt = fseek(fs->f, -1, SEEK_END); -+ pos = ftello(fs->f); -+ seekattempt = fseeko(fs->f, -1, SEEK_END); - if (seekattempt && errno == EINVAL) { - /* Zero-length file, as opposed to a pipe */ - return 0; -- } else { -- ast_seekstream(fs, 0, SEEK_SET); -+ } -+ if (seekattempt == 0) { -+ fseeko(fs->f, pos, SEEK_SET); - } - - vfs = ast_openvstream(chan, filename, preflang); diff --git a/testing/asterisk/ASTERISK-18995.patch b/testing/asterisk/ASTERISK-18995.patch deleted file mode 100644 index cd144847be..0000000000 --- a/testing/asterisk/ASTERISK-18995.patch +++ /dev/null @@ -1,358 +0,0 @@ ---- /dev/null 2011-11-29 09:02:40.279581283 +0200 -+++ b/formats/format_ogg_speex.c 2011-12-08 15:57:12.000000000 +0200 -@@ -0,0 +1,355 @@ -+/* -+ * Asterisk -- An open source telephony toolkit. -+ * -+ * Copyright (C) 2011, Timo Teräs -+ * -+ * 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 OGG/Speex streams. -+ * \arg File name extension: spx -+ * \ingroup formats -+ */ -+ -+/*** MODULEINFO -+ speex -+ ogg -+ extended -+ ***/ -+ -+#include "asterisk.h" -+ -+ASTERISK_FILE_VERSION(__FILE__, "$Revision$") -+ -+#include "asterisk/mod_format.h" -+#include "asterisk/module.h" -+ -+#include -+#include -+ -+#define BLOCK_SIZE 4096 /* buffer size for feeding OGG routines */ -+#define BUF_SIZE 200 -+ -+struct speex_desc { /* format specific parameters */ -+ /* structures for handling the Ogg container */ -+ ogg_sync_state oy; -+ ogg_stream_state os; -+ ogg_page og; -+ ogg_packet op; -+ -+ int format_id; -+ int serialno; -+ -+ /*! \brief Indicates whether an End of Stream condition has been detected. */ -+ int eos; -+}; -+ -+static int read_packet(struct ast_filestream *fs) -+{ -+ struct speex_desc *s = (struct speex_desc *)fs->_private; -+ char *buffer; -+ int result; -+ size_t bytes; -+ -+ while (1) { -+ /* Get one packet */ -+ result = ogg_stream_packetout(&s->os, &s->op); -+ if (result > 0) { -+ if (s->op.bytes>=5 && !memcmp(s->op.packet, "Speex", 5)) -+ s->serialno = s->os.serialno; -+ if (s->serialno == -1 || s->os.serialno != s->serialno) -+ continue; -+ return 0; -+ } -+ -+ if (result < 0) -+ ast_log(LOG_WARNING, -+ "Corrupt or missing data at this page position; continuing...\n"); -+ -+ /* No more packets left in the current page... */ -+ if (s->eos) { -+ /* No more pages left in the stream */ -+ return -1; -+ } -+ -+ while (!s->eos) { -+ /* See if OGG has any pages in it's internal buffers */ -+ result = ogg_sync_pageout(&s->oy, &s->og); -+ if (result > 0) { -+ /* Read all streams. */ -+ if (ogg_page_serialno(&s->og) != s->os.serialno) -+ ogg_stream_reset_serialno(&s->os, ogg_page_serialno(&s->og)); -+ /* Yes, OGG has more pages in it's internal buffers, -+ add the page to the stream state */ -+ result = ogg_stream_pagein(&s->os, &s->og); -+ if (result == 0) { -+ /* Yes, got a new,valid page */ -+ if (ogg_page_eos(&s->og) && -+ ogg_page_serialno(&s->og) == s->serialno) -+ s->eos = 1; -+ break; -+ } -+ ast_log(LOG_WARNING, -+ "Invalid page in the bitstream; continuing...\n"); -+ } -+ -+ if (result < 0) -+ ast_log(LOG_WARNING, -+ "Corrupt or missing data in bitstream; continuing...\n"); -+ -+ /* No, we need to read more data from the file descrptor */ -+ /* get a buffer from OGG to read the data into */ -+ buffer = ogg_sync_buffer(&s->oy, BLOCK_SIZE); -+ bytes = fread(buffer, 1, BLOCK_SIZE, fs->f); -+ ogg_sync_wrote(&s->oy, bytes); -+ if (bytes == 0) -+ s->eos = 1; -+ } -+ } -+} -+ -+/*! -+ * \brief Create a new OGG/Speex filestream and set it up for reading. -+ * \param fs File that points to on disk storage of the OGG/Speex data. -+ * \param expected_rate The expected Speex format (sampling rate). -+ * \return The new filestream. -+ */ -+static int ogg_speex_open(struct ast_filestream *fs, int format_id, int expected_rate) -+{ -+ char *buffer; -+ size_t bytes; -+ struct speex_desc *s = (struct speex_desc *)fs->_private; -+ SpeexHeader *hdr = NULL; -+ int i, result; -+ -+ s->format_id = format_id; -+ s->serialno = -1; -+ ogg_sync_init(&s->oy); -+ -+ buffer = ogg_sync_buffer(&s->oy, BLOCK_SIZE); -+ bytes = fread(buffer, 1, BLOCK_SIZE, fs->f); -+ ogg_sync_wrote(&s->oy, bytes); -+ -+ result = ogg_sync_pageout(&s->oy, &s->og); -+ if (result != 1) { -+ if(bytes < BLOCK_SIZE) { -+ ast_log(LOG_ERROR, "Run out of data...\n"); -+ } else { -+ ast_log(LOG_ERROR, "Input does not appear to be an Ogg bitstream.\n"); -+ } -+ ogg_sync_clear(&s->oy); -+ return -1; -+ } -+ -+ ogg_stream_init(&s->os, ogg_page_serialno(&s->og)); -+ if (ogg_stream_pagein(&s->os, &s->og) < 0) { -+ ast_log(LOG_ERROR, "Error reading first page of Ogg bitstream data.\n"); -+ goto error; -+ } -+ -+ if (read_packet(fs) < 0) { -+ ast_log(LOG_ERROR, "Error reading initial header packet.\n"); -+ goto error; -+ } -+ -+ hdr = speex_packet_to_header((char*)s->op.packet, s->op.bytes); -+ if (memcmp(hdr->speex_string, "Speex ", 8)) { -+ ast_log(LOG_ERROR, "OGG container does not contain Speex audio!\n"); -+ goto error; -+ } -+ if (hdr->frames_per_packet != 1) { -+ ast_log(LOG_ERROR, "Only one frame-per-packet OGG/Speex files are currently supported!\n"); -+ goto error; -+ } -+ if (hdr->nb_channels != 1) { -+ ast_log(LOG_ERROR, "Only monophonic OGG/Speex files are currently supported!\n"); -+ goto error; -+ } -+ if (hdr->rate != expected_rate) { -+ ast_log(LOG_ERROR, "Unexpected sampling rate (%d != %d)!\n", -+ hdr->rate, expected_rate); -+ goto error; -+ } -+ -+ /* this packet is the comment */ -+ if (read_packet(fs) < 0) { -+ ast_log(LOG_ERROR, "Error reading comment packet.\n"); -+ goto error; -+ } -+ for (i = 0; i < hdr->extra_headers; i++) { -+ if (read_packet(fs) < 0) { -+ ast_log(LOG_ERROR, "Error reading extra header packet %d.\n", i+1); -+ goto error; -+ } -+ } -+ free(hdr); -+ -+ return 0; -+error: -+ if (hdr) -+ free(hdr); -+ ogg_stream_clear(&s->os); -+ ogg_sync_clear(&s->oy); -+ return -1; -+} -+ -+/*! -+ * \brief Close a OGG/Speex filestream. -+ * \param fs A OGG/Speex filestream. -+ */ -+static void ogg_speex_close(struct ast_filestream *fs) -+{ -+ struct speex_desc *s = (struct speex_desc *)fs->_private; -+ -+ ogg_stream_clear(&s->os); -+ ogg_sync_clear(&s->oy); -+} -+ -+/*! -+ * \brief Read a frame full of audio data from the filestream. -+ * \param fs The filestream. -+ * \param whennext Number of sample times to schedule the next call. -+ * \return A pointer to a frame containing audio data or NULL ifthere is no more audio data. -+ */ -+static struct ast_frame *ogg_speex_read(struct ast_filestream *fs, -+ int *whennext) -+{ -+ struct speex_desc *s = (struct speex_desc *)fs->_private; -+ -+ if (read_packet(fs) < 0) -+ return NULL; -+ -+ fs->fr.frametype = AST_FRAME_VOICE; -+ ast_format_set(&fs->fr.subclass.format, s->format_id, 0); -+ fs->fr.mallocd = 0; -+ AST_FRAME_SET_BUFFER(&fs->fr, fs->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); -+ memcpy(fs->fr.data.ptr, s->op.packet, s->op.bytes); -+ fs->fr.datalen = s->op.bytes; -+ fs->fr.samples = *whennext = ast_codec_get_samples(&fs->fr); -+ -+ return &fs->fr; -+} -+ -+/*! -+ * \brief Trucate an OGG/Speex filestream. -+ * \param s The filestream to truncate. -+ * \return 0 on success, -1 on failure. -+ */ -+ -+static int ogg_speex_trunc(struct ast_filestream *s) -+{ -+ ast_log(LOG_WARNING, "Truncation is not supported on OGG/Speex streams!\n"); -+ return -1; -+} -+ -+/*! -+ * \brief Seek to a specific position in an OGG/Speex filestream. -+ * \param s The filestream to truncate. -+ * \param sample_offset New position for the filestream, measured in 8KHz samples. -+ * \param whence Location to measure -+ * \return 0 on success, -1 on failure. -+ */ -+static int ogg_speex_seek(struct ast_filestream *s, off_t sample_offset, int whence) -+{ -+ ast_log(LOG_WARNING, "Seeking is not supported on OGG/Speex streams!\n"); -+ return -1; -+} -+ -+static off_t ogg_speex_tell(struct ast_filestream *s) -+{ -+ ast_log(LOG_WARNING, "Telling is not supported on OGG/Speex streams!\n"); -+ return -1; -+} -+ -+static int ogg_speex_open_nb(struct ast_filestream *fs) -+{ -+ return ogg_speex_open(fs, AST_FORMAT_SPEEX, 8000); -+} -+ -+static struct ast_format_def speex_f = { -+ .name = "ogg_speex", -+ .exts = "spx", -+ .open = ogg_speex_open_nb, -+ .seek = ogg_speex_seek, -+ .trunc = ogg_speex_trunc, -+ .tell = ogg_speex_tell, -+ .read = ogg_speex_read, -+ .close = ogg_speex_close, -+ .buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET, -+ .desc_size = sizeof(struct speex_desc), -+}; -+ -+static int ogg_speex_open_wb(struct ast_filestream *fs) -+{ -+ return ogg_speex_open(fs, AST_FORMAT_SPEEX16, 16000); -+} -+ -+static struct ast_format_def speex16_f = { -+ .name = "ogg_speex16", -+ .exts = "spx16", -+ .open = ogg_speex_open_wb, -+ .seek = ogg_speex_seek, -+ .trunc = ogg_speex_trunc, -+ .tell = ogg_speex_tell, -+ .read = ogg_speex_read, -+ .close = ogg_speex_close, -+ .buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET, -+ .desc_size = sizeof(struct speex_desc), -+}; -+ -+static int ogg_speex_open_uwb(struct ast_filestream *fs) -+{ -+ return ogg_speex_open(fs, AST_FORMAT_SPEEX32, 32000); -+} -+ -+static struct ast_format_def speex32_f = { -+ .name = "ogg_speex32", -+ .exts = "spx32", -+ .open = ogg_speex_open_uwb, -+ .seek = ogg_speex_seek, -+ .trunc = ogg_speex_trunc, -+ .tell = ogg_speex_tell, -+ .read = ogg_speex_read, -+ .close = ogg_speex_close, -+ .buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET, -+ .desc_size = sizeof(struct speex_desc), -+}; -+ -+static int load_module(void) -+{ -+ ast_format_set(&speex_f.format, AST_FORMAT_SPEEX, 0); -+ ast_format_set(&speex16_f.format, AST_FORMAT_SPEEX16, 0); -+ ast_format_set(&speex32_f.format, AST_FORMAT_SPEEX32, 0); -+ -+ if (ast_format_def_register(&speex_f) || -+ ast_format_def_register(&speex16_f) || -+ ast_format_def_register(&speex32_f)) -+ return AST_MODULE_LOAD_FAILURE; -+ -+ return AST_MODULE_LOAD_SUCCESS; -+} -+ -+static int unload_module(void) -+{ -+ int res = 0; -+ res |= ast_format_def_unregister(speex_f.name); -+ res |= ast_format_def_unregister(speex16_f.name); -+ res |= ast_format_def_unregister(speex32_f.name); -+ return res; -+} -+ -+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "OGG/Speex audio", -+ .load = load_module, -+ .unload = unload_module, -+ .load_pri = AST_MODPRI_APP_DEPEND -+); diff --git a/testing/asterisk/asterisk.confd b/testing/asterisk/asterisk.confd deleted file mode 100644 index fe9f138ab7..0000000000 --- a/testing/asterisk/asterisk.confd +++ /dev/null @@ -1,91 +0,0 @@ -# -# Additional options for asterisk -# -# see "asterisk -h" for a list of options -# -ASTERISK_OPTS="" - -# -# User and group to run asterisk as -# -# Value: double-colon separated list of user and group, or empty to run as root: -# -# -# "asterisk:asterisk" to run as user "asterisk" and group "asterisk" -# "asterisk" to run as user "asterisk" and all groups that user "asterisk" is a member of -# ":asterisk" to run as user "root" and group "asterisk" -# "" to run as user "root" and group "root" -# -ASTERISK_USER="asterisk" - -# -# Nicelevel -# -# Set the priority of the asterisk process -# -# Value: (highest) -20..19 (lowest) -# -#ASTERISK_NICE="19" - -# -# Wrapper script -# -# Value: yes or no/empty -# -ASTERISK_WRAPPER="no" - -############# Wrapper script settings ############# - -# -# Send crash notifications emails to this address -# (needs a working mail service and /usr/sbin/sendmail to do so (e.g. ssmtp)) -# -# Value: Email address or empty to disable -# -#ASTERISK_NOTIFY_EMAIL="root" - -# -# Send asterisk's output to this terminal -# -# Value: Full path to device node or a number -# -#ASTERISK_TTY="/dev/tty9" - -# -# Start an asterisk console on the terminal specified by ASTERISK_TTY -# -# Warning! Use only for debugging, this is a potential security issue! -# -# Value: yes or no/empty -# -ASTERISK_CONSOLE="no" - -# -# Maximum size of core files. -# -# Value: Size in bytes, unlimited for no limit or empty to disable. -# -#ASTERISK_CORE_SIZE="unlimited" - -# -# ASTERISK_CORE_DIR -# -# Value: Directory (will be created if non-existant), default is /tmp -# -ASTERISK_CORE_DIR="/var/lib/asterisk/coredump" - -# -# Max number of filedescriptors -# -# Value: Number of descriptors -# -#ASTERISK_MAX_FD="1024" - -# -# Kill these tasks after asterisk crashed (ASTERISK_WRAPPER=yes only!) -# -# Warning! This will kill _ALL_ tasks with the specified names! -# -# Value: Space separated list of names in double quotes (e.g. "mpg123 mad") -# -#ASTERISK_CLEANUP_ON_CRASH="mpg123 asterisk-mpg123 mad" diff --git a/testing/asterisk/asterisk.initd b/testing/asterisk/asterisk.initd deleted file mode 100644 index 284898ae22..0000000000 --- a/testing/asterisk/asterisk.initd +++ /dev/null @@ -1,251 +0,0 @@ -#!/sbin/runscript - -opts="${opts} forcestop reload" - -depend() { - need net - after firewall - use nscd dns zaptel mysql postgresql slapd capi -} - -is_running() { - if [ -z "$(pidof asterisk)" ]; then - return 1 - else - PID="$(cat /var/run/asterisk/asterisk.pid 2>/dev/null)" - for x in $(pidof asterisk); do - if [ "${x}" = "${PID}" ]; then - return 0 - fi - done - fi - - return 1 -} - -asterisk_run_loop() { - local OPTS ARGS MSG NICE="" - local result=0 signal=0 - - # default options - OPTS="-f" # don't fork / detach breaks wrapper script... - - # filter (redundant) arguments - ARGS="$(echo "${@}" | sed -e "s:-c\|-f::g")" - - # mangle yes/no options - ASTERISK_CONSOLE="$(echo ${ASTERISK_CONSOLE} | tr '[:lower:]' '[:upper:]')" - - if [ -n "${ASTERISK_CORE_SIZE}" ] && - [ "${ASTERISK_CORE_SIZE}" != "0" ]; then - ulimit -c ${ASTERISK_CORE_SIZE} - - if [ -n "${ASTERISK_CORE_DIR}" ] && \ - [ ! -d "${ASTERISK_CORE_DIR}" ] - then - mkdir -m750 -p "${ASTERISK_CORE_DIR}" - - if [ -n "${ASTERISK_USER}" ]; then - chown -R "${ASTERISK_USER}" "${ASTERISK_CORE_DIR}" - fi - fi - ASTERISK_CORE_DIR="${ASTERISK_CORE_DIR:-/tmp}" - - cd "${ASTERISK_CORE_DIR}" - echo " Core dump size : ${ASTERISK_CORE_SIZE}" - echo " Core dump location : ${ASTERISK_CORE_DIR}" - fi - - if [ -n "${ASTERISK_MAX_FD}" ]; then - ulimit -n ${ASTERISK_MAX_FD} - echo " Max open filedescriptors : ${ASTERISK_MAX_FD}" - fi - - if [ -n "${ASTERISK_NICE}" ]; then - echo " Nice level : ${ASTERISK_NICE}" - NICE="nice -n ${ASTERISK_NICE} --" - fi - - if [ -n "${ASTERISK_NOTIFY_EMAIL}" ]; then - if [ -x /usr/sbin/sendmail ]; then - echo " Email notifications go to : ${ASTERISK_NOTIFY_EMAIL}" - else - echo " Notifications disabled, /usr/sbin/sendmail doesn't exist or is not executable!" - unset ASTERISK_NOTIFY_EMAIL - fi - fi - - if [ -n "${ASTERISK_TTY}" ]; then - for x in ${ASTERISK_TTY} \ - /dev/tty${ASTERISK_TTY} \ - /dev/vc/${ASTERISK_TTY} - do - if [ -c "${x}" ]; then - TTY="${x}" - fi - done - [ -n "${TTY}" ] && \ - echo " Messages are sent to : ${TTY}" - fi - - if [ "${ASTERISK_CONSOLE}" = "YES" ] && [ -n "${TTY}" ]; then - echo " Starting Asterisk console : ${ASTERISK_CONSOLE}" - OPTS="${OPTS} -c" - fi - - OPTS="${OPTS} ${ARGS}" - - while :; do - - if [ -n "${TTY}" ]; then - /usr/bin/stty -F ${TTY} sane - ${NICE} /usr/sbin/asterisk ${OPTS} >${TTY} 2>&1 <${TTY} - result=$? - else - ${NICE} /usr/sbin/asterisk ${OPTS} &>/dev/null - result=$? - fi - - if [ $result -eq 0 ]; then - echo "Asterisk terminated normally" - break - else - if [ $result -gt 128 ]; then - signal=$((result - 128)) - MSG="Asterisk terminated with Signal: $signal" - - CORE_TARGET="core-$(date "+%Y%m%d-%h%M%s")" - - local CORE_DUMPED=0 - if [ -f "${ASTERISK_CORE_DIR}/core" ]; then - mv "${ASTERISK_CORE_DIR}/core" \ - "${ASTERISK_CORE_DIR}/${CORE_TARGET}" - CORE_DUMPED=1 - - elif [ -f "${ASTERISK_CORE_DIR}/core.${PID}" ]; then - mv "${ASTERISK_CORE_DIR}/core.${PID}" \ - "${ASTERISK_CORE_DIR}/${CORE_TARGET}" - CORE_DUMPED=1 - - fi - - [ $CORE_DUMPED -eq 1 ] && \ - MSG="${MSG}\n\rCore dumped: ${ASTERISK_CORE_DIR}/${CORE_TARGET}" - else - MSG="Asterisk terminated with return code: $result" - fi - - # kill left-over tasks - for X in ${ASTERISK_CLEANUP_ON_CRASH}; do - kill -9 $(pidof ${X}); - done - fi - - [ -n "${TTY}" ] \ - && echo "${MSG}" >${TTY} \ - || echo "${MSG}" - - - if [ -n "${ASTERISK_NOTIFY_EMAIL}" ] && \ - [ -x /usr/sbin/sendmail ]; then - echo -e -n "Subject: Asterisk crashed\n\r${MSG}\n\r" |\ - /usr/sbin/sendmail "${ASTERISK_NOTIFY_EMAIL}" - fi - sleep 5 - echo "Restarting Asterisk..." - done - return 0 -} - -start() { - local OPTS USER GROUP PID - local tmp x - - if [ -n "${ASTERISK_NICE}" ]; then - if [ ${ASTERISK_NICE} -ge -20 ] && \ - [ ${ASTERISK_NICE} -le 19 ]; then - OPTS="--nicelevel ${ASTERISK_NICE}" - else - eerror "Nice value must be between -20 and 19" - return 1 - fi - fi - - if [ -n "${ASTERISK_USER}" ]; then - USER=$(echo $ASTERISK_USER | sed 's/:.*//') - GROUP=$(echo $ASTERISK_USER | awk -F: '/.*:.*/ { print $2 }') - if [ -n "${USER}" ]; then - ASTERISK_OPTS="${ASTERISK_OPTS} -U ${USER}" - fi - if [ -n "${GROUP}" ]; then - ASTERISK_OPTS="${ASTERISK_OPTS} -G ${GROUP}" - GROUP=":${GROUP}" # make it look nice... - fi - ebegin "Starting asterisk PBX (as ${USER}${GROUP})" - else - ebegin "Starting asterisk PBX (as root)" - fi - - if [ "$(echo ${ASTERISK_WRAPPER} | tr '[:upper:]' '[:lower:]')" != "yes" ]; then - start-stop-daemon --start --exec /usr/sbin/asterisk \ - ${OPTS} -- ${ASTERISK_OPTS} - result=$? - else - asterisk_run_loop ${ASTERISK_OPTS} 2>/dev/null & - result=$? - fi - - if [ $result -eq 0 ]; then - # 2 seconds should be enough for asterisk to start - sleep 2 - is_running - result=$? - fi - - eend $result -} - -forcestop() { - ebegin "Stopping asterisk PBX" - start-stop-daemon --stop --pidfile /var/run/asterisk/asterisk.pid - eend $? -} - -stop() { - if ! is_running; then - eerror "Asterisk is not running!" - return 0 - fi - - ebegin "Stopping asterisk PBX now" - /usr/sbin/asterisk -r -x "core stop now" &>/dev/null - # Now we have to wait until asterisk has _really_ stopped. - sleep 1 - if is_running; then - einfon "Waiting for asterisk to shutdown ." - local cnt=0 - while is_running; do - cnt=`expr $cnt + 1` - if [ $cnt -gt 60 ] ; then - # Waited 120 seconds now. Fail. - echo - eend 1 "Failed." - return - fi - sleep 2 - echo -n "." - done - echo - fi - eend 0 -} - -reload() { - if is_running; then - ebegin "Forcing asterisk to reload configuration" - /usr/sbin/asterisk -r -x "modules reload" &>/dev/null - eend $? - else - eerror "Asterisk is not running!" - fi -} diff --git a/testing/asterisk/asterisk.logrotate b/testing/asterisk/asterisk.logrotate deleted file mode 100644 index 30836c5c11..0000000000 --- a/testing/asterisk/asterisk.logrotate +++ /dev/null @@ -1,17 +0,0 @@ -/var/log/asterisk/messages /var/log/asterisk/*log { - missingok - rotate 5 - weekly - create 0640 asterisk asterisk - postrotate - /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null - endscript -} - -/var/log/asterisk/cdr-csv/*csv { - missingok - rotate 5 - monthly - create 0640 asterisk asterisk -} - diff --git a/testing/asterisk/asterisk.post-install b/testing/asterisk/asterisk.post-install deleted file mode 100644 index fd51c7fa5d..0000000000 --- a/testing/asterisk/asterisk.post-install +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -chown -R asterisk:asterisk /var/*/asterisk -chown -R asterisk:asterisk /etc/asterisk -chmod -R u=rwX,g=rX,o= /etc/asterisk - -# set IP ToS -# iptables -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp 0x28 -#iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp 0x28 -# more info: http://www.voip-info.org/wiki-Asterisk+non-root - diff --git a/testing/asterisk/asterisk.pre-install b/testing/asterisk/asterisk.pre-install deleted file mode 100644 index 09985d7cdb..0000000000 --- a/testing/asterisk/asterisk.pre-install +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -user=asterisk -home=/var/lib/asterisk -adduser -h $home -s /bin/false -D $user 2>/dev/null -mkdir -p $home -chown $user:$user $home - -addgroup dialout 2>/dev/null -addgroup $user dialout 2>/dev/null -exit 0 - diff --git a/testing/asterisk/asterisk.pre-upgrade b/testing/asterisk/asterisk.pre-upgrade deleted file mode 100644 index 09985d7cdb..0000000000 --- a/testing/asterisk/asterisk.pre-upgrade +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -user=asterisk -home=/var/lib/asterisk -adduser -h $home -s /bin/false -D $user 2>/dev/null -mkdir -p $home -chown $user:$user $home - -addgroup dialout 2>/dev/null -addgroup $user dialout 2>/dev/null -exit 0 - -- cgit v1.2.3