[svn-commits] oej: branch oej/videocaps r145739 - in /team/oej/videocaps: ./ agi/ apps/ cha...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 2 04:51:02 CDT 2008


Author: oej
Date: Thu Oct  2 04:51:01 2008
New Revision: 145739

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145739
Log:
Reset automerge

Removed:
    team/oej/videocaps/utils/build-extensions-conf.lua
Modified:
    team/oej/videocaps/   (props changed)
    team/oej/videocaps/CHANGES
    team/oej/videocaps/Makefile
    team/oej/videocaps/Makefile.moddir_rules
    team/oej/videocaps/agi/Makefile
    team/oej/videocaps/apps/app_dial.c
    team/oej/videocaps/apps/app_meetme.c
    team/oej/videocaps/apps/app_mixmonitor.c
    team/oej/videocaps/apps/app_osplookup.c
    team/oej/videocaps/apps/app_playback.c
    team/oej/videocaps/apps/app_queue.c
    team/oej/videocaps/apps/app_sms.c
    team/oej/videocaps/apps/app_voicemail.c
    team/oej/videocaps/channels/chan_agent.c
    team/oej/videocaps/channels/chan_console.c
    team/oej/videocaps/channels/chan_dahdi.c
    team/oej/videocaps/channels/chan_features.c
    team/oej/videocaps/channels/chan_h323.c
    team/oej/videocaps/channels/chan_iax2.c
    team/oej/videocaps/channels/chan_misdn.c
    team/oej/videocaps/channels/chan_oss.c
    team/oej/videocaps/channels/chan_sip.c
    team/oej/videocaps/channels/chan_skinny.c
    team/oej/videocaps/channels/chan_unistim.c
    team/oej/videocaps/channels/iax2-parser.c
    team/oej/videocaps/channels/misdn/isdn_lib.c
    team/oej/videocaps/channels/misdn/isdn_lib.h
    team/oej/videocaps/configs/extensions.lua.sample
    team/oej/videocaps/configs/rtp.conf.sample
    team/oej/videocaps/configure
    team/oej/videocaps/configure.ac
    team/oej/videocaps/contrib/scripts/realtime_pgsql.sql
    team/oej/videocaps/contrib/scripts/vmail.cgi
    team/oej/videocaps/doc/tex/misdn.tex
    team/oej/videocaps/doc/tex/privacy.tex
    team/oej/videocaps/formats/format_pcm.c
    team/oej/videocaps/funcs/func_curl.c
    team/oej/videocaps/funcs/func_cut.c
    team/oej/videocaps/funcs/func_strings.c
    team/oej/videocaps/include/asterisk.h
    team/oej/videocaps/include/asterisk/astmm.h
    team/oej/videocaps/include/asterisk/hashtab.h
    team/oej/videocaps/include/asterisk/localtime.h
    team/oej/videocaps/main/Makefile
    team/oej/videocaps/main/ast_expr2.c
    team/oej/videocaps/main/ast_expr2.fl
    team/oej/videocaps/main/ast_expr2.y
    team/oej/videocaps/main/ast_expr2f.c
    team/oej/videocaps/main/astmm.c
    team/oej/videocaps/main/astobj2.c
    team/oej/videocaps/main/cli.c
    team/oej/videocaps/main/features.c
    team/oej/videocaps/main/manager.c
    team/oej/videocaps/main/pbx.c
    team/oej/videocaps/main/rtp.c
    team/oej/videocaps/main/stdtime/localtime.c
    team/oej/videocaps/main/taskprocessor.c
    team/oej/videocaps/pbx/pbx_ael.c
    team/oej/videocaps/pbx/pbx_lua.c
    team/oej/videocaps/res/ais/clm.c
    team/oej/videocaps/res/ais/evt.c
    team/oej/videocaps/res/res_agi.c
    team/oej/videocaps/res/res_clioriginate.c
    team/oej/videocaps/res/res_config_ldap.c
    team/oej/videocaps/res/res_config_pgsql.c
    team/oej/videocaps/res/res_limit.c
    team/oej/videocaps/res/res_phoneprov.c
    team/oej/videocaps/utils/Makefile
    team/oej/videocaps/utils/ael_main.c
    team/oej/videocaps/utils/astman.c
    team/oej/videocaps/utils/extconf.c

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
    automerge = http://www.codename-pineapple.org/

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Oct  2 04:51:01 2008
@@ -1,1 +1,1 @@
-/trunk:1-143016
+/trunk:1-145738

Modified: team/oej/videocaps/CHANGES
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/CHANGES?view=diff&rev=145739&r1=145738&r2=145739
==============================================================================
--- team/oej/videocaps/CHANGES (original)
+++ team/oej/videocaps/CHANGES Thu Oct  2 04:51:01 2008
@@ -1,6 +1,12 @@
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.1 to Asterisk 1.6.2  -------------
 ------------------------------------------------------------------------------
+
+SIP Changes
+-----------
+ * Added support for SUBSCRIBE/NOTIFY with dialog-info based call pickups.
+   Snom phones use this for call pickup of extensions that the phone is
+   subscribed to.
 
 Dialplan Functions
 ------------------
@@ -446,8 +452,8 @@
 ----------------------
   * The ackcall and endcall options are now supplemented with options acceptdtmf
     and enddtmf. These allow for the DTMF keypress to be configurable. The options
-	default to their old hard-coded values ('#' and '*' respectively) so this should
-	not break any existing agent installations.
+    default to their old hard-coded values ('#' and '*' respectively) so this should
+    not break any existing agent installations.
 
 DAHDI channel driver (chan_dahdi) Changes
 ----------------------------------------
