<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16318">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Sean Bright: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Joshua Colp: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">muted: Remove deprecated application.<br><br>ASTERISK-29600<br><br>Change-Id: I0ae1c6a2996da43217126f094de90761314dcf82<br>---<br>A doc/UPGRADE-staging/muted_removal.txt<br>M utils/.gitignore<br>M utils/Makefile<br>D utils/muted.c<br>M utils/utils.xml<br>5 files changed, 6 insertions(+), 795 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/doc/UPGRADE-staging/muted_removal.txt b/doc/UPGRADE-staging/muted_removal.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..5cca25c</span><br><span>--- /dev/null</span><br><span>+++ b/doc/UPGRADE-staging/muted_removal.txt</span><br><span>@@ -0,0 +1,6 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: muted</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 application 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>diff --git a/utils/.gitignore b/utils/.gitignore</span><br><span>index fb3bf54..6eafc71 100644</span><br><span>--- a/utils/.gitignore</span><br><span>+++ b/utils/.gitignore</span><br><span>@@ -15,7 +15,6 @@</span><br><span> hashtab.c</span><br><span> lock.c</span><br><span> md5.c</span><br><span style="color: hsl(0, 100%, 40%);">-muted</span><br><span> pbx_ael.c</span><br><span> pval.c</span><br><span> smsq</span><br><span>diff --git a/utils/Makefile b/utils/Makefile</span><br><span>index 0471441..7d8b8a3 100644</span><br><span>--- a/utils/Makefile</span><br><span>+++ b/utils/Makefile</span><br><span>@@ -38,15 +38,6 @@</span><br><span> </span><br><span> ifeq ($(OSARCH),SunOS)</span><br><span> LIBS+=-lsocket -lnsl</span><br><span style="color: hsl(0, 100%, 40%);">- UTILS:=$(filter-out muted,$(UTILS))</span><br><span style="color: hsl(0, 100%, 40%);">-endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-ifeq ($(OSARCH),OpenBSD)</span><br><span style="color: hsl(0, 100%, 40%);">- UTILS:=$(filter-out muted,$(UTILS))</span><br><span style="color: hsl(0, 100%, 40%);">-endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-ifeq ($(OSARCH),cygwin)</span><br><span style="color: hsl(0, 100%, 40%);">- UTILS:=$(filter-out muted,$(UTILS))</span><br><span> endif</span><br><span> </span><br><span> ifeq ($(OSARCH),mingw32)</span><br><span>@@ -192,10 +183,6 @@</span><br><span> </span><br><span> streamplayer: streamplayer.o</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-muted: muted.o</span><br><span style="color: hsl(0, 100%, 40%);">-muted: LIBS+=$(AUDIO_LIBS)</span><br><span style="color: hsl(0, 100%, 40%);">-muted: _ASTCFLAGS:=$(filter-out -Werror,$(_ASTCFLAGS))</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> CHECK_SUBDIR: # do nothing, just make sure that we recurse in the subdir/</span><br><span> db1-ast/libdb1.a: CHECK_SUBDIR</span><br><span> _ASTCFLAGS="$(_ASTCFLAGS) -Wno-strict-aliasing" ASTCFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a</span><br><span>diff --git a/utils/muted.c b/utils/muted.c</span><br><span>deleted file mode 100644</span><br><span>index 5376ba7..0000000</span><br><span>--- a/utils/muted.c</span><br><span>+++ /dev/null</span><br><span>@@ -1,777 +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%);">- * Updated for Mac OSX CoreAudio</span><br><span style="color: hsl(0, 100%, 40%);">- * by Josh Roberson <josh@asteriasgi.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 Mute Daemon</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%);">- * Updated for Mac OSX CoreAudio</span><br><span style="color: hsl(0, 100%, 40%);">- * \arg Josh Roberson <josh@asteriasgi.com></span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \note Specially written for Malcolm Davenport, but I think I'll use it too</span><br><span style="color: hsl(0, 100%, 40%);">- * Connects to the Asterisk Manager Interface, AMI, and listens for events</span><br><span style="color: hsl(0, 100%, 40%);">- * on certain devices. If a phone call is connected to one of the devices (phones)</span><br><span style="color: hsl(0, 100%, 40%);">- * the local sound is muted to a lower volume during the call.</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%);">-/*! \li \ref muted.c uses the configuration file \ref muted.conf</span><br><span style="color: hsl(0, 100%, 40%);">- * \addtogroup configuration_file Configuration Files</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%);">- * \page muted.conf muted.conf</span><br><span style="color: hsl(0, 100%, 40%);">- * \verbinclude muted.conf.sample</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/autoconfig.h"</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">-#include <CoreAudio/AudioHardware.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <sys/types.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <pwd.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <sys/stat.h></span><br><span style="color: hsl(0, 100%, 40%);">-#elif defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__GLIBC__)</span><br><span style="color: hsl(0, 100%, 40%);">-#include <sys/soundcard.h></span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-#include <stdio.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <errno.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <stdlib.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <unistd.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <fcntl.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <string.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <netdb.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <sys/socket.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <sys/ioctl.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <netinet/in.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <arpa/inet.h></span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#define ast_strlen_zero(a) (!(*(a)))</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static char *config = "/etc/asterisk/muted.conf";</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static char host[256] = "";</span><br><span style="color: hsl(0, 100%, 40%);">-static char user[256] = "";</span><br><span style="color: hsl(0, 100%, 40%);">-static char pass[256] = "";</span><br><span style="color: hsl(0, 100%, 40%);">-static int smoothfade = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-static int mutelevel = 20;</span><br><span style="color: hsl(0, 100%, 40%);">-static int muted = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-static int needfork = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-static int debug = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-static int stepsize = 3;</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">-static int mixchan = SOUND_MIXER_VOLUME;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-struct subchannel {</span><br><span style="color: hsl(0, 100%, 40%);">- char *name;</span><br><span style="color: hsl(0, 100%, 40%);">- struct subchannel *next;</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 struct channel {</span><br><span style="color: hsl(0, 100%, 40%);">- char *tech;</span><br><span style="color: hsl(0, 100%, 40%);">- char *location;</span><br><span style="color: hsl(0, 100%, 40%);">- struct channel *next;</span><br><span style="color: hsl(0, 100%, 40%);">- struct subchannel *subs;</span><br><span style="color: hsl(0, 100%, 40%);">-} *channels;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static void add_channel(char *tech, char *location)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- struct channel *chan;</span><br><span style="color: hsl(0, 100%, 40%);">- chan = malloc(sizeof(struct channel));</span><br><span style="color: hsl(0, 100%, 40%);">- if (chan) {</span><br><span style="color: hsl(0, 100%, 40%);">- memset(chan, 0, sizeof(struct channel));</span><br><span style="color: hsl(0, 100%, 40%);">- if (!(chan->tech = strdup(tech))) {</span><br><span style="color: hsl(0, 100%, 40%);">- free(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- return;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!(chan->location = strdup(location))) {</span><br><span style="color: hsl(0, 100%, 40%);">- free(chan->tech);</span><br><span style="color: hsl(0, 100%, 40%);">- free(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- return;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- chan->next = channels;</span><br><span style="color: hsl(0, 100%, 40%);">- channels = chan;</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int load_config(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- FILE *f;</span><br><span style="color: hsl(0, 100%, 40%);">- char buf[256];</span><br><span style="color: hsl(0, 100%, 40%);">- char *val;</span><br><span style="color: hsl(0, 100%, 40%);">- char *val2;</span><br><span style="color: hsl(0, 100%, 40%);">- int lineno=0;</span><br><span style="color: hsl(0, 100%, 40%);">- int x;</span><br><span style="color: hsl(0, 100%, 40%);">- f = fopen(config, "r");</span><br><span style="color: hsl(0, 100%, 40%);">- if (!f) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "Unable to open config file '%s': %s\n", config, strerror(errno));</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%);">- while(!feof(f)) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!fgets(buf, sizeof(buf), f)) {</span><br><span style="color: hsl(0, 100%, 40%);">- continue;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!feof(f)) {</span><br><span style="color: hsl(0, 100%, 40%);">- lineno++;</span><br><span style="color: hsl(0, 100%, 40%);">- val = strchr(buf, '#');</span><br><span style="color: hsl(0, 100%, 40%);">- if (val) *val = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- while(strlen(buf) && (buf[strlen(buf) - 1] < 33))</span><br><span style="color: hsl(0, 100%, 40%);">- buf[strlen(buf) - 1] = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strlen(buf))</span><br><span style="color: hsl(0, 100%, 40%);">- continue;</span><br><span style="color: hsl(0, 100%, 40%);">- val = buf;</span><br><span style="color: hsl(0, 100%, 40%);">- while(*val) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (*val < 33)</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- val++;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (*val) {</span><br><span style="color: hsl(0, 100%, 40%);">- *val = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- val++;</span><br><span style="color: hsl(0, 100%, 40%);">- while(*val && (*val < 33)) val++;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strcasecmp(buf, "host")) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (val && strlen(val))</span><br><span style="color: hsl(0, 100%, 40%);">- strncpy(host, val, sizeof(host) - 1);</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "host needs an argument (the host) at line %d\n", lineno);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp(buf, "user")) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (val && strlen(val))</span><br><span style="color: hsl(0, 100%, 40%);">- snprintf(user, sizeof(user), "%s", val);</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "user needs an argument (the user) at line %d\n", lineno);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp(buf, "pass")) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (val && strlen(val))</span><br><span style="color: hsl(0, 100%, 40%);">- snprintf(pass, sizeof(pass), "%s", val);</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "pass needs an argument (the password) at line %d\n", lineno);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp(buf, "smoothfade")) {</span><br><span style="color: hsl(0, 100%, 40%);">- smoothfade = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp(buf, "mutelevel")) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (val && (sscanf(val, "%3d", &x) == 1) && (x > -1) && (x < 101)) {</span><br><span style="color: hsl(0, 100%, 40%);">- mutelevel = x;</span><br><span style="color: hsl(0, 100%, 40%);">- } else</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "mutelevel must be a number from 0 (most muted) to 100 (no mute) at line %d\n", lineno);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp(buf, "channel")) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (val && strlen(val)) {</span><br><span style="color: hsl(0, 100%, 40%);">- val2 = strchr(val, '/');</span><br><span style="color: hsl(0, 100%, 40%);">- if (val2) {</span><br><span style="color: hsl(0, 100%, 40%);">- *val2 = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- val2++;</span><br><span style="color: hsl(0, 100%, 40%);">- add_channel(val, val2);</span><br><span style="color: hsl(0, 100%, 40%);">- } else</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "channel needs to be of the format Tech/Location at line %d\n", lineno);</span><br><span style="color: hsl(0, 100%, 40%);">- } else</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "channel needs an argument (the channel) at line %d\n", lineno);</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "ignoring unknown keyword '%s'\n", buf);</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%);">- fclose(f);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strlen(host))</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "no 'host' specification in config file\n");</span><br><span style="color: hsl(0, 100%, 40%);">- else if (!strlen(user))</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "no 'user' specification in config file\n");</span><br><span style="color: hsl(0, 100%, 40%);">- else if (!channels)</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "no 'channel' specifications in config file\n");</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</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%);">-static FILE *astf;</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">-static int mixfd;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int open_mixer(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- mixfd = open("/dev/mixer", O_RDWR);</span><br><span style="color: hsl(0, 100%, 40%);">- if (mixfd < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "Unable to open /dev/mixer: %s\n", strerror(errno));</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%);">- return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-#endif /* !__Darwin */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*! Connect to the asterisk manager interface */</span><br><span style="color: hsl(0, 100%, 40%);">-static int connect_asterisk(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- int sock;</span><br><span style="color: hsl(0, 100%, 40%);">- struct hostent *hp;</span><br><span style="color: hsl(0, 100%, 40%);">- char *ports;</span><br><span style="color: hsl(0, 100%, 40%);">- int port = 5038;</span><br><span style="color: hsl(0, 100%, 40%);">- struct sockaddr_in sin;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- ports = strchr(host, ':');</span><br><span style="color: hsl(0, 100%, 40%);">- if (ports) {</span><br><span style="color: hsl(0, 100%, 40%);">- *ports = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- ports++;</span><br><span style="color: hsl(0, 100%, 40%);">- if ((sscanf(ports, "%5d", &port) != 1) || (port < 1) || (port > 65535)) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "'%s' is not a valid port number in the hostname\n", ports);</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%);">- hp = gethostbyname(host);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!hp) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "Can't find host '%s'\n", host);</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%);">- sock = socket(AF_INET, SOCK_STREAM, 0);</span><br><span style="color: hsl(0, 100%, 40%);">- if (sock < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "Failed to create socket: %s\n", strerror(errno));</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%);">- sin.sin_family = AF_INET;</span><br><span style="color: hsl(0, 100%, 40%);">- sin.sin_port = htons(port);</span><br><span style="color: hsl(0, 100%, 40%);">- memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));</span><br><span style="color: hsl(0, 100%, 40%);">- if (connect(sock, (struct sockaddr *)&sin, sizeof(sin))) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "Failed to connect to '%s' port '%d': %s\n", host, port, strerror(errno));</span><br><span style="color: hsl(0, 100%, 40%);">- close(sock);</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%);">- astf = fdopen(sock, "r+");</span><br><span style="color: hsl(0, 100%, 40%);">- if (!astf) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "fdopen failed: %s\n", strerror(errno));</span><br><span style="color: hsl(0, 100%, 40%);">- close(sock);</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%);">- return 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 char *get_line(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- static char buf[1024];</span><br><span style="color: hsl(0, 100%, 40%);">- if (fgets(buf, sizeof(buf), astf)) {</span><br><span style="color: hsl(0, 100%, 40%);">- while(strlen(buf) && (buf[strlen(buf) - 1] < 33))</span><br><span style="color: hsl(0, 100%, 40%);">- buf[strlen(buf) - 1] = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- return buf;</span><br><span style="color: hsl(0, 100%, 40%);">- } else</span><br><span style="color: hsl(0, 100%, 40%);">- return NULL;</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%);">-/*! Login to the asterisk manager interface */</span><br><span style="color: hsl(0, 100%, 40%);">-static int login_asterisk(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- char *welcome;</span><br><span style="color: hsl(0, 100%, 40%);">- char *resp;</span><br><span style="color: hsl(0, 100%, 40%);">- if (!(welcome = get_line())) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "disconnected (1)\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%);">- fprintf(astf,</span><br><span style="color: hsl(0, 100%, 40%);">- "Action: Login\r\n"</span><br><span style="color: hsl(0, 100%, 40%);">- "Username: %s\r\n"</span><br><span style="color: hsl(0, 100%, 40%);">- "Secret: %s\r\n\r\n", user, pass);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!(welcome = get_line())) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "disconnected (2)\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%);">- if (strcasecmp(welcome, "Response: Success")) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "login failed ('%s')\n", welcome);</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%);">- /* Eat the rest of the event */</span><br><span style="color: hsl(0, 100%, 40%);">- while((resp = get_line()) && strlen(resp));</span><br><span style="color: hsl(0, 100%, 40%);">- if (!resp) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "disconnected (3)\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%);">- fprintf(astf,</span><br><span style="color: hsl(0, 100%, 40%);">- "Action: Status\r\n\r\n");</span><br><span style="color: hsl(0, 100%, 40%);">- if (!(welcome = get_line())) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "disconnected (4)\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%);">- if (strcasecmp(welcome, "Response: Success")) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "status failed ('%s')\n", welcome);</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%);">- /* Eat the rest of the event */</span><br><span style="color: hsl(0, 100%, 40%);">- while((resp = get_line()) && strlen(resp));</span><br><span style="color: hsl(0, 100%, 40%);">- if (!resp) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "disconnected (5)\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%);">- return 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 struct channel *find_channel(char *channel)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- char tmp[256] = "";</span><br><span style="color: hsl(0, 100%, 40%);">- char *s, *t;</span><br><span style="color: hsl(0, 100%, 40%);">- struct channel *chan;</span><br><span style="color: hsl(0, 100%, 40%);">- strncpy(tmp, channel, sizeof(tmp) - 1);</span><br><span style="color: hsl(0, 100%, 40%);">- s = strchr(tmp, '/');</span><br><span style="color: hsl(0, 100%, 40%);">- if (s) {</span><br><span style="color: hsl(0, 100%, 40%);">- *s = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- s++;</span><br><span style="color: hsl(0, 100%, 40%);">- t = strrchr(s, '-');</span><br><span style="color: hsl(0, 100%, 40%);">- if (t) {</span><br><span style="color: hsl(0, 100%, 40%);">- *t = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (debug)</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Searching for '%s' tech, '%s' location\n", tmp, s);</span><br><span style="color: hsl(0, 100%, 40%);">- chan = channels;</span><br><span style="color: hsl(0, 100%, 40%);">- while(chan) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strcasecmp(chan->tech, tmp) && !strcasecmp(chan->location, s)) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (debug)</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Found '%s'/'%s'\n", chan->tech, chan->location);</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%);">- chan = chan->next;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- } else</span><br><span style="color: hsl(0, 100%, 40%);">- chan = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- return chan;</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%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">-static int getvol(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- int vol;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (ioctl(mixfd, MIXER_READ(mixchan), &vol)) {</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">-static float getvol(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- float volumeL, volumeR, vol;</span><br><span style="color: hsl(0, 100%, 40%);">- OSStatus err;</span><br><span style="color: hsl(0, 100%, 40%);">- AudioDeviceID device;</span><br><span style="color: hsl(0, 100%, 40%);">- UInt32 size;</span><br><span style="color: hsl(0, 100%, 40%);">- UInt32 channels[2];</span><br><span style="color: hsl(0, 100%, 40%);">- AudioObjectPropertyAddress OutputAddr = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };</span><br><span style="color: hsl(0, 100%, 40%);">- AudioObjectPropertyAddress ChannelAddr = { kAudioDevicePropertyPreferredChannelsForStereo, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementWildcard };</span><br><span style="color: hsl(0, 100%, 40%);">- AudioObjectPropertyAddress VolumeAddr = { kAudioDevicePropertyVolumeScalar, kAudioDevicePropertyScopeOutput, };</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- size = sizeof(device);</span><br><span style="color: hsl(0, 100%, 40%);">- err = AudioObjectGetPropertyData(kAudioObjectSystemObject, &OutputAddr, 0, NULL, &size, &device);</span><br><span style="color: hsl(0, 100%, 40%);">- size = sizeof(channels);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!err) {</span><br><span style="color: hsl(0, 100%, 40%);">- err = AudioObjectGetPropertyData(device, &ChannelAddr, 0, NULL, &size, &channels);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- size = sizeof(vol);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!err) {</span><br><span style="color: hsl(0, 100%, 40%);">- VolumeAddr.mElement = channels[0];</span><br><span style="color: hsl(0, 100%, 40%);">- err = AudioObjectGetPropertyData(device, &VolumeAddr, 0, NULL, &size, &volumeL);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!err) {</span><br><span style="color: hsl(0, 100%, 40%);">- VolumeAddr.mElement = channels[1];</span><br><span style="color: hsl(0, 100%, 40%);">- err = AudioObjectGetPropertyData(device, &VolumeAddr, 0, NULL, &size, &volumeR);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!err)</span><br><span style="color: hsl(0, 100%, 40%);">- vol = (volumeL < volumeR) ? volumeR : volumeL;</span><br><span style="color: hsl(0, 100%, 40%);">- else {</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "Unable to read mixer volume: %s\n", strerror(errno));</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%);">- return vol;</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%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">-static int setvol(int vol)</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">-static int setvol(float vol)</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- if (ioctl(mixfd, MIXER_WRITE(mixchan), &vol)) {</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">- float volumeL = vol;</span><br><span style="color: hsl(0, 100%, 40%);">- float volumeR = vol;</span><br><span style="color: hsl(0, 100%, 40%);">- OSStatus err;</span><br><span style="color: hsl(0, 100%, 40%);">- AudioDeviceID device;</span><br><span style="color: hsl(0, 100%, 40%);">- UInt32 size;</span><br><span style="color: hsl(0, 100%, 40%);">- UInt32 channels[2];</span><br><span style="color: hsl(0, 100%, 40%);">- AudioObjectPropertyAddress OutputAddr = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };</span><br><span style="color: hsl(0, 100%, 40%);">- AudioObjectPropertyAddress ChannelAddr = { kAudioDevicePropertyPreferredChannelsForStereo, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementWildcard };</span><br><span style="color: hsl(0, 100%, 40%);">- AudioObjectPropertyAddress VolumeAddr = { kAudioDevicePropertyVolumeScalar, kAudioDevicePropertyScopeOutput, };</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- size = sizeof(device);</span><br><span style="color: hsl(0, 100%, 40%);">- err = AudioObjectGetPropertyData(kAudioObjectSystemObject, &OutputAddr, 0, NULL, &size, &device);</span><br><span style="color: hsl(0, 100%, 40%);">- size = sizeof(channels);</span><br><span style="color: hsl(0, 100%, 40%);">- err = AudioObjectGetPropertyData(device, &ChannelAddr, 0, NULL, &size, &channels);</span><br><span style="color: hsl(0, 100%, 40%);">- size = sizeof(vol);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!err) {</span><br><span style="color: hsl(0, 100%, 40%);">- VolumeAddr.mElement = channels[0];</span><br><span style="color: hsl(0, 100%, 40%);">- err = AudioObjectSetPropertyData(device, &VolumeAddr, 0, NULL, size, &volumeL);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!err) {</span><br><span style="color: hsl(0, 100%, 40%);">- VolumeAddr.mElement = channels[1];</span><br><span style="color: hsl(0, 100%, 40%);">- err = AudioObjectSetPropertyData(device, &VolumeAddr, 0, NULL, size, &volumeR);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (err) {</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "Unable to write mixer volume: %s\n", strerror(errno));</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%);">- return 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%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">-static int oldvol = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-static int mutevol = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">-static float oldvol = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-static float mutevol = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">-static int mutedlevel(int orig, int level)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- int l = orig >> 8;</span><br><span style="color: hsl(0, 100%, 40%);">- int r = orig & 0xff;</span><br><span style="color: hsl(0, 100%, 40%);">- l = (float)(level) * (float)(l) / 100.0;</span><br><span style="color: hsl(0, 100%, 40%);">- r = (float)(level) * (float)(r) / 100.0;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- return (l << 8) | r;</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">-static float mutedlevel(float orig, float level)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- float master = orig;</span><br><span style="color: hsl(0, 100%, 40%);">- master = level * master / 100.0;</span><br><span style="color: hsl(0, 100%, 40%);">- return master;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</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%);">-static void mute(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- int vol;</span><br><span style="color: hsl(0, 100%, 40%);">- int start;</span><br><span style="color: hsl(0, 100%, 40%);">- int x;</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">- float vol;</span><br><span style="color: hsl(0, 100%, 40%);">- float start = 1.0;</span><br><span style="color: hsl(0, 100%, 40%);">- float x;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- vol = getvol();</span><br><span style="color: hsl(0, 100%, 40%);">- oldvol = vol;</span><br><span style="color: hsl(0, 100%, 40%);">- if (smoothfade)</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- start = mutelevel;</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">- start = 100;</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- start = mutelevel;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- for (x=start;x>=mutelevel;x-=stepsize) {</span><br><span style="color: hsl(0, 100%, 40%);">- mutevol = mutedlevel(vol, x);</span><br><span style="color: hsl(0, 100%, 40%);">- setvol(mutevol);</span><br><span style="color: hsl(0, 100%, 40%);">- /* Wait 0.01 sec */</span><br><span style="color: hsl(0, 100%, 40%);">- usleep(10000);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- mutevol = mutedlevel(vol, mutelevel);</span><br><span style="color: hsl(0, 100%, 40%);">- setvol(mutevol);</span><br><span style="color: hsl(0, 100%, 40%);">- if (debug)</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Mute from '%f' to '%f'!\n", oldvol, mutevol);</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Mute from '%04x' to '%04x'!\n", oldvol, mutevol);</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- muted = 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%);">-static void unmute(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- float vol;</span><br><span style="color: hsl(0, 100%, 40%);">- float start;</span><br><span style="color: hsl(0, 100%, 40%);">- float x;</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">- int vol;</span><br><span style="color: hsl(0, 100%, 40%);">- int start;</span><br><span style="color: hsl(0, 100%, 40%);">- int x;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- vol = getvol();</span><br><span style="color: hsl(0, 100%, 40%);">- if (debug)</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Unmute from '%f' (should be '%f') to '%f'!\n", vol, mutevol, oldvol);</span><br><span style="color: hsl(0, 100%, 40%);">- mutevol = vol;</span><br><span style="color: hsl(0, 100%, 40%);">- if (vol == mutevol) {</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Unmute from '%04x' (should be '%04x') to '%04x'!\n", vol, mutevol, oldvol);</span><br><span style="color: hsl(0, 100%, 40%);">- if ((int)vol == mutevol) {</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- if (smoothfade)</span><br><span style="color: hsl(0, 100%, 40%);">- start = mutelevel;</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- start = 1.0;</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">- start = 100;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- for (x=start;x<100;x+=stepsize) {</span><br><span style="color: hsl(0, 100%, 40%);">- mutevol = mutedlevel(oldvol, x);</span><br><span style="color: hsl(0, 100%, 40%);">- setvol(mutevol);</span><br><span style="color: hsl(0, 100%, 40%);">- /* Wait 0.01 sec */</span><br><span style="color: hsl(0, 100%, 40%);">- usleep(10000);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- setvol(oldvol);</span><br><span style="color: hsl(0, 100%, 40%);">- } else</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Whoops, it's already been changed!\n");</span><br><span style="color: hsl(0, 100%, 40%);">- muted = 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 void check_mute(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- int offhook = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- struct channel *chan;</span><br><span style="color: hsl(0, 100%, 40%);">- chan = channels;</span><br><span style="color: hsl(0, 100%, 40%);">- while(chan) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (chan->subs) {</span><br><span style="color: hsl(0, 100%, 40%);">- offhook++;</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%);">- chan = chan->next;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (offhook && !muted)</span><br><span style="color: hsl(0, 100%, 40%);">- mute();</span><br><span style="color: hsl(0, 100%, 40%);">- else if (!offhook && muted)</span><br><span style="color: hsl(0, 100%, 40%);">- unmute();</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 void delete_sub(struct channel *chan, char *name)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- struct subchannel *sub, *prev;</span><br><span style="color: hsl(0, 100%, 40%);">- prev = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- sub = chan->subs;</span><br><span style="color: hsl(0, 100%, 40%);">- while(sub) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strcasecmp(sub->name, name)) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (prev)</span><br><span style="color: hsl(0, 100%, 40%);">- prev->next = sub->next;</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- chan->subs = sub->next;</span><br><span style="color: hsl(0, 100%, 40%);">- free(sub->name);</span><br><span style="color: hsl(0, 100%, 40%);">- free(sub);</span><br><span style="color: hsl(0, 100%, 40%);">- return;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- prev = sub;</span><br><span style="color: hsl(0, 100%, 40%);">- sub = sub->next;</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%);">-static void append_sub(struct channel *chan, char *name)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- struct subchannel *sub;</span><br><span style="color: hsl(0, 100%, 40%);">- sub = chan->subs;</span><br><span style="color: hsl(0, 100%, 40%);">- while(sub) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strcasecmp(sub->name, name))</span><br><span style="color: hsl(0, 100%, 40%);">- return;</span><br><span style="color: hsl(0, 100%, 40%);">- sub = sub->next;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- sub = malloc(sizeof(struct subchannel));</span><br><span style="color: hsl(0, 100%, 40%);">- if (sub) {</span><br><span style="color: hsl(0, 100%, 40%);">- memset(sub, 0, sizeof(struct subchannel));</span><br><span style="color: hsl(0, 100%, 40%);">- if (!(sub->name = strdup(name))) {</span><br><span style="color: hsl(0, 100%, 40%);">- free(sub);</span><br><span style="color: hsl(0, 100%, 40%);">- return;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- sub->next = chan->subs;</span><br><span style="color: hsl(0, 100%, 40%);">- chan->subs = sub;</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%);">-static void hangup_chan(char *channel)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- struct channel *chan;</span><br><span style="color: hsl(0, 100%, 40%);">- if (debug)</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Hangup '%s'\n", channel);</span><br><span style="color: hsl(0, 100%, 40%);">- chan = find_channel(channel);</span><br><span style="color: hsl(0, 100%, 40%);">- if (chan)</span><br><span style="color: hsl(0, 100%, 40%);">- delete_sub(chan, channel);</span><br><span style="color: hsl(0, 100%, 40%);">- check_mute();</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 void offhook_chan(char *channel)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- struct channel *chan;</span><br><span style="color: hsl(0, 100%, 40%);">- if (debug)</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Offhook '%s'\n", channel);</span><br><span style="color: hsl(0, 100%, 40%);">- chan = find_channel(channel);</span><br><span style="color: hsl(0, 100%, 40%);">- if (chan)</span><br><span style="color: hsl(0, 100%, 40%);">- append_sub(chan, channel);</span><br><span style="color: hsl(0, 100%, 40%);">- check_mute();</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 wait_event(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- char *resp;</span><br><span style="color: hsl(0, 100%, 40%);">- char event[120]="";</span><br><span style="color: hsl(0, 100%, 40%);">- char channel[120]="";</span><br><span style="color: hsl(0, 100%, 40%);">- char oldname[120]="";</span><br><span style="color: hsl(0, 100%, 40%);">- char newname[120]="";</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- resp = get_line();</span><br><span style="color: hsl(0, 100%, 40%);">- if (!resp) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "disconnected (6)\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%);">- if (!strncasecmp(resp, "Event: ", strlen("Event: "))) {</span><br><span style="color: hsl(0, 100%, 40%);">- int event_len = -1;</span><br><span style="color: hsl(0, 100%, 40%);">- int channel_len = -1;</span><br><span style="color: hsl(0, 100%, 40%);">- int newname_len = -1;</span><br><span style="color: hsl(0, 100%, 40%);">- int oldname_len = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- event_len = snprintf(event, sizeof(event), "%s", resp + strlen("Event: "));</span><br><span style="color: hsl(0, 100%, 40%);">- /* Consume the rest of the non-event */</span><br><span style="color: hsl(0, 100%, 40%);">- while((resp = get_line()) && strlen(resp)) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strncasecmp(resp, "Channel: ", strlen("Channel: ")))</span><br><span style="color: hsl(0, 100%, 40%);">- channel_len = snprintf(channel, sizeof(channel), "%s", resp + strlen("Channel: "));</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strncasecmp(resp, "Newname: ", strlen("Newname: ")))</span><br><span style="color: hsl(0, 100%, 40%);">- newname_len = snprintf(newname, sizeof(newname), "%s", resp + strlen("Newname: "));</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strncasecmp(resp, "Oldname: ", strlen("Oldname: ")))</span><br><span style="color: hsl(0, 100%, 40%);">- oldname_len = snprintf(oldname, sizeof(oldname), "%s", resp + strlen("Oldname: "));</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (channel_len == strlen(channel)) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (event_len == strlen(event) && !strcasecmp(event, "Hangup"))</span><br><span style="color: hsl(0, 100%, 40%);">- hangup_chan(channel);</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- offhook_chan(channel);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (newname_len == strlen(newname) && oldname_len == strlen(oldname)) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (event_len == strlen(event) && !strcasecmp(event, "Rename")) {</span><br><span style="color: hsl(0, 100%, 40%);">- hangup_chan(oldname);</span><br><span style="color: hsl(0, 100%, 40%);">- offhook_chan(newname);</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%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- /* Consume the rest of the non-event */</span><br><span style="color: hsl(0, 100%, 40%);">- while((resp = get_line()) && strlen(resp));</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!resp) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "disconnected (7)\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%);">- return 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 void usage(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Usage: muted [-f] [-d]\n"</span><br><span style="color: hsl(0, 100%, 40%);">- " -f : Do not fork\n"</span><br><span style="color: hsl(0, 100%, 40%);">- " -d : Debug (implies -f)\n");</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%);">-int main(int argc, char *argv[])</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- int x;</span><br><span style="color: hsl(0, 100%, 40%);">- while((x = getopt(argc, argv, "fhd")) > 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- switch(x) {</span><br><span style="color: hsl(0, 100%, 40%);">- case 'd':</span><br><span style="color: hsl(0, 100%, 40%);">- debug = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- needfork = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- case 'f':</span><br><span style="color: hsl(0, 100%, 40%);">- needfork = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- case 'h':</span><br><span style="color: hsl(0, 100%, 40%);">- /* Fall through */</span><br><span style="color: hsl(0, 100%, 40%);">- default:</span><br><span style="color: hsl(0, 100%, 40%);">- usage();</span><br><span style="color: hsl(0, 100%, 40%);">- exit(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 (load_config())</span><br><span style="color: hsl(0, 100%, 40%);">- exit(1);</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- if (open_mixer())</span><br><span style="color: hsl(0, 100%, 40%);">- exit(1);</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- if (connect_asterisk()) {</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- close(mixfd);</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- exit(1);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (login_asterisk()) {</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef __Darwin__</span><br><span style="color: hsl(0, 100%, 40%);">- close(mixfd);</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- fclose(astf);</span><br><span style="color: hsl(0, 100%, 40%);">- exit(1);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef HAVE_WORKING_FORK</span><br><span style="color: hsl(0, 100%, 40%);">- if (needfork) {</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef HAVE_SBIN_LAUNCHD</span><br><span style="color: hsl(0, 100%, 40%);">- if (daemon(0,0) < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "daemon() failed: %s\n", strerror(errno));</span><br><span style="color: hsl(0, 100%, 40%);">- exit(1);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">- const char *found = NULL, *paths[] = {</span><br><span style="color: hsl(0, 100%, 40%);">- "/Library/LaunchAgents/org.asterisk.muted.plist",</span><br><span style="color: hsl(0, 100%, 40%);">- "/Library/LaunchDaemons/org.asterisk.muted.plist",</span><br><span style="color: hsl(0, 100%, 40%);">- "contrib/init.d/org.asterisk.muted.plist",</span><br><span style="color: hsl(0, 100%, 40%);">- "<path-to-asterisk-source>/contrib/init.d/org.asterisk.muted.plist" };</span><br><span style="color: hsl(0, 100%, 40%);">- char userpath[256];</span><br><span style="color: hsl(0, 100%, 40%);">- struct stat unused;</span><br><span style="color: hsl(0, 100%, 40%);">- struct passwd *pwd = getpwuid(getuid());</span><br><span style="color: hsl(0, 100%, 40%);">- int i;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- snprintf(userpath, sizeof(userpath), "%s%s", pwd->pw_dir, paths[0]);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!stat(userpath, &unused)) {</span><br><span style="color: hsl(0, 100%, 40%);">- found = userpath;</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 (!found) {</span><br><span style="color: hsl(0, 100%, 40%);">- for (i = 0; i < 3; i++) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!stat(paths[i], &unused)) {</span><br><span style="color: hsl(0, 100%, 40%);">- found = paths[i];</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(stderr, "Mac OS X detected. Use 'launchctl load -w %s' to launch.\n", found ? found : paths[3]);</span><br><span style="color: hsl(0, 100%, 40%);">- exit(1);</span><br><span style="color: hsl(0, 100%, 40%);">-#endif /* !defined(HAVE_SBIN_LAUNCHD */</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">- for(;;) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (wait_event()) {</span><br><span style="color: hsl(0, 100%, 40%);">- fclose(astf);</span><br><span style="color: hsl(0, 100%, 40%);">- while(connect_asterisk()) {</span><br><span style="color: hsl(0, 100%, 40%);">- sleep(5);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (login_asterisk()) {</span><br><span style="color: hsl(0, 100%, 40%);">- fclose(astf);</span><br><span style="color: hsl(0, 100%, 40%);">- exit(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%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- exit(0);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span>diff --git a/utils/utils.xml b/utils/utils.xml</span><br><span>index ae72bac..93c560c 100644</span><br><span>--- a/utils/utils.xml</span><br><span>+++ b/utils/utils.xml</span><br><span>@@ -28,10 +28,6 @@</span><br><span> <defaultenabled>no</defaultenabled></span><br><span> <support_level>extended</support_level></span><br><span> </member></span><br><span style="color: hsl(0, 100%, 40%);">- <member name="muted"></span><br><span style="color: hsl(0, 100%, 40%);">- <defaultenabled>no</defaultenabled></span><br><span style="color: hsl(0, 100%, 40%);">- <support_level>deprecated</support_level></span><br><span style="color: hsl(0, 100%, 40%);">- </member></span><br><span> <member name="smsq"></span><br><span> <defaultenabled>no</defaultenabled></span><br><span> <depend>popt</depend></span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16318">change 16318</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/+/16318"/><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: I0ae1c6a2996da43217126f094de90761314dcf82 </div>
<div style="display:none"> Gerrit-Change-Number: 16318 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>