[svn-commits] dlee: branch dlee/play_media r392755 - in /team/dlee/play_media: include/aste...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jun 24 14:59:57 CDT 2013


Author: dlee
Date: Mon Jun 24 14:59:56 2013
New Revision: 392755

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392755
Log:
Little ast_play_media function that didn't quite make it in with another patch

Modified:
    team/dlee/play_media/include/asterisk/app.h
    team/dlee/play_media/main/app.c

Modified: team/dlee/play_media/include/asterisk/app.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/play_media/include/asterisk/app.h?view=diff&rev=392755&r1=392754&r2=392755
==============================================================================
--- team/dlee/play_media/include/asterisk/app.h (original)
+++ team/dlee/play_media/include/asterisk/app.h Mon Jun 24 14:59:56 2013
@@ -687,6 +687,19 @@
 	long *offsetms,
 	ast_waitstream_fr_cb cb);
 
+/*!
+ * \brief Plays a sound to the channel, in the channel's default language.
+ *
+ * This will stop any existing streams on the channel.
+
+ * \param chan channel to stream the file to
+ * \param filename the name of the file you wish to stream, minus the extension
+ * \retval 0 on success.
+ * \retval -1 on failure.
+ * \since 12
+ */
+int ast_play_media(struct ast_channel *chan, const char *filename);
+
 /*! \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);
 

Modified: team/dlee/play_media/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/play_media/main/app.c?view=diff&rev=392755&r1=392754&r2=392755
==============================================================================
--- team/dlee/play_media/main/app.c (original)
+++ team/dlee/play_media/main/app.c Mon Jun 24 14:59:56 2013
@@ -343,6 +343,17 @@
 
 	res = ast_app_exec_macro(autoservice_chan, macro_chan, args_str);
 	ast_free(args_str);
+	return res;
+}
+
+int ast_play_media(struct ast_channel *chan, const char *filename)
+{
+	int res;
+	res = ast_streamfile(chan, filename, ast_channel_language(chan));
+	if (res == 0) {
+		res = ast_waitstream(chan, "");
+	}
+	ast_stopstream(chan);
 	return res;
 }
 




More information about the svn-commits mailing list