aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk/ASTERISK-18977.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-12-16 08:44:26 +0200
committerTimo Teräs <timo.teras@iki.fi>2011-12-16 08:45:33 +0200
commite0d4e807e849edd9fbbdb7fc9b010fd4e3d85e4c (patch)
treebb92c4cc49c0a079761ce40e9f2827f6d6b78638 /main/asterisk/ASTERISK-18977.patch
parent46b0b8a55ba0053b15355f4f5f2f0e25221c5d04 (diff)
downloadaports-e0d4e807e849edd9fbbdb7fc9b010fd4e3d85e4c.tar.bz2
aports-e0d4e807e849edd9fbbdb7fc9b010fd4e3d85e4c.tar.xz
main/asterisk: upgrade to 10.0.0
... and delete the testing version.
Diffstat (limited to 'main/asterisk/ASTERISK-18977.patch')
-rw-r--r--main/asterisk/ASTERISK-18977.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/main/asterisk/ASTERISK-18977.patch b/main/asterisk/ASTERISK-18977.patch
new file mode 100644
index 0000000000..fffce032cd
--- /dev/null
+++ b/main/asterisk/ASTERISK-18977.patch
@@ -0,0 +1,63 @@
+--- a/res/res_musiconhold.c.orig
++++ b/res/res_musiconhold.c
+@@ -158,6 +158,7 @@
+ char name[MAX_MUSICCLASS];
+ struct ast_format origwfmt;
+ struct ast_format mohwfmt;
++ int announcement;
+ int samples;
+ int sample_queue;
+ int pos;
+@@ -173,6 +174,7 @@
+ #define MOH_SORTALPHA (1 << 4)
+
+ #define MOH_CACHERTCLASSES (1 << 5) /*!< Should we use a separate instance of MOH for each user or not */
++#define MOH_ANNOUNCEMENT (1 << 6)
+
+ /* Custom astobj2 flag */
+ #define MOH_NOTDELETED (1 << 30) /*!< Find only records that aren't deleted? */
+@@ -183,6 +185,7 @@
+ char name[MAX_MUSICCLASS];
+ char dir[256];
+ char args[256];
++ char announcement[80];
+ char mode[80];
+ char digit;
+ /*! A dynamically sized array to hold the list of filenames in "files" mode */
+@@ -278,6 +281,7 @@
+ }
+
+ state->save_pos = state->pos;
++ state->announcement = 0;
+
+ state->class = mohclass_unref(state->class, "Unreffing channel's music class upon deactivation of generator");
+ }
+@@ -293,6 +297,16 @@
+ chan->stream = NULL;
+ }
+
++ if (ast_test_flag(state->class, MOH_ANNOUNCEMENT) && state->announcement == 0) {
++ state->announcement = 1;
++ if (ast_openstream_full(chan, state->class->announcement, chan->language, 1)) {
++ ast_debug(1, "%s Opened announcement '%s'\n", chan->name, state->class->announcement);
++ return 0;
++ }
++ } else {
++ state->announcement = 0;
++ }
++
+ if (!state->class->total_files) {
+ ast_log(LOG_WARNING, "No files available for class '%s'\n", state->class->name);
+ return -1;
+@@ -1731,7 +1745,10 @@
+ ast_copy_string(class->dir, var->value, sizeof(class->dir));
+ else if (!strcasecmp(var->name, "application"))
+ ast_copy_string(class->args, var->value, sizeof(class->args));
+- else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value)))
++ else if (!strcasecmp(var->name, "announcement")) {
++ ast_copy_string(class->announcement, var->value, sizeof(class->announcement));
++ ast_set_flag(class, MOH_ANNOUNCEMENT);
++ } else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value)))
+ class->digit = *var->value;
+ else if (!strcasecmp(var->name, "random"))
+ ast_set2_flag(class, ast_true(var->value), MOH_RANDOMIZE);