67 .alert_pipe = { -1, -1 },
77 { SA_AIS_ERR_LIBRARY,
"Library Error" },
78 { SA_AIS_ERR_VERSION,
"Version Not Compatible" },
79 { SA_AIS_ERR_INIT,
"Callback Not Registered" },
80 { SA_AIS_ERR_TIMEOUT,
"Timeout" },
81 { SA_AIS_ERR_TRY_AGAIN ,
"Try Again" },
82 { SA_AIS_ERR_INVALID_PARAM,
"Invalid Parameter" },
83 { SA_AIS_ERR_NO_MEMORY,
"No Memory" },
84 { SA_AIS_ERR_BAD_HANDLE,
"Invalid Handle" },
85 { SA_AIS_ERR_BUSY,
"Resource Already In Use" },
86 { SA_AIS_ERR_ACCESS,
"Access Denied" },
87 { SA_AIS_ERR_NOT_EXIST,
"Does Not Exist" },
88 { SA_AIS_ERR_NAME_TOO_LONG,
"Name Too Long" },
89 { SA_AIS_ERR_EXIST,
"Already Exists" },
90 { SA_AIS_ERR_NO_SPACE,
"Buffer Too Small" },
91 { SA_AIS_ERR_INTERRUPT,
"Request Interrupted" },
92 { SA_AIS_ERR_NAME_NOT_FOUND,
"Name Not Found" },
93 { SA_AIS_ERR_NO_RESOURCES,
"Not Enough Resources" },
94 { SA_AIS_ERR_NOT_SUPPORTED,
"Requested Function Not Supported" },
95 { SA_AIS_ERR_BAD_OPERATION,
"Operation Not Allowed" },
96 { SA_AIS_ERR_FAILED_OPERATION,
"Operation Failed" },
97 { SA_AIS_ERR_MESSAGE_ERROR,
"Communication Error" },
98 { SA_AIS_ERR_QUEUE_FULL,
"Destination Queue Full" },
99 { SA_AIS_ERR_QUEUE_NOT_AVAILABLE,
"Destination Queue Not Available" },
100 { SA_AIS_ERR_BAD_FLAGS,
"Invalid Flags" },
101 { SA_AIS_ERR_TOO_BIG,
"Value Too Large" },
102 { SA_AIS_ERR_NO_SECTIONS,
"No More Sections to Initialize" },
119 SaSelectionObjectT clm_fd, evt_fd;
121 struct pollfd pfd[3] = {
122 { .events = POLLIN, },
123 { .events = POLLIN, },
124 { .events = POLLIN, },
128 ais_res = saClmSelectionObjectGet(
clm_handle, &clm_fd);
129 if (ais_res != SA_AIS_OK) {
131 "This module will not operate.\n");
135 ais_res = saEvtSelectionObjectGet(
evt_handle, &evt_fd);
136 if (ais_res != SA_AIS_OK) {
138 "This module will not operate.\n");
152 if (res == -1 &&
errno != EINTR &&
errno != EAGAIN) {
154 "and the module will no longer operate.\n", strerror(
errno));
158 if (pfd[0].revents & POLLIN) {
161 if (pfd[1].revents & POLLIN) {
164 if (pfd[2].revents & POLLIN) {
166 ast_debug(1,
"Got a command in the poll() loop\n");
186 res = write(
dispatch_thread.alert_pipe[1], (
char *) &cmd,
sizeof(cmd));
188 ast_debug(1,
"AIS cmd: %d, res: %d\n", cmd, res);
210 goto dispatch_failed;
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
int ast_ais_evt_load_module(void)
void ast_ais_evt_membership_changed(void)
#define ast_pthread_create_background(a, b, c, d)
int ast_ais_clm_load_module(void)
#define ast_debug(level,...)
Log a DEBUG message.
General Asterisk PBX channel definitions.
#define AST_PTHREADT_NULL
#define ast_poll(a, b, c)
Usage of the SAForum AIS (Application Interface Specification)
static int unload_module(void)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
static struct ais_error ais_errors[]
int ast_ais_evt_unload_module(void)
static struct @322 dispatch_thread
Support for logging to various files, console and syslog Configuration in file logger.conf.
static int load_module(void)
Standard Command Line Interface.
const char * ais_err2str(SaAisErrorT error)
static void * dispatch_thread_handler(void *data)
Options provided by main asterisk program.
int ast_ais_clm_unload_module(void)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.