@@ -867,7 +873,7 @@
     allocation of additional extensions which will reach the specified user.
   * A new option for the configure script, --enable-internal-poll, has been added
     for use with systems which may have a buggy implementation of the poll system
-	call. If you notice odd behavior such as the CLI being unresponsive on remote
-	consoles, you may want to try using this option. This option is enabled by default
-	on Darwin systems since it is known that the Darwin poll() implementation has
-	odd issues.
+    call. If you notice odd behavior such as the CLI being unresponsive on remote
+    consoles, you may want to try using this option. This option is enabled by default
+    on Darwin systems since it is known that the Darwin poll() implementation has
+    odd issues.

Modified: team/oej/videocaps/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/Makefile?view=diff&rev=145739&r1=145738&r2=145739
==============================================================================
--- team/oej/videocaps/Makefile (original)
+++ team/oej/videocaps/Makefile Thu Oct  2 04:51:01 2008
@@ -232,8 +232,6 @@
 
 ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
 
-ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
-
 ifeq ($(AST_DEVMODE),yes)
   ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -Wformat-security #-Wformat=2
 endif
@@ -600,6 +598,8 @@
 	@echo " + doxygen installed on your local system    +"
 	@echo " +-------------------------------------------+"
 	@$(MAKE) -s oldmodcheck
+
+isntall: install
 
 upgrade: bininstall
 

Modified: team/oej/videocaps/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/Makefile.moddir_rules?view=diff&rev=145739&r1=145738&r2=145739
==============================================================================
--- team/oej/videocaps/Makefile.moddir_rules (original)
+++ team/oej/videocaps/Makefile.moddir_rules Thu Oct  2 04:51:01 2008
@@ -17,12 +17,6 @@
 # (remember that they apply recursively to prerequisites).
 # Also note that we can only set one variable per rule, so we have to
 # repeat the left hand side to set multiple variables.
-
-ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
- ifeq ($(findstring astmm.h,$(ASTCFLAGS)),)
-  ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
- endif
-endif
 
 ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
   ASTCFLAGS+=${GC_CFLAGS}

Modified: team/oej/videocaps/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/agi/Makefile?view=diff&rev=145739&r1=145738&r2=145739
==============================================================================
--- team/oej/videocaps/agi/Makefile (original)
+++ team/oej/videocaps/agi/Makefile Thu Oct  2 04:51:01 2008
@@ -29,8 +29,13 @@
 
 strcompat.c: ../main/strcompat.c
 	@cp $< $@
+strcompat.o: ASTCFLAGS+=-DSTANDALONE
+
+eagi-test.o: ASTCFLAGS+=-DSTANDALONE
 
 eagi-test: eagi-test.o strcompat.o
+
+eagi-sphinx-test.o: ASTCFLAGS+=-DSTANDALONE
 
 eagi-sphinx-test: eagi-sphinx-test.o
 

Modified: team/oej/videocaps/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_dial.c?view=diff&rev=145739&r1=145738&r2=145739
==============================================================================
--- team/oej/videocaps/apps/app_dial.c (original)
+++ team/oej/videocaps/apps/app_dial.c Thu Oct  2 04:51:01 2008
@@ -1500,6 +1500,7 @@
 		/* Inherit specially named variables from parent channel */
 		ast_channel_inherit_variables(chan, tc);
 		ast_set_capabilities(tmp->chan, &chan->channelcaps);	/* ??? OEJ */
+		ast_channel_datastore_inherit(chan, tc);
 
 		tc->appl = "AppDial";
 		tc->data = "(Outgoing Line)";

Modified: team/oej/videocaps/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_meetme.c?view=diff&rev=145739&r1=145738&r2=145739
==============================================================================
--- team/oej/videocaps/apps/app_meetme.c (original)
+++ team/oej/videocaps/apps/app_meetme.c Thu Oct  2 04:51:01 2008
@@ -219,6 +219,7 @@
 static int fuzzystart;
 static int earlyalert;
 static int endalert;
+static int extendby;
 
 /* Log participant count to the RealTime backend */
 static int rt_log_members;
@@ -297,6 +298,7 @@
 static const char *descrip3 = 
 "  MeetMeAdmin(confno,command[,user]): Run admin command for conference\n"
 "      'e' -- Eject last user that joined\n"
+"      'E' -- Extend conference end time, if scheduled\n"
 "      'k' -- Kick one user out of conference\n"
 "      'K' -- Kick all users out of conference\n"
 "      'l' -- Unlock conference\n"
@@ -315,6 +317,12 @@
 "      'U' -- Raise one user's listen volume\n"
 "      'v' -- Lower entire conference listening volume\n"
 "      'V' -- Raise entire conference listening volume\n"
+"  MeetMeAdmin will additionally set the variable MEETMEADMINSTATUS with one\n"
+"of the following values:\n"
+"      'NOPARSE'  -- Invalid arguments\n"
+"      'NOTFOUND' -- User specified was not found\n"
+"      'FAILED'   -- Another failure occurred\n"
+"      'OK'       -- The operation was completed successfully\n"
 "";
 
 static const char *descrip4 = 
@@ -352,6 +360,7 @@
 
 #define MAX_CONFNUM 80
 #define MAX_PIN     80
+#define OPTIONS_LEN 32
 
 /*! \brief The MeetMe Conference object */
 struct ast_conference {
@@ -883,7 +892,6 @@
 	return cnf;
 }
 
-
 static char *complete_meetmecmd(const char *line, const char *word, int pos, int state)
 {
 	static char *cmds[] = {"concise", "lock", "unlock", "mute", "unmute", "kick", "list", NULL};
@@ -946,11 +954,10 @@
 	return NULL;
 }
 
