[Asterisk-cvs] asterisk/apps app_meetme.c,1.67,1.68

twisted at lists.digium.com twisted at lists.digium.com
Thu Jan 13 22:21:42 CST 2005


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv24208/apps

Modified Files:
	app_meetme.c 
Log Message:
Add meetme option to kick last user (bug #2491 with slight modification)


Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- app_meetme.c	7 Jan 2005 07:23:31 -0000	1.67
+++ app_meetme.c	14 Jan 2005 04:25:35 -0000	1.68
@@ -91,6 +91,7 @@
 "  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 @@
 {
 	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 @@
 						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 @@
 											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 @@
 						}
 					}
 					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 */




More information about the svn-commits mailing list