<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16304">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_ices: Remove deprecated module.<br><br>ASTERISK-29586<br><br>Change-Id: I1e0a4535135b00938b609fe0ccba9bbddbac93ad<br>---<br>D apps/app_ices.c<br>A doc/UPGRADE-staging/app_ices_removal.txt<br>2 files changed, 6 insertions(+), 216 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/04/16304/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_ices.c b/apps/app_ices.c</span><br><span>deleted file mode 100644</span><br><span>index 38c68c0..0000000</span><br><span>--- a/apps/app_ices.c</span><br><span>+++ /dev/null</span><br><span>@@ -1,216 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-/*</span><br><span style="color: hsl(0, 100%, 40%);">- * Asterisk -- An open source telephony toolkit.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Copyright (C) 1999 - 2005, Digium, Inc.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Mark Spencer <markster@digium.com></span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * See http://www.asterisk.org for more information about</span><br><span style="color: hsl(0, 100%, 40%);">- * the Asterisk project. Please do not directly contact</span><br><span style="color: hsl(0, 100%, 40%);">- * any of the maintainers of this project for assistance;</span><br><span style="color: hsl(0, 100%, 40%);">- * the project provides a web site, mailing lists and IRC</span><br><span style="color: hsl(0, 100%, 40%);">- * channels for your use.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * This program is free software, distributed under the terms of</span><br><span style="color: hsl(0, 100%, 40%);">- * the GNU General Public License Version 2. See the LICENSE file</span><br><span style="color: hsl(0, 100%, 40%);">- * at the top of the source tree.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*! \file</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Stream to an icecast server via ICES (see contrib/asterisk-ices.xml)</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \author Mark Spencer <markster@digium.com></span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * ICES - http://www.icecast.org/ices.php</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \ingroup applications</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*** MODULEINFO</span><br><span style="color: hsl(0, 100%, 40%);">- <support_level>deprecated</support_level></span><br><span style="color: hsl(0, 100%, 40%);">- <deprecated_in>16</deprecated_in></span><br><span style="color: hsl(0, 100%, 40%);">- <removed_in>19</removed_in></span><br><span style="color: hsl(0, 100%, 40%);">- ***/</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk.h"</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#include <signal.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <fcntl.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <sys/time.h></span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/paths.h" /* use ast_config_AST_CONFIG_DIR */</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/lock.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/file.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/channel.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/frame.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/pbx.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/module.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/translate.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/app.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/format_cache.h"</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*** DOCUMENTATION</span><br><span style="color: hsl(0, 100%, 40%);">- <application name="ICES" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">- <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">- Encode and stream using 'ices'.</span><br><span style="color: hsl(0, 100%, 40%);">- </synopsis></span><br><span style="color: hsl(0, 100%, 40%);">- <syntax></span><br><span style="color: hsl(0, 100%, 40%);">- <parameter name="config" required="true"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>ICES configuration file.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </parameter></span><br><span style="color: hsl(0, 100%, 40%);">- </syntax></span><br><span style="color: hsl(0, 100%, 40%);">- <description></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Streams to an icecast server using ices (available separately).</span><br><span style="color: hsl(0, 100%, 40%);">- A configuration file must be supplied for ices (see contrib/asterisk-ices.xml).</para></span><br><span style="color: hsl(0, 100%, 40%);">- <note><para>ICES version 2 client and server required.</para></note></span><br><span style="color: hsl(0, 100%, 40%);">- </description></span><br><span style="color: hsl(0, 100%, 40%);">- </application></span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- ***/</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#define path_BIN "/usr/bin/"</span><br><span style="color: hsl(0, 100%, 40%);">-#define path_LOCAL "/usr/local/bin/"</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static char *app = "ICES";</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int icesencode(char *filename, int fd)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- int res;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- res = ast_safe_fork(0);</span><br><span style="color: hsl(0, 100%, 40%);">- if (res < 0)</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "Fork failed\n");</span><br><span style="color: hsl(0, 100%, 40%);">- if (res) {</span><br><span style="color: hsl(0, 100%, 40%);">- return res;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_opt_high_priority)</span><br><span style="color: hsl(0, 100%, 40%);">- ast_set_priority(0);</span><br><span style="color: hsl(0, 100%, 40%);">- dup2(fd, STDIN_FILENO);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_close_fds_above_n(STDERR_FILENO);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- /* Most commonly installed in /usr/local/bin</span><br><span style="color: hsl(0, 100%, 40%);">- * But many places has it in /usr/bin</span><br><span style="color: hsl(0, 100%, 40%);">- * As a last-ditch effort, try to use PATH</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">- execl(path_LOCAL "ices2", "ices", filename, SENTINEL);</span><br><span style="color: hsl(0, 100%, 40%);">- execl(path_BIN "ices2", "ices", filename, SENTINEL);</span><br><span style="color: hsl(0, 100%, 40%);">- execlp("ices2", "ices", filename, SENTINEL);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(1, "Couldn't find ices version 2, attempting to use ices version 1.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- execl(path_LOCAL "ices", "ices", filename, SENTINEL);</span><br><span style="color: hsl(0, 100%, 40%);">- execl(path_BIN "ices", "ices", filename, SENTINEL);</span><br><span style="color: hsl(0, 100%, 40%);">- execlp("ices", "ices", filename, SENTINEL);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "Execute of ices failed, could not find command.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- close(fd);</span><br><span style="color: hsl(0, 100%, 40%);">- _exit(0);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int ices_exec(struct ast_channel *chan, const char *data)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- int res = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- int fds[2];</span><br><span style="color: hsl(0, 100%, 40%);">- int ms = -1;</span><br><span style="color: hsl(0, 100%, 40%);">- int pid = -1;</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_format *oreadformat;</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_frame *f;</span><br><span style="color: hsl(0, 100%, 40%);">- char filename[256]="";</span><br><span style="color: hsl(0, 100%, 40%);">- char *c;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_strlen_zero(data)) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "ICES requires an argument (configfile.xml)\n");</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (pipe(fds)) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "Unable to create pipe\n");</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- ast_fd_set_flags(fds[1], O_NONBLOCK);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- ast_stopstream(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_channel_state(chan) != AST_STATE_UP)</span><br><span style="color: hsl(0, 100%, 40%);">- res = ast_answer(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (res) {</span><br><span style="color: hsl(0, 100%, 40%);">- close(fds[0]);</span><br><span style="color: hsl(0, 100%, 40%);">- close(fds[1]);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "Answer failed!\n");</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- oreadformat = ao2_bump(ast_channel_readformat(chan));</span><br><span style="color: hsl(0, 100%, 40%);">- res = ast_set_read_format(chan, ast_format_slin);</span><br><span style="color: hsl(0, 100%, 40%);">- if (res < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- close(fds[0]);</span><br><span style="color: hsl(0, 100%, 40%);">- close(fds[1]);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(oreadformat);</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (((char *)data)[0] == '/')</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(filename, (char *) data, sizeof(filename));</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- snprintf(filename, sizeof(filename), "%s/%s", ast_config_AST_CONFIG_DIR, (char *)data);</span><br><span style="color: hsl(0, 100%, 40%);">- /* Placeholder for options */</span><br><span style="color: hsl(0, 100%, 40%);">- c = strchr(filename, '|');</span><br><span style="color: hsl(0, 100%, 40%);">- if (c)</span><br><span style="color: hsl(0, 100%, 40%);">- *c = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- res = icesencode(filename, fds[0]);</span><br><span style="color: hsl(0, 100%, 40%);">- if (res >= 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- pid = res;</span><br><span style="color: hsl(0, 100%, 40%);">- for (;;) {</span><br><span style="color: hsl(0, 100%, 40%);">- /* Wait for audio, and stream */</span><br><span style="color: hsl(0, 100%, 40%);">- ms = ast_waitfor(chan, -1);</span><br><span style="color: hsl(0, 100%, 40%);">- if (ms < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(1, "Hangup detected\n");</span><br><span style="color: hsl(0, 100%, 40%);">- res = -1;</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- f = ast_read(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!f) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(1, "Null frame == hangup() detected\n");</span><br><span style="color: hsl(0, 100%, 40%);">- res = -1;</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (f->frametype == AST_FRAME_VOICE) {</span><br><span style="color: hsl(0, 100%, 40%);">- res = write(fds[1], f->data.ptr, f->datalen);</span><br><span style="color: hsl(0, 100%, 40%);">- if (res < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (errno != EAGAIN) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "Write failed to pipe: %s\n", strerror(errno));</span><br><span style="color: hsl(0, 100%, 40%);">- res = -1;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_frfree(f);</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- ast_frfree(f);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- close(fds[0]);</span><br><span style="color: hsl(0, 100%, 40%);">- close(fds[1]);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (pid > -1)</span><br><span style="color: hsl(0, 100%, 40%);">- kill(pid, SIGKILL);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!res && oreadformat)</span><br><span style="color: hsl(0, 100%, 40%);">- ast_set_read_format(chan, oreadformat);</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(oreadformat);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- return res;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int unload_module(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_unregister_application(app);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int load_module(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_register_application_xml(app, ices_exec);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Encode and Stream via icecast and ices");</span><br><span>diff --git a/doc/UPGRADE-staging/app_ices_removal.txt b/doc/UPGRADE-staging/app_ices_removal.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..79ab27b</span><br><span>--- /dev/null</span><br><span>+++ b/doc/UPGRADE-staging/app_ices_removal.txt</span><br><span>@@ -0,0 +1,6 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_ices</span><br><span style="color: hsl(120, 100%, 40%);">+Master-Only: True</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+This module was deprecated in Asterisk 16</span><br><span style="color: hsl(120, 100%, 40%);">+and is now being removed in accordance with</span><br><span style="color: hsl(120, 100%, 40%);">+the Asterisk Module Deprecation policy.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16304">change 16304</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/16304"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I1e0a4535135b00938b609fe0ccba9bbddbac93ad </div>
<div style="display:none"> Gerrit-Change-Number: 16304 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>