Index: manager.c =================================================================== RCS file: /usr/cvsroot/asterisk/manager.c,v retrieving revision 1.88 diff -u -r1.88 manager.c --- manager.c 23 Mar 2005 05:56:31 -0000 1.88 +++ manager.c 31 Mar 2005 20:40:29 -0000 @@ -109,6 +109,7 @@ return res; } +/*--- authority_to_str: Convert authority code to string with serveral options */ static char *authority_to_str(int authority, char *res, int reslen) { int running_total = 0, i; @@ -497,6 +498,7 @@ { struct manager_action *cur = first_action; char idText[256] = ""; + char temp[BUFSIZ]; char *id = astman_get_header(m,"ActionID"); if (id && !ast_strlen_zero(id)) @@ -506,7 +508,7 @@ ast_mutex_lock(&actionlock); while (cur) { /* Walk the list of actions */ if ((s->writeperm & cur->authority) == cur->authority) - ast_cli(s->fd, "%s: %s\r\n", cur->action, cur->synopsis); + ast_cli(s->fd, "%s|%s|%s\r\n", cur->action, authority_to_str(cur->authority, temp, sizeof(temp)), cur->synopsis); cur = cur->next; } ast_mutex_unlock(&actionlock); @@ -1375,6 +1377,7 @@ return NULL; } +/*--- manager_event: Send AMI event to client */ int manager_event(int category, char *event, char *fmt, ...) { struct mansession *s; @@ -1388,6 +1391,7 @@ ast_mutex_lock(&s->lock); if (!s->blocking) { ast_cli(s->fd, "Event: %s\r\n", event); + ast_cli(s->fd, "AMICategory: %s\r\n", authority_to_str(category, tmp, sizeof(tmp))); va_start(ap, fmt); vsnprintf(tmp, sizeof(tmp), fmt, ap); va_end(ap); @@ -1512,7 +1516,7 @@ 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_register2( "Command", EVENT_FLAG_COMMAND, action_command, "Execute Command", mandescr_command ); + ast_manager_register2( "Command", EVENT_FLAG_COMMAND, action_command, "Execute Asterisk CLI 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 );