[asterisk-commits] russell: branch russell/chan_refcount r82587 - in /team/russell/chan_refcount...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 17 11:15:04 CDT 2007


Author: russell
Date: Mon Sep 17 11:15:03 2007
New Revision: 82587

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82587
Log:
convert app_mixmonitor and update some more docs

Modified:
    team/russell/chan_refcount/apps/app_mixmonitor.c
    team/russell/chan_refcount/include/asterisk/audiohook.h
    team/russell/chan_refcount/main/audiohook.c

Modified: team/russell/chan_refcount/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_mixmonitor.c?view=diff&rev=82587&r1=82586&r2=82587
==============================================================================
--- team/russell/chan_refcount/apps/app_mixmonitor.c (original)
+++ team/russell/chan_refcount/apps/app_mixmonitor.c Mon Sep 17 11:15:03 2007
@@ -350,8 +350,10 @@
 		*slash = '\0';
 	ast_mkdir(tmp, 0777);
 
+	ast_channel_lock(chan);
 	pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename);
 	launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process);
+	ast_channel_unlock(chan);
 
 	return 0;
 }
@@ -369,18 +371,15 @@
 	if (argc < 3)
 		return RESULT_SHOWUSAGE;
 
-	if (!(chan = ast_get_channel_by_name_prefix_locked(argv[2], strlen(argv[2])))) {
+	if (!(chan = ast_channel_get_by_name_prefix(argv[2], strlen(argv[2])))) {
 		ast_cli(fd, "No channel matching '%s' found.\n", argv[2]);
 		return RESULT_SUCCESS;
 	}
 
-	if (!strcasecmp(argv[1], "start")) {
+	if (!strcasecmp(argv[1], "start"))
 		mixmonitor_exec(chan, argv[3]);
-		ast_channel_unlock(chan);
-	} else {
-		ast_channel_unlock(chan);
+	else
 		ast_audiohook_detach_source(chan, mixmonitor_spy_type);
-	}
 
 	return RESULT_SUCCESS;
 }

Modified: team/russell/chan_refcount/include/asterisk/audiohook.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/include/asterisk/audiohook.h?view=diff&rev=82587&r1=82586&r2=82587
==============================================================================
--- team/russell/chan_refcount/include/asterisk/audiohook.h (original)
+++ team/russell/chan_refcount/include/asterisk/audiohook.h Mon Sep 17 11:15:03 2007
@@ -141,10 +141,15 @@
  */
 int ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list);
 
-/*! \brief Detach specified source audiohook from channel
+/*! 
+ * \brief Detach specified source audiohook from channel
+ *
  * \param chan Channel to detach from
  * \param source Name of source to detach
+ *
  * \return Returns 0 on success, -1 on failure
+ *
+ * \note The channel does not need to be locked before calling this function.
  */
 int ast_audiohook_detach_source(struct ast_channel *chan, const char *source);
 

Modified: team/russell/chan_refcount/main/audiohook.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/main/audiohook.c?view=diff&rev=82587&r1=82586&r2=82587
==============================================================================
--- team/russell/chan_refcount/main/audiohook.c (original)
+++ team/russell/chan_refcount/main/audiohook.c Mon Sep 17 11:15:03 2007
@@ -412,11 +412,6 @@
 	return NULL;
 }
 
-/*! \brief Detach specified source audiohook from channel
- * \param chan Channel to detach from
- * \param source Name of source to detach
- * \return Returns 0 on success, -1 on failure
- */
 int ast_audiohook_detach_source(struct ast_channel *chan, const char *source)
 {
 	struct ast_audiohook *audiohook = NULL;




More information about the asterisk-commits mailing list