[asterisk-commits] oej: branch oej/mutestream-trunk r215157 - /team/oej/mutestream-trunk/res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Sep 1 14:17:15 CDT 2009
Author: oej
Date: Tue Sep 1 14:17:11 2009
New Revision: 215157
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=215157
Log:
Address russellb's comments in reviewboard
Changing name of functions based on feedback from kpfleming
Thanks for your time!
Modified:
team/oej/mutestream-trunk/res/res_mutestream.c
Modified: team/oej/mutestream-trunk/res/res_mutestream.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/mutestream-trunk/res/res_mutestream.c?view=diff&rev=215157&r1=215156&r2=215157
==============================================================================
--- team/oej/mutestream-trunk/res/res_mutestream.c (original)
+++ team/oej/mutestream-trunk/res/res_mutestream.c Tue Sep 1 14:17:11 2009
@@ -22,18 +22,23 @@
*
* \author Olle E. Johansson <oej at edvina.net>
*
+ * \ingroup functions
+ *
+ * \note This module only handles audio streams today, but can easily be appended to also
+ * zero out text streams if there's an application for it.
+ * When we know and understands what happens if we zero out video, we can do that too.
*/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 89545 $")
-#include <time.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
+//#include <time.h>
+//#include <string.h>
+//#include <stdio.h>
+//#include <stdlib.h>
+//#include <unistd.h>
+//#include <errno.h>
#include "asterisk/options.h"
#include "asterisk/logger.h"
@@ -48,9 +53,9 @@
#include "asterisk/manager.h"
/*** DOCUMENTATION
- <function name="MUTESTREAM" language="en_US">
+ <function name="MUTEAUDIO" language="en_US">
<synopsis>
- Muting streams in the channel
+ Muting audio streams in the channel
</synopsis>
<syntax>
<parameter name="direction" required="true">
@@ -69,12 +74,12 @@
</parameter>
</syntax>
<description>
- <para>The MUTESTREAM function can be used to mute inbound (to the PBX) or outbound audio in a call.
+ <para>The MUTEAUDIO function can be used to mute inbound (to the PBX) or outbound audio in a call.
Example:
</para>
<para>
- MUTESTREAM(in)=on
- MUTESTREAM(in)=off
+ MUTEAUDIO(in)=on
+ MUTEAUDIO(in)=off
</para>
</description>
</function>
@@ -232,12 +237,11 @@
}
if (is_new) {
- if(mute_add_audiohook(chan, mute, datastore)) {
+ if (mute_add_audiohook(chan, mute, datastore)) {
/* Can't add audiohook - already printed error message */
ast_datastore_free(datastore);
ast_free(mute);
}
-
}
ast_channel_unlock(chan);
@@ -246,7 +250,7 @@
/* Function for debugging - might be useful */
static struct ast_custom_function mute_function = {
- .name = "MUTESTREAM",
+ .name = "MUTEAUDIO",
.write = func_mute_write,
};
@@ -308,7 +312,7 @@
}
if (is_new) {
- if(mute_add_audiohook(c, mute, datastore)) {
+ if (mute_add_audiohook(c, mute, datastore)) {
/* Can't add audiohook - already printed error message */
ast_datastore_free(datastore);
ast_free(mute);
@@ -324,7 +328,7 @@
}
-static char mandescr_mutestream[] =
+static const char mandescr_mutestream[] =
"Description: Mute an incoming or outbound audio stream in a channel.\n"
"Variables: \n"
" Channel: <name> The channel you want to mute.\n"
@@ -338,9 +342,9 @@
int res;
res = ast_custom_function_register(&mute_function);
- res |= ast_manager_register2("MuteStream", EVENT_FLAG_SYSTEM, manager_mutestream,
+ res |= ast_manager_register2("MuteAudio", EVENT_FLAG_SYSTEM, manager_mutestream,
"Mute an audio stream", mandescr_mutestream);
-
+
return (res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS);
}
@@ -348,7 +352,7 @@
{
ast_custom_function_unregister(&mute_function);
/* Unregister AMI actions */
- ast_manager_unregister("MuteStream");
+ ast_manager_unregister("MuteAudio");
return 0;
}
More information about the asterisk-commits
mailing list