-static char *meetme_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *meetme_show_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	/* Process the command */
 	struct ast_conference *cnf;
-	struct ast_conf_user *user;
 	int hr, min, sec;
 	int i = 0, total = 0;
 	time_t now;
@@ -960,17 +967,15 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "meetme";
+		e->command = "meetme list [concise]";
 		e->usage =
-			"Usage: meetme (un)lock|(un)mute|kick|list [concise] <confno> <usernumber>\n"
-			"       Executes a command for the conference or on a conferee\n";
+			"Usage: meetme list [concise] <confno> \n"
+			"       List all or a specific conference.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return complete_meetmecmd(a->line, a->word, a->pos, a->n);
 	}
 
-	if (a->argc > 8)
-		ast_cli(a->fd, "Invalid Arguments.\n");
 	/* Check for length so no buffer will overflow... */
 	for (i = 0; i < a->argc; i++) {
 		if (strlen(a->argv[i]) > 100)
@@ -1028,7 +1033,55 @@
 		ast_free(cmdline);
 		return CLI_SUCCESS;
 	}
-	if (a->argc < 3) {
+	if (a->argc < 2) {
+		ast_free(cmdline);
+		return CLI_SHOWUSAGE;
+	}
+
+	ast_debug(1, "Cmdline: %s\n", cmdline->str);
+
+	admin_exec(NULL, cmdline->str);
+	ast_free(cmdline);
+
+	return CLI_SUCCESS;
+}
+
+
+static char *meetme_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	/* Process the command */
+	struct ast_conference *cnf;
+	struct ast_conf_user *user;
+	int hr, min, sec;
+	int i = 0;
+	time_t now;
+	struct ast_str *cmdline = NULL;
+
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "meetme {lock|unlock|mute|unmute|kick}";
+		e->usage =
+			"Usage: meetme (un)lock|(un)mute|kick <confno> <usernumber>\n"
+			"       Executes a command for the conference or on a conferee\n";
+		return NULL;
+	case CLI_GENERATE:
+		return complete_meetmecmd(a->line, a->word, a->pos, a->n);
+	}
+
+	if (a->argc > 8)
+		ast_cli(a->fd, "Invalid Arguments.\n");
+	/* Check for length so no buffer will overflow... */
+	for (i = 0; i < a->argc; i++) {
+		if (strlen(a->argv[i]) > 100)
+			ast_cli(a->fd, "Invalid Arguments.\n");
+	}
+
+	/* Max confno length */
+	if (!(cmdline = ast_str_create(MAX_CONFNUM))) {
+		return CLI_FAILURE;
+	}
+
+	if (a->argc < 1) {
 		ast_free(cmdline);
 		return CLI_SHOWUSAGE;
 	}
@@ -1307,6 +1360,7 @@
 
 static struct ast_cli_entry cli_meetme[] = {
 	AST_CLI_DEFINE(meetme_cmd, "Execute a command on a conference or conferee"),
+	AST_CLI_DEFINE(meetme_show_cmd, "List all or one conference"),
 	AST_CLI_DEFINE(sla_show_trunks, "Show SLA Trunks"),
 	AST_CLI_DEFINE(sla_show_stations, "Show SLA Stations"),
 };
