mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Use pseudo channel (but real channel) instead of just directly opening /dev/zap/pseudo to enable future meetme enhancements (bug #1766)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -92,7 +92,7 @@ LOCAL_USER_DECL;
|
|||||||
|
|
||||||
static struct ast_conference {
|
static struct ast_conference {
|
||||||
char confno[AST_MAX_EXTENSION]; /* Conference */
|
char confno[AST_MAX_EXTENSION]; /* Conference */
|
||||||
int fd; /* Announcements fd */
|
struct ast_channel *chan; /* Announcements channel */
|
||||||
int zapconf; /* Zaptel Conf # */
|
int zapconf; /* Zaptel Conf # */
|
||||||
int users; /* Number of active users */
|
int users; /* Number of active users */
|
||||||
int markedusers; /* Number of marked users */
|
int markedusers; /* Number of marked users */
|
||||||
@@ -181,7 +181,7 @@ static void conf_play(struct ast_conference *conf, int sound)
|
|||||||
len = 0;
|
len = 0;
|
||||||
}
|
}
|
||||||
if (data)
|
if (data)
|
||||||
careful_write(conf->fd, data, len);
|
careful_write(conf->chan->fds[0], data, len);
|
||||||
ast_mutex_unlock(&conflock);
|
ast_mutex_unlock(&conflock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,8 +203,8 @@ static struct ast_conference *build_conf(char *confno, char *pin, int make, int
|
|||||||
memset(cnf, 0, sizeof(struct ast_conference));
|
memset(cnf, 0, sizeof(struct ast_conference));
|
||||||
strncpy(cnf->confno, confno, sizeof(cnf->confno) - 1);
|
strncpy(cnf->confno, confno, sizeof(cnf->confno) - 1);
|
||||||
strncpy(cnf->pin, pin, sizeof(cnf->pin) - 1);
|
strncpy(cnf->pin, pin, sizeof(cnf->pin) - 1);
|
||||||
cnf->fd = open("/dev/zap/pseudo", O_RDWR);
|
cnf->chan = ast_request("zap", AST_FORMAT_ULAW, "pseudo");
|
||||||
if (cnf->fd < 0) {
|
if (!cnf->chan) {
|
||||||
ast_log(LOG_WARNING, "Unable to open pseudo channel\n");
|
ast_log(LOG_WARNING, "Unable to open pseudo channel\n");
|
||||||
free(cnf);
|
free(cnf);
|
||||||
cnf = NULL;
|
cnf = NULL;
|
||||||
@@ -214,10 +214,10 @@ static struct ast_conference *build_conf(char *confno, char *pin, int make, int
|
|||||||
/* Setup a new zap conference */
|
/* Setup a new zap conference */
|
||||||
ztc.chan = 0;
|
ztc.chan = 0;
|
||||||
ztc.confno = -1;
|
ztc.confno = -1;
|
||||||
ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
|
ztc.confmode = ZT_CONF_CONFANN;
|
||||||
if (ioctl(cnf->fd, ZT_SETCONF, &ztc)) {
|
if (ioctl(cnf->chan->fds[0], ZT_SETCONF, &ztc)) {
|
||||||
ast_log(LOG_WARNING, "Error setting conference\n");
|
ast_log(LOG_WARNING, "Error setting conference\n");
|
||||||
close(cnf->fd);
|
ast_hangup(cnf->chan);
|
||||||
free(cnf);
|
free(cnf);
|
||||||
cnf = NULL;
|
cnf = NULL;
|
||||||
goto cnfout;
|
goto cnfout;
|
||||||
@@ -927,7 +927,7 @@ outrun:
|
|||||||
}
|
}
|
||||||
if (!cur)
|
if (!cur)
|
||||||
ast_log(LOG_WARNING, "Conference not found\n");
|
ast_log(LOG_WARNING, "Conference not found\n");
|
||||||
close(conf->fd);
|
ast_hangup(conf->chan);
|
||||||
free(conf);
|
free(conf);
|
||||||
} else {
|
} else {
|
||||||
/* Remove the user struct */
|
/* Remove the user struct */
|
||||||
|
Reference in New Issue
Block a user