[asterisk-commits] branch oej/test-this-branch r10711 - in /team/oej/test-this-branch: ./ channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 22 09:20:12 MST 2006


Author: oej
Date: Wed Feb 22 10:20:02 2006
New Revision: 10711

URL: http://svn.digium.com/view/asterisk?rev=10711&view=rev
Log:
- Adding the sendtext manager action
- Fixing small compilation warning in iax2-provision.c (iptos)

Modified:
    team/oej/test-this-branch/README.test-this-branch
    team/oej/test-this-branch/channels/iax2-provision.c
    team/oej/test-this-branch/manager.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=10711&r1=10710&r2=10711&view=diff
==============================================================================
--- team/oej/test-this-branch/README.test-this-branch (original)
+++ team/oej/test-this-branch/README.test-this-branch Wed Feb 22 10:20:02 2006
@@ -23,13 +23,15 @@
 - subscribemwi: Support for SIP subscription of MWI notification (#6390)
 - iptos: New IPtos support, separate audio and signalling (#6355)
 
+And the following stand-alone patches
+- New CLI commands for global variables (#6506)
+- Additional options for the CHANNEL dialplan function
+- Manager sendtext event (ZX81, #6131)
+
 Coming here soon:
 - metermaids: Subscription support for parking lots (#5779)
 - multiparking: Multiple parking lots (#6113)
 
-And the following stand-alone patches
-- New CLI commands for global variables (#6506)
-- Additional options for the CHANNEL dialplan function
 
 All of these exist in the bug tracker
 

Modified: team/oej/test-this-branch/channels/iax2-provision.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/iax2-provision.c?rev=10711&r1=10710&r2=10711&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/iax2-provision.c (original)
+++ team/oej/test-this-branch/channels/iax2-provision.c Wed Feb 22 10:20:02 2006
@@ -37,6 +37,7 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
+#include "asterisk/acl.h"
 #include "asterisk/config.h"
 #include "asterisk/logger.h"
 #include "asterisk/cli.h"

Modified: team/oej/test-this-branch/manager.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/manager.c?rev=10711&r1=10710&r2=10711&view=diff
==============================================================================
--- team/oej/test-this-branch/manager.c (original)
+++ team/oej/test-this-branch/manager.c Wed Feb 22 10:20:02 2006
@@ -918,6 +918,46 @@
 		ast_mutex_unlock(&chan2->lock);
 	return 0;
 }
+
+static char mandescr_sendText[] =
+"Description: Sends A Text Message while in a call.\n"
+"Variables: (Names marked with * are required)\n"
+"       *Channel: Channel to send message to\n"
+"       *Message: Message to send\n"
+"       ActionID: Optional Action id for message matching.\n";
+
+static int action_sendText(struct mansession *s, struct message *m)
+{
+        struct ast_channel *c = NULL;
+        char *name = astman_get_header(m, "Channel");
+        char *textmsg = astman_get_header(m, "Message");
+        int res = 0;
+
+        if (!ast_strlen_zero(name)) {
+                astman_send_error(s, m, "No channel specified");
+                return 0;
+        }
+        if (!ast_strlen_zero(textmsg)) {
+                astman_send_error(s, m, "No Message specified");
+                return 0;
+        }
+
+        c = ast_get_channel_by_name_locked(name);
+        if (!c) {
+                astman_send_error(s, m, "No such channel");
+                return 0;
+        }
+
+        ast_mutex_unlock(&c->lock);
+        res = ast_sendtext(c, textmsg);
+        if (res>0){
+                astman_send_ack(s, m, "Success");
+        } else {
+                astman_send_error(s, m, "Failure");
+        }
+        return res;
+}
+
 
 static char mandescr_command[] = 
 "Description: Run a CLI command.\n"
@@ -1670,6 +1710,7 @@
 		ast_manager_register2("Logoff", 0, action_logoff, "Logoff Manager", mandescr_logoff);
 		ast_manager_register2("Hangup", EVENT_FLAG_CALL, action_hangup, "Hangup Channel", mandescr_hangup);
 		ast_manager_register("Status", EVENT_FLAG_CALL, action_status, "Lists channel status" );
+                ast_manager_register2("SendText", EVENT_FLAG_CALL, action_sendText, "Send a Text Message", mandescr_sendText );
 		ast_manager_register2("Setvar", EVENT_FLAG_CALL, action_setvar, "Set Channel Variable", mandescr_setvar );
 		ast_manager_register2("Getvar", EVENT_FLAG_CALL, action_getvar, "Gets a Channel Variable", mandescr_getvar );
 		ast_manager_register2("Redirect", EVENT_FLAG_CALL, action_redirect, "Redirect (transfer) a call", mandescr_redirect );



More information about the asterisk-commits mailing list