@@ -1478,14 +1532,75 @@
 	AST_LIST_LOCK(&confs);
 	if (ast_atomic_dec_and_test(&conf->refcount)) {
 		/* Take the conference room number out of an inuse state */
-		if ((sscanf(conf->confno, "%d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024))
+		if ((sscanf(conf->confno, "%d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024)) {
 			conf_map[confno_int] = 0;
+		}
 		conf_free(conf);
 		res = 1;
 	}
 	AST_LIST_UNLOCK(&confs);
 
 	return res;
+}
+
+static int rt_extend_conf(char *confno)
+{
+	char currenttime[32];
+	char endtime[32];
+	struct timeval now;
+	struct ast_tm tm;
+	struct ast_variable *var;
+	char bookid[8]; 
+
+	if (!extendby) {
+		return 0;
+	}
+
+	now = ast_tvnow();
+
+	ast_localtime(&now, &tm, NULL);
+	ast_strftime(currenttime, sizeof(currenttime), DATE_FORMAT, &tm);
+
+	var = ast_load_realtime("meetme", "confno",
+		confno, "startTime<= ", currenttime,
+		"endtime>= ", currenttime, NULL);
+
+	/* Identify the specific RealTime conference */
+	while (var) {
+		if (!strcasecmp(var->name, "bookid")) {
+			ast_copy_string(bookid, var->value, sizeof(bookid));
+		}
+		if (!strcasecmp(var->name, "endtime")) {
+			ast_copy_string(endtime, var->value, sizeof(endtime));
+		}
+
+		var = var->next;
+	}
+	ast_variables_destroy(var);
+
+	ast_strptime(endtime, DATE_FORMAT, &tm);
+	now = ast_mktime(&tm, NULL);
+
+	now.tv_sec += extendby;
+
+	ast_localtime(&now, &tm, NULL);
+	ast_strftime(currenttime, sizeof(currenttime), DATE_FORMAT, &tm);
+	strcat(currenttime, "0"); /* Seconds needs to be 00 */
+
+	var = ast_load_realtime("meetme", "confno",
+		confno, "startTime<= ", currenttime,
+		"endtime>= ", currenttime, NULL);
+
+	/* If there is no conflict with extending the conference, update the DB */
+	if (!var) {
+		ast_debug(3, "Trying to update the endtime of Conference %s to %s\n", confno, currenttime);
+		ast_update_realtime("meetme", "bookid", bookid, "endtime", currenttime, NULL);
+		return 0;
+
+	}
+
+	ast_variables_destroy(var);
+	return -1;
 }
 
 static void conf_start_moh(struct ast_channel *chan, const char *musicclass)
@@ -2028,10 +2143,40 @@
 			ms = -1;
 			now = ast_tvnow();
 
-			if (rt_schedule) {
+			if (rt_schedule && conf->endtime) {
+				char currenttime[32];
+				long localendtime;
+				int extended = 0;
+				struct ast_tm tm;
+				struct ast_variable *var, *origvar;
+				struct timeval tmp;
+
 				if (now.tv_sec % 60 == 0) {
 					if (!checked) {
-						if (now.tv_sec > conf->endtime) {
+						ast_localtime(&now, &tm, NULL);
+						ast_strftime(currenttime, sizeof(currenttime), DATE_FORMAT, &tm);
+						var = origvar = ast_load_realtime("meetme", "confno",
+							conf->confno, "starttime <=", currenttime,
+							 "endtime >=", currenttime, NULL);
+
+						for ( ; var; var = var->next) {
+							if (!strcasecmp(var->name, "endtime")) {
+								struct ast_tm tm;
+								ast_strptime(var->value, "%Y-%m-%d %H:%M:%S", &tm);
+								tmp = ast_mktime(&tm, NULL);
+								localendtime = tmp.tv_sec;
+							}
+						}
+						ast_variables_destroy(origvar);
+
+						/* A conference can be extended from the
+						   Admin/User menu or by an external source */
+						if (localendtime > conf->endtime){
+							conf->endtime = localendtime;
+							extended = 1;
+						}
+
+						if (conf->endtime && (now.tv_sec > conf->endtime)) {
 							ast_verbose("Quitting time...\n");
 							goto outrun;
 						}
@@ -2046,27 +2191,34 @@
 								announcement_played = 1;
 							}
 						}
+
+						if (extended) {
+							announcement_played = 0;
+						}
+
 						checked = 1;
-						
 					}
 				} else {
 					checked = 0;
 				}
 			}
 
- 			if (user->kicktime && (user->kicktime <= now.tv_sec)) 
+ 			if (user->kicktime && (user->kicktime <= now.tv_sec)) {
 				break;
+			}
   
  			to = -1;
  			if (user->timelimit) {
 				int minutes = 0, seconds = 0, remain = 0;
  
  				to = ast_tvdiff_ms(nexteventts, now);
- 				if (to < 0)
+ 				if (to < 0) {
  					to = 0;
+				}
  				time_left_ms = user->timelimit - ast_tvdiff_ms(now, user->start_time);
- 				if (time_left_ms < to)
+ 				if (time_left_ms < to) {
  					to = time_left_ms;
+				}
  	
  				if (time_left_ms <= 0) {
  					if (user->end_sound) {						
@@ -2109,22 +2261,25 @@
  							}
  						}
  					}
- 					if (user->warning_freq)
+ 					if (user->warning_freq) {
  						nexteventts = ast_tvadd(nexteventts, ast_samp2tv(user->warning_freq, 1000));
- 					else
+ 					} else {
  						nexteventts = ast_tvadd(user->start_time, ast_samp2tv(user->timelimit, 1000));
+					}
  				}
  			}
 
 			now = ast_tvnow();
-			if (timeout && now.tv_sec >= timeout)
+			if (timeout && now.tv_sec >= timeout) {
 				break;
+			}
 
 			/* if we have just exited from the menu, and the user had a channel-driver
 			   volume adjustment, restore it
 			*/
-			if (!menu_active && menu_was_active && user->listen.desired && !user->listen.actual)
+			if (!menu_active && menu_was_active && user->listen.desired && !user->listen.actual) {
 				set_talk_volume(user, user->listen.desired);
+			}
 
 			menu_was_active = menu_active;
 
@@ -2136,16 +2291,20 @@
 				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) {
-						if (!ast_streamfile(chan, "conf-userwilljoin", chan->language))
+						if (!ast_streamfile(chan, "conf-userwilljoin", chan->language)) {
 							ast_waitstream(chan, "");
+						}
 					} else {
-						if (!ast_streamfile(chan, "conf-userswilljoin", chan->language))
+						if (!ast_streamfile(chan, "conf-userswilljoin", chan->language)) {
 							ast_waitstream(chan, "");
+						}
 					}
 				}
-				if (conf->users == 1 && ! (confflags & CONFFLAG_MARKEDUSER))
-					if (!ast_streamfile(chan, "conf-onlyperson", chan->language))
+				if (conf->users == 1 && ! (confflags & CONFFLAG_MARKEDUSER)) {
+					if (!ast_streamfile(chan, "conf-onlyperson", chan->language)) {
 						ast_waitstream(chan, "");
+					}
+				}
 			}
 
 			c = ast_waitfor_nandfds(&chan, 1, &fd, nfds, NULL, &outfd, &ms);
