[svn-commits] file: branch file/bridging r65592 - in
/team/file/bridging: ./ apps/ build_to...
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Wed May 23 06:11:06 MST 2007
Author: file
Date: Wed May 23 08:11:05 2007
New Revision: 65592
URL: http://svn.digium.com/view/asterisk?view=rev&rev=65592
Log:
Merged revisions 65502,65505,65542,65573,65590 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r65502 | russell | 2007-05-22 14:41:56 -0400 (Tue, 22 May 2007) | 11 lines
Merged revisions 65501 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r65501 | russell | 2007-05-22 13:40:38 -0500 (Tue, 22 May 2007) | 3 lines
List res_smdi as a dependency for app_voicemail and chan_zap
(Thanks to mnicholson for pointing it out)
........
................
r65505 | russell | 2007-05-22 14:52:59 -0400 (Tue, 22 May 2007) | 8 lines
Add a new feature for Music on Hold. If you set the "digit" option for a
class in musiconhold.conf, a caller on hold may press this digit to switch
to listening to that music class.
This involved adding a new callback for generators, which allow generators
to get notified of DTMF from the channel they are running on. Then, a callback
was implemented for the music on hold generators.
(patch from bbryant)
................
r65542 | kpfleming | 2007-05-22 16:26:35 -0400 (Tue, 22 May 2007) | 10 lines
Merged revisions 65541 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r65541 | kpfleming | 2007-05-22 16:25:41 -0400 (Tue, 22 May 2007) | 2 lines
when building a version string for a developer branch, include the base branch in the version string
........
................
r65573 | russell | 2007-05-22 22:55:22 -0400 (Tue, 22 May 2007) | 1 line
Fix a couple minor spelling mistakes.
................
r65590 | file | 2007-05-23 09:07:28 -0400 (Wed, 23 May 2007) | 2 lines
Fix compiling of res_musiconhold under dev mode.
................
Modified:
team/file/bridging/ (props changed)
team/file/bridging/CHANGES
team/file/bridging/apps/app_voicemail.c
team/file/bridging/build_tools/make_version
team/file/bridging/channels/chan_zap.c
team/file/bridging/configs/musiconhold.conf.sample
team/file/bridging/include/asterisk/channel.h
team/file/bridging/main/channel.c
team/file/bridging/main/devicestate.c
team/file/bridging/res/res_musiconhold.c
Propchange: team/file/bridging/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/file/bridging/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed May 23 08:11:05 2007
@@ -1,1 +1,1 @@
-/trunk:1-65456
+/trunk:1-65590
Modified: team/file/bridging/CHANGES
URL: http://svn.digium.com/view/asterisk/team/file/bridging/CHANGES?view=diff&rev=65592&r1=65591&r2=65592
==============================================================================
--- team/file/bridging/CHANGES (original)
+++ team/file/bridging/CHANGES Wed May 23 08:11:05 2007
@@ -82,7 +82,7 @@
* Added two new dialplan functions, ENUMQUERY and ENUMRESULT. These
functions will allow you to initiate an ENUM lookup from the dialplan,
and Asterisk will cache the results. ENUMRESULT can be used to access
- the results without doing multiple DNS queries.
+ the results without doing multiple DNS queries.
Voicemail Changes
-----------------
@@ -134,6 +134,13 @@
* Added a new application, MeetMeChannelAdmin, which is similar to MeetMeAdmin,
except it does operations on a channel by name, instead of number in a conference.
This is a very useful feature in combination with the 'X' option to ChanSpy.
+
+Music On Hold Changes
+---------------------
+ * A new option, "digit", has been added for music on hold classes in
+ musiconhold.conf. If this is set for a music on hold class, a caller
+ listening to music on hold can press this digit to switch to listening
+ to this music on hold class.
Miscellaneous
-------------
Modified: team/file/bridging/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/apps/app_voicemail.c?view=diff&rev=65592&r1=65591&r2=65592
==============================================================================
--- team/file/bridging/apps/app_voicemail.c (original)
+++ team/file/bridging/apps/app_voicemail.c Wed May 23 08:11:05 2007
@@ -41,6 +41,7 @@
*/
/*** MODULEINFO
+ <depend>res_smdi</depend>
***/
/*** MAKEOPTS
Modified: team/file/bridging/build_tools/make_version
URL: http://svn.digium.com/view/asterisk/team/file/bridging/build_tools/make_version?view=diff&rev=65592&r1=65591&r2=65592
==============================================================================
--- team/file/bridging/build_tools/make_version (original)
+++ team/file/bridging/build_tools/make_version Wed May 23 08:11:05 2007
@@ -9,6 +9,8 @@
TAG=0
REV=`svnversion -c ${1} | cut -d: -f2`
+
+ BASE=`LANG=C svn pg svnmerge-integrated ${1} | cut -d: -f1`
if [ "${PARTS}" = "trunk" ]
then
@@ -60,6 +62,6 @@
then
echo ${RESULT}
else
- echo SVN-${RESULT##-}-r${REV}
+ echo SVN-${RESULT##-}-r${REV}${BASE:+-${BASE}}
fi
fi
Modified: team/file/bridging/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/channels/chan_zap.c?view=diff&rev=65592&r1=65591&r2=65592
==============================================================================
--- team/file/bridging/channels/chan_zap.c (original)
+++ team/file/bridging/channels/chan_zap.c Wed May 23 08:11:05 2007
@@ -38,6 +38,7 @@
*/
/*** MODULEINFO
+ <depend>res_smdi</depend>
<depend>zaptel_vldtmf</depend>
<depend>zaptel</depend>
<depend>tonezone</depend>
Modified: team/file/bridging/configs/musiconhold.conf.sample
URL: http://svn.digium.com/view/asterisk/team/file/bridging/configs/musiconhold.conf.sample?view=diff&rev=65592&r1=65591&r2=65592
==============================================================================
--- team/file/bridging/configs/musiconhold.conf.sample (original)
+++ team/file/bridging/configs/musiconhold.conf.sample Wed May 23 08:11:05 2007
@@ -39,7 +39,10 @@
;[native-random]
;mode=files
;directory=/var/lib/asterisk/moh
-;random=yes ; Play the files in a random order
+;random=yes ; Play the files in a random order
+;digit=# ; If this option is set for a class, then when callers are
+; ; listening to music on hold, they can press this digit, and
+; ; they will switch to listening to this music class.
; =========
Modified: team/file/bridging/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/file/bridging/include/asterisk/channel.h?view=diff&rev=65592&r1=65591&r2=65592
==============================================================================
--- team/file/bridging/include/asterisk/channel.h (original)
+++ team/file/bridging/include/asterisk/channel.h Wed May 23 08:11:05 2007
@@ -182,6 +182,8 @@
void *(*alloc)(struct ast_channel *chan, void *params);
void (*release)(struct ast_channel *chan, void *data);
int (*generate)(struct ast_channel *chan, void *data, int len, int samples);
+ /*! This gets called when DTMF_END frames are read from the channel */
+ void (*digit)(struct ast_channel *chan, char digit);
};
/*! \brief Structure for a data store type */
Modified: team/file/bridging/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/channel.c?view=diff&rev=65592&r1=65591&r2=65592
==============================================================================
--- team/file/bridging/main/channel.c (original)
+++ team/file/bridging/main/channel.c Wed May 23 08:11:05 2007
@@ -2420,6 +2420,9 @@
chan->fin = FRAMECOUNT_INC(chan->fin);
done:
+ if (chan->music_state && chan->generator && chan->generator->digit && f && f->frametype == AST_FRAME_DTMF_END)
+ chan->generator->digit(chan, f->subclass);
+
ast_channel_unlock(chan);
return f;
}
Modified: team/file/bridging/main/devicestate.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/devicestate.c?view=diff&rev=65592&r1=65591&r2=65592
==============================================================================
--- team/file/bridging/main/devicestate.c (original)
+++ team/file/bridging/main/devicestate.c Wed May 23 08:11:05 2007
@@ -48,7 +48,7 @@
* or just a specific extensions.
*
* For non-device related states, there's an API called
- * devicestateproviders. This is an extendable system for
+ * devicestate providers. This is an extendible system for
* delivering state information from outside sources or
* functions within Asterisk. Currently we have providers
* for app_meetme.c - the conference bridge - and call
@@ -63,7 +63,7 @@
*
* The CLI command "show hints" show last known state
*
- * \note None of these handle user states, like an IM presense
+ * \note None of these handle user states, like an IM presence
* system. res_jabber.c can subscribe and watch such states
* in jabber/xmpp based systems.
*
Modified: team/file/bridging/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/res/res_musiconhold.c?view=diff&rev=65592&r1=65591&r2=65592
==============================================================================
--- team/file/bridging/res/res_musiconhold.c (original)
+++ team/file/bridging/res/res_musiconhold.c Wed May 23 08:11:05 2007
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <errno.h>
+#include <ctype.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
@@ -130,6 +131,7 @@
char dir[256];
char args[256];
char mode[80];
+ char digit;
/*! A dynamically sized array to hold the list of filenames in "files" mode */
char **filearray;
/*! The current size of the filearray */
@@ -324,11 +326,42 @@
return chan->music_state;
}
+/*! \note This function should be called with the mohclasses list locked */
+static struct mohclass *get_mohbydigit(char digit)
+{
+ struct mohclass *moh = NULL;
+
+ AST_RWLIST_TRAVERSE(&mohclasses, moh, list) {
+ if (digit == moh->digit)
+ break;
+ }
+
+ return moh;
+}
+
+static void moh_handle_digit(struct ast_channel *chan, char digit)
+{
+ struct mohclass *moh;
+ const char *classname = NULL;
+
+ AST_RWLIST_RDLOCK(&mohclasses);
+ if ((moh = get_mohbydigit(digit)))
+ classname = ast_strdupa(moh->name);
+ AST_RWLIST_UNLOCK(&mohclasses);
+
+ if (!moh)
+ return;
+
+ ast_moh_stop(chan);
+ ast_moh_start(chan, classname, NULL);
+}
+
static struct ast_generator moh_file_stream =
{
alloc: moh_files_alloc,
release: moh_files_release,
generate: moh_files_generator,
+ digit: moh_handle_digit,
};
static int spawn_mp3(struct mohclass *class)
@@ -742,6 +775,7 @@
alloc: moh_alloc,
release: moh_release,
generate: moh_generate,
+ digit: moh_handle_digit
};
static int moh_add_file(struct mohclass *class, const char *filepath)
@@ -996,9 +1030,9 @@
for (; cat; cat = ast_category_browse(cfg, cat)) {
/* These names were deprecated in 1.4 and should not be used until after the next major release. */
if (strcasecmp(cat, "classes") && strcasecmp(cat, "moh_files")) {
- if (!(class = moh_class_malloc())) {
+ if (!(class = moh_class_malloc()))
break;
- }
+
ast_copy_string(class->name, cat, sizeof(class->name));
var = ast_variable_browse(cfg, cat);
while (var) {
@@ -1008,6 +1042,8 @@
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)))
+ class->digit = *var->value;
else if (!strcasecmp(var->name, "random"))
ast_set2_flag(class, ast_true(var->value), MOH_RANDOMIZE);
else if (!strcasecmp(var->name, "format")) {
@@ -1143,6 +1179,8 @@
ast_cli(fd, "Class: %s\n", class->name);
ast_cli(fd, "\tMode: %s\n", S_OR(class->mode, "<none>"));
ast_cli(fd, "\tDirectory: %s\n", S_OR(class->dir, "<none>"));
+ if (class->digit)
+ ast_cli(fd, "\tDigit: %c\n", class->digit);
if (ast_test_flag(class, MOH_CUSTOM))
ast_cli(fd, "\tApplication: %s\n", S_OR(class->args, "<none>"));
if (strcasecmp(class->mode, "files"))
More information about the svn-commits
mailing list