[asterisk-commits] oej: branch oej/res_agi_moh_streamfile r338378 - /team/oej/res_agi_moh_stream...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 29 04:56:27 CDT 2011


Author: oej
Date: Thu Sep 29 04:56:21 2011
New Revision: 338378

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=338378
Log:
Small patch to restart MOH after AGI streamfile

https://reviewboard.asterisk.org/r/1470/

ASTERISK-17367

Modified:
    team/oej/res_agi_moh_streamfile/res/res_agi.c

Modified: team/oej/res_agi_moh_streamfile/res/res_agi.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/res_agi_moh_streamfile/res/res_agi.c?view=diff&rev=338378&r1=338377&r2=338378
==============================================================================
--- team/oej/res_agi_moh_streamfile/res/res_agi.c (original)
+++ team/oej/res_agi_moh_streamfile/res/res_agi.c Thu Sep 29 04:56:21 2011
@@ -1934,6 +1934,7 @@
 	struct ast_filestream *fs, *vfs;
 	long sample_offset = 0, max_length;
 	const char *edigits = "";
+	int moh = ast_test_flag(chan, AST_FLAG_MOH);
 
 	if (argc < 4 || argc > 5)
 		return RESULT_SHOWUSAGE;
@@ -1969,6 +1970,10 @@
 	 * the end of the stream, return that amount, else check for the amount */
 	sample_offset = (chan->stream) ? ast_tellstream(fs) : max_length;
 	ast_stopstream(chan);
+	if (moh) {
+		/* restart music on hold if it was on */
+		ast_moh_start(chan, NULL, NULL);
+	}
 	if (res == 1) {
 		/* Stop this command, don't print a result line, as there is a new command */
 		return RESULT_SUCCESS;




More information about the asterisk-commits mailing list