@@ -2156,12 +2315,15 @@
 			if (confflags & CONFFLAG_WAITMARKED) {
 				if (currentmarked == 0) {
 					if (lastmarked != 0) {
-						if (!(confflags & CONFFLAG_QUIET))
-							if (!ast_streamfile(chan, "conf-leaderhasleft", chan->language))
+						if (!(confflags & CONFFLAG_QUIET)) {
+							if (!ast_streamfile(chan, "conf-leaderhasleft", chan->language)) {
 								ast_waitstream(chan, "");
+							}
+						}
 						if (confflags & CONFFLAG_MARKEDEXIT) {
-							if (confflags & CONFFLAG_KICK_CONTINUE)
+							if (confflags & CONFFLAG_KICK_CONTINUE) {
 								ret = 0;
+							}
 							break;
 						} else {
 							dahdic.confmode = DAHDI_CONF_CONF;
@@ -2179,12 +2341,13 @@
 				} else if (currentmarked >= 1 && lastmarked == 0) {
 					/* Marked user entered, so cancel timeout */
 					timeout = 0;
-					if (confflags & CONFFLAG_MONITOR)
+					if (confflags & CONFFLAG_MONITOR) {
 						dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
-					else if (confflags & CONFFLAG_TALKER)
+					} else if (confflags & CONFFLAG_TALKER) {
 						dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
-					else
+					} else {
 						dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
+					}
 					if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
 						ast_log(LOG_WARNING, "Error setting conference\n");
 						close(fd);
@@ -2195,8 +2358,9 @@
 						musiconhold = 0;
 					}
 					if (!(confflags & CONFFLAG_QUIET) && !(confflags & CONFFLAG_MARKEDUSER)) {
-						if (!ast_streamfile(chan, "conf-placeintoconf", chan->language))
+						if (!ast_streamfile(chan, "conf-placeintoconf", chan->language)) {
 							ast_waitstream(chan, "");
+						}
 						conf_play(chan, conf, ENTER);
 					}
 				}
@@ -2219,10 +2383,11 @@
 			
 			/* Leave if the last marked user left */
 			if (currentmarked == 0 && lastmarked != 0 && (confflags & CONFFLAG_MARKEDEXIT)) {
-				if (confflags & CONFFLAG_KICK_CONTINUE)
+				if (confflags & CONFFLAG_KICK_CONTINUE) {
 					ret = 0;
-				else
+				} else {
 					ret = -1;
+				}
 				break;
 			}
 	
@@ -2302,8 +2467,9 @@
 			}
 
 			/* Perform an extra hangup check just in case */
-			if (ast_check_hangup(chan))
+			if (ast_check_hangup(chan)) {
 				break;
+			}
 
 			if (c) {
 				char dtmfstr[2] = "";
@@ -2319,26 +2485,30 @@
 					user->dahdichannel = !retrydahdi;
 					goto dahdiretry;
 				}
-				if ((confflags & CONFFLAG_MONITOR) || (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)))
+				if ((confflags & CONFFLAG_MONITOR) || (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED))) {
 					f = ast_read_noaudio(c);
-				else
+				} else {
 					f = ast_read(c);
-				if (!f)
+				}
+				if (!f) {
 					break;
+				}
 				if (f->frametype == AST_FRAME_DTMF) {
 					dtmfstr[0] = f->subclass;
 					dtmfstr[1] = '\0';
 				}
 
 				if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) {
-					if (user->talk.actual)
+					if (user->talk.actual) {
 						ast_frame_adjust_volume(f, user->talk.actual);
+					}
 
 					if (!(confflags & CONFFLAG_MONITOR)) {
 						int totalsilence;
 
-						if (user->talking == -1)
+						if (user->talking == -1) {
 							user->talking = 0;
+						}
 
 						res = ast_dsp_silence(dsp, f, &totalsilence);
 						if (!user->talking && totalsilence < MEETME_DELAYDETECTTALK) {
@@ -2354,7 +2524,7 @@
 						}
 						if (user->talking && totalsilence > MEETME_DELAYDETECTENDTALK) {
 							user->talking = 0;
-							if (confflags & CONFFLAG_MONITORTALKER)
+							if (confflags & CONFFLAG_MONITORTALKER) {
 								manager_event(EVENT_FLAG_CALL, "MeetmeTalking",
 								      "Channel: %s\r\n"
 								      "Uniqueid: %s\r\n"
@@ -2362,6 +2532,7 @@
 								      "Usernum: %d\r\n"
 								      "Status: off\r\n",
 								      chan->name, chan->uniqueid, conf->confno, user->user_no);
+							}
 						}
 					}
 					if (using_pseudo) {
@@ -2377,12 +2548,14 @@
 						   don't want to block, but we do want to at least *try*
 						   to write out all the samples.
 						 */
-						if (user->talking)
+						if (user->talking) {
 							careful_write(fd, f->data.ptr, f->datalen, 0);
+						}
 					}
 				} else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) {
-					if (confflags & CONFFLAG_PASS_DTMF)
+					if (confflags & CONFFLAG_PASS_DTMF) {
 						conf_queue_dtmf(conf, user, f);
+					}
 					if (ioctl(fd, DAHDI_SETCONF, &dahdic_empty)) {
 						ast_log(LOG_WARNING, "Error setting conference\n");
 						close(fd);
@@ -2393,8 +2566,9 @@
 					/* if we are entering the menu, and the user has a channel-driver
 					   volume adjustment, clear it
 					*/
-					if (!menu_active && user->talk.desired && !user->talk.actual)
+					if (!menu_active && user->talk.desired && !user->talk.actual) {
 						set_talk_volume(user, 0);
+					}
 
 					if (musiconhold) {
 			   			ast_moh_stop(chan);
@@ -2404,56 +2578,81 @@
 						if (!menu_active) {
 							menu_active = 1;
 							/* Record this sound! */
-							if (!ast_streamfile(chan, "conf-adminmenu", chan->language)) {
+							if (!ast_streamfile(chan, "conf-adminmenu-162", chan->language)) {
 								dtmf = ast_waitstream(chan, AST_DIGIT_ANY);
 								ast_stopstream(chan);
-							} else 
+							} else {
 								dtmf = 0;
-						} else 
+							}
+						} else {
 							dtmf = f->subclass;
+						}
 						if (dtmf) {
 							switch(dtmf) {
 							case '1': /* Un/Mute */
 								menu_active = 0;
 
 								/* for admin, change both admin and use flags */
-								if (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED))
+								if (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) {
 									user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
-								else
+								} else {
 									user->adminflags |= (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
+								}
 
 								if ((confflags & CONFFLAG_MONITOR) || (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED))) {
-									if (!ast_streamfile(chan, "conf-muted", chan->language))
+									if (!ast_streamfile(chan, "conf-muted", chan->language)) {
 										ast_waitstream(chan, "");
+									}
 								} else {
-									if (!ast_streamfile(chan, "conf-unmuted", chan->language))
+									if (!ast_streamfile(chan, "conf-unmuted", chan->language)) {
 										ast_waitstream(chan, "");
+									}
 								}
 								break;
 							case '2': /* Un/Lock the Conference */
 								menu_active = 0;
 								if (conf->locked) {
 									conf->locked = 0;
-									if (!ast_streamfile(chan, "conf-unlockednow", chan->language))
+									if (!ast_streamfile(chan, "conf-unlockednow", chan->language)) {
 										ast_waitstream(chan, "");
+									}
 								} else {
 									conf->locked = 1;
-									if (!ast_streamfile(chan, "conf-lockednow", chan->language))
+									if (!ast_streamfile(chan, "conf-lockednow", chan->language)) {
 										ast_waitstream(chan, "");
+									}
 								}
 								break;
 							case '3': /* Eject last user */
 								menu_active = 0;
 								usr = AST_LIST_LAST(&conf->userlist);
-								if ((usr->chan->name == chan->name)||(usr->userflags & CONFFLAG_ADMIN)) {
-									if (!ast_streamfile(chan, "conf-errormenu", chan->language))
+								if ((usr->chan->name == chan->name) || (usr->userflags & CONFFLAG_ADMIN)) {
+									if (!ast_streamfile(chan, "conf-errormenu", chan->language)) {
 										ast_waitstream(chan, "");
-								} else 
+									}
+								} else {
 									usr->adminflags |= ADMINFLAG_KICKME;
+								}
 								ast_stopstream(chan);
 								break;	
 							case '4':
 								tweak_listen_volume(user, VOL_DOWN);
+								break;
+							case '5':
+								/* Extend RT conference */
+								if (rt_schedule) {
+									if (!rt_extend_conf(conf->confno)) {
+										if (!ast_streamfile(chan, "conf-extended", chan->language)) {
+											ast_waitstream(chan, "");
+										}
+									} else {
+										if (!ast_streamfile(chan, "conf-nonextended", chan->language)) {
+											ast_waitstream(chan, "");
+										}
+									}
+									ast_stopstream(chan);
+								}
+								menu_active = 0;
 								break;
 							case '6':
 								tweak_listen_volume(user, VOL_UP);
@@ -2470,8 +2669,9 @@
 							default:
 								menu_active = 0;
 								/* Play an error message! */
-								if (!ast_streamfile(chan, "conf-errormenu", chan->language))
+								if (!ast_streamfile(chan, "conf-errormenu", chan->language)) {
 									ast_waitstream(chan, "");
+								}
 								break;
 							}
 						}
@@ -2479,15 +2679,17 @@
 						/* User menu */
 						if (!menu_active) {
 							menu_active = 1;
-							if (!ast_streamfile(chan, "conf-usermenu", chan->language)) {
+							if (!ast_streamfile(chan, "conf-usermenu-162", chan->language)) {
 								dtmf = ast_waitstream(chan, AST_DIGIT_ANY);
 								ast_stopstream(chan);
-							} else
+							} else {
 								dtmf = 0;
-						} else 
+							}
+						} else {
 							dtmf = f->subclass;
+						}
 						if (dtmf) {
-							switch(dtmf) {
+							switch (dtmf) {
 							case '1': /* Un/Mute */
 								menu_active = 0;
 
@@ -2496,24 +2698,36 @@
 
 								/* they can't override the admin mute state */
 								if ((confflags & CONFFLAG_MONITOR) || (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED))) {
-									if (!ast_streamfile(chan, "conf-muted", chan->language))
+									if (!ast_streamfile(chan, "conf-muted", chan->language)) {
 										ast_waitstream(chan, "");
+									}
 								} else {
-									if (!ast_streamfile(chan, "conf-unmuted", chan->language))
+									if (!ast_streamfile(chan, "conf-unmuted", chan->language)) {
 										ast_waitstream(chan, "");
+									}
 								}
 								break;
 							case '2':
 								menu_active = 0;
-								if (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED))
+								if (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) {
 									user->adminflags |= ADMINFLAG_T_REQUEST;
+								}
 									
-								if (user->adminflags & ADMINFLAG_T_REQUEST)
-									if (!ast_streamfile(chan, "beep", chan->language))
+								if (user->adminflags & ADMINFLAG_T_REQUEST) {
+									if (!ast_streamfile(chan, "beep", chan->language)) {
 										ast_waitstream(chan, "");
+									}
+								}
 								break;
 							case '4':
 								tweak_listen_volume(user, VOL_DOWN);
+								break;
+							case '5':
+								/* Extend RT conference */
+								if (rt_schedule) {
+									rt_extend_conf(conf->confno);
+								}
+								menu_active = 0;
 								break;
 							case '6':
 								tweak_listen_volume(user, VOL_UP);
@@ -2529,14 +2743,16 @@
 								break;
 							default:
 								menu_active = 0;
-								if (!ast_streamfile(chan, "conf-errormenu", chan->language))
+								if (!ast_streamfile(chan, "conf-errormenu", chan->language)) {
 									ast_waitstream(chan, "");
+								}
 								break;
 							}
 						}
 					}
