aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-09-09 08:22:20 +0300
committerTimo Teräs <timo.teras@iki.fi>2016-09-09 08:24:19 +0300
commit372b48e0f1c329fe0434e4f91c4640af8ef284c0 (patch)
tree1c685e3006c9f6fdda1fc1aac8492d5c3104ed75 /main/asterisk
parentb20bcc50abdf385b2b55ff516458892801118623 (diff)
downloadaports-372b48e0f1c329fe0434e4f91c4640af8ef284c0.tar.bz2
aports-372b48e0f1c329fe0434e4f91c4640af8ef284c0.tar.xz
main/asterisk: upgrade to 13.11.1
AST-2016-006: Crash on ACK from unknown endpoint AST-2016-007: RTP Resource Exhaustion Remove our custom patch ASTERISK-19109 as unneeded since the administrative mute can be used for similar features. And remove musl-includes.patch as it was merged upstream.
Diffstat (limited to 'main/asterisk')
-rw-r--r--main/asterisk/APKBUILD28
-rw-r--r--main/asterisk/ASTERISK-18995.patch85
-rw-r--r--main/asterisk/ASTERISK-19109.patch817
-rw-r--r--main/asterisk/ASTERISK-20527.patch27
-rw-r--r--main/asterisk/musl-includes.patch46
5 files changed, 98 insertions, 905 deletions
diff --git a/main/asterisk/APKBUILD b/main/asterisk/APKBUILD
index 7e6c54dd81..836d368935 100644
--- a/main/asterisk/APKBUILD
+++ b/main/asterisk/APKBUILD
@@ -2,7 +2,7 @@
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=asterisk
-pkgver=13.9.1
+pkgver=13.11.1
pkgrel=0
pkgdesc="Asterisk: A Module Open Source PBX System"
pkgusers="asterisk"
@@ -30,11 +30,9 @@ source="$_download/asterisk-$pkgver.tar.gz
http://dev.alpinelinux.org/~tteras/asterisk-addon-mp3-r201.patch.gz
musl-libcap.patch
- musl-includes.patch
musl-glob-compat.patch
musl-mutex-init.patch
ASTERISK-18995.patch
- ASTERISK-19109.patch
ASTERISK-20527.patch
asterisk.initd
asterisk.confd
@@ -242,39 +240,33 @@ sound_en() {
chown -R asterisk:asterisk "$subpkgdir"/var/*/asterisk
}
-md5sums="76c42992a79f41ec467ed20500e8b249 asterisk-13.9.1.tar.gz
+md5sums="7c27d278533c5936348a412e9df5982d asterisk-13.11.1.tar.gz
126dd4fba66f4cf9aa94dfd7034e0ec4 asterisk-addon-mp3-r201.patch.gz
7b699961171a93d7788420f518c5931e musl-libcap.patch
-1147c81ac5e49c36a5d264019480bec0 musl-includes.patch
9b3e6cb75464a6ef4c40d191bdfdf7ea musl-glob-compat.patch
1ca5e8326dc03c963a7ce5455d0f21ba musl-mutex-init.patch
-5535ecf893134fd341cfbd9f8e1249d2 ASTERISK-18995.patch
-1602fe604bba3261d4a77ab58467237b ASTERISK-19109.patch
-018f2fb1ebd31dc28bfb49919b2a0a81 ASTERISK-20527.patch
+120deda3ccd21c905ac51fda1f696931 ASTERISK-18995.patch
+a91bf5c4fea24b3e04f02e41751aaa88 ASTERISK-20527.patch
4bdc82ba3d6bdfdedc71e5da2fde5ec2 asterisk.initd
ed31d7ba37bcf8b0346dcf8593c395f0 asterisk.confd
3e65172275684373e1a25c8a11224411 asterisk.logrotate"
-sha256sums="00e51aeaf077b54e610ebb5ebe64097f3d64da2cc2aecab25306dd74de96a236 asterisk-13.9.1.tar.gz
+sha256sums="d1dc61b78b5e2c51a3c7b65300f2cb29470c88552fc6c30aa9ea426fef385748 asterisk-13.11.1.tar.gz
d32a5a695cee1699011d0e9ad02eb43af612def06f92017627194099edf98e3f asterisk-addon-mp3-r201.patch.gz
f23aa2c03f9be1eb3c4c0ceac79ddcce7381aae46d6e6853ad20b1de5ac125d9 musl-libcap.patch
-354596949399ac38f245e03a0833ca4cf6aa664e28ef92d79715c654465aa5fe musl-includes.patch
c6a5c32646b767f09ebffccc49cac6a4ff9181498499e4453300775e75284b52 musl-glob-compat.patch
a5205ed44b57a72934baf8cde543ddb179f277494181818905110bfdcccfe7d9 musl-mutex-init.patch
-d3f1304ddcce48f2c09cb81e924052f7eb2d36829aa1a0bf6a2e0be476333ee7 ASTERISK-18995.patch
-25a6f985448ed3468dcad8fc03f492ffe1d4804aefa6a35fff609dfa13ccdf05 ASTERISK-19109.patch
-84d21c9ef2d3a21d8cdef12034c5dcf57eb08a6a7fb76367bc839b60f7d24713 ASTERISK-20527.patch
+76ba70d0df5f4a788294854cf3a40c3adea711ea70fdb7750ee208afc0b13b12 ASTERISK-18995.patch
+790af610fe147d8add270e7e7e0d998e265ed78374f597844beaedd270d44b07 ASTERISK-20527.patch
10454553733e6cc52c6e9db508768a638655d99c095c5b39fb043858c088f21f asterisk.initd
d221148583b57f9c37d7160f2493f0d204ad11f7abb17e3a3534e108ad5452d7 asterisk.confd
77b253b6db71460acf9a51e87ad4c8582027a46db01a4c50fb048bada58c19d1 asterisk.logrotate"
-sha512sums="a30635930a8b98b5ff5a132897de16b80cfff182e7dcae5d9507ced95a388fff97c624f75b787ebe6775cf6085a043c152d8854e8f0562528a0e01d2ac295d81 asterisk-13.9.1.tar.gz
+sha512sums="23bb5b8997426ae952017bdc6c7630ff1ca4ca401879557f14b26fd5fb83014577b487e2e0a52cc46d15b691c4e5a732aaf7baba47d566bfb676e9c5f7f472c0 asterisk-13.11.1.tar.gz
aacef3f4796fb1abd33266998b53909cb4b36e7cc5ad2f7bac68bdc43e9a9072d9a4e2e7e681bddfa31f3d04575eb248afe6ea95da780c67e4829c1e22adfe1b asterisk-addon-mp3-r201.patch.gz
31bdf1323155a9fbedf8c05183167903ff83bef4d408848368d3fab78e6c6265228ceece54375d68df6a99b9c1879431033d0a8cec875244c61ccc1f8e37fc5d musl-libcap.patch
-7eb3c1f3207d8f7c58fbc3b30e7b9193e7498da09d53d7e907f3d9d79ffc86fa6f83b593dc4c1b0007d7e62565cb8618dc415d1a9ee61affa10e6a64b146967a musl-includes.patch
edf65eba44e8f1f0e78671aba312bcff2090134cf94e89ebb4b6beef7b2d57b24381ae9511cbf9fffe6b555e695a3dbe2cedcd04f1d237df822fa742bd5092ac musl-glob-compat.patch
f72c2e04de80d3ed9ce841308101383a1655e6da7a3c888ad31fffe63d1280993e08aefcf8e638316d439c68b38ee05362c87503fca1f36343976a01af9d6eb1 musl-mutex-init.patch
-f6c1b0030225638a20e374a6f14dca23fce88e1953bec0e399e8ee2e18241f6fdebc6be0404d7ae46359f66cdb7aa9240f2a4be17d5046aedf5aa72235e9da5d ASTERISK-18995.patch
-ca1c0b23bb34a9bde2ce1e32f6f6a0f8d54459badff6a5614b1ddb79c7eaeb7a6e8e32714df61136471acf7981ec143e4746b2b00c163da2fcc9da04974fb1fc ASTERISK-19109.patch
-cdc41b50827f79194bf641782f82e5e0f15866788824002fe456e9e32bc37921ee2525baa476219c357ec35891a194ed00515a17b0ccab3a6bc4479ec52bc175 ASTERISK-20527.patch
+e6becba58f73ffeac7831092135e9cfd5ca9029b9471061b6f20d6e98c9c4d4dcaea7d69a53c079fb5baf03963809740e5feaf8b595072229a04912bff9ff41a ASTERISK-18995.patch
+0c9f643b2b5548753bf5228ea17a2a55753ea4fdcd32c3ef105f4f27a762a0f93a4a02ba0b88d969fad8729048d357959d3f7d0fa166c2935170f0753b08d8a4 ASTERISK-20527.patch
cd5bd1c1d7db0a44b14eb10e6d098af0c6474c8fe1a57395090d6795ac00e9243d004b7d24eba2cfd5bd6d6407c271913e794551a8dfcf3cf93e89fc91349e12 asterisk.initd
ab6b6f08ff43268cbb1abb7ed7d678949991ba495682a644bbaeb017d6adbff0a43297905fd73ae8db1786a28d5b5904f1bc253209a0e388c8a27f26c6ce14ed asterisk.confd
7591d2faf539d05d9ee4e431c78a5e20686721fd79221ad94dffeeaff9282220b09cb9aec214bd7a8d12affaec0276c9c91e6e21af8b6712c0a9502b60b02f2b asterisk.logrotate"
diff --git a/main/asterisk/ASTERISK-18995.patch b/main/asterisk/ASTERISK-18995.patch
index 2613176305..03f796dd79 100644
--- a/main/asterisk/ASTERISK-18995.patch
+++ b/main/asterisk/ASTERISK-18995.patch
@@ -1,10 +1,45 @@
---- /dev/null 2014-10-31 08:01:35.193329595 -0200
-+++ asterisk-13.0.0/formats/format_ogg_speex.c 2014-10-31 09:19:34.010493106 -0200
-@@ -0,0 +1,336 @@
+From 56bdf048d2c873d0ddfad3672a07e7a08f0b706e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Fri, 3 Jun 2016 09:20:39 +0300
+Subject: [PATCH] Add support for OGG/Speex file format
+
+ASTERISK-18995 #close
+
+Change-Id: I98518bd28fc8f95668b3fe27d2cab45045ff3f7a
+---
+ CHANGES | 7 +
+ formats/format_ogg_speex.c | 345 +++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 352 insertions(+)
+ create mode 100644 formats/format_ogg_speex.c
+
+diff --git a/CHANGES b/CHANGES
+index 43dc18f..175138a 100644
+--- a/CHANGES
++++ b/CHANGES
+@@ -249,6 +249,13 @@ Functions
+ * The func_odbc global option "single_db_connection" default value has been
+ changed to 'no'.
+
++
++Formats
++------------------
++ * New module format_ogg_speex added which supports Speex codec inside
++ Ogg containers (filename extension .spx).
++
++
+ CHANNEL
+ ------------------
+ * Added CHANNEL(onhold) item that returns 1 (onhold) and 0 (not-onhold) for
+diff --git a/formats/format_ogg_speex.c b/formats/format_ogg_speex.c
+new file mode 100644
+index 0000000..6152e9c
+--- /dev/null
++++ b/formats/format_ogg_speex.c
+@@ -0,0 +1,345 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
-+ * Copyright (C) 2011-2014, Timo Teräs
++ * Copyright (C) 2011-2016, Timo Teräs
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
@@ -32,7 +67,7 @@
+
+#include "asterisk.h"
+
-+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
++ASTERISK_REGISTER_FILE()
+
+#include "asterisk/mod_format.h"
+#include "asterisk/module.h"
@@ -68,16 +103,19 @@
+ /* 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))
++ 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)
++ }
++ if (s->serialno == -1 || s->os.serialno != s->serialno) {
+ continue;
++ }
+ return 0;
+ }
+
-+ if (result < 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) {
@@ -90,13 +128,14 @@
+ result = ogg_sync_pageout(&s->oy, &s->og);
+ if (result > 0) {
+ /* Read all streams. */
-+ if (ogg_page_serialno(&s->og) != s->os.serialno)
++ 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 */
++ /* Yes, got a new, valid page */
+ if (ogg_page_eos(&s->og) &&
+ ogg_page_serialno(&s->og) == s->serialno)
+ s->eos = 1;
@@ -106,17 +145,19 @@
+ "Invalid page in the bitstream; continuing...\n");
+ }
+
-+ if (result < 0)
++ 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)
++ if (bytes == 0) {
+ s->eos = 1;
++ }
+ }
+ }
+}
@@ -154,7 +195,7 @@
+ }
+
+ ogg_stream_init(&s->os, ogg_page_serialno(&s->og));
-+ if (ogg_stream_pagein(&s->os, &s->og) < 0) {
++ if (ogg_stream_pagein(&s->os, &s->og) < 0) {
+ ast_log(LOG_ERROR, "Error reading first page of Ogg bitstream data.\n");
+ goto error;
+ }
@@ -194,12 +235,13 @@
+ goto error;
+ }
+ }
-+ free(hdr);
++ speex_header_free(hdr);
+
+ return 0;
+error:
-+ if (hdr)
-+ free(hdr);
++ if (hdr) {
++ speex_header_free(hdr);
++ }
+ ogg_stream_clear(&s->os);
+ ogg_sync_clear(&s->oy);
+ return -1;
@@ -228,8 +270,9 @@
+{
+ struct speex_desc *s = (struct speex_desc *)fs->_private;
+
-+ if (read_packet(fs) < 0)
++ if (read_packet(fs) < 0) {
+ return NULL;
++ }
+
+ AST_FRAME_SET_BUFFER(&fs->fr, fs->buf, AST_FRIENDLY_OFFSET, BUF_SIZE);
+ memcpy(fs->fr.data.ptr, s->op.packet, s->op.bytes);
@@ -255,7 +298,7 @@
+ * \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
++ * \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)
@@ -317,8 +360,9 @@
+
+ if (ast_format_def_register(&speex_f) ||
+ ast_format_def_register(&speex16_f) ||
-+ ast_format_def_register(&speex32_f))
++ ast_format_def_register(&speex32_f)) {
+ return AST_MODULE_LOAD_FAILURE;
++ }
+
+ return AST_MODULE_LOAD_SUCCESS;
+}
@@ -337,3 +381,6 @@
+ .unload = unload_module,
+ .load_pri = AST_MODPRI_APP_DEPEND
+);
+--
+2.10.0
+
diff --git a/main/asterisk/ASTERISK-19109.patch b/main/asterisk/ASTERISK-19109.patch
deleted file mode 100644
index d089363cc1..0000000000
--- a/main/asterisk/ASTERISK-19109.patch
+++ /dev/null
@@ -1,817 +0,0 @@
-From 22eaabbc4e86b68812efebd2db4e08518d38f8b2 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
-Date: Thu, 2 Jun 2016 09:22:03 +0300
-Subject: [PATCH] Implement deafened mode for confbridge
-
-ASTERISK-19109
----
- CHANGES | 4 +
- apps/app_confbridge.c | 252 +++++++++++++++++++++++++++++----
- apps/confbridge/conf_config_parser.c | 14 ++
- apps/confbridge/confbridge_manager.c | 78 ++++++++++
- apps/confbridge/include/confbridge.h | 8 ++
- bridges/bridge_softmix.c | 24 ++--
- configs/samples/confbridge.conf.sample | 5 +
- include/asterisk/bridge_features.h | 2 +
- main/bridge_channel.c | 17 ++-
- 9 files changed, 369 insertions(+), 35 deletions(-)
-
-diff --git a/CHANGES b/CHANGES
-index 382c4a4..435c69b 100644
---- a/CHANGES
-+++ b/CHANGES
-@@ -8,6 +8,10 @@
- ===
- ==============================================================================
-
-+
-+ * Added support for deaf participants with CLI commands, manager actions
-+ and ConfBridge DTMF actions to toggle the deaf state.
-+
- ------------------------------------------------------------------------------
- --- Functionality changes from Asterisk 13.8.0 to Asterisk 13.9.0 ------------
- ------------------------------------------------------------------------------
-diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
-index 55b7b12..363d88c 100644
---- a/apps/app_confbridge.c
-+++ b/apps/app_confbridge.c
-@@ -272,6 +272,30 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
- <description>
- </description>
- </manager>
-+ <manager name="ConfbridgeDeafen" language="en_US">
-+ <synopsis>
-+ Deafen a Confbridge user.
-+ </synopsis>
-+ <syntax>
-+ <xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
-+ <parameter name="Conference" required="true" />
-+ <parameter name="Channel" required="true" />
-+ </syntax>
-+ <description>
-+ </description>
-+ </manager>
-+ <manager name="ConfbridgeUndeafen" language="en_US">
-+ <synopsis>
-+ Undeafen a Confbridge user.
-+ </synopsis>
-+ <syntax>
-+ <xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
-+ <parameter name="Conference" required="true" />
-+ <parameter name="Channel" required="true" />
-+ </syntax>
-+ <description>
-+ </description>
-+ </manager>
- <manager name="ConfbridgeKick" language="en_US">
- <synopsis>
- Kick a Confbridge user.
-@@ -368,6 +392,13 @@ static const char app[] = "ConfBridge";
- /*! Initial recording filename space. */
- #define RECORD_FILENAME_INITIAL_SPACE 128
-
-+enum confbridge_feature_action {
-+ CONFBRIDGE_FEATURE_MUTE,
-+ CONFBRIDGE_FEATURE_UNMUTE,
-+ CONFBRIDGE_FEATURE_DEAFEN,
-+ CONFBRIDGE_FEATURE_UNDEAFEN
-+};
-+
- /*! \brief Container to hold all conference bridges in progress */
- struct ao2_container *conference_bridges;
-
-@@ -439,6 +470,10 @@ const char *conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds
- return S_OR(custom_sounds->muted, "conf-muted");
- case CONF_SOUND_UNMUTED:
- return S_OR(custom_sounds->unmuted, "conf-unmuted");
-+ case CONF_SOUND_DEAFENED:
-+ return S_OR(custom_sounds->deafened, "conf-deafened");
-+ case CONF_SOUND_UNDEAFENED:
-+ return S_OR(custom_sounds->undeafened, "conf-undeafened");
- case CONF_SOUND_ONLY_ONE:
- return S_OR(custom_sounds->onlyone, "conf-onlyone");
- case CONF_SOUND_THERE_ARE:
-@@ -589,6 +624,16 @@ static void send_unmute_event(struct confbridge_user *user, struct confbridge_co
- ast_json_unref(json_object);
- }
-
-+static void send_deafen_event(struct confbridge_user *user, struct confbridge_conference *conference)
-+{
-+ send_conf_stasis(conference, user->chan, confbridge_deafen_type(), NULL, 1);
-+}
-+
-+static void send_undeafen_event(struct confbridge_user *user, struct confbridge_conference *conference)
-+{
-+ send_conf_stasis(conference, user->chan, confbridge_undeafen_type(), NULL, 1);
-+}
-+
- static void set_rec_filename(struct confbridge_conference *conference, struct ast_str **filename, int is_new)
- {
- char *rec_file = conference->b_profile.rec_file;
-@@ -1088,26 +1133,54 @@ void conf_update_user_mute(struct confbridge_user *user)
-
- /*
- * \internal
-- * \brief Mute/unmute a single user.
-+ * \brief Send feature change test event.
- */
--static void generic_mute_unmute_user(struct confbridge_conference *conference, struct confbridge_user *user, int mute)
-+static void test_suite_feature_action_event_notify(
-+ struct confbridge_conference *conference,
-+ struct confbridge_user *user,
-+ const char *state, const char *verb)
- {
-- /* Set user level mute request. */
-- user->muted = mute ? 1 : 0;
--
-- conf_update_user_mute(user);
-- ast_test_suite_event_notify("CONF_MUTE",
-+ ast_test_suite_event_notify(state,
- "Message: participant %s %s\r\n"
- "Conference: %s\r\n"
- "Channel: %s",
- ast_channel_name(user->chan),
-- mute ? "muted" : "unmuted",
-+ verb,
- conference->b_profile.name,
- ast_channel_name(user->chan));
-- if (mute) {
-+}
-+
-+/* \internal
-+ * \brief Change a feature for one conference user.
-+ */
-+static void generic_feature_action_helper_user(
-+ struct confbridge_conference *conference, struct confbridge_user *user,
-+ enum confbridge_feature_action action)
-+{
-+ switch (action) {
-+ case CONFBRIDGE_FEATURE_DEAFEN:
-+ user->features.deaf = 1;
-+ test_suite_feature_action_event_notify(conference, user, "CONF_DEAF", "deafened");
-+ send_deafen_event(user, conference);
-+ break;
-+ case CONFBRIDGE_FEATURE_UNDEAFEN:
-+ user->features.deaf = 0;
-+ test_suite_feature_action_event_notify(conference, user, "CONF_DEAF", "undeafened");
-+ send_undeafen_event(user, conference);
-+ break;
-+ case CONFBRIDGE_FEATURE_MUTE:
-+ user->muted = 1;
-+ conf_update_user_mute(user);
-+ test_suite_feature_action_event_notify(conference, user, "CONF_MUTE", "muted");
- send_mute_event(user, conference);
-- } else {
-+ break;
-+ case CONFBRIDGE_FEATURE_UNMUTE:
-+ default:
-+ user->muted = 0;
-+ conf_update_user_mute(user);
-+ test_suite_feature_action_event_notify(conference, user, "CONF_MUTE", "unmuted");
- send_unmute_event(user, conference);
-+ break;
- }
- }
-
-@@ -1766,6 +1839,11 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
- if (args.argc > 3 && !ast_strlen_zero(args.menu_profile_name)) {
- menu_profile_name = args.menu_profile_name;
- }
-+ /* If the caller should be joined already deafened, set the flag before we join. */
-+ if (ast_test_flag(&user.u_profile, USER_OPT_STARTDEAF)) {
-+ /* Set user level deaf request */
-+ user.features.deaf = 1;
-+ }
-
- if (conf_set_menu_to_user(chan, &user, menu_profile_name)) {
- pbx_builtin_setvar_helper(chan, "CONFBRIDGE_RESULT", "FAILED");
-@@ -1995,6 +2073,30 @@ static int action_toggle_mute_participants(struct confbridge_conference *confere
- return 0;
- }
-
-+static int action_toggle_deaf(struct confbridge_conference *conference,
-+ struct confbridge_user *user, struct ast_channel *chan)
-+{
-+ /* Deafen or undeafen yourself */
-+ user->features.deaf = !user->features.deaf;
-+ ast_test_suite_event_notify("CONF_DEAF",
-+ "Message: participant %s %s\r\n"
-+ "Conference: %s\r\n"
-+ "Channel: %s",
-+ ast_channel_name(chan),
-+ user->features.deaf ? "deafened" : "undeafened",
-+ user->b_profile.name,
-+ ast_channel_name(chan));
-+ if (user->features.deaf) {
-+ send_deafen_event(user, conference);
-+ } else {
-+ send_undeafen_event(user, conference);
-+ }
-+ return ast_stream_and_wait(chan, (user->features.deaf ?
-+ conf_get_sound(CONF_SOUND_DEAFENED, user->b_profile.sounds) :
-+ conf_get_sound(CONF_SOUND_UNDEAFENED, user->b_profile.sounds)),
-+ "");
-+}
-+
- static int action_playback(struct ast_bridge_channel *bridge_channel, const char *playback_file)
- {
- char *file_copy = ast_strdupa(playback_file);
-@@ -2180,6 +2282,11 @@ static int execute_menu_entry(struct confbridge_conference *conference,
- case MENU_ACTION_PARTICIPANT_COUNT:
- announce_user_count(conference, user, bridge_channel);
- break;
-+ case MENU_ACTION_TOGGLE_DEAF:
-+ res |= action_toggle_deaf(conference,
-+ user,
-+ bridge_channel->chan);
-+ break;
- case MENU_ACTION_PLAYBACK:
- if (!stop_prompts) {
- res |= action_playback(bridge_channel, menu_action->data.playback_file);
-@@ -2567,14 +2674,14 @@ static int generic_lock_unlock_helper(int lock, const char *conference_name)
- }
-
- /* \internal
-- * \brief finds a conference user by channel name and mutes/unmutes them.
-+ * \brief finds a conference user by channel name and changes feature bits on it.
- *
- * \retval 0 success
- * \retval -1 conference not found
- * \retval -2 user not found
- */
--static int generic_mute_unmute_helper(int mute, const char *conference_name,
-- const char *chan_name)
-+static int generic_feature_action_helper(enum confbridge_feature_action action,
-+ const char *conference_name, const char *chan_name)
- {
- RAII_VAR(struct confbridge_conference *, conference, NULL, ao2_cleanup);
- struct confbridge_user *user;
-@@ -2594,7 +2701,7 @@ static int generic_mute_unmute_helper(int mute, const char *conference_name,
- strlen(chan_name));
- if (match || all
- || (participants && !ast_test_flag(&user->u_profile, USER_OPT_ADMIN))) {
-- generic_mute_unmute_user(conference, user, mute);
-+ generic_feature_action_helper_user(conference, user, action);
- res = 0;
- if (match) {
- return res;
-@@ -2607,7 +2714,7 @@ static int generic_mute_unmute_helper(int mute, const char *conference_name,
- strlen(chan_name));
- if (match || all
- || (participants && !ast_test_flag(&user->u_profile, USER_OPT_ADMIN))) {
-- generic_mute_unmute_user(conference, user, mute);
-+ generic_feature_action_helper_user(conference, user, action);
- res = 0;
- if (match) {
- return res;
-@@ -2619,9 +2726,10 @@ static int generic_mute_unmute_helper(int mute, const char *conference_name,
- return res;
- }
-
--static int cli_mute_unmute_helper(int mute, struct ast_cli_args *a)
-+static int cli_feature_action_helper(enum confbridge_feature_action action, struct ast_cli_args *a)
- {
-- int res = generic_mute_unmute_helper(mute, a->argv[2], a->argv[3]);
-+ const char *verb;
-+ int res = generic_feature_action_helper(action, a->argv[2], a->argv[3]);
-
- if (res == -1) {
- ast_cli(a->fd, "No conference bridge named '%s' found!\n", a->argv[2]);
-@@ -2634,7 +2742,24 @@ static int cli_mute_unmute_helper(int mute, struct ast_cli_args *a)
- }
- return -1;
- }
-- ast_cli(a->fd, "%s %s from confbridge %s\n", mute ? "Muting" : "Unmuting", a->argv[3], a->argv[2]);
-+
-+ switch (action) {
-+ case CONFBRIDGE_FEATURE_DEAFEN:
-+ verb = "Deafening";
-+ break;
-+ case CONFBRIDGE_FEATURE_UNDEAFEN:
-+ verb = "Undeafening";
-+ break;
-+ case CONFBRIDGE_FEATURE_MUTE:
-+ verb = "Muting";
-+ break;
-+ case CONFBRIDGE_FEATURE_UNMUTE:
-+ default:
-+ verb = "Unmuting";
-+ break;
-+ }
-+
-+ ast_cli(a->fd, "%s %s from confbridge %s\n", verb, a->argv[3], a->argv[2]);
- return 0;
- }
-
-@@ -2664,7 +2789,7 @@ static char *handle_cli_confbridge_mute(struct ast_cli_entry *e, int cmd, struct
- return CLI_SHOWUSAGE;
- }
-
-- cli_mute_unmute_helper(1, a);
-+ cli_feature_action_helper(CONFBRIDGE_FEATURE_MUTE, a);
-
- return CLI_SUCCESS;
- }
-@@ -2695,7 +2820,53 @@ static char *handle_cli_confbridge_unmute(struct ast_cli_entry *e, int cmd, stru
- return CLI_SHOWUSAGE;
- }
-
-- cli_mute_unmute_helper(0, a);
-+ cli_feature_action_helper(CONFBRIDGE_FEATURE_UNMUTE, a);
-+
-+ return CLI_SUCCESS;
-+}
-+
-+static char *handle_cli_confbridge_deafen(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-+{
-+ switch (cmd) {
-+ case CLI_INIT:
-+ e->command = "confbridge deafen";
-+ e->usage =
-+ "Usage: confbridge deafen <conference> <channel>\n";
-+ return NULL;
-+ case CLI_GENERATE:
-+ if (a->pos == 2) {
-+ return complete_confbridge_name(a->line, a->word, a->pos, a->n);
-+ }
-+ return NULL;
-+ }
-+ if (a->argc != 4) {
-+ return CLI_SHOWUSAGE;
-+ }
-+
-+ cli_feature_action_helper(CONFBRIDGE_FEATURE_DEAFEN, a);
-+
-+ return CLI_SUCCESS;
-+}
-+
-+static char *handle_cli_confbridge_undeafen(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-+{
-+ switch (cmd) {
-+ case CLI_INIT:
-+ e->command = "confbridge undeafen";
-+ e->usage =
-+ "Usage: confbridge undeafen <conference> <channel>\n";
-+ return NULL;
-+ case CLI_GENERATE:
-+ if (a->pos == 2) {
-+ return complete_confbridge_name(a->line, a->word, a->pos, a->n);
-+ }
-+ return NULL;
-+ }
-+ if (a->argc != 4) {
-+ return CLI_SHOWUSAGE;
-+ }
-+
-+ cli_feature_action_helper(CONFBRIDGE_FEATURE_UNDEAFEN, a);
-
- return CLI_SUCCESS;
- }
-@@ -2850,6 +3021,8 @@ static struct ast_cli_entry cli_confbridge[] = {
- AST_CLI_DEFINE(handle_cli_confbridge_kick, "Kick participants out of conference bridges."),
- AST_CLI_DEFINE(handle_cli_confbridge_mute, "Mute participants."),
- AST_CLI_DEFINE(handle_cli_confbridge_unmute, "Unmute participants."),
-+ AST_CLI_DEFINE(handle_cli_confbridge_deafen, "Deafen a participant."),
-+ AST_CLI_DEFINE(handle_cli_confbridge_undeafen, "Undeafen a participant."),
- AST_CLI_DEFINE(handle_cli_confbridge_lock, "Lock a conference."),
- AST_CLI_DEFINE(handle_cli_confbridge_unlock, "Unlock a conference."),
- AST_CLI_DEFINE(handle_cli_confbridge_start_record, "Start recording a conference"),
-@@ -2996,10 +3169,11 @@ static int action_confbridgelistrooms(struct mansession *s, const struct message
- return 0;
- }
-
--static int action_mute_unmute_helper(struct mansession *s, const struct message *m, int mute)
-+static int action_feature_action_helper(struct mansession *s, const struct message *m, enum confbridge_feature_action action)
- {
- const char *conference_name = astman_get_header(m, "Conference");
- const char *channel_name = astman_get_header(m, "Channel");
-+ char *verb;
- int res = 0;
-
- if (ast_strlen_zero(conference_name)) {
-@@ -3015,7 +3189,7 @@ static int action_mute_unmute_helper(struct mansession *s, const struct message
- return 0;
- }
-
-- res = generic_mute_unmute_helper(mute, conference_name, channel_name);
-+ res = generic_feature_action_helper(action, conference_name, channel_name);
-
- if (res == -1) {
- astman_send_error(s, m, "No Conference by that name found.");
-@@ -3025,17 +3199,41 @@ static int action_mute_unmute_helper(struct mansession *s, const struct message
- return 0;
- }
-
-- astman_send_ack(s, m, mute ? "User muted" : "User unmuted");
-+ switch (action) {
-+ case CONFBRIDGE_FEATURE_DEAFEN:
-+ verb = "User deafened";
-+ break;
-+ case CONFBRIDGE_FEATURE_UNDEAFEN:
-+ verb = "User undeafened";
-+ break;
-+ case CONFBRIDGE_FEATURE_MUTE:
-+ verb = "User muted";
-+ break;
-+ case CONFBRIDGE_FEATURE_UNMUTE:
-+ default:
-+ verb = "User unmuted";
-+ break;
-+ }
-+
-+ astman_send_ack(s, m, verb);
- return 0;
- }
-
- static int action_confbridgeunmute(struct mansession *s, const struct message *m)
- {
-- return action_mute_unmute_helper(s, m, 0);
-+ return action_feature_action_helper(s, m, CONFBRIDGE_FEATURE_UNMUTE);
- }
- static int action_confbridgemute(struct mansession *s, const struct message *m)
- {
-- return action_mute_unmute_helper(s, m, 1);
-+ return action_feature_action_helper(s, m, CONFBRIDGE_FEATURE_MUTE);
-+}
-+static int action_confbridgeundeafen(struct mansession *s, const struct message *m)
-+{
-+ return action_feature_action_helper(s, m, CONFBRIDGE_FEATURE_UNDEAFEN);
-+}
-+static int action_confbridgedeafen(struct mansession *s, const struct message *m)
-+{
-+ return action_feature_action_helper(s, m, CONFBRIDGE_FEATURE_DEAFEN);
- }
-
- static int action_lock_unlock_helper(struct mansession *s, const struct message *m, int lock)
-@@ -3389,6 +3587,8 @@ static int unload_module(void)
- ast_manager_unregister("ConfbridgeListRooms");
- ast_manager_unregister("ConfbridgeMute");
- ast_manager_unregister("ConfbridgeUnmute");
-+ ast_manager_unregister("ConfbridgeDeafen");
-+ ast_manager_unregister("ConfbridgeUndeafen");
- ast_manager_unregister("ConfbridgeKick");
- ast_manager_unregister("ConfbridgeUnlock");
- ast_manager_unregister("ConfbridgeLock");
-@@ -3458,6 +3658,8 @@ static int load_module(void)
- res |= ast_manager_register_xml("ConfbridgeListRooms", EVENT_FLAG_REPORTING, action_confbridgelistrooms);
- res |= ast_manager_register_xml("ConfbridgeMute", EVENT_FLAG_CALL, action_confbridgemute);
- res |= ast_manager_register_xml("ConfbridgeUnmute", EVENT_FLAG_CALL, action_confbridgeunmute);
-+ res |= ast_manager_register_xml("ConfbridgeDeafen", EVENT_FLAG_CALL, action_confbridgedeafen);
-+ res |= ast_manager_register_xml("ConfbridgeUndeafen", EVENT_FLAG_CALL, action_confbridgeundeafen);
- res |= ast_manager_register_xml("ConfbridgeKick", EVENT_FLAG_CALL, action_confbridgekick);
- res |= ast_manager_register_xml("ConfbridgeUnlock", EVENT_FLAG_CALL, action_confbridgeunlock);
- res |= ast_manager_register_xml("ConfbridgeLock", EVENT_FLAG_CALL, action_confbridgelock);
-diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c
-index b8b1e2a..5bf3269 100644
---- a/apps/confbridge/conf_config_parser.c
-+++ b/apps/confbridge/conf_config_parser.c
-@@ -872,6 +872,10 @@ static int set_sound(const char *sound_name, const char *sound_file, struct brid
- ast_string_field_set(sounds, muted, sound_file);
- } else if (!strcasecmp(sound_name, "sound_unmuted")) {
- ast_string_field_set(sounds, unmuted, sound_file);
-+ } else if (!strcasecmp(sound_name, "sound_deafened")) {
-+ ast_string_field_set(sounds, deafened, sound_file);
-+ } else if (!strcasecmp(sound_name, "sound_undeafened")) {
-+ ast_string_field_set(sounds, undeafened, sound_file);
- } else if (!strcasecmp(sound_name, "sound_there_are")) {
- ast_string_field_set(sounds, thereare, sound_file);
- } else if (!strcasecmp(sound_name, "sound_other_in_party")) {
-@@ -1097,6 +1101,7 @@ static int add_action_to_menu_entry(struct conf_menu_entry *menu_entry, enum con
- switch (id) {
- case MENU_ACTION_NOOP:
- case MENU_ACTION_TOGGLE_MUTE:
-+ case MENU_ACTION_TOGGLE_DEAF:
- case MENU_ACTION_INCREASE_LISTENING:
- case MENU_ACTION_DECREASE_LISTENING:
- case MENU_ACTION_INCREASE_TALKING:
-@@ -1387,6 +1392,9 @@ static char *handle_cli_confbridge_show_user_profile(struct ast_cli_entry *e, in
- ast_cli(a->fd,"Start Muted: %s\n",
- u_profile.flags & USER_OPT_STARTMUTED?
- "true" : "false");
-+ ast_cli(a->fd,"Start Deaf: %s\n",
-+ u_profile.flags & USER_OPT_STARTDEAF?
-+ "true" : "false");
- ast_cli(a->fd,"MOH When Empty: %s\n",
- u_profile.flags & USER_OPT_MUSICONHOLD ?
- "enabled" : "disabled");
-@@ -1591,6 +1599,8 @@ static char *handle_cli_confbridge_show_bridge_profile(struct ast_cli_entry *e,
- ast_cli(a->fd,"sound_kicked: %s\n", conf_get_sound(CONF_SOUND_KICKED, b_profile.sounds));
- ast_cli(a->fd,"sound_muted: %s\n", conf_get_sound(CONF_SOUND_MUTED, b_profile.sounds));
- ast_cli(a->fd,"sound_unmuted: %s\n", conf_get_sound(CONF_SOUND_UNMUTED, b_profile.sounds));
-+ ast_cli(a->fd,"sound_deafened: %s\n", conf_get_sound(CONF_SOUND_DEAFENED, b_profile.sounds));
-+ ast_cli(a->fd,"sound_undeafened: %s\n", conf_get_sound(CONF_SOUND_UNDEAFENED, b_profile.sounds));
- ast_cli(a->fd,"sound_there_are: %s\n", conf_get_sound(CONF_SOUND_THERE_ARE, b_profile.sounds));
- ast_cli(a->fd,"sound_other_in_party: %s\n", conf_get_sound(CONF_SOUND_OTHER_IN_PARTY, b_profile.sounds));
- ast_cli(a->fd,"sound_place_into_conference: %s\n", conf_get_sound(CONF_SOUND_PLACE_IN_CONF, b_profile.sounds));
-@@ -1719,6 +1729,9 @@ static char *handle_cli_confbridge_show_menu(struct ast_cli_entry *e, int cmd, s
- case MENU_ACTION_TOGGLE_MUTE:
- ast_cli(a->fd, "toggle_mute");
- break;
-+ case MENU_ACTION_TOGGLE_DEAF:
-+ ast_cli(a->fd, "toggle_deaf");
-+ break;
- case MENU_ACTION_NOOP:
- ast_cli(a->fd, "no_op");
- break;
-@@ -2092,6 +2105,7 @@ int conf_load_config(void)
- aco_option_register(&cfg_info, "admin", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ADMIN);
- aco_option_register(&cfg_info, "marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MARKEDUSER);
- aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED);
-+ aco_option_register(&cfg_info, "startdeaf", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTDEAF);
- aco_option_register(&cfg_info, "music_on_hold_when_empty", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MUSICONHOLD);
- aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET);
- aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0);
-diff --git a/apps/confbridge/confbridge_manager.c b/apps/confbridge/confbridge_manager.c
-index eb1b58e..e33c73f 100644
---- a/apps/confbridge/confbridge_manager.c
-+++ b/apps/confbridge/confbridge_manager.c
-@@ -189,6 +189,38 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
- </see-also>
- </managerEventInstance>
- </managerEvent>
-+ <managerEvent language="en_US" name="ConfbridgeDeafen">
-+ <managerEventInstance class="EVENT_FLAG_CALL">
-+ <synopsis>Raised when a Confbridge participant deafens.</synopsis>
-+ <syntax>
-+ <parameter name="Conference">
-+ <para>The name of the Confbridge conference.</para>
-+ </parameter>
-+ <bridge_snapshot/>
-+ <channel_snapshot/>
-+ </syntax>
-+ <see-also>
-+ <ref type="managerEvent">ConfbridgeUndeafen</ref>
-+ <ref type="application">ConfBridge</ref>
-+ </see-also>
-+ </managerEventInstance>
-+ </managerEvent>
-+ <managerEvent language="en_US" name="ConfbridgeUndeafen">
-+ <managerEventInstance class="EVENT_FLAG_CALL">
-+ <synopsis>Raised when a confbridge participant undeafens.</synopsis>
-+ <syntax>
-+ <parameter name="Conference">
-+ <para>The name of the Confbridge conference.</para>
-+ </parameter>
-+ <bridge_snapshot/>
-+ <channel_snapshot/>
-+ </syntax>
-+ <see-also>
-+ <ref type="managerEvent">ConfbridgeMute</ref>
-+ <ref type="application">ConfBridge</ref>
-+ </see-also>
-+ </managerEventInstance>
-+ </managerEvent>
- <managerEvent language="en_US" name="ConfbridgeTalking">
- <managerEventInstance class="EVENT_FLAG_CALL">
- <synopsis>Raised when a confbridge participant unmutes.</synopsis>
-@@ -338,6 +370,18 @@ static void confbridge_unmute_cb(void *data, struct stasis_subscription *sub,
- ast_free(extra_text);
- }
-
-+static void confbridge_deafen_cb(void *data, struct stasis_subscription *sub,
-+ struct stasis_message *message)
-+{
-+ confbridge_publish_manager_event(message, "ConfbridgeDeafen", NULL);
-+}
-+
-+static void confbridge_undeafen_cb(void *data, struct stasis_subscription *sub,
-+ struct stasis_message *message)
-+{
-+ confbridge_publish_manager_event(message, "ConfbridgeUndeafen", NULL);
-+}
-+
- static void confbridge_talking_cb(void *data, struct stasis_subscription *sub,
- struct stasis_message *message)
- {
-@@ -366,6 +410,8 @@ STASIS_MESSAGE_TYPE_DEFN(confbridge_start_record_type);
- STASIS_MESSAGE_TYPE_DEFN(confbridge_stop_record_type);
- STASIS_MESSAGE_TYPE_DEFN(confbridge_mute_type);
- STASIS_MESSAGE_TYPE_DEFN(confbridge_unmute_type);
-+STASIS_MESSAGE_TYPE_DEFN(confbridge_deafen_type);
-+STASIS_MESSAGE_TYPE_DEFN(confbridge_undeafen_type);
- STASIS_MESSAGE_TYPE_DEFN(confbridge_talking_type);
-
- void manager_confbridge_shutdown(void) {
-@@ -377,6 +423,8 @@ void manager_confbridge_shutdown(void) {
- STASIS_MESSAGE_TYPE_CLEANUP(confbridge_stop_record_type);
- STASIS_MESSAGE_TYPE_CLEANUP(confbridge_mute_type);
- STASIS_MESSAGE_TYPE_CLEANUP(confbridge_unmute_type);
-+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_deafen_type);
-+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_undeafen_type);
- STASIS_MESSAGE_TYPE_CLEANUP(confbridge_talking_type);
-
- if (bridge_state_router) {
-@@ -400,6 +448,8 @@ int manager_confbridge_init(void)
- STASIS_MESSAGE_TYPE_INIT(confbridge_stop_record_type);
- STASIS_MESSAGE_TYPE_INIT(confbridge_mute_type);
- STASIS_MESSAGE_TYPE_INIT(confbridge_unmute_type);
-+ STASIS_MESSAGE_TYPE_INIT(confbridge_deafen_type);
-+ STASIS_MESSAGE_TYPE_INIT(confbridge_undeafen_type);
- STASIS_MESSAGE_TYPE_INIT(confbridge_talking_type);
-
- bridge_state_router = stasis_message_router_create(
-@@ -466,6 +516,20 @@ int manager_confbridge_init(void)
- return -1;
- }
- if (stasis_message_router_add(bridge_state_router,
-+ confbridge_deafen_type(),
-+ confbridge_deafen_cb,
-+ NULL)) {
-+ manager_confbridge_shutdown();
-+ return -1;
-+ }
-+ if (stasis_message_router_add(bridge_state_router,
-+ confbridge_undeafen_type(),
-+ confbridge_undeafen_cb,
-+ NULL)) {
-+ manager_confbridge_shutdown();
-+ return -1;
-+ }
-+ if (stasis_message_router_add(bridge_state_router,
- confbridge_talking_type(),
- confbridge_talking_cb,
- NULL)) {
-@@ -538,6 +602,20 @@ int manager_confbridge_init(void)
- return -1;
- }
- if (stasis_message_router_add(channel_state_router,
-+ confbridge_deafen_type(),
-+ confbridge_deafen_cb,
-+ NULL)) {
-+ manager_confbridge_shutdown();
-+ return -1;
-+ }
-+ if (stasis_message_router_add(channel_state_router,
-+ confbridge_undeafen_type(),
-+ confbridge_undeafen_cb,
-+ NULL)) {
-+ manager_confbridge_shutdown();
-+ return -1;
-+ }
-+ if (stasis_message_router_add(channel_state_router,
- confbridge_talking_type(),
- confbridge_talking_cb,
- NULL)) {
-diff --git a/apps/confbridge/include/confbridge.h b/apps/confbridge/include/confbridge.h
-index 8d2dffb..ffa60d8 100644
---- a/apps/confbridge/include/confbridge.h
-+++ b/apps/confbridge/include/confbridge.h
-@@ -62,6 +62,7 @@ enum user_profile_flags {
- USER_OPT_ANNOUNCEUSERCOUNTALL = (1 << 14), /*!< Sets if the number of users should be announced to everyone. */
- USER_OPT_JITTERBUFFER = (1 << 15), /*!< Places a jitterbuffer on the user. */
- USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW = (1 << 16), /*!< modifies ANNOUNCE_JOIN_LEAVE - user reviews the recording before continuing */
-+ USER_OPT_STARTDEAF = (1 << 17), /*!< Set if the caller should be initially set deaf */
- };
-
- enum bridge_profile_flags {
-@@ -74,6 +75,7 @@ enum bridge_profile_flags {
-
- enum conf_menu_action_id {
- MENU_ACTION_TOGGLE_MUTE = 1,
-+ MENU_ACTION_TOGGLE_DEAF,
- MENU_ACTION_PLAYBACK,
- MENU_ACTION_PLAYBACK_AND_CONTINUE,
- MENU_ACTION_INCREASE_LISTENING,
-@@ -150,6 +152,8 @@ enum conf_sounds {
- CONF_SOUND_KICKED,
- CONF_SOUND_MUTED,
- CONF_SOUND_UNMUTED,
-+ CONF_SOUND_DEAFENED,
-+ CONF_SOUND_UNDEAFENED,
- CONF_SOUND_ONLY_ONE,
- CONF_SOUND_THERE_ARE,
- CONF_SOUND_OTHER_IN_PARTY,
-@@ -177,6 +181,8 @@ struct bridge_profile_sounds {
- AST_STRING_FIELD(kicked);
- AST_STRING_FIELD(muted);
- AST_STRING_FIELD(unmuted);
-+ AST_STRING_FIELD(deafened);
-+ AST_STRING_FIELD(undeafened);
- AST_STRING_FIELD(onlyone);
- AST_STRING_FIELD(thereare);
- AST_STRING_FIELD(otherinparty);
-@@ -367,6 +373,8 @@ int conf_handle_dtmf(
- struct conf_menu_entry *menu_entry,
- struct conf_menu *menu);
-
-+struct stasis_message_type *confbridge_deafen_type(void);
-+struct stasis_message_type *confbridge_undeafen_type(void);
-
- /*! \brief Looks to see if sound file is stored in bridge profile sounds, if not
- * default sound is provided.*/
-diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
-index e3df18f..aeaf1dd 100644
---- a/bridges/bridge_softmix.c
-+++ b/bridges/bridge_softmix.c
-@@ -1025,15 +1025,21 @@ static int softmix_mixing_loop(struct ast_bridge *bridge)
-
- ast_mutex_lock(&sc->lock);
-
-- /* Make SLINEAR write frame from local buffer */
-- ao2_t_replace(sc->write_frame.subclass.format, cur_slin,
-- "Replace softmix channel slin format");
-- sc->write_frame.datalen = softmix_datalen;
-- sc->write_frame.samples = softmix_samples;
-- memcpy(sc->final_buf, buf, softmix_datalen);
--
-- /* process the softmix channel's new write audio */
-- softmix_process_write_audio(&trans_helper, ast_channel_rawwriteformat(bridge_channel->chan), sc);
-+ if (bridge_channel->features && bridge_channel->features->deaf) {
-+ /* For deaf channels post a null frame */
-+ sc->write_frame.frametype = AST_FRAME_NULL;
-+ } else {
-+ /* Make SLINEAR write frame from local buffer */
-+ sc->write_frame.frametype = AST_FRAME_VOICE;
-+ ao2_t_replace(sc->write_frame.subclass.format, cur_slin,
-+ "Replace softmix channel slin format");
-+ sc->write_frame.datalen = softmix_datalen;
-+ sc->write_frame.samples = softmix_samples;
-+ memcpy(sc->final_buf, buf, softmix_datalen);
-+
-+ /* process the softmix channel's new write audio */
-+ softmix_process_write_audio(&trans_helper, ast_channel_rawwriteformat(bridge_channel->chan), sc);
-+ }
-
- ast_mutex_unlock(&sc->lock);
-
-diff --git a/configs/samples/confbridge.conf.sample b/configs/samples/confbridge.conf.sample
-index d0bdd6f..8104fc2 100644
---- a/configs/samples/confbridge.conf.sample
-+++ b/configs/samples/confbridge.conf.sample
-@@ -20,6 +20,7 @@ type=user
- ;admin=yes ; Sets if the user is an admin or not. Off by default.
- ;marked=yes ; Sets if this is a marked user or not. Off by default.
- ;startmuted=yes; Sets if all users should start out muted. Off by default
-+;startdeaf=yes ; Sets if all users should start out deaf. Off by default.
- ;music_on_hold_when_empty=yes ; Sets whether MOH should be played when only
- ; one person is in the conference or when the
- ; the user is waiting on a marked user to enter
-@@ -228,6 +229,8 @@ type=bridge
- ;sound_kicked ; The sound played to a user who has been kicked from the conference.
- ;sound_muted ; The sound played when the mute option it toggled on.
- ;sound_unmuted ; The sound played when the mute option it toggled off.
-+;sound_deafened ; The sound played when the deaf option is toggled on.
-+;sound_undeafened ; The sound played when the deaf option is toggled off.
- ;sound_only_person ; The sound played when the user is the only person in the conference.
- ;sound_only_one ; The sound played to a user when there is only one other
- ; person is in the conference.
-@@ -289,6 +292,8 @@ type=bridge
- ; using the '&' character as a delimiter.
- ; toggle_mute ; Toggle turning on and off mute. Mute will make the user silent
- ; to everyone else, but the user will still be able to listen in.
-+; toggle_deaf ; Toggle turning on and off deaf. Deaf will make the user to hear
-+ ; only silence, but the user will still be able to talk.
-
- ; no_op ; This action does nothing (No Operation). Its only real purpose exists for
- ; being able to reserve a sequence in the config as a menu exit sequence.
-diff --git a/include/asterisk/bridge_features.h b/include/asterisk/bridge_features.h
-index df01a0d..1bbce9f 100644
---- a/include/asterisk/bridge_features.h
-+++ b/include/asterisk/bridge_features.h
-@@ -273,6 +273,8 @@ struct ast_bridge_features {
- unsigned int usable:1;
- /*! TRUE if the channel/bridge is muted. */
- unsigned int mute:1;
-+ /*! TRUE if the channel/bridge is deaf. */
-+ unsigned int deaf:1;
- /*! TRUE if DTMF should be passed into the bridge tech. */
- unsigned int dtmf_passthrough:1;
- };
-diff --git a/main/bridge_channel.c b/main/bridge_channel.c
-index 4baae3c..d164ac2 100644
---- a/main/bridge_channel.c
-+++ b/main/bridge_channel.c
-@@ -42,6 +42,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
- #include "asterisk/app.h"
- #include "asterisk/pbx.h"
- #include "asterisk/channel.h"
-+#include "asterisk/format_cache.h"
- #include "asterisk/timing.h"
- #include "asterisk/bridge.h"
- #include "asterisk/bridge_channel.h"
-@@ -971,7 +972,21 @@ int ast_bridge_channel_queue_frame(struct ast_bridge_channel *bridge_channel, st
- return 0;
- }
-
-- dup = ast_frdup(fr);
-+ if (fr->frametype == AST_FRAME_VOICE &&
-+ (bridge_channel->features && bridge_channel->features->deaf)) {
-+ short buf[fr->samples];
-+ struct ast_frame sframe = {
-+ .frametype = AST_FRAME_VOICE,
-+ .subclass.format = ast_format_slin,
-+ .data.ptr = buf,
-+ .samples = fr->samples,
-+ .datalen = sizeof(buf),
-+ };
-+ memset(buf, 0, sizeof(buf));
-+ dup = ast_frdup(&sframe);
-+ } else {
-+ dup = ast_frdup(fr);
-+ }
- if (!dup) {
- return -1;
- }
---
-2.8.3
-
diff --git a/main/asterisk/ASTERISK-20527.patch b/main/asterisk/ASTERISK-20527.patch
index 9be50ce631..e2095bed41 100644
--- a/main/asterisk/ASTERISK-20527.patch
+++ b/main/asterisk/ASTERISK-20527.patch
@@ -1,8 +1,22 @@
+From 538c6415c6d255876a808d69acd9f5ebd603b286 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Fri, 3 Jun 2016 09:33:08 +0300
+Subject: [PATCH 1/1] chan_sip: Support auth username for callbackextension
+ feature
+
+ASTERISK-20527 #close
+
+Change-Id: I659cf7f00836a09d09d146ad226a40477d731239
+---
+ channels/chan_sip.c | 2 +-
+ configs/samples/sip.conf.sample | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
-index 7569bba..24a8cec 100644
+index 19f8aa3..03cba92 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
-@@ -30189,7 +30189,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
+@@ -31811,7 +31811,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
olddirectmediaacl = ast_free_acl_list(olddirectmediaacl);
if (!ast_strlen_zero(peer->callback)) { /* build string from peer info */
char *reg_string;
@@ -11,11 +25,11 @@ index 7569bba..24a8cec 100644
sip_register(reg_string, 0); /* XXX TODO: count in registry_count */
ast_free(reg_string);
}
-diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample
-index 81ca998..812be7b 100644
+diff --git a/configs/samples/sip.conf.sample b/configs/samples/sip.conf.sample
+index 8f28e26..a7b74df 100644
--- a/configs/samples/sip.conf.sample
+++ b/configs/samples/sip.conf.sample
-@@ -711,7 +711,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
+@@ -786,7 +786,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; A similar effect can be achieved by adding a "callbackextension" option in a peer section.
; this is equivalent to having the following line in the general section:
;
@@ -24,3 +38,6 @@ index 81ca998..812be7b 100644
;
; and more readable because you don't have to write the parameters in two places
; (note that the "port" is ignored - this is a bug that should be fixed).
+--
+2.10.0
+
diff --git a/main/asterisk/musl-includes.patch b/main/asterisk/musl-includes.patch
deleted file mode 100644
index a45f710a89..0000000000
--- a/main/asterisk/musl-includes.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff -ru asterisk-13.0.0.orig/include/asterisk/compat.h asterisk-13.0.0/include/asterisk/compat.h
---- asterisk-13.0.0.orig/include/asterisk/compat.h 2014-10-31 08:48:56.000000000 -0200
-+++ asterisk-13.0.0/include/asterisk/compat.h 2014-10-31 08:49:10.163808393 -0200
-@@ -68,7 +68,7 @@
- #endif
-
- #ifndef AST_POLL_COMPAT
--#include <sys/poll.h>
-+#include <poll.h>
- #else
- #include "asterisk/poll-compat.h"
- #endif
-diff -ru asterisk-13.0.0.orig/include/asterisk/poll-compat.h asterisk-13.0.0/include/asterisk/poll-compat.h
---- asterisk-13.0.0.orig/include/asterisk/poll-compat.h 2014-10-31 08:48:56.000000000 -0200
-+++ asterisk-13.0.0/include/asterisk/poll-compat.h 2014-10-31 08:49:10.163808393 -0200
-@@ -83,7 +83,7 @@
-
- #ifndef AST_POLL_COMPAT
-
--#include <sys/poll.h>
-+#include <poll.h>
-
- #define ast_poll(a, b, c) poll(a, b, c)
-
-diff -ru asterisk-13.0.0.orig/main/ast_expr2.c asterisk-13.0.0/main/ast_expr2.c
---- asterisk-13.0.0.orig/main/ast_expr2.c 2014-10-31 08:48:56.000000000 -0200
-+++ asterisk-13.0.0/main/ast_expr2.c 2014-10-31 08:49:10.163808393 -0200
-@@ -93,6 +93,7 @@
-
- #include "asterisk.h"
-
-+#include <sys/cdefs.h>
- #include <sys/types.h>
- #include <stdio.h>
-
-diff -ru asterisk-13.0.0.orig/main/ast_expr2.y asterisk-13.0.0/main/ast_expr2.y
---- asterisk-13.0.0.orig/main/ast_expr2.y 2014-10-31 08:48:56.000000000 -0200
-+++ asterisk-13.0.0/main/ast_expr2.y 2014-10-31 08:49:10.163808393 -0200
-@@ -14,6 +14,7 @@
-
- #include "asterisk.h"
-
-+#include <sys/cdefs.h>
- #include <sys/types.h>
- #include <stdio.h>
-