[asterisk-commits] dlee: branch dlee/record-controls r395334 - in /team/dlee/record-controls: ap...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 24 16:22:45 CDT 2013


Author: dlee
Date: Wed Jul 24 16:22:42 2013
New Revision: 395334

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395334
Log:
Fixed double-beep on recording start

Modified:
    team/dlee/record-controls/apps/app_minivm.c
    team/dlee/record-controls/apps/app_voicemail.c
    team/dlee/record-controls/include/asterisk/app.h
    team/dlee/record-controls/main/app.c
    team/dlee/record-controls/res/res_stasis_recording.c

Modified: team/dlee/record-controls/apps/app_minivm.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record-controls/apps/app_minivm.c?view=diff&rev=395334&r1=395333&r2=395334
==============================================================================
--- team/dlee/record-controls/apps/app_minivm.c (original)
+++ team/dlee/record-controls/apps/app_minivm.c Wed Jul 24 16:22:42 2013
@@ -1674,7 +1674,7 @@
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
 			if (ast_test_flag(vmu, MVM_OPERATOR))
 				canceldtmf = "0";
-			cmd = ast_play_and_record_full(chan, playfile, recordfile, maxtime, fmt, duration, sound_duration, global_silencethreshold, global_maxsilence, unlockdir, acceptdtmf, canceldtmf, 0, AST_RECORD_IF_EXISTS_OVERWRITE);
+			cmd = ast_play_and_record_full(chan, playfile, recordfile, maxtime, fmt, duration, sound_duration, 0, global_silencethreshold, global_maxsilence, unlockdir, acceptdtmf, canceldtmf, 0, AST_RECORD_IF_EXISTS_OVERWRITE);
 			if (record_gain)
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &zero_gain, sizeof(zero_gain), 0);
 			if (cmd == -1) /* User has hung up, no options to give */

Modified: team/dlee/record-controls/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record-controls/apps/app_voicemail.c?view=diff&rev=395334&r1=395333&r2=395334
==============================================================================
--- team/dlee/record-controls/apps/app_voicemail.c (original)
+++ team/dlee/record-controls/apps/app_voicemail.c Wed Jul 24 16:22:42 2013
@@ -14682,7 +14682,7 @@
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
 			if (ast_test_flag(vmu, VM_OPERATOR))
 				canceldtmf = "0";
-			cmd = ast_play_and_record_full(chan, playfile, tempfile, maxtime, fmt, duration, sound_duration, silencethreshold, maxsilence, unlockdir, acceptdtmf, canceldtmf, 0, AST_RECORD_IF_EXISTS_OVERWRITE);
+			cmd = ast_play_and_record_full(chan, playfile, tempfile, maxtime, fmt, duration, sound_duration, 0, silencethreshold, maxsilence, unlockdir, acceptdtmf, canceldtmf, 0, AST_RECORD_IF_EXISTS_OVERWRITE);
 			if (strchr(canceldtmf, cmd)) {
 			/* need this flag here to distinguish between pressing '0' during message recording or after */
 				canceleddtmf = 1;

Modified: team/dlee/record-controls/include/asterisk/app.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record-controls/include/asterisk/app.h?view=diff&rev=395334&r1=395333&r2=395334
==============================================================================
--- team/dlee/record-controls/include/asterisk/app.h (original)
+++ team/dlee/record-controls/include/asterisk/app.h Wed Jul 24 16:22:42 2013
@@ -709,11 +709,12 @@
  *        skip_confirmation_sound is false.
  *
  * \param chan the channel being recorded
- * \param playfile Filename of sound to play before recording begins
+ * \param playfile Filename of sound to play before recording begins. Implies beep.
  * \param recordfile Filename to save the recording
  * \param maxtime_sec Longest possible message length in seconds
  * \param fmt string containing all formats to be recorded delimited by '|'
  * \param duration pointer to integer for storing length of the recording
+ * \param beep If true, play a beep before recording begins.
  * \param sound_duration pointer to integer for storing length of the recording minus all silence
  * \param silencethreshold tolerance of noise levels that can be considered silence for the purpose of silence timeout, -1 for default
  * \param maxsilence_ms Length of time in milliseconds which will trigger a timeout from silence, -1 for default
@@ -728,7 +729,7 @@
  * \retval 't' Recording ended from the message exceeding the maximum duration
  * \retval dtmfchar Recording ended via the return value's DTMF character for either cancel or accept.
  */
-int ast_play_and_record_full(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime_sec, const char *fmt, int *duration, int *sound_duration, int silencethreshold, int maxsilence_ms, const char *path, const char *acceptdtmf, const char *canceldtmf, int skip_confirmation_sound, enum ast_record_if_exists if_exists);
+int ast_play_and_record_full(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime_sec, const char *fmt, int *duration, int *sound_duration, int beep, int silencethreshold, int maxsilence_ms, const char *path, const char *acceptdtmf, const char *canceldtmf, int skip_confirmation_sound, enum ast_record_if_exists if_exists);
 
 /*!
  * \brief Record a file based on input from a channel. Use default accept and cancel DTMF.

Modified: team/dlee/record-controls/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record-controls/main/app.c?view=diff&rev=395334&r1=395333&r2=395334
==============================================================================
--- team/dlee/record-controls/main/app.c (original)
+++ team/dlee/record-controls/main/app.c Wed Jul 24 16:22:42 2013
@@ -1636,9 +1636,9 @@
 static const char default_acceptdtmf[] = "#";
 static const char default_canceldtmf[] = "";
 
-int ast_play_and_record_full(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int *sound_duration, int silencethreshold, int maxsilence, const char *path, const char *acceptdtmf, const char *canceldtmf, int skip_confirmation_sound, enum ast_record_if_exists if_exists)
-{
-	return __ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, sound_duration, 0, silencethreshold, maxsilence, path, 0, S_OR(acceptdtmf, default_acceptdtmf), S_OR(canceldtmf, default_canceldtmf), skip_confirmation_sound, if_exists);
+int ast_play_and_record_full(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int *sound_duration, int beep, int silencethreshold, int maxsilence, const char *path, const char *acceptdtmf, const char *canceldtmf, int skip_confirmation_sound, enum ast_record_if_exists if_exists)
+{
+	return __ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, sound_duration, beep, silencethreshold, maxsilence, path, 0, S_OR(acceptdtmf, default_acceptdtmf), S_OR(canceldtmf, default_canceldtmf), skip_confirmation_sound, if_exists);
 }
 
 int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int *sound_duration, int silencethreshold, int maxsilence, const char *path)

Modified: team/dlee/record-controls/res/res_stasis_recording.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record-controls/res/res_stasis_recording.c?view=diff&rev=395334&r1=395333&r2=395334
==============================================================================
--- team/dlee/record-controls/res/res_stasis_recording.c (original)
+++ team/dlee/record-controls/res/res_stasis_recording.c Wed Jul 24 16:22:42 2013
@@ -259,12 +259,13 @@
 	}
 
 	ast_play_and_record_full(chan,
-		recording->options->beep ? "beep" : NULL,
+		NULL, /* playfile */
 		recording->absolute_name,
 		recording->options->max_duration_seconds,
 		recording->options->format,
 		&duration,
 		NULL, /* sound_duration */
+		recording->options->beep,
 		-1, /* silencethreshold */
 		recording->options->max_silence_seconds * 1000,
 		NULL, /* path */




More information about the asterisk-commits mailing list