-					if (musiconhold)
+					if (musiconhold) {
 						conf_start_moh(chan, optargs[OPT_ARG_MOH_CLASS]);
+					}
 
 					if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
 						ast_log(LOG_WARNING, "Error setting conference\n");
@@ -2546,10 +2762,11 @@
 					}
 
 					conf_flush(fd, chan);
-				/* Since this option could absorb dtmf meant for the previous (menu), we have to check this one last */
+				/* Since this option could absorb DTMF meant for the previous (menu), we have to check this one last */
 				} else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT) && ast_exists_extension(chan, exitcontext, dtmfstr, 1, "")) {
-					if (confflags & CONFFLAG_PASS_DTMF)
+					if (confflags & CONFFLAG_PASS_DTMF) {
 						conf_queue_dtmf(conf, user, f);
+					}
 
 					if (!ast_goto_if_exists(chan, exitcontext, dtmfstr, 1)) {
 						ast_debug(1, "Got DTMF %c, goto context %s\n", dtmfstr[0], exitcontext);
@@ -2562,8 +2779,9 @@
 				} else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_KEYEXIT) && (strchr(exitkeys, f->subclass))) {
 					pbx_builtin_setvar_helper(chan, "MEETME_EXIT_KEY", dtmfstr);
 						
-					if (confflags & CONFFLAG_PASS_DTMF)
+					if (confflags & CONFFLAG_PASS_DTMF) {
 						conf_queue_dtmf(conf, user, f);
+					}
 					ret = 0;
 					ast_frfree(f);
 					break;
@@ -2601,27 +2819,33 @@
 						 (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) ||
 						 (!user->talking)) ) {
 						int idx;
-						for (idx = 0; idx < AST_FRAME_BITS; idx++)
-							if (chan->rawwriteformat & (1 << idx))
+						for (idx = 0; idx < AST_FRAME_BITS; idx++) {
+							if (chan->rawwriteformat & (1 << idx)) {
 								break;
-						if (idx >= AST_FRAME_BITS)
+							}
+						}
+						if (idx >= AST_FRAME_BITS) {
 							goto bailoutandtrynormal;
+						}
 						ast_mutex_lock(&conf->listenlock);
 						if (!conf->transframe[idx]) {
 							if (conf->origframe) {
-								if (!conf->transpath[idx])
+								if (!conf->transpath[idx]) {
 									conf->transpath[idx] = ast_translator_build_path((1 << idx), AST_FORMAT_SLINEAR);
+								}
 								if (conf->transpath[idx]) {
 									conf->transframe[idx] = ast_translate(conf->transpath[idx], conf->origframe, 0);
-									if (!conf->transframe[idx])
+									if (!conf->transframe[idx]) {
 										conf->transframe[idx] = &ast_null_frame;
+									}
 								}
 							}
 						}
 						if (conf->transframe[idx]) {
  							if (conf->transframe[idx]->frametype != AST_FRAME_NULL) {
-	 							if (ast_write(chan, conf->transframe[idx]))
+	 							if (ast_write(chan, conf->transframe[idx])) {
 									ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", chan->name);
+								}
 							}
 						} else {
 							ast_mutex_unlock(&conf->listenlock);
@@ -2630,25 +2854,28 @@
 						ast_mutex_unlock(&conf->listenlock);
 					} else {
 bailoutandtrynormal:					
-						if (user->listen.actual)
+						if (user->listen.actual) {
 							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", chan->name);
 						}
 					}
-				} else 
+				} else {
 					ast_log(LOG_WARNING, "Failed to read frame: %s\n", strerror(errno));
+				}
 			}
 			lastmarked = currentmarked;
 		}
 	}
 
