[asterisk-commits] branch oej/test-this-branch r13025 - in /team/oej/test-this-branch: ./ apps/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 15 01:37:27 MST 2006


Author: oej
Date: Wed Mar 15 02:37:24 2006
New Revision: 13025

URL: http://svn.digium.com/view/asterisk?rev=13025&view=rev
Log:
Issue #6682 - Add manager PlayDTMF command (Squinky86)

Modified:
    team/oej/test-this-branch/README.test-this-branch
    team/oej/test-this-branch/apps/app_senddtmf.c

Modified: team/oej/test-this-branch/README.test-this-branch
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/README.test-this-branch?rev=13025&r1=13024&r2=13025&view=diff
==============================================================================
--- team/oej/test-this-branch/README.test-this-branch (original)
+++ team/oej/test-this-branch/README.test-this-branch Wed Mar 15 02:37:24 2006
@@ -48,6 +48,8 @@
   See doc/rt_ldap.txt!
 - PostgreSQL realtime driver (mguesdoon, #5637)
 - Mute logging in remote console (mavetju, #6524)
+- Manager playDTMF command (squinky, #6682) 
+  (Note: I changed the name in this version...)
 
 Things that has been commited to svn trunk:
 - Abandon Queue manager event (tim_ringenbach, #6459)

Modified: team/oej/test-this-branch/apps/app_senddtmf.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/apps/app_senddtmf.c?rev=13025&r1=13024&r2=13025&view=diff
==============================================================================
--- team/oej/test-this-branch/apps/app_senddtmf.c (original)
+++ team/oej/test-this-branch/apps/app_senddtmf.c Wed Mar 15 02:37:24 2006
@@ -43,6 +43,7 @@
 #include "asterisk/options.h"
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
+#include "asterisk/manager.h"
 
 static char *tdesc = "Send DTMF digits Application";
 
@@ -93,11 +94,29 @@
 	return res;
 }
 
+static int manager_send_dtmf(struct mansession *s, struct message *m)
+{
+	char *channel, *digit;
+
+	channel = astman_get_header(m, "Channel");
+	digit = astman_get_header(m, "Digit");
+	struct ast_channel *chan = ast_get_channel_by_name_locked(channel);
+	if (chan == NULL) {
+		astman_send_error(s, m, "No such channel");
+		return 0;
+	}
+	ast_senddigit(chan, *digit);
+	ast_mutex_unlock(&chan->lock);
+	astman_send_ack(s, m, "DTMF successfully sent");
+	return 0;
+}
+
 int unload_module(void)
 {
 	int res;
 
 	res = ast_unregister_application(app);
+	res |= ast_manager_unregister("SendDTMF");
 
 	STANDARD_HANGUP_LOCALUSERS;
 
@@ -106,6 +125,7 @@
 
 int load_module(void)
 {
+	ast_manager_register( "playDTMF", EVENT_FLAG_AGENT, manager_send_dtmf, "Play DTMF signal on a specific channel." );
 	return ast_register_application(app, senddtmf_exec, synopsis, descrip);
 }
 



More information about the asterisk-commits mailing list