[asterisk-commits] russell: branch russell/res_monkeys r81322 - in /team/russell/res_monkeys: in...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 28 17:53:55 CDT 2007


Author: russell
Date: Tue Aug 28 17:53:54 2007
New Revision: 81322

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81322
Log:
Add support for a callback for audiohook whisper mode. 

Modified:
    team/russell/res_monkeys/include/asterisk/audiohook.h
    team/russell/res_monkeys/main/audiohook.c

Modified: team/russell/res_monkeys/include/asterisk/audiohook.h
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/include/asterisk/audiohook.h?view=diff&rev=81322&r1=81321&r2=81322
==============================================================================
--- team/russell/res_monkeys/include/asterisk/audiohook.h (original)
+++ team/russell/res_monkeys/include/asterisk/audiohook.h Tue Aug 28 17:53:54 2007
@@ -68,6 +68,9 @@
  */
 typedef int (*ast_audiohook_manipulate_callback)(struct ast_audiohook *audiohook, struct ast_channel *chan, struct ast_frame *frame, enum ast_audiohook_direction direction);
 
+typedef int (*ast_audiohook_whisper_callback(struct ast_audiohook *audiohook, 
+	struct ast_channel *chan, unsigned int samples, void *user_data);
+
 struct ast_audiohook_options {
 	int read_volume;  /*!< Volume adjustment on frames read from the channel the hook is on */
 	int write_volume; /*!< Volume adjustment on frames written to the channel the hook is on */
@@ -85,6 +88,8 @@
 	int format;                                            /*!< Format translation path is setup as */
 	struct ast_trans_pvt *trans_pvt;                       /*!< Translation path for reading frames */
 	ast_audiohook_manipulate_callback manipulate_callback; /*!< Manipulation callback */
+	ast_audiohook_whisper_callback whisper_callback;       /*!< Whisper callback */
+	void *user_data;                                       /*!< User data for whisper callback */
 	struct ast_audiohook_options options;                  /*!< Applicable options */
 	AST_LIST_ENTRY(ast_audiohook) list;                    /*!< Linked list information */
 };

Modified: team/russell/res_monkeys/main/audiohook.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/main/audiohook.c?view=diff&rev=81322&r1=81321&r2=81322
==============================================================================
--- team/russell/res_monkeys/main/audiohook.c (original)
+++ team/russell/res_monkeys/main/audiohook.c Tue Aug 28 17:53:54 2007
@@ -523,6 +523,8 @@
 				ast_audiohook_unlock(audiohook);
 				continue;
 			}
+			if (audiohook->whisper_callback)
+				audiohook->whisper_callback(audiohook, chan, samples);
 			if (ast_slinfactory_available(&audiohook->write_factory) >= samples && ast_slinfactory_read(&audiohook->write_factory, read_buf, samples)) {
 				/* Take audio from this whisper source and combine it into our main buffer */
 				for (i = 0, data1 = combine_buf, data2 = read_buf; i < samples; i++, data1++, data2++)




More information about the asterisk-commits mailing list