-	if (musiconhold)
+	if (musiconhold) {
 		ast_moh_stop(chan);
+	}
 	
-	if (using_pseudo)
+	if (using_pseudo) {
 		close(fd);
-	else {
+	} else {
 		/* Take out of conference */
 		dahdic.chan = 0;	
 		dahdic.confno = 0;
@@ -2661,16 +2888,19 @@
 	reset_volumes(user);
 
 	AST_LIST_LOCK(&confs);
-	if (!(confflags & CONFFLAG_QUIET) && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN))
+	if (!(confflags & CONFFLAG_QUIET) && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN)) {
 		conf_play(chan, conf, LEAVE);
+	}
 
 	if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) {
 		if (ast_fileexists(user->namerecloc, NULL, NULL)) {
 			if ((conf->chan) && (conf->users > 1)) {
-				if (!ast_streamfile(conf->chan, user->namerecloc, chan->language))
+				if (!ast_streamfile(conf->chan, user->namerecloc, chan->language)) {
 					ast_waitstream(conf->chan, "");
-				if (!ast_streamfile(conf->chan, "conf-hasleft", chan->language))
+				}
+				if (!ast_streamfile(conf->chan, "conf-hasleft", chan->language)) {
 					ast_waitstream(conf->chan, "");
+				}
 			}
 			ast_filedelete(user->namerecloc, NULL);
 		}
@@ -2680,8 +2910,9 @@
  outrun:
 	AST_LIST_LOCK(&confs);
 
-	if (dsp)
+	if (dsp) {
 		ast_dsp_free(dsp);
+	}
 	
 	if (user->user_no) { /* Only cleanup users who really joined! */
 		now = ast_tvnow();
@@ -2716,16 +2947,18 @@
 					NULL);
 				ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
 			}
