aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authortwisted <twisted@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-14 04:25:35 +0000
committertwisted <twisted@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-14 04:25:35 +0000
commit056dc4d73c3b51efb235e8ea69ba6b545fc41d37 (patch)
treeaca4490c2c1368a0e8882774facb2e9c9003b649 /apps
parent05d856b489e073888f9ec9e6ab92b28963a91049 (diff)
Add meetme option to kick last user (bug #2491 with slight modification)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4785 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_meetme.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index b4eec3038..887ac4ce1 100755
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -91,6 +91,7 @@ static char *descrip3 =
" MeetMeAdmin(confno,command[,user]): Run admin command for conference\n"
" 'K' -- Kick all users out of conference\n"
" 'k' -- Kick one user out of conference\n"
+" 'e' -- Eject last user that joined\n"
" 'L' -- Lock conference\n"
" 'l' -- Unlock conference\n"
" 'M' -- Mute conference\n"
@@ -500,6 +501,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
{
struct ast_conference *prev=NULL, *cur;
struct ast_conf_user *user = malloc(sizeof(struct ast_conf_user));
+ struct ast_conf_user *usr = NULL;
int fd;
struct zt_confinfo ztc;
struct ast_frame *f;
@@ -873,9 +875,9 @@ zapretry:
if (!menu_active) {
menu_active = 1;
/* Record this sound! */
- if (!ast_streamfile(chan, "conf-adminmenu", chan->language))
+ if (!ast_streamfile(chan, "conf-adminmenu", chan->language))
dtmf = ast_waitstream(chan, AST_DIGIT_ANY);
- else
+ else
dtmf = 0;
} else
dtmf = f->subclass;
@@ -915,6 +917,16 @@ zapretry:
ast_waitstream(chan, "");
}
break;
+ case '6': /* Eject last user */
+ menu_active = 0;
+ usr = conf->lastuser;
+ if ((usr->chan->name == chan->name)||(usr->userflags & CONFFLAG_ADMIN)) {
+ if(!ast_streamfile(chan, "conf-errormenu", chan->language))
+ ast_waitstream(chan, "");
+ } else
+ usr->adminflags |= ADMINFLAG_KICKME;
+ ast_stopstream(chan);
+ break;
default:
menu_active = 0;
/* Play an error message! */
@@ -1538,11 +1550,21 @@ static int admin_exec(struct ast_channel *chan, void *data) {
}
}
break;
+ case 101: /* e: Eject last user*/
+ user = cnf->lastuser;
+ if (!(user->userflags & CONFFLAG_ADMIN)) {
+ user->adminflags |= ADMINFLAG_KICKME;
+ break;
+ } else
+ ast_log(LOG_NOTICE, "Not kicking last user, is an Admin!\n");
+ }
+ break;
+
case 77: /* M: Mute */
if (user) {
user->adminflags |= ADMINFLAG_MUTED;
} else {
- ast_log(LOG_NOTICE, "Specified User not found!");
+ ast_log(LOG_NOTICE, "Specified User not found!\n");
}
break;
case 78: /* N: Mute all users */