[asterisk-commits] dlee: branch dlee/record r392769 - in /team/dlee/record: apps/ include/asteri...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 24 15:33:45 CDT 2013


Author: dlee
Date: Mon Jun 24 15:33:43 2013
New Revision: 392769

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392769
Log:
Skip the confirmation sound for ARI recordings

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

Modified: team/dlee/record/apps/app_minivm.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/apps/app_minivm.c?view=diff&rev=392769&r1=392768&r2=392769
==============================================================================
--- team/dlee/record/apps/app_minivm.c (original)
+++ team/dlee/record/apps/app_minivm.c Mon Jun 24 15:33:43 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, AST_RECORD_IF_EXISTS_OVERWRITE);
+			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);
 			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/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/apps/app_voicemail.c?view=diff&rev=392769&r1=392768&r2=392769
==============================================================================
--- team/dlee/record/apps/app_voicemail.c (original)
+++ team/dlee/record/apps/app_voicemail.c Mon Jun 24 15:33:43 2013
@@ -14684,7 +14684,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, AST_RECORD_IF_EXISTS_OVERWRITE);
+			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);
 			if (strchr(canceldtmf, cmd)) {
 			/* need this flag here to distinguish between pressing '0' during message recording or after */
 				canceleddtmf = 1;

Modified: team/dlee/record/include/asterisk/app.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/include/asterisk/app.h?view=diff&rev=392769&r1=392768&r2=392769
==============================================================================
--- team/dlee/record/include/asterisk/app.h (original)
+++ team/dlee/record/include/asterisk/app.h Mon Jun 24 15:33:43 2013
@@ -689,7 +689,10 @@
 /*! \brief Play a stream and wait for a digit, returning the digit that was pressed */
 int ast_play_and_wait(struct ast_channel *chan, const char *fn);
 
-/*! Possible actions to take if a recording already exists */
+/*!
+ * Possible actions to take if a recording already exists
+ * \since 12
+ */
 enum ast_record_if_exists {
 	/*! Fail the recording. */
 	AST_RECORD_IF_EXISTS_FAIL,
@@ -701,7 +704,8 @@
 
 /*!
  * \brief Record a file based on input from a channel
- *        This function will play "auth-thankyou" upon successful recording.
+ *        This function will play "auth-thankyou" upon successful recording if
+ *        skip_confirmation_sound is false.
  *
  * \param chan the channel being recorded
  * \param playfile Filename of sound to play before recording begins
@@ -715,6 +719,7 @@
  * \param path Optional filesystem path to unlock
  * \param acceptdtmf Character of DTMF to end and accept the recording
  * \param canceldtmf Character of DTMF to end and cancel the recording
+ * \param skip_confirmation_sound If true, don't play auth-thankyou at end. Nice for custom recording prompts in apps.
  * \param ast_record_if_exists Action to take if recording already exists.
  *
  * \retval -1 failure or hangup
@@ -722,7 +727,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, 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 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/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/main/app.c?view=diff&rev=392769&r1=392768&r2=392769
==============================================================================
--- team/dlee/record/main/app.c (original)
+++ team/dlee/record/main/app.c Mon Jun 24 15:33:43 2013
@@ -1492,9 +1492,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, 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), 0, 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 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(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/res/res_stasis_recording.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/res/res_stasis_recording.c?view=diff&rev=392769&r1=392768&r2=392769
==============================================================================
--- team/dlee/record/res/res_stasis_recording.c (original)
+++ team/dlee/record/res/res_stasis_recording.c Mon Jun 24 15:33:43 2013
@@ -263,6 +263,7 @@
 		NULL, /* path */
 		acceptdtmf,
 		NULL, /* canceldtmf */
+		1, /* skip_confirmation_sound */
 		recording->options->if_exists);
 
 	ast_debug(3, "%s: Recording complete\n", ast_channel_uniqueid(chan));




More information about the asterisk-commits mailing list