[asterisk-commits] russell: branch 1.4 r209838 - /branches/1.4/apps/app_milliwatt.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Aug 1 05:59:09 CDT 2009


Author: russell
Date: Sat Aug  1 05:59:05 2009
New Revision: 209838

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=209838
Log:
Modify how Playtones() is used in Milliwatt() to resolve gain issue.

When Milliwatt() was changed internally to use Playtones() so that the proper
tone was used, it introduced a drop in gain in the output signal.  So, use
the playtones API directly and specify a volume argument such that the output
matches the gain of the original Milliwatt() code.

(closes issue #15386)
Reported by: rue_mohr
Patches:
      issue_15386.rev2.diff uploaded by russell (license 2)
Tested by: rue_mohr

Modified:
    branches/1.4/apps/app_milliwatt.c

Modified: branches/1.4/apps/app_milliwatt.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/apps/app_milliwatt.c?view=diff&rev=209838&r1=209837&r2=209838
==============================================================================
--- branches/1.4/apps/app_milliwatt.c (original)
+++ branches/1.4/apps/app_milliwatt.c Sat Aug  1 05:59:05 2009
@@ -38,6 +38,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
+#include <limits.h>
 
 #include "asterisk/lock.h"
 #include "asterisk/file.h"
@@ -46,6 +47,7 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/utils.h"
+#include "asterisk/indications.h"
 
 static char *app = "Milliwatt";
 
@@ -145,7 +147,6 @@
 static int milliwatt_exec(struct ast_channel *chan, void *data)
 {
 	const char *options = data;
-	struct ast_app *playtones_app;
 	struct ast_module_user *u;
 	int res = -1;
 
@@ -156,12 +157,7 @@
 		goto exit_app;
 	}
 
-	if (!(playtones_app = pbx_findapp("Playtones"))) {
-		ast_log(LOG_ERROR, "The Playtones application is required to run Milliwatt()\n");
-		goto exit_app;
-	}
-
-	res = pbx_exec(chan, playtones_app, "1004/1000");
+	res = ast_playtones_start(chan, 23255, "1004/1000", 0);
 
 	while (!res) {
 		res = ast_safe_sleep(chan, 10000);




More information about the asterisk-commits mailing list