[Asterisk-cvs] asterisk manager.c,1.74,1.74.2.1

russell at lists.digium.com russell at lists.digium.com
Sat Feb 26 20:16:27 CST 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv3208

Modified Files:
      Tag: v1-0
	manager.c 
Log Message:
some more management command description updates (bug #3645)


Index: manager.c
===================================================================
RCS file: /usr/cvsroot/asterisk/manager.c,v
retrieving revision 1.74
retrieving revision 1.74.2.1
diff -u -d -r1.74 -r1.74.2.1
--- manager.c	22 Sep 2004 14:11:44 -0000	1.74
+++ manager.c	27 Feb 2005 02:14:15 -0000	1.74.2.1
@@ -1,6 +1,8 @@
 /*
  * Asterisk -- A telephony toolkit for Linux.
  *
+ * The Asterisk Management Interface - AMI
+ *
  * Channel Management and more
  * 
  * Copyright (C) 1999-2004, Digium, Inc.
@@ -118,6 +120,9 @@
 			running_total += strlen(perms[i].label);
 		}
 	}
+	if (ast_strlen_zero(res)) {
+		strncpy(res, "<none>", reslen);
+	}
 	return res;
 }
 
@@ -570,6 +575,13 @@
 	return 0;
 }
 
+static char mandescr_setvar[] = 
+"Description: Set a local channel variable.\n"
+"Variables: (Names marked with * are required)\n"
+"	*Channel: Channel to set variable for\n"
+"	*Variable: Variable name\n"
+"	*Value: Value\n";
+
 static int action_setvar(struct mansession *s, struct message *m)
 {
         struct ast_channel *c = NULL;
@@ -606,6 +618,13 @@
 	return 0;
 }
 
+static char mandescr_getvar[] = 
+"Description: Get the value of a local channel variable.\n"
+"Variables: (Names marked with * are required)\n"
+"	*Channel: Channel to read variable from\n"
+"	*Variable: Variable name\n"
+"	ActionID: Optional Action id for message matching.\n";
+
 static int action_getvar(struct mansession *s, struct message *m)
 {
         struct ast_channel *c = NULL;
@@ -785,6 +804,11 @@
 	return 0;
 }
 
+static char mandescr_command[] = 
+"Description: Run a CLI command.\n"
+"Variables: (Names marked with * are required)\n"
+"	*Command: Asterisk CLI command to run\n"
+"	ActionID: Optional Action id for message matching.\n";
 static int action_command(struct mansession *s, struct message *m)
 {
 	char *cmd = astman_get_header(m, "Command");
@@ -938,6 +962,16 @@
 	return 0;
 }
 
+static char mandescr_mailboxstatus[] = 
+"Description: Checks a voicemail account for status.\n"
+"Variables: (Names marked with * are required)\n"
+"	*Mailbox: Full mailbox ID <mailbox>@<vm-context>\n"
+"	ActionID: Optional ActionID for message matching.\n"
+"Returns number of messages.\n"
+"	Message: Mailbox Status\n"
+"	Mailbox: <mailboxid>\n"
+"	Waiting: <count>\n"
+"\n";
 static int action_mailboxstatus(struct mansession *s, struct message *m)
 {
 	char *mailbox = astman_get_header(m, "Mailbox");
@@ -961,6 +995,17 @@
 	return 0;
 }
 
+static char mandescr_mailboxcount[] = 
+"Description: Checks a voicemail account for new messages.\n"
+"Variables: (Names marked with * are required)\n"
+"	*Mailbox: Full mailbox ID <mailbox>@<vm-context>\n"
+"	ActionID: Optional ActionID for message matching.\n"
+"Returns number of new and old messages.\n"
+"	Message: Mailbox Message Count\n"
+"	Mailbox: <mailboxid>\n"
+"	NewMessages: <count>\n"
+"	OldMessages: <count>\n"
+"\n";
 static int action_mailboxcount(struct mansession *s, struct message *m)
 {
 	char *mailbox = astman_get_header(m, "Mailbox");
@@ -988,6 +1033,17 @@
 	return 0;
 }
 
+static char mandescr_extensionstate[] = 
+"Description: Report the extension state for given extension.\n"
+"  If the extension has a hint, will use devicestate to check\n"
+"  the status of the device connected to the extension.\n"
+"Variables: (Names marked with * are required)\n"
+"	*Exten: Extension to check state on\n"
+"	*Context: Context for extension\n"
+"	ActionId: Optional ID for this transaction\n"
+"Will return an \"Extension Status\" message.\n"
+"The response will include the hint for the extension and the status.\n";
+
 static int action_extensionstate(struct mansession *s, struct message *m)
 {
 	char *exten = astman_get_header(m, "Exten");
@@ -1020,6 +1076,13 @@
 	return 0;
 }
 
+static char mandescr_timeout[] = 
+"Description: Hangup a channel after a certain time.\n"
+"Variables: (Names marked with * are required)\n"
+"	*Channel: Channel name to hangup\n"
+"	*Timeout: Maximum duration of the call (sec)\n"
+"Acknowledges set time with 'Timeout Set' message\n";
+
 static int action_timeout(struct mansession *s, struct message *m)
 {
 	struct ast_channel *c = NULL;
@@ -1392,15 +1455,15 @@
 		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, "Status" );
-		ast_manager_register( "Setvar", EVENT_FLAG_CALL, action_setvar, "Set Channel Variable" );
-		ast_manager_register( "Getvar", EVENT_FLAG_CALL, action_getvar, "Gets a Channel Variable" );
+		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_register( "Redirect", EVENT_FLAG_CALL, action_redirect, "Redirect" );
 		ast_manager_register2("Originate", EVENT_FLAG_CALL, action_originate, "Originate Call", mandescr_originate);
-		ast_manager_register( "MailboxStatus", EVENT_FLAG_CALL, action_mailboxstatus, "Check Mailbox" );
-		ast_manager_register( "Command", EVENT_FLAG_COMMAND, action_command, "Execute Command" );
-		ast_manager_register( "ExtensionState", EVENT_FLAG_CALL, action_extensionstate, "Check Extension Status" );
-		ast_manager_register( "AbsoluteTimeout", EVENT_FLAG_CALL, action_timeout, "Set Absolute Timeout" );
-		ast_manager_register( "MailboxCount", EVENT_FLAG_CALL, action_mailboxcount, "Check Mailbox Message Count" );
+		ast_manager_register2( "Command", EVENT_FLAG_COMMAND, action_command, "Execute Command", mandescr_command );
+		ast_manager_register2( "ExtensionState", EVENT_FLAG_CALL, action_extensionstate, "Check Extension Status", mandescr_extensionstate );
+		ast_manager_register2( "AbsoluteTimeout", EVENT_FLAG_CALL, action_timeout, "Set Absolute Timeout", mandescr_timeout );
+		ast_manager_register2( "MailboxStatus", EVENT_FLAG_CALL, action_mailboxstatus, "Check Mailbox", mandescr_mailboxstatus );
+		ast_manager_register2( "MailboxCount", EVENT_FLAG_CALL, action_mailboxcount, "Check Mailbox Message Count", mandescr_mailboxcount );
 		ast_manager_register2("ListCommands", 0, action_listcommands, "List available manager commands", mandescr_listcommands);
 
 		ast_cli_register(&show_mancmd_cli);




More information about the svn-commits mailing list