mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
whitepace cleanup and various minor fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -200,7 +200,7 @@ static void *recordthread(void *args);
|
||||
#define CONFFLAG_ADMIN (1 << 1) /* If set the user has admin access on the conference */
|
||||
#define CONFFLAG_MONITOR (1 << 2) /* If set the user can only receive audio from the conference */
|
||||
#define CONFFLAG_POUNDEXIT (1 << 3) /* If set asterisk will exit conference when '#' is pressed */
|
||||
#define CONFFLAG_STARMENU (1 << 4) /* If set asterisk will provide a menu to the user what '*' is pressed */
|
||||
#define CONFFLAG_STARMENU (1 << 4) /* If set asterisk will provide a menu to the user when '*' is pressed */
|
||||
#define CONFFLAG_TALKER (1 << 5) /* If set the use can only send audio to the conference */
|
||||
#define CONFFLAG_QUIET (1 << 6) /* If set there will be no enter or leave sounds */
|
||||
#define CONFFLAG_VIDEO (1 << 7) /* Set to enable video mode */
|
||||
@@ -259,6 +259,7 @@ static int careful_write(int fd, unsigned char *data, int len)
|
||||
{
|
||||
int res;
|
||||
int x;
|
||||
|
||||
while (len) {
|
||||
x = ZT_IOMUX_WRITE | ZT_IOMUX_SIGEVENT;
|
||||
res = ioctl(fd, ZT_IOMUX, &x);
|
||||
@@ -274,6 +275,7 @@ static int careful_write(int fd, unsigned char *data, int len)
|
||||
len -= res;
|
||||
data += res;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -305,6 +307,7 @@ static int set_talk_volume(struct ast_conf_user *user, int volume)
|
||||
if successful, don't adjust in the frame reading routine
|
||||
*/
|
||||
gain_adjust = gain_map[volume + 5];
|
||||
|
||||
return ast_channel_setoption(user->chan, AST_OPTION_RXGAIN, &gain_adjust, sizeof(gain_adjust), 0);
|
||||
}
|
||||
|
||||
@@ -316,6 +319,7 @@ static int set_listen_volume(struct ast_conf_user *user, int volume)
|
||||
if successful, don't adjust in the frame reading routine
|
||||
*/
|
||||
gain_adjust = gain_map[volume + 5];
|
||||
|
||||
return ast_channel_setoption(user->chan, AST_OPTION_TXGAIN, &gain_adjust, sizeof(gain_adjust), 0);
|
||||
}
|
||||
|
||||
@@ -391,9 +395,12 @@ static void conf_play(struct ast_channel *chan, struct ast_conference *conf, int
|
||||
unsigned char *data;
|
||||
int len;
|
||||
int res = -1;
|
||||
|
||||
if (!chan->_softhangup)
|
||||
res = ast_autoservice_start(chan);
|
||||
|
||||
ast_mutex_lock(&conflock);
|
||||
|
||||
switch(sound) {
|
||||
case ENTER:
|
||||
data = enter;
|
||||
@@ -409,7 +416,9 @@ static void conf_play(struct ast_channel *chan, struct ast_conference *conf, int
|
||||
}
|
||||
if (data)
|
||||
careful_write(conf->fd, data, len);
|
||||
|
||||
ast_mutex_unlock(&conflock);
|
||||
|
||||
if (!res)
|
||||
ast_autoservice_stop(chan);
|
||||
}
|
||||
@@ -418,18 +427,18 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
|
||||
{
|
||||
struct ast_conference *cnf;
|
||||
struct zt_confinfo ztc;
|
||||
|
||||
ast_mutex_lock(&conflock);
|
||||
cnf = confs;
|
||||
while(cnf) {
|
||||
|
||||
for (cnf = confs; cnf; cnf = cnf->next) {
|
||||
if (!strcmp(confno, cnf->confno))
|
||||
break;
|
||||
cnf = cnf->next;
|
||||
}
|
||||
|
||||
if (!cnf && (make || dynamic)) {
|
||||
cnf = malloc(sizeof(struct ast_conference));
|
||||
if (cnf) {
|
||||
/* Make a new one */
|
||||
memset(cnf, 0, sizeof(struct ast_conference));
|
||||
cnf = calloc(1, sizeof(*cnf));
|
||||
if (cnf) {
|
||||
ast_copy_string(cnf->confno, confno, sizeof(cnf->confno));
|
||||
ast_copy_string(cnf->pin, pin, sizeof(cnf->pin));
|
||||
ast_copy_string(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin));
|
||||
@@ -484,6 +493,7 @@ cnfout:
|
||||
static int confs_show(int fd, int argc, char **argv)
|
||||
{
|
||||
ast_cli(fd, "Deprecated! Please use 'meetme' instead.\n");
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -599,17 +609,24 @@ static int conf_cmd(int fd, int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
/* Show all the users */
|
||||
user = cnf->firstuser;
|
||||
while(user) {
|
||||
ast_cli(fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s\n", user->user_no, user->chan->cid.cid_num ? user->chan->cid.cid_num : "<unknown>", user->chan->cid.cid_name ? user->chan->cid.cid_name : "<no name>", user->chan->name, (user->userflags & CONFFLAG_ADMIN) ? "(Admin)" : "", (user->userflags & CONFFLAG_MONITOR) ? "(Listen only)" : "", (user->adminflags & ADMINFLAG_MUTED) ? "(Admn Muted)" : "", istalking(user->talking));
|
||||
user = user->nextuser;
|
||||
}
|
||||
for (user = cnf->firstuser; user; user = user->nextuser)
|
||||
ast_cli(fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s\n",
|
||||
user->user_no,
|
||||
user->chan->cid.cid_num ? user->chan->cid.cid_num : "<unknown>",
|
||||
user->chan->cid.cid_name ? user->chan->cid.cid_name : "<no name>",
|
||||
user->chan->name,
|
||||
user->userflags & CONFFLAG_ADMIN ? "(Admin)" : "",
|
||||
user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
|
||||
user->adminflags & ADMINFLAG_MUTED ? "(Admn Muted)" : "",
|
||||
istalking(user->talking));
|
||||
ast_cli(fd,"%d users in that conference.\n",cnf->users);
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
} else
|
||||
return RESULT_SHOWUSAGE;
|
||||
ast_log(LOG_DEBUG, "Cmdline: %s\n", cmdline);
|
||||
admin_exec(NULL, cmdline);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -653,7 +670,6 @@ static char *complete_confcmd(char *line, char *word, int pos, int state) {
|
||||
}
|
||||
which++;
|
||||
ast_mutex_lock(&conflock);
|
||||
cnf = confs;
|
||||
|
||||
/* TODO: Find the conf number from the cmdline (ignore spaces) <- test this and make it fail-safe! */
|
||||
myline = ast_strdupa(line);
|
||||
@@ -662,28 +678,26 @@ static char *complete_confcmd(char *line, char *word, int pos, int state) {
|
||||
;
|
||||
}
|
||||
|
||||
while(cnf) {
|
||||
if (strcmp(confno, cnf->confno) == 0) {
|
||||
for (cnf = confs; cnf; cnf = cnf->next) {
|
||||
if (!strcmp(confno, cnf->confno))
|
||||
break;
|
||||
}
|
||||
cnf = cnf->next;
|
||||
}
|
||||
|
||||
if (cnf) {
|
||||
/* Search for the user */
|
||||
usr = cnf->firstuser;
|
||||
while(usr) {
|
||||
for (usr = cnf->firstuser; usr; usr = usr->nextuser) {
|
||||
snprintf(usrno, sizeof(usrno), "%d", usr->user_no);
|
||||
if (!strncasecmp(word, usrno, strlen(word))) {
|
||||
if (++which > state)
|
||||
break;
|
||||
}
|
||||
usr = usr->nextuser;
|
||||
}
|
||||
}
|
||||
ast_mutex_unlock(&conflock);
|
||||
return usr ? strdup(usrno) : NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -698,6 +712,7 @@ static struct ast_cli_entry cli_conf = {
|
||||
static void conf_flush(int fd)
|
||||
{
|
||||
int x;
|
||||
|
||||
x = ZT_FLUSH_ALL;
|
||||
if (ioctl(fd, ZT_FLUSH, &x))
|
||||
ast_log(LOG_WARNING, "Error flushing channel\n");
|
||||
@@ -747,7 +762,7 @@ static int conf_free(struct ast_conference *conf)
|
||||
|
||||
static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags)
|
||||
{
|
||||
struct ast_conf_user *user = malloc(sizeof(struct ast_conf_user));
|
||||
struct ast_conf_user *user = calloc(1, sizeof(*user));
|
||||
struct ast_conf_user *usr = NULL;
|
||||
int fd;
|
||||
struct zt_confinfo ztc, ztc_empty;
|
||||
@@ -763,7 +778,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
||||
int origfd;
|
||||
int musiconhold = 0;
|
||||
int firstpass = 0;
|
||||
int origquiet;
|
||||
int lastmarked = 0;
|
||||
int currentmarked = 0;
|
||||
int ret = -1;
|
||||
@@ -772,7 +786,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
||||
int using_pseudo = 0;
|
||||
int duration=20;
|
||||
struct ast_dsp *dsp=NULL;
|
||||
|
||||
struct ast_app *app;
|
||||
char *agifile;
|
||||
char *agifiledefault = "conf-background.agi";
|
||||
@@ -780,16 +793,14 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
||||
char exitcontext[AST_MAX_CONTEXT] = "";
|
||||
char recordingtmp[AST_MAX_EXTENSION] = "";
|
||||
int dtmf;
|
||||
|
||||
ZT_BUFFERINFO bi;
|
||||
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
|
||||
char *buf = __buf + AST_FRIENDLY_OFFSET;
|
||||
|
||||
if (!user) {
|
||||
ast_log(LOG_ERROR, "Out of memory\n");
|
||||
return(ret);
|
||||
return ret;
|
||||
}
|
||||
memset(user, 0, sizeof(struct ast_conf_user));
|
||||
|
||||
if (confflags & CONFFLAG_RECORDCONF && conf->recording !=MEETME_RECORD_ACTIVE) {
|
||||
conf->recordingfilename = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFILE");
|
||||
@@ -804,12 +815,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
||||
}
|
||||
pthread_attr_init(&conf->attr);
|
||||
pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
|
||||
ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n", conf->confno, conf->recordingfilename, conf->recordingformat);
|
||||
ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n",
|
||||
conf->confno, conf->recordingfilename, conf->recordingformat);
|
||||
ast_pthread_create(&conf->recordthread, &conf->attr, recordthread, conf);
|
||||
}
|
||||
|
||||
user->user_no = 0; /* User number 0 means starting up user! (dead - not in the list!) */
|
||||
|
||||
time(&user->jointime);
|
||||
|
||||
if (conf->locked) {
|
||||
@@ -823,19 +833,16 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
||||
conf->markedusers++;
|
||||
|
||||
ast_mutex_lock(&conflock);
|
||||
if (conf->firstuser == NULL) {
|
||||
if (!conf->firstuser) {
|
||||
/* Fill the first new User struct */
|
||||
user->user_no = 1;
|
||||
user->nextuser = NULL;
|
||||
user->prevuser = NULL;
|
||||
conf->firstuser = user;
|
||||
conf->lastuser = user;
|
||||
} else {
|
||||
/* Fill the new user struct */
|
||||
user->user_no = conf->lastuser->user_no + 1;
|
||||
user->prevuser = conf->lastuser;
|
||||
user->nextuser = NULL;
|
||||
if (conf->lastuser->nextuser != NULL) {
|
||||
if (conf->lastuser->nextuser) {
|
||||
ast_log(LOG_WARNING, "Error in User Management!\n");
|
||||
ast_mutex_unlock(&conflock);
|
||||
goto outrun;
|
||||
@@ -844,12 +851,14 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
||||
conf->lastuser = user;
|
||||
}
|
||||
}
|
||||
|
||||
user->chan = chan;
|
||||
user->userflags = confflags;
|
||||
user->adminflags = 0;
|
||||
user->talking = -1;
|
||||
conf->users++;
|
||||
ast_mutex_unlock(&conflock);
|
||||
origquiet = confflags & CONFFLAG_QUIET;
|
||||
|
||||
if (confflags & CONFFLAG_EXIT_CONTEXT) {
|
||||
if ((agifile = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT")))
|
||||
ast_copy_string(exitcontext, agifile, sizeof(exitcontext));
|
||||
@@ -860,12 +869,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
||||
}
|
||||
|
||||
if (!(confflags & CONFFLAG_QUIET) && (confflags & CONFFLAG_INTROUSER)) {
|
||||
snprintf(user->namerecloc,sizeof(user->namerecloc),"%s/meetme/meetme-username-%s-%d",ast_config_AST_SPOOL_DIR,conf->confno,user->user_no);
|
||||
snprintf(user->namerecloc, sizeof(user->namerecloc),
|
||||
"%s/meetme/meetme-username-%s-%d", ast_config_AST_SPOOL_DIR,
|
||||
conf->confno, user->user_no);
|
||||
ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
|
||||
}
|
||||
|
||||
conf->users++;
|
||||
|
||||
if (!(confflags & CONFFLAG_QUIET)) {
|
||||
if (conf->users == 1 && !(confflags & CONFFLAG_WAITMARKED))
|
||||
if (!ast_streamfile(chan, "conf-onlyperson", chan->language))
|
||||
@@ -911,20 +920,20 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
||||
}
|
||||
}
|
||||
|
||||
/* Set it into linear mode (write) */
|
||||
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
|
||||
ast_log(LOG_WARNING, "Unable to set '%s' to write linear mode\n", chan->name);
|
||||
goto outrun;
|
||||
}
|
||||
|
||||
/* Set it into linear mode (read) */
|
||||
if (ast_set_read_format(chan, AST_FORMAT_SLINEAR) < 0) {
|
||||
ast_log(LOG_WARNING, "Unable to set '%s' to read linear mode\n", chan->name);
|
||||
goto outrun;
|
||||
}
|
||||
|
||||
ast_indicate(chan, -1);
|
||||
retryzap = strcasecmp(chan->type, "Zap");
|
||||
user->zapchannel = !retryzap;
|
||||
|
||||
zapretry:
|
||||
origfd = chan->fds[0];
|
||||
if (retryzap) {
|
||||
@@ -990,7 +999,9 @@ zapretry:
|
||||
/* Add us to the conference */
|
||||
ztc.chan = 0;
|
||||
ztc.confno = conf->zapconf;
|
||||
|
||||
ast_mutex_lock(&conflock);
|
||||
|
||||
if (!(confflags & CONFFLAG_QUIET) && (confflags & CONFFLAG_INTROUSER) && conf->users > 1) {
|
||||
if (conf->chan && ast_fileexists(user->namerecloc, NULL, NULL)) {
|
||||
if (!ast_streamfile(conf->chan, user->namerecloc, chan->language))
|
||||
@@ -1028,10 +1039,12 @@ zapretry:
|
||||
if (!(confflags & CONFFLAG_WAITMARKED) || (conf->markedusers >= 1))
|
||||
conf_play(chan, conf, ENTER);
|
||||
}
|
||||
conf_flush(fd);
|
||||
ast_mutex_unlock(&conflock);
|
||||
if (confflags & CONFFLAG_AGI) {
|
||||
|
||||
ast_mutex_unlock(&conflock);
|
||||
|
||||
conf_flush(fd);
|
||||
|
||||
if (confflags & CONFFLAG_AGI) {
|
||||
/* Get name of AGI file to run from $(MEETME_AGI_BACKGROUND)
|
||||
or use default filename of conf-background.agi */
|
||||
|
||||
@@ -1082,7 +1095,10 @@ zapretry:
|
||||
menu_was_active = menu_active;
|
||||
|
||||
currentmarked = conf->markedusers;
|
||||
if (!(confflags & CONFFLAG_QUIET) && (confflags & CONFFLAG_MARKEDUSER) && (confflags & CONFFLAG_WAITMARKED) && lastmarked == 0) {
|
||||
if (!(confflags & CONFFLAG_QUIET) &&
|
||||
(confflags & CONFFLAG_MARKEDUSER) &&
|
||||
(confflags & CONFFLAG_WAITMARKED) &&
|
||||
lastmarked == 0) {
|
||||
if (currentmarked == 1 && conf->users > 1) {
|
||||
ast_say_number(chan, conf->users - 1, AST_DIGIT_ANY, chan->language, (char *) NULL);
|
||||
if (conf->users - 1 == 1) {
|
||||
@@ -1232,6 +1248,7 @@ zapretry:
|
||||
|
||||
if (confflags & CONFFLAG_MONITORTALKER) {
|
||||
int totalsilence;
|
||||
|
||||
if (user->talking == -1)
|
||||
user->talking = 0;
|
||||
|
||||
@@ -1261,6 +1278,7 @@ zapretry:
|
||||
}
|
||||
} else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT)) {
|
||||
char tmp[2];
|
||||
|
||||
tmp[0] = f->subclass;
|
||||
tmp[1] = '\0';
|
||||
if (ast_goto_if_exists(chan, exitcontext, tmp, 1)) {
|
||||
@@ -1275,7 +1293,6 @@ zapretry:
|
||||
if (ioctl(fd, ZT_SETCONF, &ztc_empty)) {
|
||||
ast_log(LOG_WARNING, "Error setting conference\n");
|
||||
close(fd);
|
||||
ast_mutex_unlock(&conflock);
|
||||
goto outrun;
|
||||
}
|
||||
|
||||
@@ -1345,27 +1362,21 @@ zapretry:
|
||||
usr->adminflags |= ADMINFLAG_KICKME;
|
||||
ast_stopstream(chan);
|
||||
break;
|
||||
|
||||
case '4':
|
||||
tweak_listen_volume(user, VOL_DOWN);
|
||||
break;
|
||||
|
||||
case '6':
|
||||
tweak_listen_volume(user, VOL_UP);
|
||||
break;
|
||||
|
||||
case '7':
|
||||
tweak_talk_volume(user, VOL_DOWN);
|
||||
break;
|
||||
|
||||
case '8':
|
||||
menu_active = 0;
|
||||
break;
|
||||
|
||||
case '9':
|
||||
tweak_talk_volume(user, VOL_UP);
|
||||
break;
|
||||
|
||||
default:
|
||||
menu_active = 0;
|
||||
/* Play an error message! */
|
||||
@@ -1378,7 +1389,6 @@ zapretry:
|
||||
/* User menu */
|
||||
if (!menu_active) {
|
||||
menu_active = 1;
|
||||
/* Record this sound! */
|
||||
if (!ast_streamfile(chan, "conf-usermenu", chan->language))
|
||||
dtmf = ast_waitstream(chan, AST_DIGIT_ANY);
|
||||
else
|
||||
@@ -1412,35 +1422,28 @@ zapretry:
|
||||
case '4':
|
||||
tweak_listen_volume(user, VOL_DOWN);
|
||||
break;
|
||||
|
||||
case '6':
|
||||
tweak_listen_volume(user, VOL_UP);
|
||||
break;
|
||||
|
||||
case '7':
|
||||
tweak_talk_volume(user, VOL_DOWN);
|
||||
break;
|
||||
|
||||
case '8':
|
||||
menu_active = 0;
|
||||
break;
|
||||
|
||||
case '9':
|
||||
tweak_talk_volume(user, VOL_UP);
|
||||
break;
|
||||
|
||||
default:
|
||||
menu_active = 0;
|
||||
/* Play an error message! */
|
||||
if (!ast_streamfile(chan, "conf-errormenu", chan->language))
|
||||
ast_waitstream(chan, "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (musiconhold) {
|
||||
if (musiconhold)
|
||||
ast_moh_start(chan, NULL);
|
||||
}
|
||||
|
||||
if (ioctl(fd, ZT_SETCONF, &ztc)) {
|
||||
ast_log(LOG_WARNING, "Error setting conference\n");
|
||||
@@ -1450,7 +1453,9 @@ zapretry:
|
||||
}
|
||||
conf_flush(fd);
|
||||
} else if (option_debug) {
|
||||
ast_log(LOG_DEBUG, "Got unrecognized frame on channel %s, f->frametype=%d,f->subclass=%d\n",chan->name,f->frametype,f->subclass);
|
||||
ast_log(LOG_DEBUG,
|
||||
"Got unrecognized frame on channel %s, f->frametype=%d,f->subclass=%d\n",
|
||||
chan->name, f->frametype, f->subclass);
|
||||
}
|
||||
ast_frfree(f);
|
||||
} else if (outfd > -1) {
|
||||
@@ -1467,7 +1472,6 @@ zapretry:
|
||||
ast_frame_adjust_volume(&fr, user->listen.actual);
|
||||
if (ast_write(chan, &fr) < 0) {
|
||||
ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
|
||||
/* break; */
|
||||
}
|
||||
} else
|
||||
ast_log(LOG_WARNING, "Failed to read frame: %s\n", strerror(errno));
|
||||
@@ -1506,9 +1510,9 @@ zapretry:
|
||||
}
|
||||
ast_mutex_unlock(&conflock);
|
||||
|
||||
|
||||
outrun:
|
||||
ast_mutex_lock(&conflock);
|
||||
|
||||
if (confflags & CONFFLAG_MONITORTALKER && dsp)
|
||||
ast_dsp_free(dsp);
|
||||
|
||||
@@ -1560,6 +1564,7 @@ outrun:
|
||||
}
|
||||
free(user);
|
||||
ast_mutex_unlock(&conflock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1571,11 +1576,9 @@ static struct ast_conference *find_conf(struct ast_channel *chan, char *confno,
|
||||
|
||||
/* Check first in the conference list */
|
||||
ast_mutex_lock(&conflock);
|
||||
cnf = confs;
|
||||
while (cnf) {
|
||||
for (cnf = confs; cnf; cnf = cnf->next) {
|
||||
if (!strcmp(confno, cnf->confno))
|
||||
break;
|
||||
cnf = cnf->next;
|
||||
}
|
||||
ast_mutex_unlock(&conflock);
|
||||
|
||||
@@ -1638,6 +1641,7 @@ static struct ast_conference *find_conf(struct ast_channel *chan, char *confno,
|
||||
if (dynamic_pin[0] == 'q')
|
||||
dynamic_pin[0] = '\0';
|
||||
}
|
||||
|
||||
return cnf;
|
||||
}
|
||||
|
||||
@@ -1682,6 +1686,7 @@ static int count_exec(struct ast_channel *chan, void *data)
|
||||
res = ast_say_number(chan, count, "", chan->language, (char *) NULL); /* Needs gender */
|
||||
}
|
||||
LOCAL_USER_REMOVE(u);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1863,7 +1868,10 @@ static int conf_exec(struct ast_channel *chan, void *data)
|
||||
if (allowretry)
|
||||
confno[0] = '\0';
|
||||
} else {
|
||||
if ((!ast_strlen_zero(cnf->pin) && !ast_test_flag(&confflags, CONFFLAG_ADMIN)) || (!ast_strlen_zero(cnf->pinadmin) && ast_test_flag(&confflags, CONFFLAG_ADMIN))) {
|
||||
if ((!ast_strlen_zero(cnf->pin) &&
|
||||
!ast_test_flag(&confflags, CONFFLAG_ADMIN)) ||
|
||||
(!ast_strlen_zero(cnf->pinadmin) &&
|
||||
ast_test_flag(&confflags, CONFFLAG_ADMIN))) {
|
||||
char pin[AST_MAX_EXTENSION]="";
|
||||
int j;
|
||||
|
||||
@@ -1877,8 +1885,9 @@ static int conf_exec(struct ast_channel *chan, void *data)
|
||||
res = ast_app_getdata(chan, "conf-getpin", pin + strlen(pin), sizeof(pin) - 1 - strlen(pin), 0);
|
||||
}
|
||||
if (res >= 0) {
|
||||
if (!strcasecmp(pin, cnf->pin) || (!ast_strlen_zero(cnf->pinadmin) && !strcasecmp(pin, cnf->pinadmin))) {
|
||||
|
||||
if (!strcasecmp(pin, cnf->pin) ||
|
||||
(!ast_strlen_zero(cnf->pinadmin) &&
|
||||
!strcasecmp(pin, cnf->pinadmin))) {
|
||||
/* Pin correct */
|
||||
allowretry = 0;
|
||||
if (!ast_strlen_zero(cnf->pinadmin) && !strcasecmp(pin, cnf->pinadmin))
|
||||
@@ -1936,6 +1945,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
|
||||
static struct ast_conf_user* find_user(struct ast_conference *conf, char *callerident) {
|
||||
struct ast_conf_user *user = NULL;
|
||||
char usrno[1024] = "";
|
||||
|
||||
if (conf && callerident) {
|
||||
user = conf->firstuser;
|
||||
while (user) {
|
||||
@@ -1972,11 +1982,9 @@ static int admin_exec(struct ast_channel *chan, void *data) {
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
cnf = confs;
|
||||
while (cnf) {
|
||||
if (strcmp(cnf->confno, conf) == 0)
|
||||
for (cnf = confs; cnf; cnf = cnf->next) {
|
||||
if (!strcmp(cnf->confno, conf))
|
||||
break;
|
||||
cnf = cnf->next;
|
||||
}
|
||||
|
||||
if (caller)
|
||||
@@ -2069,13 +2077,12 @@ static int admin_exec(struct ast_channel *chan, void *data) {
|
||||
|
||||
static void *recordthread(void *args)
|
||||
{
|
||||
struct ast_conference *cnf;
|
||||
struct ast_conference *cnf = args;
|
||||
struct ast_frame *f=NULL;
|
||||
int flags;
|
||||
struct ast_filestream *s;
|
||||
int res=0;
|
||||
|
||||
cnf = (struct ast_conference *)args;
|
||||
if (!cnf || !cnf->chan) {
|
||||
pthread_exit(0);
|
||||
}
|
||||
@@ -2145,7 +2152,9 @@ char *description(void)
|
||||
int usecount(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
STANDARD_USECOUNT(res);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user