[Pkg-voip-commits] [asterisk] 04/05: Fixed / removed patches for Asterisk 13
tzafrir at debian.org
tzafrir at debian.org
Sun Oct 26 08:15:59 UTC 2014
This is an automated email from the git hooks/post-receive script.
tzafrir pushed a commit to branch master
in repository asterisk.
commit 364a00bdf9715a15aba5d3576fc11fa2ed729e0c
Author: Tzafrir Cohen <tzafrir at debian.org>
Date: Sun Oct 26 09:55:20 2014 +0200
Fixed / removed patches for Asterisk 13
---
debian/patches/allow-tilde-destdir | 25 --
debian/patches/dahdi_create_channels | 563 --------------------------
debian/patches/enable_addons | 10 -
debian/patches/escape_manpage_hyphen.patch | 19 -
debian/patches/ignore_failed_channels.patch | 37 --
debian/patches/neon_version_check.patch | 19 -
debian/patches/pjproject | 130 ------
debian/patches/pri_destroy_span_prilist.patch | 136 -------
debian/patches/res_fax_bounds.patch | 17 -
debian/patches/series | 12 -
debian/patches/sigpri_handle_enodev_1.patch | 77 ----
11 files changed, 1045 deletions(-)
diff --git a/debian/patches/allow-tilde-destdir b/debian/patches/allow-tilde-destdir
deleted file mode 100644
index da5d2fb..0000000
--- a/debian/patches/allow-tilde-destdir
+++ /dev/null
@@ -1,25 +0,0 @@
-Subject: relax badshell tilde test
-Author: Faidon Liambotis <paravoid at debian.org>
-Bug: http://issues.asterisk.org/view.php?id=14718
-Last-Update: 2009-12-19
-
-badshell is disallowing tildes (~) in the DESTDIR directory to warn people
-who use a shell that doesn't expand it to $HOMEDIR.
-
-However, we have such a tilde in our directory (~rcN) that isn't expanded
-to $HOMEDIR nor shouldn't be.
-
-This patch relaxes this test just for cases where the ~ is followed by a '/',
-which should catch most cases.
-
---- a/Makefile
-+++ b/Makefile
-@@ -596,7 +596,7 @@ oldmodcheck:
- fi
-
- badshell:
--ifneq ($(findstring ~,$(DESTDIR)),)
-+ifneq ($(findstring ~/,$(DESTDIR)),)
- @echo "Your shell doesn't do ~ expansion when expected (specifically, when doing \"make install DESTDIR=~/path\")."
- @echo "Try replacing ~ with \$$HOME, as in \"make install DESTDIR=\$$HOME/path\"."
- @exit 1
diff --git a/debian/patches/dahdi_create_channels b/debian/patches/dahdi_create_channels
deleted file mode 100644
index 6cc30bf..0000000
--- a/debian/patches/dahdi_create_channels
+++ /dev/null
@@ -1,563 +0,0 @@
-From: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
-Date: Thu, 8 Aug 2013 22:09:07 +0000
-Subject: [PATCH] chan_dahdi: create channels at run-time
-Origin: http://svnview.digium.com/svn/asterisk?view=rev&rev=396474
-
-This code adds chan_dahdi the command 'dahdi create channels <range>'
-(where <range> is a single <n>-<m> or 'new') and updates 'dahdi destroy
-channel' with a similar 'dahdi destroy channels'. It allows DAHDI
-channels and spans to be added after the initial channel load
-(without destroying all other channels as in 'dahdi restart').
-
-It also includes some fixes to the D-Channel / span destruction code
-(r394552).
-
-This change is intended to provide a hook for a script running from
-udev once a span has been assigned ("registered") / unassigned
-("unregistered") for its channels. The udev hook configures the span's
-channels with dahdi_cfg -S, and can then ask Asterisk to create ethe
-channels. See the scripts added to DAHDI-tools in 2.7.0.
-
-Review: https://reviewboard.asterisk.org/r/1598/
-
-A trivial backport from trunk / 12.
-
----
- channels/chan_dahdi.c | 322 +++++++++++++++++++++++++++++++++++++++----------
- 1 file changed, 261 insertions(+), 61 deletions(-)
-
---- a/channels/chan_dahdi.c
-+++ b/channels/chan_dahdi.c
-@@ -404,6 +404,8 @@ static const char config[] = "chan_dahdi
- static int num_cadence = 4;
- static int user_has_defined_cadences = 0;
-
-+static int has_pseudo;
-+
- static struct dahdi_ring_cadence cadences[NUM_CADENCE_MAX] = {
- { { 125, 125, 2000, 4000 } }, /*!< Quick chirp followed by normal ring */
- { { 250, 250, 500, 1000, 250, 250, 500, 4000 } }, /*!< British style ring */
-@@ -1391,6 +1393,18 @@ struct dahdi_chan_conf {
- * \note Set from the "smdiport" string read in from chan_dahdi.conf
- */
- char smdi_port[SMDI_MAX_FILENAME_LEN];
-+
-+ /*!
-+ * \brief Don't create channels below this number
-+ * \note by default is 0 (no limit)
-+ */
-+ int wanted_channels_start;
-+
-+ /*!
-+ * \brief Don't create channels above this number (infinity by default)
-+ * \note by default is 0 (special value that means "no limit").
-+ */
-+ int wanted_channels_end;
- };
-
- /*! returns a new dahdi_chan_conf with default values (by-value) */
-@@ -3217,7 +3231,7 @@ static int sig_pri_tone_to_dahditone(enu
- #endif /* defined(HAVE_PRI) */
-
- #if defined(HAVE_PRI)
--static int pri_destroy_dchan(struct sig_pri_span *pri);
-+static void pri_destroy_span(struct sig_pri_span *pri);
-
- static void my_handle_dchan_exception(struct sig_pri_span *pri, int index)
- {
-@@ -3247,7 +3261,7 @@ static void my_handle_dchan_exception(st
- pri_event_noalarm(pri, index, 0);
- break;
- case DAHDI_EVENT_REMOVED:
-- pri_destroy_dchan(pri);
-+ pri_destroy_span(pri);
- break;
- default:
- break;
-@@ -11670,29 +11684,121 @@ static int mwi_send_process_event(struct
- return handled;
- }
-
--/* destroy a DAHDI channel, identified by its number */
--static int dahdi_destroy_channel_bynum(int channel)
-+/* destroy a range DAHDI channels, identified by their number */
-+static void dahdi_destroy_channel_range(int start, int end)
- {
- struct dahdi_pvt *cur;
-+ struct dahdi_pvt *next;
-+ int destroyed_first = 0;
-+ int destroyed_last = 0;
-
- ast_mutex_lock(&iflock);
-- for (cur = iflist; cur; cur = cur->next) {
-- if (cur->channel == channel) {
-+ ast_debug(1, "range: %d-%d\n", start, end);
-+ for (cur = iflist; cur; cur = next) {
-+ next = cur->next;
-+ if (cur->channel >= start && cur->channel <= end) {
- int x = DAHDI_FLASH;
-
-+ if (cur->channel > destroyed_last) {
-+ destroyed_last = cur->channel;
-+ }
-+ if (destroyed_first < 1 || cur->channel < destroyed_first) {
-+ destroyed_first = cur->channel;
-+ }
-+ ast_debug(3, "Destroying %d\n", cur->channel);
- /* important to create an event for dahdi_wait_event to register so that all analog_ss_threads terminate */
- ioctl(cur->subs[SUB_REAL].dfd, DAHDI_HOOK, &x);
-
- destroy_channel(cur, 1);
-- ast_mutex_unlock(&iflock);
- ast_module_unref(ast_module_info->self);
-- return RESULT_SUCCESS;
- }
- }
- ast_mutex_unlock(&iflock);
-- return RESULT_FAILURE;
-+ if (destroyed_first > start || destroyed_last < end) {
-+ ast_debug(1, "Asked to destroy %d-%d, destroyed %d-%d,\n",
-+ start, end, destroyed_first, destroyed_last);
-+ }
-+}
-+
-+static int setup_dahdi(int reload);
-+static int setup_dahdi_int(int reload, struct dahdi_chan_conf *default_conf, struct dahdi_chan_conf *base_conf, struct dahdi_chan_conf *conf);
-+
-+/*!
-+ * \internal
-+ * \brief create a range of new DAHDI channels
-+ *
-+ * \param start first channel in the range
-+ * \param end last channel in the range
-+ *
-+ * \retval RESULT_SUCCESS on success.
-+ * \retval RESULT_FAILURE on error.
-+ */
-+static int dahdi_create_channel_range(int start, int end)
-+{
-+ struct dahdi_pvt *cur;
-+ struct dahdi_chan_conf default_conf = dahdi_chan_conf_default();
-+ struct dahdi_chan_conf base_conf = dahdi_chan_conf_default();
-+ struct dahdi_chan_conf conf = dahdi_chan_conf_default();
-+ int i, x;
-+ int ret = RESULT_FAILURE; /* be pessimistic */
-+
-+ ast_debug(1, "channel range caps: %d - %d\n", start, end);
-+ ast_mutex_lock(&iflock);
-+ for (cur = iflist; cur; cur = cur->next) {
-+ if (cur->channel >= start && cur->channel <= end) {
-+ ast_log(LOG_ERROR,
-+ "channel range %d-%d is occupied\n",
-+ start, end);
-+ goto out;
-+ }
-+ }
-+ for (x = 0; x < NUM_SPANS; x++) {
-+#ifdef HAVE_PRI
-+ struct dahdi_pri *pri = pris + x;
-+
-+ if (!pris[x].pri.pvts[0]) {
-+ break;
-+ }
-+ for (i = 0; i < SIG_PRI_NUM_DCHANS; i++) {
-+ int channo = pri->dchannels[i];
-+
-+ if (!channo) {
-+ break;
-+ }
-+ if (!pri->pri.fds[i]) {
-+ break;
-+ }
-+ if (channo >= start && channo <= end) {
-+ ast_log(LOG_ERROR,
-+ "channel range %d-%d is occupied by span %d\n",
-+ start, end, x + 1);
-+ goto out;
-+ }
-+ }
-+#endif
-+ }
-+ if (!default_conf.chan.cc_params || !base_conf.chan.cc_params ||
-+ !conf.chan.cc_params) {
-+ goto out;
-+ }
-+ default_conf.wanted_channels_start = start;
-+ base_conf.wanted_channels_start = start;
-+ conf.wanted_channels_start = start;
-+ default_conf.wanted_channels_end = end;
-+ base_conf.wanted_channels_end = end;
-+ conf.wanted_channels_end = end;
-+ if (setup_dahdi_int(0, &default_conf, &base_conf, &conf) == 0) {
-+ ret = RESULT_SUCCESS;
-+ }
-+out:
-+ ast_cc_config_params_destroy(default_conf.chan.cc_params);
-+ ast_cc_config_params_destroy(base_conf.chan.cc_params);
-+ ast_cc_config_params_destroy(conf.chan.cc_params);
-+ ast_mutex_unlock(&iflock);
-+ return ret;
- }
-
-+
- static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event)
- {
- int res;
-@@ -12058,11 +12164,7 @@ static void *do_monitor(void *data)
- doomed = NULL;
- for (i = iflist;; i = i->next) {
- if (doomed) {
-- int res;
-- res = dahdi_destroy_channel_bynum(doomed->channel);
-- if (res != RESULT_SUCCESS) {
-- ast_log(LOG_WARNING, "Couldn't find channel to destroy, hopefully another destroy operation just happened.\n");
-- }
-+ dahdi_destroy_channel_range(doomed->channel, doomed->channel);
- doomed = NULL;
- }
- if (!i) {
-@@ -14497,10 +14599,21 @@ static int prepare_pri(struct dahdi_pri
- for (i = 0; i < SIG_PRI_NUM_DCHANS; i++) {
- if (!pri->dchannels[i])
- break;
-+ if (pri->pri.fds[i] >= 0) {
-+ /* A partial range addition. Not a complete setup. */
-+ break;
-+ }
- pri->pri.fds[i] = open("/dev/dahdi/channel", O_RDWR);
-+ if ((pri->pri.fds[i] < 0)) {
-+ ast_log(LOG_ERROR, "Unable to open D-channel (fd=%d) (%s)\n",
-+ pri->pri.fds[i], strerror(errno));
-+ return -1;
-+ }
- x = pri->dchannels[i];
-- if ((pri->pri.fds[i] < 0) || (ioctl(pri->pri.fds[i],DAHDI_SPECIFY,&x) == -1)) {
-- ast_log(LOG_ERROR, "Unable to open D-channel %d (%s)\n", x, strerror(errno));
-+ res = ioctl(pri->pri.fds[i], DAHDI_SPECIFY, &x);
-+ if (res) {
-+ dahdi_close_pri_fd(pri, i);
-+ ast_log(LOG_ERROR, "Unable to SPECIFY channel %d (%s)\n", x, strerror(errno));
- return -1;
- }
- memset(&p, 0, sizeof(p));
-@@ -14901,22 +15014,44 @@ static char *handle_pri_show_spans(struc
- *
- * \param pri the pri span
- *
-- * \return TRUE if the span was valid and we attempted destroying.
-- *
- * Shuts down a span and destroys its D-Channel. Further destruction
- * of the B-channels using dahdi_destroy_channel() would probably be required
- * for the B-Channels.
- */
--static int pri_destroy_dchan(struct sig_pri_span *pri)
-+static void pri_destroy_span(struct sig_pri_span *pri)
- {
- int i;
-+ int res;
-+ int cancel_code;
- struct dahdi_pri* dahdi_pri;
-+ pthread_t master = pri->master;
-
-- if (!pri->master || (pri->master == AST_PTHREADT_NULL)) {
-- return 0;
-+ if (!master || (master == AST_PTHREADT_NULL)) {
-+ return;
-+ }
-+ ast_debug(2, "About to destroy DAHDI channels of span %d.\n", pri->span);
-+ for (i = 0; i < pri->numchans; i++) {
-+ int channel;
-+ struct sig_pri_chan *pvt = pri->pvts[i];
-+
-+ if (!pvt) {
-+ continue;
-+ }
-+ channel = pvt->channel;
-+ ast_debug(2, "About to destroy B-channel %d.\n", channel);
-+ dahdi_destroy_channel_range(channel, channel);
-+ }
-+
-+ cancel_code = pthread_cancel(master);
-+ ast_debug(4,
-+ "Waiting to join thread of span %d "
-+ "with pid=%p cancel_code=%d\n",
-+ pri->span, (void *)master, cancel_code);
-+ res = pthread_join(master, NULL);
-+ if (res != 0) {
-+ ast_log(LOG_NOTICE, "pthread_join failed: %d\n", res);
- }
-- pthread_cancel(pri->master);
-- pthread_join(pri->master, NULL);
-+ pri->master = AST_PTHREADT_NULL;
-
- /* The 'struct dahdi_pri' that contains our 'struct sig_pri_span' */
- dahdi_pri = container_of(pri, struct dahdi_pri, pri);
-@@ -14924,17 +15059,16 @@ static int pri_destroy_dchan(struct sig_
- ast_debug(4, "closing pri_fd %d\n", i);
- dahdi_close_pri_fd(dahdi_pri, i);
- }
-- pri->pri = NULL;
-+ sig_pri_init_pri(pri);
- ast_debug(1, "PRI span %d destroyed\n", pri->span);
-- return 1;
- }
-
- static char *handle_pri_destroy_span(struct ast_cli_entry *e, int cmd,
- struct ast_cli_args *a)
- {
- int span;
-- int i;
- int res;
-+ struct sig_pri_span *pri;
-
- switch (cmd) {
- case CLI_INIT:
-@@ -14958,25 +15092,13 @@ static char *handle_pri_destroy_span(str
- a->argv[3], 1, NUM_SPANS);
- return CLI_SUCCESS;
- }
-- if (!pris[span - 1].pri.pri) {
-+ pri = &pris[span - 1].pri;
-+ if (!pri->pri) {
- ast_cli(a->fd, "No PRI running on span %d\n", span);
- return CLI_SUCCESS;
- }
-
-- for (i = 0; i < pris[span - 1].pri.numchans; i++) {
-- int channel;
-- struct sig_pri_chan *pvt = pris[span - 1].pri.pvts[i];
--
-- if (!pvt) {
-- continue;
-- }
-- channel = pvt->channel;
-- ast_debug(2, "About to destroy B-channel %d.\n", channel);
-- dahdi_destroy_channel_bynum(channel);
-- }
-- ast_debug(2, "About to destroy D-channel of span %d.\n", span);
-- pri_destroy_dchan(&pris[span - 1].pri);
--
-+ pri_destroy_span(pri);
- return CLI_SUCCESS;
- }
-
-@@ -15428,26 +15550,97 @@ static struct ast_cli_entry dahdi_mfcr2_
-
- #endif /* HAVE_OPENR2 */
-
--static char *dahdi_destroy_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-+static char *dahdi_destroy_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
- {
-- int channel;
-- int ret;
-+ int start;
-+ int end;
- switch (cmd) {
- case CLI_INIT:
-- e->command = "dahdi destroy channel";
-+ e->command = "dahdi destroy channels";
- e->usage =
-- "Usage: dahdi destroy channel <chan num>\n"
-+ "Usage: dahdi destroy channels <from_channel> [<to_channel>]\n"
- " DON'T USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING. Immediately removes a given channel, whether it is in use or not\n";
- return NULL;
- case CLI_GENERATE:
- return NULL;
- }
-- if (a->argc != 4)
-+ if ((a->argc < 4) || a->argc > 5) {
- return CLI_SHOWUSAGE;
-+ }
-+ start = atoi(a->argv[3]);
-+ if (start < 1) {
-+ ast_cli(a->fd, "Invalid starting channel number %s.\n",
-+ a->argv[4]);
-+ return CLI_FAILURE;
-+ }
-+ if (a->argc == 5) {
-+ end = atoi(a->argv[4]);
-+ if (end < 1) {
-+ ast_cli(a->fd, "Invalid ending channel number %s.\n",
-+ a->argv[4]);
-+ return CLI_FAILURE;
-+ }
-+ } else {
-+ end = start;
-+ }
-
-- channel = atoi(a->argv[3]);
-- ret = dahdi_destroy_channel_bynum(channel);
-- return ( RESULT_SUCCESS == ret ) ? CLI_SUCCESS : CLI_FAILURE;
-+ if (end < start) {
-+ ast_cli(a->fd,
-+ "range end (%d) is smaller than range start (%d)\n",
-+ end, start);
-+ return CLI_FAILURE;
-+ }
-+ dahdi_destroy_channel_range(start, end);
-+ return CLI_SUCCESS;
-+}
-+
-+static char *dahdi_create_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-+{
-+ int start;
-+ int end;
-+ int ret;
-+
-+ switch (cmd) {
-+ case CLI_INIT:
-+ e->command = "dahdi create channels";
-+ e->usage = "Usage: dahdi create channels <from> [<to>] - a range of channels\n"
-+ " dahdi create channels new - add channels not yet created\n"
-+ "For ISDN and SS7 the range should include complete spans.\n";
-+ return NULL;
-+ case CLI_GENERATE:
-+ return NULL;
-+ }
-+ if ((a->argc < 4) || a->argc > 5) {
-+ return CLI_SHOWUSAGE;
-+ }
-+ if (a->argc == 4 && !strcmp(a->argv[3], "new")) {
-+ ret = dahdi_create_channel_range(0, 0);
-+ return (RESULT_SUCCESS == ret) ? CLI_SUCCESS : CLI_FAILURE;
-+ }
-+ start = atoi(a->argv[3]);
-+ if (start <= 0) {
-+ ast_cli(a->fd, "Invalid starting channel number '%s'.\n",
-+ a->argv[3]);
-+ return CLI_FAILURE;
-+ }
-+ if (a->argc == 5) {
-+ end = atoi(a->argv[4]);
-+ if (end <= 0) {
-+ ast_cli(a->fd, "Invalid ending channel number '%s'.\n",
-+ a->argv[4]);
-+ return CLI_FAILURE;
-+ }
-+ } else {
-+ end = start;
-+ }
-+ if (end < start) {
-+ ast_cli(a->fd,
-+ "range end (%d) is smaller than range start (%d)\n",
-+ end, start);
-+ return CLI_FAILURE;
-+ }
-+ ret = dahdi_create_channel_range(start, end);
-+ return (RESULT_SUCCESS == ret) ? CLI_SUCCESS : CLI_FAILURE;
- }
-
- static void dahdi_softhangup_all(void)
-@@ -15478,7 +15671,6 @@ retry:
- ast_mutex_unlock(&iflock);
- }
-
--static int setup_dahdi(int reload);
- static int dahdi_restart(void)
- {
- #if defined(HAVE_PRI) || defined(HAVE_SS7)
-@@ -16254,7 +16446,8 @@ static struct ast_cli_entry dahdi_cli[]
- AST_CLI_DEFINE(handle_dahdi_show_cadences, "List cadences"),
- AST_CLI_DEFINE(dahdi_show_channels, "Show active DAHDI channels"),
- AST_CLI_DEFINE(dahdi_show_channel, "Show information on a channel"),
-- AST_CLI_DEFINE(dahdi_destroy_channel, "Destroy a channel"),
-+ AST_CLI_DEFINE(dahdi_destroy_channels, "Destroy channels"),
-+ AST_CLI_DEFINE(dahdi_create_channels, "Create channels"),
- AST_CLI_DEFINE(dahdi_restart_cmd, "Fully restart DAHDI channels"),
- AST_CLI_DEFINE(dahdi_show_status, "Show all DAHDI cards status"),
- AST_CLI_DEFINE(dahdi_show_version, "Show the DAHDI version in use"),
-@@ -17278,7 +17471,7 @@ static char *parse_spanchan(char *chanst
- return p;
- }
-
--static int build_channels(struct dahdi_chan_conf *conf, const char *value, int reload, int lineno, int *found_pseudo)
-+static int build_channels(struct dahdi_chan_conf *conf, const char *value, int reload, int lineno)
- {
- char *c, *chan;
- char *subdir;
-@@ -17301,8 +17494,6 @@ static int build_channels(struct dahdi_c
- finish = start;
- } else if (!strcasecmp(chan, "pseudo")) {
- finish = start = CHAN_PSEUDO;
-- if (found_pseudo)
-- *found_pseudo = 1;
- } else {
- ast_log(LOG_ERROR, "Syntax error parsing '%s' at '%s'\n", value, chan);
- return -1;
-@@ -17332,6 +17523,12 @@ static int build_channels(struct dahdi_c
- }
- }
- }
-+ if (conf->wanted_channels_start &&
-+ (real_channel < conf->wanted_channels_start ||
-+ real_channel > conf->wanted_channels_end)
-+ ) {
-+ continue;
-+ }
- tmp = mkintf(real_channel, conf, reload);
-
- if (tmp) {
-@@ -17341,6 +17538,9 @@ static int build_channels(struct dahdi_c
- (reload == 1) ? "reconfigure" : "register", value);
- return -1;
- }
-+ if (real_channel == CHAN_PSEUDO) {
-+ has_pseudo = 1;
-+ }
- }
- }
-
-@@ -17527,7 +17727,6 @@ static int process_dahdi(struct dahdi_ch
- {
- struct dahdi_pvt *tmp;
- int y;
-- int found_pseudo = 0;
- struct ast_variable *dahdichan = NULL;
-
- for (; v; v = v->next) {
-@@ -17540,7 +17739,7 @@ static int process_dahdi(struct dahdi_ch
- ast_log(LOG_WARNING, "Channel '%s' ignored.\n", v->value);
- continue;
- }
-- if (build_channels(confp, v->value, reload, v->lineno, &found_pseudo)) {
-+ if (build_channels(confp, v->value, reload, v->lineno)) {
- if (confp->ignore_failed_channels) {
- ast_log(LOG_WARNING, "Channel '%s' failure ignored: ignore_failed_channels.\n", v->value);
- continue;
-@@ -18673,8 +18872,7 @@ static int process_dahdi(struct dahdi_ch
-
- if (dahdichan) {
- /* Process the deferred dahdichan value. */
-- if (build_channels(confp, dahdichan->value, reload, dahdichan->lineno,
-- &found_pseudo)) {
-+ if (build_channels(confp, dahdichan->value, reload, dahdichan->lineno)) {
- if (confp->ignore_failed_channels) {
- ast_log(LOG_WARNING,
- "Dahdichan '%s' failure ignored: ignore_failed_channels.\n",
-@@ -18697,7 +18895,7 @@ static int process_dahdi(struct dahdi_ch
-
- /*< \todo why check for the pseudo in the per-channel section.
- * Any actual use for manual setup of the pseudo channel? */
-- if (!found_pseudo && reload != 1 && !(options & PROC_DAHDI_OPT_NOCHAN)) {
-+ if (!has_pseudo && reload != 1 && !(options & PROC_DAHDI_OPT_NOCHAN)) {
- /* use the default configuration for a channel, so
- that any settings from real configured channels
- don't "leak" into the pseudo channel config
-@@ -18711,6 +18909,7 @@ static int process_dahdi(struct dahdi_ch
- }
- if (tmp) {
- ast_verb(3, "Automatically generated pseudo channel\n");
-+ has_pseudo = 1;
- } else {
- ast_log(LOG_WARNING, "Unable to register pseudo channel!\n");
- }
-@@ -18990,7 +19189,8 @@ static int setup_dahdi_int(int reload, s
- if (reload != 1) {
- int x;
- for (x = 0; x < NUM_SPANS; x++) {
-- if (pris[x].pri.pvts[0]) {
-+ if (pris[x].pri.pvts[0] &&
-+ pris[x].pri.master == AST_PTHREADT_NULL) {
- prepare_pri(pris + x);
- if (sig_pri_start_pri(&pris[x].pri)) {
- ast_log(LOG_ERROR, "Unable to start D-channel on span %d\n", x + 1);
diff --git a/debian/patches/enable_addons b/debian/patches/enable_addons
index f20163b..518bd8c 100644
--- a/debian/patches/enable_addons
+++ b/debian/patches/enable_addons
@@ -20,16 +20,6 @@ included. See contrib/scripts/get_mp3_source.sh in the source tree.
<support_level>deprecated</support_level>
<replacement>func_odbc</replacement>
***/
---- a/addons/app_saycountpl.c
-+++ b/addons/app_saycountpl.c
-@@ -21,7 +21,6 @@
- */
-
- /*** MODULEINFO
-- <defaultenabled>no</defaultenabled>
- <support_level>deprecated</support_level>
- <replacement>say.conf</replacement>
- ***/
--- a/addons/chan_mobile.c
+++ b/addons/chan_mobile.c
@@ -27,7 +27,6 @@
diff --git a/debian/patches/escape_manpage_hyphen.patch b/debian/patches/escape_manpage_hyphen.patch
deleted file mode 100644
index 8816e61..0000000
--- a/debian/patches/escape_manpage_hyphen.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Author: Jeremy Lainé <jeremy.laine at m4x.org>
-Description: fix groff error in asterisk manpage
-Bug: https://issues.asterisk.org/jira/browse/ASTERISK-23768
-
-Fix an unescaped hyphen in the asterisk manpage.
-
-diff --git a/doc/asterisk.8 b/doc/asterisk.8
-index 15d7ab7..d566480 100644
---- a/doc/asterisk.8
-+++ b/doc/asterisk.8
-@@ -98,7 +98,7 @@ option also implies \*(T<\fB\-f\fR\*(T> (no forking). However when
- connecting to an existing Asterisk instance (\*(T<\fB\-r\fR\*(T> or
- \*(T<\fB\-R\fR\*(T>), it may only increase the debug level.
- .TP
---e \fImemory\fR
-+\-e \fImemory\fR
- Limit the generation of new channels when the amount of free memory
- has decreased to under \fImemory\fR megabytes.
- Equivalent to \*(T<\fBminmemfree = \fR\*(T>\fImemory\fR in
diff --git a/debian/patches/ignore_failed_channels.patch b/debian/patches/ignore_failed_channels.patch
deleted file mode 100644
index c748daf..0000000
--- a/debian/patches/ignore_failed_channels.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Author: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
-Description: Ignore failed DAHDI channels at startup
-Origin: https://reviewboard.asterisk.org/r/3063
-
-Allow DAHDI channels to be failed at startup, as it allows them to be
-added later through 'dahdi create channels' from e.g. a udev hook.
-
---- a/configs/chan_dahdi.conf.sample
-+++ b/configs/chan_dahdi.conf.sample
-@@ -1159,12 +1159,11 @@
- ;
- ;
- ; ignore_failed_channels: Continue even if some channels failed to configure.
--; False by default, as if even a single channel failed to configure, it might
--; mean other channels are misplaced and having them work may not be a good
--; idea. If enabled (set to true), chan_dahdi will nevertheless attempt to
--; configure other channels rather than giving up. This normally makes sense
--; only if you use names (<subdir>!<number>) for DAHDI channels.
--;ignore_failed_channels = true
-+; True by default. Disable this if you can guarantee that DAHDI starts before
-+; Asterisk and want to be sure chan_dahdi will not start with broken
-+; configuration.
-+;
-+;ignore_failed_channels = false
- ;
- ; Configure jitter buffers in DAHDI (each one is 20ms, default is 4)
- ; This is set globally, rather than per-channel.
---- a/channels/chan_dahdi.c
-+++ b/channels/chan_dahdi.c
-@@ -961,6 +961,7 @@
- .debouncetime = -1
- },
- .is_sig_auto = 1,
-+ .ignore_failed_channels = 1,
- .smdi_port = "/dev/ttyS0",
- };
-
diff --git a/debian/patches/neon_version_check.patch b/debian/patches/neon_version_check.patch
deleted file mode 100644
index 5a1b3e8..0000000
--- a/debian/patches/neon_version_check.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From: Jeremy Lainé <jeremy.laine at m4x.org>
-Subject: relax neon version check
-Bug: https://issues.asterisk.org/jira/browse/ASTERISK-24325
-
-Relax the neon version check to also accept version 0.30.x
-
-diff --git a/res/res_calendar_ews.c b/res/res_calendar_ews.c
-index 0f8b0c2..a617790 100644
---- a/res/res_calendar_ews.c
-+++ b/res/res_calendar_ews.c
-@@ -907,7 +907,7 @@ static int load_module(void)
- {
- /* Actualy, 0.29.1 is required (because of NTLM authentication), but this
- * function does not support matching patch version. */
-- if (ne_version_match(0, 29)) {
-+ if (ne_version_match(0, 29) && ne_version_match(0, 30)) {
- ast_log(LOG_ERROR, "Exchange Web Service calendar module require neon >= 0.29.1, but %s is installed.\n", ne_version_string());
- return AST_MODULE_LOAD_DECLINE;
- }
diff --git a/debian/patches/pjproject b/debian/patches/pjproject
deleted file mode 100644
index 0d37f3c..0000000
--- a/debian/patches/pjproject
+++ /dev/null
@@ -1,130 +0,0 @@
-From 5d584d0d83c063006ba1b731046d309123b7409c Mon Sep 17 00:00:00 2001
-From: Jason Parker <jparker at digium.com>
-Date: Tue, 12 Mar 2013 19:08:59 +0000
-Origin: http://svnview.digium.com/svn/asterisk?view=rev&rev=382900
-Subject: Switch to using external pjproject libraries.
-
-ICE/STUN/TURN support in res_rtp_asterisk is also now optional.
-
-(With minor backport adjustments for branch 11)
-
---- a/build_tools/menuselect-deps.in
-+++ b/build_tools/menuselect-deps.in
-@@ -43,6 +43,7 @@ OPENH323=@PBX_OPENH323@
- OSPTK=@PBX_OSPTK@
- OSS=@PBX_OSS@
- PGSQL=@PBX_PGSQL@
-+PJPROJECT=@PBX_PJPROJECT@
- POPT=@PBX_POPT@
- PORTAUDIO=@PBX_PORTAUDIO@
- PRI=@PBX_PRI@
---- a/configure.ac
-+++ b/configure.ac
-@@ -425,6 +425,7 @@ AST_EXT_LIB_SETUP([OPENR2], [MFR2], [ope
- AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
- AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
- AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
-+AST_EXT_LIB_SETUP([PJPROJECT], [PJPROJECT], [pjproject])
- AST_EXT_LIB_SETUP([POPT], [popt], [popt])
- AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
- AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
-@@ -2008,6 +2009,8 @@ if test "${PG_CONFIG}" != No; then
- fi
- fi
-
-+AST_PKG_CONFIG_CHECK([PJPROJECT], [libpjproject])
-+
- AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
-
- AST_EXT_LIB_CHECK([PORTAUDIO], [portaudio], [Pa_GetDeviceCount], [portaudio.h])
---- a/include/asterisk/autoconfig.h.in
-+++ b/include/asterisk/autoconfig.h.in
-@@ -554,6 +554,9 @@
- /* Define to indicate presence of the pg_encoding_to_char API. */
- #undef HAVE_PGSQL_pg_encoding_to_char
-
-+/* Define if your system has the PJPROJECT libraries. */
-+#undef HAVE_PJPROJECT
-+
- /* Define to 1 if your system defines IP_PKTINFO. */
- #undef HAVE_PKTINFO
-
---- a/makeopts.in
-+++ b/makeopts.in
-@@ -214,6 +214,9 @@ OSS_LIB=@OSS_LIB@ @FFMPEG_LIB@ @SDL_LIB@
- PGSQL_INCLUDE=@PGSQL_INCLUDE@
- PGSQL_LIB=@PGSQL_LIB@
-
-+PJPROJECT_INCLUDE=@PJPROJECT_INCLUDE@
-+PJPROJECT_LIB=@PJPROJECT_LIB@
-+
- POPT_INCLUDE=@POPT_INCLUDE@
- POPT_LIB=@POPT_LIB@
-
---- a/res/Makefile
-+++ b/res/Makefile
-@@ -67,31 +67,9 @@ endif
- ael/pval.o: ael/pval.c
-
- clean::
-- @if [ -f pjproject/build.mak ]; then $(MAKE) -C pjproject realclean; fi
- rm -f snmp/*.o snmp/*.i ael/*.o ael/*.i ais/*.o ais/*.i
-
--dist-clean:: distclean
--distclean::
-- rm -f pjproject/build.mak
--
--pjproject/build.mak: pjproject/aconfigure
-- (cd pjproject && CFLAGS="-fPIC" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --disable-floating-point --disable-sound --disable-oss --disable-speex-aec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-g711-codec)
--
--ifneq ($(findstring $(MAKECMDGOALS),all),)
---include pjproject/build.mak
--endif
--
--.PHONY: FORCE
--FORCE:
--
--$(PJ_LIB_FILES): FORCE
-- $(MAKE) -C $(patsubst %/lib/,%,$(dir $@))/build/ ../lib/$(notdir $@)
--
- ifeq ($(subst 1:0,1,$(UUID)), 1)
--res_rtp_asterisk.o: $(PJ_LIB_FILES)
- res_rtp_asterisk.o: _ASTCFLAGS+=-DUSE_PJPROJECT
--res_rtp_asterisk.o: _ASTCFLAGS+=$(PJ_CFLAGS)
--res_rtp_asterisk.so: _ASTLDFLAGS+=$(PJ_LDFLAGS)
--res_rtp_asterisk.so: LIBS+=$(PJ_LDLIBS)
- endif
-
---- a/res/res_rtp_asterisk.c
-+++ b/res/res_rtp_asterisk.c
-@@ -29,7 +29,7 @@
- */
-
- /*** MODULEINFO
-- <use type="external">uuid</use>
-+ <use type="external">pjproject</use>
- <support_level>core</support_level>
- ***/
-
-@@ -52,9 +52,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
- * here since it is used internally by pjlib. The only other option would be to modify pjlib... which won't happen. */
- #undef bzero
- #define bzero bzero
--#include "pjlib.h"
--#include "pjlib-util.h"
--#include "pjnath.h"
-+#include <pjlib.h>
-+#include <pjlib-util.h>
-+#include <pjnath.h>
- #endif
-
- #include "asterisk/stun.h"
-@@ -2067,7 +2067,7 @@ static int ice_create(struct ast_rtp_ins
-
- /* Create an ICE session for ICE negotiation */
- if (pj_ice_sess_create(&stun_config, NULL, PJ_ICE_SESS_ROLE_UNKNOWN, 2,
-- &ast_rtp_ice_sess_cb, &ufrag, &passwd, &rtp->ice) == PJ_SUCCESS) {
-+ &ast_rtp_ice_sess_cb, &ufrag, &passwd, NULL, &rtp->ice) == PJ_SUCCESS) {
- /* Make this available for the callbacks */
- rtp->ice->user_data = instance;
-
diff --git a/debian/patches/pri_destroy_span_prilist.patch b/debian/patches/pri_destroy_span_prilist.patch
deleted file mode 100644
index 66b171d..0000000
--- a/debian/patches/pri_destroy_span_prilist.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
-Subject: defer destructions of pri spans
-Bug: https://issues.asterisk.org/jira/browse/ASTERISK-23554
-
-Fixes a deadlock in destruction of PRI spans
-
-See also: https://reviewboard.asterisk.org/r/3548
-
----
- channels/chan_dahdi.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++--
- 1 files changed, 79 insertions(+), 3 deletions(-)
-
-diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
-index fd5abe2..c21d593 100644
---- a/channels/chan_dahdi.c
-+++ b/channels/chan_dahdi.c
-@@ -1353,6 +1353,14 @@ static struct dahdi_pvt *iflist = NULL; /*!< Main interface list start */
- static struct dahdi_pvt *ifend = NULL; /*!< Main interface list end */
-
- #if defined(HAVE_PRI)
-+struct doomed_pri {
-+ struct sig_pri_span *pri;
-+ AST_LIST_ENTRY(doomed_pri) list;
-+};
-+static AST_LIST_HEAD_STATIC(doomed_pris, doomed_pri);
-+
-+static void pri_destroy_span(struct sig_pri_span *pri);
-+
- static struct dahdi_parms_pseudo {
- int buf_no; /*!< Number of buffers */
- int buf_policy; /*!< Buffer policy */
-@@ -1754,6 +1762,75 @@ static int analogsub_to_dahdisub(enum analog_sub analogsub)
- return index;
- }
-
-+/*!
-+ * \internal
-+ * \brief release all members on the doomed pris list
-+ * \since 13.0
-+ *
-+ * Called priodically by the monitor threads to release spans marked for
-+ * removal.
-+ */
-+static void release_doomed_pris(void) {
-+#ifdef HAVE_PRI
-+ struct doomed_pri *entry;
-+ AST_LIST_HEAD_NOLOCK(doomed_pris, doomed_pri) doomed_list;
-+
-+ /* Move the global list to our local list. This prevents deadlocks with
-+ * any pri->lock.
-+ */
-+ AST_LIST_LOCK(&doomed_pris);
-+ doomed_list.first = doomed_pris.first;
-+ doomed_list.last = doomed_pris.last;
-+ doomed_pris.first = doomed_pris.last = NULL;
-+ AST_LIST_UNLOCK(&doomed_pris);
-+
-+ AST_LIST_TRAVERSE_SAFE_BEGIN(&doomed_list, entry, list) {
-+ AST_LIST_REMOVE_CURRENT(list);
-+ pri_destroy_span(entry->pri);
-+ ast_free(entry);
-+ }
-+ AST_LIST_TRAVERSE_SAFE_END;
-+#endif
-+}
-+
-+#ifdef HAVE_PRI
-+/*!
-+ * \internal
-+ * \brief Queue a span for destruction
-+ * \since 13.0
-+ *
-+ * \param pri the span to destroy
-+ *
-+ * Add a span to the list of spans to be destroyed later on
-+ * by the monitor thread. Allows destroying a span while holding its
-+ * lock.
-+ */
-+static void pri_queue_for_destruction(struct sig_pri_span *pri) {
-+ struct doomed_pri *entry;
-+ int len = 0;
-+
-+ AST_LIST_LOCK(&doomed_pris);
-+ AST_LIST_TRAVERSE(&doomed_pris, entry, list) {
-+ if (entry->pri == pri) {
-+ AST_LIST_UNLOCK(&doomed_pris);
-+ return;
-+ }
-+ len++;
-+ }
-+ entry = ast_calloc(sizeof(struct doomed_pri), 1);
-+ if (!entry) {
-+ /* Nothing useful to do here. Panic? */
-+ ast_log(LOG_WARNING, "Failed allocating memory for a doomed_pri.\n");
-+ AST_LIST_UNLOCK(&doomed_pris);
-+ return;
-+ }
-+ entry->pri = pri;
-+ ast_debug(4, "Queue span %d for destruction.\n", pri->span);
-+ AST_LIST_INSERT_TAIL(&doomed_pris, entry, list);
-+ AST_LIST_UNLOCK(&doomed_pris);
-+}
-+#endif
-+
- static enum analog_event dahdievent_to_analogevent(int event);
- static int bump_gains(struct dahdi_pvt *p);
- static int dahdi_setlinear(int dfd, int linear);
-@@ -3229,8 +3306,6 @@ static int sig_pri_tone_to_dahditone(enum sig_pri_tone tone)
- #endif /* defined(HAVE_PRI) */
-
- #if defined(HAVE_PRI)
--static void pri_destroy_span(struct sig_pri_span *pri);
--
- static void my_handle_dchan_exception(struct sig_pri_span *pri, int index)
- {
- int x;
-@@ -3259,7 +3334,7 @@ static void my_handle_dchan_exception(struct sig_pri_span *pri, int index)
- pri_event_noalarm(pri, index, 0);
- break;
- case DAHDI_EVENT_REMOVED:
-- pri_destroy_span(pri);
-+ pri_queue_for_destruction(pri);
- break;
- default:
- break;
-@@ -12172,6 +12247,7 @@ static void *do_monitor(void *data)
- dahdi_destroy_channel_range(doomed->channel, doomed->channel);
- doomed = NULL;
- }
-+ release_doomed_pris();
- if (!i) {
- break;
- }
---
-1.7.1
-
diff --git a/debian/patches/res_fax_bounds.patch b/debian/patches/res_fax_bounds.patch
deleted file mode 100644
index a2f8fcc..0000000
--- a/debian/patches/res_fax_bounds.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-From: Jeremy Lainé <jeremy.laine at m4x.org>
-Subject: out of bounds error in update_modem_bits
-Bug: https://issues.asterisk.org/jira/browse/ASTERISK-24357
-
-diff --git a/res/res_fax.c b/res/res_fax.c
-index 1678256..5413fa5 100644
---- a/res/res_fax.c
-+++ b/res/res_fax.c
-@@ -585,7 +585,7 @@ static int update_modem_bits(enum ast_fax_modems *bits, const char *value)
- m[i] = NULL;
- } else {
- tok = strtok(v, ", ");
-- while (tok && (i < 5)) {
-+ while (tok && (i < 4)) {
- m[i++] = tok;
- tok = strtok(NULL, ", ");
- }
diff --git a/debian/patches/series b/debian/patches/series
index c9b7269..dec8d9d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,4 @@
# upstream fixes
-allow-tilde-destdir
-
hack-multiple-app-voicemail
# Not used ATM. See comment in patch:
#make-clean-fixes
@@ -19,18 +17,8 @@ no_uname
ilbc_disable
astdatadir
-pjproject
-
-# Backport of dynamic generation of DAHDI channels:
-dahdi_create_channels
-pri_destroy_span_prilist.patch
-sigpri_handle_enodev_1.patch
reenable
-ignore_failed_channels.patch
smsq_enable.patch
-escape_manpage_hyphen.patch
aelparse_enable.patch
-res_fax_bounds.patch
-neon_version_check.patch
systemd.patch
diff --git a/debian/patches/sigpri_handle_enodev_1.patch b/debian/patches/sigpri_handle_enodev_1.patch
deleted file mode 100644
index 3ee4789..0000000
--- a/debian/patches/sigpri_handle_enodev_1.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From: Tzafrir Cohen <tzafrir.cohen at xorcom.com
-Subject: handle ENODEV on sig_pri
-Bug: https://issues.asterisk.org/jira/browse/ASTERISK-23554
-
-Handle ENODEV error in libpri following a device removal.
-
-See also: https://reviewboard.asterisk.org/r/3548
-
----
- channels/chan_dahdi.c | 3 ++-
- channels/sig_pri.c | 8 ++++++++
- channels/sig_pri.h | 2 ++
- 3 files changed, 12 insertions(+), 1 deletions(-)
-
-diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
-index c21d593..b6b644f 100644
---- a/channels/chan_dahdi.c
-+++ b/channels/chan_dahdi.c
-@@ -1795,7 +1795,6 @@ static void release_doomed_pris(void) {
-
- #ifdef HAVE_PRI
- /*!
-- * \internal
- * \brief Queue a span for destruction
- * \since 13.0
- *
-@@ -3617,6 +3616,7 @@ struct sig_pri_callback sig_pri_callbacks =
- .dial_digits = my_pri_dial_digits,
- .open_media = my_pri_ss7_open_media,
- .ami_channel_event = my_ami_channel_event,
-+ .destroy_later = pri_queue_for_destruction,
- };
- #endif /* defined(HAVE_PRI) */
-
-@@ -15146,6 +15146,7 @@ static void pri_destroy_span(struct sig_pri_span *pri)
- for (i = 0; i < SIG_PRI_NUM_DCHANS; i++) {
- ast_debug(4, "closing pri_fd %d\n", i);
- dahdi_close_pri_fd(dahdi_pri, i);
-+ dahdi_pri->dchannels[i] = 0;
- }
- sig_pri_init_pri(pri);
- ast_debug(1, "PRI span %d destroyed\n", pri->span);
-diff --git a/channels/sig_pri.c b/channels/sig_pri.c
-index 1d9067a..5636594 100644
---- a/channels/sig_pri.c
-+++ b/channels/sig_pri.c
-@@ -6301,6 +6301,14 @@ static void *pri_dchannel(void *vpri)
- }
- if (e)
- break;
-+
-+ if ((errno != 0) && (errno != EINTR)) {
-+ ast_log(LOG_NOTICE, "pri_check_event returned error %d (%s)\n",
-+ errno, strerror(errno));
-+ }
-+ if (errno == ENODEV) {
-+ sig_pri_callbacks.destroy_later(pri);
-+ }
- }
- } else if (errno != EINTR)
- ast_log(LOG_WARNING, "pri_event returned error %d (%s)\n", errno, strerror(errno));
-diff --git a/channels/sig_pri.h b/channels/sig_pri.h
-index 43acb12..7bfbc79 100644
---- a/channels/sig_pri.h
-+++ b/channels/sig_pri.h
-@@ -229,6 +229,8 @@ struct sig_pri_callback {
- void (*module_ref)(void);
- /*! Unreference the parent module. */
- void (*module_unref)(void);
-+ /*! Mark the span for destruction. */
-+ void (*destroy_later)(struct sig_pri_span *pri);
- };
-
- /*! Global sig_pri callbacks to the upper layer. */
---
-1.7.1
-
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/asterisk.git
More information about the Pkg-voip-commits
mailing list