30 #define COMMANDLINE_LENGTH_MAX 2048 59 log_debug(
ZONE,
"action %s on PBX pipe", a==0?
"action_ACCEPT":a==1?
"action_READ":a==2?
"action_WRITE":a==3?
"action_CLOSE":
"-unknown-");
93 log_write(c2s->
log, LOG_ERR,
"PBX for Windows is not supported yet");
100 log_debug(
ZONE,
"error opening pipe: %d %s", errno, strerror(errno));
101 log_write(c2s->
log, LOG_ERR,
"failed to open PBX named pipe %s for %s", c2s->
pbx_pipe, mode==O_RDONLY?
"reading":
"writing");
123 log_write(c2s->
log, LOG_ERR,
"PBX for Windows is not supported yet");
129 if(stat(c2s->
pbx_pipe, &sb) == -1) {
130 if(mkfifo(c2s->
pbx_pipe, S_IRUSR | S_IWUSR | S_IRGRP) == -1) {
135 if(!S_ISFIFO(sb.st_mode)) {
static void _pbx_close_pipe(c2s_t c2s)
void log_write(log_t log, int level, const char *msgfmt,...)
static void _pbx_read_command(c2s_t c2s)
void c2s_pbx_init(c2s_t c2s)
mio_action_t
these are the actions and a handler type assigned by the applicaiton using mio
static void _pbx_read_pipe(c2s_t c2s)
#define mio_read(m, fd)
process read events for this fd
int _pbx_process_command(c2s_t c2s, const char *cmd)
process commandline
#define COMMANDLINE_LENGTH_MAX
static void _pbx_open_pipe(c2s_t c2s, int mode)
static int _pbx_mio_callback(mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg)
#define mio_close(m, fd)
request that mio close this fd
static void _pbx_write_pipe(c2s_t c2s)
#define mio_write(m, fd)
mio should try the write action on this fd now
const char * pbx_pipe
PBX integration named pipe.
#define mio_register(m, fd, app, arg)
for adding an existing socket connected to this mio