#include <stdarg.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "asterisk/lock.h"
Include dependency graph for manager.h:
Go to the source code of this file.
Data Structures | |
struct | eventqent |
struct | manager_action |
struct | mansession |
struct | message |
Defines | |
#define | ast_manager_register(a, b, c, d) ast_manager_register2(a, b, c, d, NULL) |
#define | AST_MAX_MANHEADER_LEN 256 |
#define | AST_MAX_MANHEADERS 80 |
#define | DEFAULT_MANAGER_PORT 5038 |
#define | EVENT_FLAG_AGENT (1 << 5) |
#define | EVENT_FLAG_CALL (1 << 1) |
#define | EVENT_FLAG_COMMAND (1 << 4) |
#define | EVENT_FLAG_LOG (1 << 2) |
#define | EVENT_FLAG_SYSTEM (1 << 0) |
#define | EVENT_FLAG_USER (1 << 6) |
#define | EVENT_FLAG_VERBOSE (1 << 3) |
Functions | |
int | ast_carefulwrite (int fd, char *s, int len, int timeoutms) |
int | ast_manager_register2 (const char *action, int authority, int(*func)(struct mansession *s, struct message *m), const char *synopsis, const char *description) |
int | ast_manager_unregister (char *action) |
int char * | astman_get_header (struct message *m, char *var) |
ast_variable * | astman_get_variables (struct message *m) |
void | astman_send_ack (struct mansession *s, struct message *m, char *msg) |
void | astman_send_error (struct mansession *s, struct message *m, char *error) |
void | astman_send_response (struct mansession *s, struct message *m, char *resp, char *msg) |
int | init_manager (void) |
int | manager_event (int category, char *event, char *contents,...) __attribute__((format(printf |
int | reload_manager (void) |
Manager protocol packages are text fields of the form a: b. There is always exactly one space after the colon.
The first header type is the "Event" header. Other headers vary from event to event. Headers end with standard
termination. The last line of the manager response or event is an empty line. (
)
Please try to re-use existing headers to simplify manager message parsing in clients. Don't re-use an existing header with a new meaning, please. You can find a reference of standard headers in doc/manager.txt
Definition in file manager.h.
int ast_manager_register2 | ( | const char * | action, | |
int | authority, | |||
int(*)(struct mansession *s, struct message *m) | func, | |||
const char * | synopsis, | |||
const char * | description | |||
) |
action | Name of the requested Action: | |
authority | Required authority for this command | |
func | Function to call for this command | |
synopsis | Help text (one line, up to 30 chars) for CLI manager show commands | |
description | Help text, several lines |
int ast_manager_unregister | ( | char * | action | ) |
action | Name of registred Action: |
int char* astman_get_header | ( | struct message * | m, | |
char * | var | |||
) |
Get header from mananger transaction
struct ast_variable* astman_get_variables | ( | struct message * | m | ) |
Get a linked list of the Variable: headers
void astman_send_error | ( | struct mansession * | s, | |
struct message * | m, | |||
char * | error | |||
) |
Send error in manager transaction
int init_manager | ( | void | ) |
Called by Asterisk initialization
int manager_event | ( | int | category, | |
char * | event, | |||
char * | contents, | |||
... | ||||
) |
category | Event category, matches manager authorization | |
event | Event name | |
contents | Contents of event |
int reload_manager | ( | void | ) |
Called by Asterisk initialization