-			if (confflags & CONFFLAG_MARKEDUSER) 
+			if (confflags & CONFFLAG_MARKEDUSER) {
 				conf->markedusers--;
+			}
 		}
 		/* Remove ourselves from the list */
 		AST_LIST_REMOVE(&conf->userlist, user, list);
 
 		/* Change any states */
-		if (!conf->users)
+		if (!conf->users) {
 			ast_devstate_changed(AST_DEVICE_NOT_INUSE, "meetme:%s", conf->confno);
-		
+		}
+
 		/* Return the number of seconds the user was in the conf */
 		snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
 		pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
@@ -2738,9 +2971,9 @@
 
 static struct ast_conference *find_conf_realtime(struct ast_channel *chan, char *confno, int make, int dynamic,
 				char *dynamic_pin, size_t pin_buf_len, int refcount, struct ast_flags *confflags,
-				char *optargs[], int *too_early)
-{
-	struct ast_variable *var;
+				char *useropts, char *adminopts, int *too_early)
+{
+	struct ast_variable *var, *origvar;
 	struct ast_conference *cnf;
 
 	*too_early = 0;
@@ -2762,8 +2995,6 @@
 		struct timeval now;
 		char currenttime[19] = "";
 		char eatime[19] = "";
-		char useropts[32] = "";
-		char adminopts[32] = "";
 		struct ast_tm tm, etm;
 		struct timeval endtime = { .tv_sec = 0 };
 
@@ -2798,12 +3029,14 @@
 				var = ast_load_realtime("meetme", "confno",
 					confno, "starttime <= ", eatime, "endtime >= ",
 					currenttime, NULL);
-				if (var)
+				if (var) {
 					*too_early = 1;
-			}
-
-		} else
+				}
+			}
+
+		} else {
 			 var = ast_load_realtime("meetme", "confno", confno, NULL);
+		}
 
 		if (!var)
 			return NULL;
@@ -2816,35 +3049,25 @@
 			return NULL;
 		}
 
-		while (var) {
+		for (origvar = var; var; var = var->next) {
 			if (!strcasecmp(var->name, "pin")) {
 				pin = ast_strdupa(var->value);
 			} else if (!strcasecmp(var->name, "adminpin")) {
 				pinadmin = ast_strdupa(var->value);
 			} else if (!strcasecmp(var->name, "opts")) {
-				ast_copy_string(useropts, var->value, sizeof(useropts));
+				ast_copy_string(useropts, var->value, sizeof(char[OPTIONS_LEN]));
 			} else if (!strcasecmp(var->name, "maxusers")) {
 				maxusers = atoi(var->value);
 			} else if (!strcasecmp(var->name, "adminopts")) {
-				ast_copy_string(adminopts, var->value, sizeof(adminopts));
+				ast_copy_string(adminopts, var->value, sizeof(char[OPTIONS_LEN]));
 			} else if (!strcasecmp(var->name, "endtime")) {
-				union {
-					struct ast_tm atm;
-					struct tm tm;
-				} t = { { 0, }, };
-				strptime(var->value, "%Y-%m-%d %H:%M:%S", &t.tm);
-				/* strptime does not determine if a time is
-				 * in DST or not.  Set tm_isdst to -1 to 
-				 * allow ast_mktime to adjust for DST 
-				 * if needed */
-				t.tm.tm_isdst = -1; 
-				endtime = ast_mktime(&t.atm, NULL);
-			}
-
-			var = var->next;
-		}
-
-		ast_variables_destroy(var);
+				struct ast_tm tm;
+				ast_strptime(var->value, "%Y-%m-%d %H:%M:%S", &tm);
+				endtime = ast_mktime(&tm, NULL);
+			}
+		}
+
+		ast_variables_destroy(origvar);
 
 		cnf = build_conf(confno, pin ? pin : "", pinadmin ? pinadmin : "", make, dynamic, refcount, chan);
 
@@ -2952,8 +3175,9 @@
 		/* Correct for the user selecting 'D' instead of 'd' to have
 		   someone join into a conference that has already been created
 		   with a pin. */
-		if (dynamic_pin[0] == 'q')
+		if (dynamic_pin[0] == 'q') {
 			dynamic_pin[0] = '\0';
+		}
 	}
 
 	if (cnf) {
@@ -3011,8 +3235,9 @@
 		snprintf(val, sizeof(val), "%d", count);
 		pbx_builtin_setvar_helper(chan, args.varname, val);
 	} else {
-		if (chan->_state != AST_STATE_UP)
+		if (chan->_state != AST_STATE_UP) {
 			ast_answer(chan);
+		}
 		res = ast_say_number(chan, count, "", chan->language, (char *) NULL); /* Needs gender */
 	}
 
@@ -3170,13 +3395,16 @@
 			}
 		}
 		if (!ast_strlen_zero(confno)) {
+			char useropts[OPTIONS_LEN];
+			char adminopts[OPTIONS_LEN];
 			/* Check the validity of the conference */
 			cnf = find_conf(chan, confno, 1, dynamic, the_pin, 
 				sizeof(the_pin), 1, &confflags);
 			if (!cnf) {
 				int too_early = 0;
+
 				cnf = find_conf_realtime(chan, confno, 1, dynamic, 
-					the_pin, sizeof(the_pin), 1, &confflags, optargs, &too_early);
+					the_pin, sizeof(the_pin), 1, &confflags, useropts, adminopts, &too_early);
 				if (rt_schedule && too_early)
 					allowretry = 0;
 			}

[... 4788 lines stripped ...]



More information about the svn-commits mailing list