[asterisk-commits] russell: branch russell/chan_refcount r89497 - in /team/russell/chan_refcount...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 21 13:29:34 CST 2007


Author: russell
Date: Wed Nov 21 13:29:32 2007
New Revision: 89497

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89497
Log:
resolve some conflicts and get the branch compiling again

Added:
    team/russell/chan_refcount/doc/tex/backtrace.tex
      - copied unchanged from r87187, trunk/doc/tex/backtrace.tex
Modified:
    team/russell/chan_refcount/   (props changed)
    team/russell/chan_refcount/CHANGES
    team/russell/chan_refcount/LICENSE
    team/russell/chan_refcount/Makefile
    team/russell/chan_refcount/UPGRADE.txt
    team/russell/chan_refcount/apps/app_controlplayback.c
    team/russell/chan_refcount/apps/app_dial.c
    team/russell/chan_refcount/apps/app_meetme.c
    team/russell/chan_refcount/apps/app_minivm.c
    team/russell/chan_refcount/apps/app_mixmonitor.c
    team/russell/chan_refcount/apps/app_osplookup.c
    team/russell/chan_refcount/apps/app_playback.c
    team/russell/chan_refcount/apps/app_queue.c
    team/russell/chan_refcount/apps/app_read.c
    team/russell/chan_refcount/apps/app_rpt.c
    team/russell/chan_refcount/apps/app_voicemail.c
    team/russell/chan_refcount/apps/app_zapateller.c
    team/russell/chan_refcount/channels/chan_agent.c
    team/russell/chan_refcount/channels/chan_alsa.c
    team/russell/chan_refcount/channels/chan_features.c
    team/russell/chan_refcount/channels/chan_gtalk.c
    team/russell/chan_refcount/channels/chan_h323.c
    team/russell/chan_refcount/channels/chan_iax2.c
    team/russell/chan_refcount/channels/chan_jingle.c
    team/russell/chan_refcount/channels/chan_local.c
    team/russell/chan_refcount/channels/chan_mgcp.c
    team/russell/chan_refcount/channels/chan_misdn.c
    team/russell/chan_refcount/channels/chan_oss.c
    team/russell/chan_refcount/channels/chan_sip.c
    team/russell/chan_refcount/channels/chan_skinny.c
    team/russell/chan_refcount/channels/chan_usbradio.c
    team/russell/chan_refcount/channels/chan_zap.c
    team/russell/chan_refcount/channels/iax2-provision.c
    team/russell/chan_refcount/channels/misdn/isdn_lib.c
    team/russell/chan_refcount/channels/misdn/isdn_lib.h
    team/russell/chan_refcount/channels/misdn/isdn_msg_parser.c
    team/russell/chan_refcount/channels/xpmr/xpmr.c
    team/russell/chan_refcount/codecs/codec_zap.c
    team/russell/chan_refcount/configs/dundi.conf.sample
    team/russell/chan_refcount/configs/features.conf.sample
    team/russell/chan_refcount/configs/meetme.conf.sample
    team/russell/chan_refcount/configs/queues.conf.sample
    team/russell/chan_refcount/configs/zapata.conf.sample
    team/russell/chan_refcount/configure
    team/russell/chan_refcount/configure.ac
    team/russell/chan_refcount/doc/PEERING
    team/russell/chan_refcount/doc/asterisk-mib.txt
    team/russell/chan_refcount/doc/tex/ael.tex
    team/russell/chan_refcount/doc/tex/ajam.tex
    team/russell/chan_refcount/doc/tex/app-sms.tex
    team/russell/chan_refcount/doc/tex/asterisk.tex
    team/russell/chan_refcount/doc/tex/billing.tex
    team/russell/chan_refcount/doc/tex/cdrdriver.tex
    team/russell/chan_refcount/doc/tex/channelvariables.tex
    team/russell/chan_refcount/doc/tex/cliprompt.tex
    team/russell/chan_refcount/doc/tex/configuration.tex
    team/russell/chan_refcount/doc/tex/dundi.tex
    team/russell/chan_refcount/doc/tex/enum.tex
    team/russell/chan_refcount/doc/tex/extensions.tex
    team/russell/chan_refcount/doc/tex/ices.tex
    team/russell/chan_refcount/doc/tex/imapstorage.tex
    team/russell/chan_refcount/doc/tex/jitterbuffer.tex
    team/russell/chan_refcount/doc/tex/localchannel.tex
    team/russell/chan_refcount/doc/tex/manager.tex
    team/russell/chan_refcount/doc/tex/misdn.tex
    team/russell/chan_refcount/doc/tex/odbcstorage.tex
    team/russell/chan_refcount/doc/tex/privacy.tex
    team/russell/chan_refcount/doc/tex/qos.tex
    team/russell/chan_refcount/doc/tex/queuelog.tex
    team/russell/chan_refcount/doc/tex/queues-with-callback-members.tex
    team/russell/chan_refcount/doc/tex/realtime.tex
    team/russell/chan_refcount/doc/tex/security.tex
    team/russell/chan_refcount/doc/tex/sla.tex
    team/russell/chan_refcount/funcs/func_callerid.c
    team/russell/chan_refcount/funcs/func_curl.c
    team/russell/chan_refcount/funcs/func_cut.c
    team/russell/chan_refcount/funcs/func_devstate.c
    team/russell/chan_refcount/funcs/func_logic.c
    team/russell/chan_refcount/funcs/func_strings.c
    team/russell/chan_refcount/funcs/func_vmcount.c
    team/russell/chan_refcount/include/asterisk/app.h
    team/russell/chan_refcount/include/asterisk/channel.h
    team/russell/chan_refcount/include/asterisk/cli.h
    team/russell/chan_refcount/include/asterisk/compat.h
    team/russell/chan_refcount/include/asterisk/linkedlists.h
    team/russell/chan_refcount/include/asterisk/lock.h
    team/russell/chan_refcount/include/asterisk/logger.h
    team/russell/chan_refcount/include/asterisk/pval.h
    team/russell/chan_refcount/include/asterisk/strings.h
    team/russell/chan_refcount/main/Makefile
    team/russell/chan_refcount/main/acl.c
    team/russell/chan_refcount/main/app.c
    team/russell/chan_refcount/main/ast_expr2.c
    team/russell/chan_refcount/main/ast_expr2.h
    team/russell/chan_refcount/main/ast_expr2.y
    team/russell/chan_refcount/main/ast_expr2f.c
    team/russell/chan_refcount/main/asterisk.c
    team/russell/chan_refcount/main/astmm.c
    team/russell/chan_refcount/main/astobj2.c
    team/russell/chan_refcount/main/cdr.c
    team/russell/chan_refcount/main/channel.c
    team/russell/chan_refcount/main/cli.c
    team/russell/chan_refcount/main/config.c
    team/russell/chan_refcount/main/db.c
    team/russell/chan_refcount/main/dnsmgr.c
    team/russell/chan_refcount/main/file.c
    team/russell/chan_refcount/main/frame.c
    team/russell/chan_refcount/main/http.c
    team/russell/chan_refcount/main/image.c
    team/russell/chan_refcount/main/loader.c
    team/russell/chan_refcount/main/logger.c
    team/russell/chan_refcount/main/manager.c
    team/russell/chan_refcount/main/pbx.c
    team/russell/chan_refcount/main/rtp.c
    team/russell/chan_refcount/main/say.c
    team/russell/chan_refcount/main/stdtime/localtime.c
    team/russell/chan_refcount/main/term.c
    team/russell/chan_refcount/main/threadstorage.c
    team/russell/chan_refcount/main/translate.c
    team/russell/chan_refcount/main/udptl.c
    team/russell/chan_refcount/main/utils.c
    team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-ntest22
    team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test16
    team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test19
    team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test2
    team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test3
    team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test4
    team/russell/chan_refcount/pbx/dundi-parser.c
    team/russell/chan_refcount/pbx/pbx_ael.c
    team/russell/chan_refcount/pbx/pbx_config.c
    team/russell/chan_refcount/pbx/pbx_dundi.c
    team/russell/chan_refcount/pbx/pbx_realtime.c
    team/russell/chan_refcount/res/ael/ael.flex
    team/russell/chan_refcount/res/ael/ael.tab.c
    team/russell/chan_refcount/res/ael/ael.tab.h
    team/russell/chan_refcount/res/ael/ael.y
    team/russell/chan_refcount/res/ael/ael_lex.c
    team/russell/chan_refcount/res/ael/pval.c
    team/russell/chan_refcount/res/res_agi.c
    team/russell/chan_refcount/res/res_clioriginate.c
    team/russell/chan_refcount/res/res_config_pgsql.c
    team/russell/chan_refcount/res/res_config_sqlite.c
    team/russell/chan_refcount/res/res_convert.c
    team/russell/chan_refcount/res/res_crypto.c
    team/russell/chan_refcount/res/res_features.c
    team/russell/chan_refcount/res/res_indications.c
    team/russell/chan_refcount/res/res_jabber.c
    team/russell/chan_refcount/res/res_limit.c
    team/russell/chan_refcount/res/res_musiconhold.c
    team/russell/chan_refcount/res/res_odbc.c
    team/russell/chan_refcount/res/res_realtime.c
    team/russell/chan_refcount/res/res_smdi.c
    team/russell/chan_refcount/utils/ael_main.c
    team/russell/chan_refcount/utils/clicompat.c
    team/russell/chan_refcount/utils/conf2ael.c

Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Nov 21 13:29:32 2007
@@ -1,1 +1,1 @@
-/trunk:1-85454
+/trunk:1-87200

Modified: team/russell/chan_refcount/CHANGES
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/CHANGES?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/CHANGES (original)
+++ team/russell/chan_refcount/CHANGES Wed Nov 21 13:29:32 2007
@@ -179,6 +179,11 @@
      This is a very useful feature in combination with the 'X' option to ChanSpy.
   * Added 'C' option to Meetme which causes a caller to continue in the dialplan
      when kicked out.
+  * Added new RealTime functionality to provide support for scheduled conferencing.
+     This includes optional messages to the caller if they attempt to join before
+     the schedule start time, or to allow the caller to join the conference early.
+     Also included is optional support for limiting the number of callers per
+     RealTime conference.
 
 Music On Hold Changes
 ---------------------
@@ -295,3 +300,5 @@
      SIP call to Voicemail by putting a Local channel in the middle.  This
      feature is enabled by using the 'j' option in the Dial string to the Local
      channel in conjunction with the existing 'n' option for local channels.
+  * Added support for reading the TOUCH_MONITOR_PREFIX channel variable.
+     It allows you to configure a prefix for auto-monitor recordings.

Modified: team/russell/chan_refcount/LICENSE
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/LICENSE?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/LICENSE (original)
+++ team/russell/chan_refcount/LICENSE Wed Nov 21 13:29:32 2007
@@ -57,14 +57,13 @@
 If you have any questions regarding our licensing policy, please
 contact us:
 
-+1.877.546.8963 (via telephone in the USA)
++1.877.344.4861 (via telephone in the USA)
 +1.256.428.6000 (via telephone outside the USA)
 +1.256.864.0464 (via FAX inside or outside the USA)
 IAX2/misery.digium.com/6000 (via IAX2)
 licensing at digium.com (via email)
 
 Digium, Inc.
-150 West Park Loop
-Suite 100
+445 Jan Davis Drive
 Huntsville, AL  35806
 USA

Modified: team/russell/chan_refcount/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/Makefile?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/Makefile (original)
+++ team/russell/chan_refcount/Makefile Wed Nov 21 13:29:32 2007
@@ -577,6 +577,17 @@
 		echo ";internal_timing = yes" ; \
 		echo ";systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues" ; \
 		echo ";autosystemname = yes ; automatically set systemname to hostname - uses 'localhost' on failure, or systemname if set" ; \
+		echo ";maxcalls = 10 ; Maximum amount of calls allowed" ; \
+		echo ";maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit" ; \
+		echo ";maxfiles = 1000 ; Maximum amount of openfiles" ; \
+		echo ";minmemfree = 1 ; in MBs, Asterisk stops accepting new calls if the amount of free memory falls below this watermark" ; \
+		echo ";cache_record_files = yes ; Cache recorded sound files to another directory during recording" ; \
+		echo ";record_cache_dir = /tmp ; Specify cache directory (used in cnjunction with cache_record_files)" ; \
+		echo ";transmit_silence_during_record = yes ; Transmit SLINEAR silence while a channel is being recorded" ; \
+		echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
+		echo ";runuser = asterisk ; The user to run as" ; \
+		echo ";rungroup = asterisk ; The group to run as" ; \
+		echo "" ; \
 		echo "; Changing the following lines may compromise your security." ; \
 		echo ";[files]" ; \
 		echo ";astctlpermissions = 0660" ; \
@@ -637,20 +648,20 @@
 config:
 	@if [ "${OSARCH}" = "linux-gnu" ]; then \
 		if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
-			$(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
-			/sbin/chkconfig --add asterisk; \
+			$(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
+			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
 		elif [ -f /etc/debian_version ]; then \
-			$(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk /etc/init.d/asterisk; \
-			/usr/sbin/update-rc.d asterisk start 10 2 3 4 5 . stop 91 2 3 4 5 .; \
+			$(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk $(DESTDIR)/etc/init.d/asterisk; \
+			if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 10 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
 		elif [ -f /etc/gentoo-release ]; then \
-			$(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk /etc/init.d/asterisk; \
-			/sbin/rc-update add asterisk default; \
+			$(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk $(DESTDIR)/etc/init.d/asterisk; \
+			if [ -z "$(DESTDIR)" ]; then /sbin/rc-update add asterisk default; fi; \
 		elif [ -f /etc/mandrake-release ]; then \
-			$(INSTALL) -m 755 contrib/init.d/rc.mandrake.asterisk /etc/rc.d/init.d/asterisk; \
-			/sbin/chkconfig --add asterisk; \
+			$(INSTALL) -m 755 contrib/init.d/rc.mandrake.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
+			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
 		elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
-			$(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk /etc/init.d/asterisk; \
-			/sbin/chkconfig --add asterisk; \
+			$(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk $(DESTDIR)/etc/init.d/asterisk; \
+			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
 		elif [ -f /etc/slackware-version ]; then \
 			echo "Slackware is not currently supported, although an init script does exist for it." \
 		else \

Modified: team/russell/chan_refcount/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/UPGRADE.txt?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/UPGRADE.txt (original)
+++ team/russell/chan_refcount/UPGRADE.txt Wed Nov 21 13:29:32 2007
@@ -1,11 +1,5 @@
 Information for Upgrading From Previous Asterisk Releases
 =========================================================
-
-Manager:
-
-* The CallerID fields across Manager events have now been made more
-  consistent. CallerID Number will be sent as CallerIDNum and CallerID
-  Name will be sent as CallerIDName wherever used.
 
 AEL:
 
@@ -113,7 +107,17 @@
   semicolon, in order to make the Local channel driver compatible with the comma
   delimiter change in applications.
 
+Configuration:
+
+* pbx_dundi.c: tos parameter changed to use new values. Old values like lowdelay,
+  lowcost and other is not acceptable now. Look into qos.tex for description of 
+  this parameter.
+
 Manager:
+
+* The CallerID fields across Manager events have now been made more
+  consistent. CallerID Number will be sent as CallerIDNum and CallerID
+  Name will be sent as CallerIDName wherever used.
 
 * The IAXpeers command output has been changed to more closely resemble the
   output of the SIPpeers command.

Modified: team/russell/chan_refcount/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_controlplayback.c?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/apps/app_controlplayback.c (original)
+++ team/russell/chan_refcount/apps/app_controlplayback.c Wed Nov 21 13:29:32 2007
@@ -142,7 +142,7 @@
 	res = ast_control_streamfile(chan, args.filename, args.fwd, args.rev, args.stop, args.pause, args.restart, skipms, &offsetms);
 
 	/* If we stopped on one of our stop keys, return 0  */
-	if (args.stop && strchr(args.stop, res)) {
+	if (res > 0 && args.stop && strchr(args.stop, res)) {
 		res = 0;
 		pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "USERSTOPPED");
 	} else {

Modified: team/russell/chan_refcount/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_dial.c?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/apps/app_dial.c (original)
+++ team/russell/chan_refcount/apps/app_dial.c Wed Nov 21 13:29:32 2007
@@ -1405,6 +1405,7 @@
 		tc->cid.cid_pres = chan->cid.cid_pres;
 		tc->cid.cid_ton = chan->cid.cid_ton;
 		tc->cid.cid_tns = chan->cid.cid_tns;
+		tc->cid.cid_ani2 = chan->cid.cid_ani2;
 		tc->adsicpe = chan->adsicpe;
 		tc->transfercapability = chan->transfercapability;
 

Modified: team/russell/chan_refcount/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_meetme.c?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/apps/app_meetme.c (original)
+++ team/russell/chan_refcount/apps/app_meetme.c Wed Nov 21 13:29:32 2007
@@ -76,10 +76,15 @@
 /*! each buffer is 20ms, so this is 640ms total */
 #define DEFAULT_AUDIO_BUFFERS  32
 
+/*! String format for scheduled conferences */
+#define DATE_FORMAT "%Y-%m-%d %H:%M:%S"
+
 enum {
 	ADMINFLAG_MUTED =     (1 << 1), /*!< User is muted */
 	ADMINFLAG_SELFMUTED = (1 << 2), /*!< User muted self */
-	ADMINFLAG_KICKME =    (1 << 3)  /*!< User has been kicked */
+	ADMINFLAG_KICKME =    (1 << 3),  /*!< User has been kicked */
+	/*! User has requested to speak */
+	ADMINFLAG_T_REQUEST = (1 << 4),
 };
 
 #define MEETME_DELAYDETECTTALK     300
@@ -210,6 +215,15 @@
 static const char *slastation_synopsis = "Shared Line Appearance Station";
 static const char *slatrunk_synopsis = "Shared Line Appearance Trunk";
 
+/* Lookup RealTime conferences based on confno and current time */
+static int rt_schedule;
+static int fuzzystart;
+static int earlyalert;
+static int endalert;
+
+/* Log participant count to the RealTime backend */
+static int rt_log_members;
+
 static const char *descrip =
 "  MeetMe([confno][,[options][,pin]]): Enters the user into a specified MeetMe\n"
 "conference.  If the conference number is omitted, the user will be prompted\n"
@@ -337,6 +351,8 @@
 	int zapconf;                            /*!< Zaptel Conf # */
 	int users;                              /*!< Number of active users */
 	int markedusers;                        /*!< Number of marked users */
+	int maxusers;				/*!< Participant limit if scheduled */
+	int endalert;				/*!< When to play conf ending message */
 	time_t start;                           /*!< Start time (s) */
 	int refcount;                           /*!< reference count of usage */
 	enum recording_state recording:2;       /*!< recording status */
@@ -350,6 +366,7 @@
 	char pin[MAX_PIN];                      /*!< If protected by a PIN */
 	char pinadmin[MAX_PIN];                 /*!< If protected by a admin PIN */
 	char uniqueid[32];
+	char endtime[19];			/*!< When to end the conf if scheduled */
 	struct ast_frame *transframe[32];
 	struct ast_frame *origframe;
 	struct ast_trans_pvt *transpath[32];
@@ -828,6 +845,7 @@
 
 	/* Fill the conference struct */
 	cnf->start = time(NULL);
+	cnf->maxusers = 0x7fffffff;
 	cnf->isdynamic = dynamic ? 1 : 0;
 	ast_verb(3, "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
 	AST_LIST_INSERT_HEAD(&confs, cnf, list);
@@ -1034,7 +1052,7 @@
 			min = ((now - user->jointime) % 3600) / 60;
 			sec = (now - user->jointime) % 60;
 			if ( !concise )
-				ast_cli(a->fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %02d:%02d:%02d\n",
+				ast_cli(a->fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %s %02d:%02d:%02d\n",
 					user->user_no,
 					S_OR(user->chan->cid.cid_num, "<unknown>"),
 					S_OR(user->chan->cid.cid_name, "<no name>"),
@@ -1042,9 +1060,10 @@
 					user->userflags & CONFFLAG_ADMIN ? "(Admin)" : "",
 					user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
 					user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : user->adminflags & ADMINFLAG_SELFMUTED ? "(Muted)" : "",
+					user->adminflags & ADMINFLAG_T_REQUEST ? "(Request to Talk)" : "",
 					istalking(user->talking), hr, min, sec); 
 			else 
-				ast_cli(a->fd, "%d!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
+				ast_cli(a->fd, "%d!%s!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
 					user->user_no,
 					S_OR(user->chan->cid.cid_num, ""),
 					S_OR(user->chan->cid.cid_name, ""),
@@ -1052,6 +1071,7 @@
 					user->userflags  & CONFFLAG_ADMIN   ? "1" : "",
 					user->userflags  & CONFFLAG_MONITOR ? "1" : "",
 					user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)  ? "1" : "",
+					user->adminflags & ADMINFLAG_T_REQUEST ? "1" : "",
 					user->talking, hr, min, sec);
 			
 		}
@@ -1228,9 +1248,9 @@
 }
 
 static struct ast_cli_entry cli_meetme[] = {
-	NEW_CLI(meetme_cmd, "Execute a command on a conference or conferee"),
-	NEW_CLI(sla_show_trunks, "Show SLA Trunks"),
-	NEW_CLI(sla_show_stations, "Show SLA Stations"),
+	AST_CLI_DEFINE(meetme_cmd, "Execute a command on a conference or conferee"),
+	AST_CLI_DEFINE(sla_show_trunks, "Show SLA Trunks"),
+	AST_CLI_DEFINE(sla_show_stations, "Show SLA Stations"),
 };
 
 static void conf_flush(int fd, struct ast_channel *chan)
@@ -1429,11 +1449,14 @@
 	int ret = -1;
 	int x;
 	int menu_active = 0;
+	int talkreq_manager = 0;
 	int using_pseudo = 0;
 	int duration=20;
 	int hr, min, sec;
 	int sent_event = 0;
-	time_t now;
+	int checked = 0;
+	int announcement_played = 0;
+	struct timeval now;
 	struct ast_dsp *dsp=NULL;
 	struct ast_app *app;
 	const char *agifile;
@@ -1521,6 +1544,14 @@
 	else
 		user->user_no = AST_LIST_LAST(&conf->userlist)->user_no + 1;
 
+	if (rt_schedule && conf->maxusers)
+		if (user->user_no > conf->maxusers){
+			/* Sorry, but this confernce has reached the participant limit! */	
+			if (!ast_streamfile(chan, "conf-full", chan->language))
+				ast_waitstream(chan, "");
+			goto outrun;
+		}
+
 	AST_LIST_INSERT_TAIL(&conf->userlist, user, list);
 
 	user->chan = chan;
@@ -1528,10 +1559,11 @@
 	user->adminflags = (confflags & CONFFLAG_STARTMUTED) ? ADMINFLAG_SELFMUTED : 0;
 	user->talking = -1;
 	conf->users++;
-	/* Update table */
-	snprintf(members, sizeof(members), "%d", conf->users);
-	ast_update_realtime("meetme", "confno", conf->confno, "members", members , NULL);
-
+	if (rt_log_members) {
+		/* Update table */
+		snprintf(members, sizeof(members), "%d", conf->users);
+		ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
+	}
 	/* This device changed state now - if this is the first user */
 	if (conf->users == 1)
 		ast_devstate_changed(AST_DEVICE_INUSE, "meetme:%s", conf->confno);
@@ -1775,8 +1807,44 @@
 			ast_log(LOG_WARNING, "Unable to allocate DSP!\n");
 			res = -1;
 		}
-		for(;;) {
+		for (;;) {
 			int menu_was_active = 0;
+
+			if (rt_schedule) {
+				char currenttime[32];
+				struct ast_tm tm;
+
+				now = ast_tvnow();
+				if (now.tv_sec % 60 == 0) {
+					if (!checked) {
+						ast_localtime(&now, &tm, NULL);
+						ast_strftime(currenttime, sizeof(currenttime), DATE_FORMAT, &tm);
+						if (strcmp(currenttime, conf->endtime) > 0){
+							ast_verbose("Quitting time...\n");
+							goto outrun;
+						}
+
+						if (!announcement_played && conf->endalert) {
+							now.tv_sec += conf->endalert; 
+							ast_localtime(&now, &tm, NULL);
+							ast_strftime(currenttime, sizeof(currenttime), DATE_FORMAT, &tm);
+							if (strcmp(currenttime, conf->endtime) > 0){
+								if (!ast_streamfile(chan, "conf-will-end-in", chan->language))
+									ast_waitstream(chan, "");
+								ast_say_digits(chan, conf->endalert / 60, "", chan->language);
+								if (!ast_streamfile(chan, "minutes", chan->language))
+									ast_waitstream(chan, "");
+								announcement_played = 1;
+
+							}
+						}
+						checked = 1;
+						
+					}
+				} else {
+					checked = 0;
+				}
+			}
 
 			outfd = -1;
 			ms = -1;
@@ -1928,7 +1996,33 @@
 						"Status: off\r\n",
 						chan->name, chan->uniqueid, conf->confno, user->user_no);
 			}
-
+			
+			if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && 
+				(user->adminflags & ADMINFLAG_T_REQUEST) && !(talkreq_manager)) {
+				talkreq_manager = 1;
+
+				manager_event(EVENT_FLAG_CALL, "MeetmeTalkRequest", 
+					      "Channel: %s\r\n"
+							      "Uniqueid: %s\r\n"
+							      "Meetme: %s\r\n"
+							      "Usernum: %i\r\n"
+							      "Status: on\r\n",
+							      chan->name, chan->uniqueid, conf->confno, user->user_no);
+			}
+
+			
+			if (!(user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && 
+				!(user->adminflags & ADMINFLAG_T_REQUEST) && (talkreq_manager)) {
+				talkreq_manager = 0;
+				manager_event(EVENT_FLAG_CALL, "MeetmeTalkRequest", 
+					      "Channel: %s\r\n"
+							      "Uniqueid: %s\r\n"
+							      "Meetme: %s\r\n"
+							      "Usernum: %i\r\n"
+							      "Status: off\r\n",
+							     chan->name, chan->uniqueid, conf->confno, user->user_no);
+			}
+			
 			/* If I have been kicked, exit the conference */
 			if (user->adminflags & ADMINFLAG_KICKME) {
 				//You have been kicked.
@@ -2163,6 +2257,15 @@
 									if (!ast_streamfile(chan, "conf-unmuted", chan->language))
 										ast_waitstream(chan, "");
 								}
+								break;
+							case '2':
+								menu_active = 0;
+								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))
+										ast_waitstream(chan, "");
 								break;
 							case '4':
 								tweak_listen_volume(user, VOL_DOWN);
@@ -2315,10 +2418,10 @@
 		ast_dsp_free(dsp);
 	
 	if (user->user_no) { /* Only cleanup users who really joined! */
-		now = time(NULL);
-		hr = (now - user->jointime) / 3600;
-		min = ((now - user->jointime) % 3600) / 60;
-		sec = (now - user->jointime) % 60;
+		now = ast_tvnow();
+		hr = (now.tv_sec - user->jointime) / 3600;
+		min = ((now.tv_sec - user->jointime) % 3600) / 60;
+		sec = (now.tv_sec - user->jointime) % 60;
 
 		if (sent_event) {
 			manager_event(EVENT_FLAG_CALL, "MeetmeLeave",
@@ -2333,13 +2436,15 @@
 				      user->user_no,
 				      S_OR(user->chan->cid.cid_num, "<unknown>"),
 				      S_OR(user->chan->cid.cid_name, "<unknown>"),
-				      (long)(now - user->jointime));
+				      (long)(now.tv_sec - user->jointime));
 		}
 
 		conf->users--;
-		/* Update table */
-		snprintf(members, sizeof(members), "%d", conf->users);
-		ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
+		if (rt_log_members){
+			/* Update table */
+			snprintf(members, sizeof(members), "%d", conf->users);
+			ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
+		}
 		if (confflags & CONFFLAG_MARKEDUSER) 
 			conf->markedusers--;
 		/* Remove ourselves from the list */
@@ -2360,10 +2465,13 @@
 }
 
 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 *dynamic_pin, size_t pin_buf_len, int refcount, struct ast_flags *confflags,
+				char *optargs[], int *too_early)
 {
 	struct ast_variable *var;
 	struct ast_conference *cnf;
+
+	*too_early = 0;
 
 	/* Check first in the conference list */
 	AST_LIST_LOCK(&confs);
@@ -2378,8 +2486,40 @@
 
 	if (!cnf) {
 		char *pin = NULL, *pinadmin = NULL; /* For temp use */
-		
-		var = ast_load_realtime("meetme", "confno", confno, NULL);
+		int maxusers = 0;
+		struct timeval now;
+		char currenttime[19] = "";
+		char startTime[19] = "";
+		char endtime[19] = "";
+		char eatime[19] = "";
+		char userOpts[32] = "";
+		char adminOpts[32] = "";
+		struct ast_tm tm, etm;
+
+		if (rt_schedule){
+			now = ast_tvnow();
+
+			if (fuzzystart)
+				now.tv_sec += fuzzystart;
+
+			ast_localtime(&now, &tm, NULL);
+			ast_strftime(currenttime, sizeof(currenttime), DATE_FORMAT, &tm);
+
+			if (earlyalert){
+				now.tv_sec += earlyalert;
+				ast_localtime(&now, &etm, NULL);
+				ast_strftime(eatime, sizeof(eatime), DATE_FORMAT, &etm);
+			} else {
+				ast_copy_string(eatime, currenttime, sizeof(eatime));
+			}
+
+			ast_debug(1, "Looking for conference %s that starts after %s\n", confno, eatime);
+
+			var = ast_load_realtime("meetme", "confno",
+				confno, "startTime<= ", eatime, "endtime>= ",
+				currenttime, NULL);
+		} else
+			 var = ast_load_realtime("meetme", "confno", confno, NULL);
 
 		if (!var)
 			return NULL;
@@ -2389,12 +2529,39 @@
 				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));
+			} else if (!strcasecmp(var->name, "maxusers")) {
+				maxusers = atoi(var->value);
+			} else if (!strcasecmp(var->name, "adminopts")) {
+				ast_copy_string(adminOpts, var->value, sizeof(adminOpts));
+			} else if (!strcasecmp(var->name, "endtime")) {
+				ast_copy_string(endtime, var->value, sizeof(endtime));
+			} else if (!strcasecmp(var->name, "starttime")) {
+				ast_copy_string(startTime, var->value, sizeof(startTime));
 			}
+
 			var = var->next;
 		}
 		ast_variables_destroy(var);
-		
+
+		if (earlyalert) {
+			if (strcmp(startTime, currenttime) > 0) {
+				/* Announce that the caller is early and exit */
+				if (!ast_streamfile(chan, "conf-has-not-started", chan->language))
+					 ast_waitstream(chan, "");
+				*too_early = 1;
+				return NULL;
+			}
+		}
+
 		cnf = build_conf(confno, pin ? pin : "", pinadmin ? pinadmin : "", make, dynamic, refcount, chan);
+
+		if (cnf) {
+			cnf->maxusers = maxusers;
+			cnf->endalert = endalert;
+			ast_copy_string(cnf->endtime, endtime, sizeof(cnf->endtime));
+		}
 	}
 
 	if (cnf) {
@@ -2472,7 +2639,7 @@
 					return NULL;
 				
 				AST_STANDARD_APP_ARGS(args, parse);
-				ast_debug(3,"Will conf %s match %s?\n", confno, args.confno);
+				ast_debug(3, "Will conf %s match %s?\n", confno, args.confno);
 				if (!strcasecmp(args.confno, confno)) {
 					/* Bingo it's a valid conference */
 					cnf = build_conf(args.confno,
@@ -2713,17 +2880,21 @@
 			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);
+					the_pin, sizeof(the_pin), 1, &confflags, optargs, &too_early);
+				if (rt_schedule && too_early)
+					allowretry = 0;
 			}
 
 			if (!cnf) {
-				res = ast_streamfile(chan, "conf-invalid", chan->language);
-				if (!res)
-					ast_waitstream(chan, "");
-				res = -1;
-				if (allowretry)
+				if (allowretry) {
 					confno[0] = '\0';
+					res = ast_streamfile(chan, "conf-invalid", chan->language);
+					if (!res)
+						ast_waitstream(chan, "");
+					res = -1;
+				}
 			} else {
 				if ((!ast_strlen_zero(cnf->pin) &&
 				     !ast_test_flag(&confflags, CONFFLAG_ADMIN)) ||
@@ -2891,13 +3062,13 @@
 		break;					
 	case 109: /* m: Unmute */ 
 		if (user) {
-			user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
+			user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED | ADMINFLAG_T_REQUEST);
 		} else
 			ast_log(LOG_NOTICE, "Specified User not found!\n");
 		break;
 	case 110: /* n: Unmute all users */
 		AST_LIST_TRAVERSE(&cnf->userlist, user, list)
-			user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
+			user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED | ADMINFLAG_T_REQUEST);
 		break;
 	case 107: /* k: Kick user */ 
 		if (user)
@@ -3079,7 +3250,7 @@
 	if (mute)
 		user->adminflags |= ADMINFLAG_MUTED;	/* request user muting */
 	else
-		user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);	/* request user unmuting */
+		user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED | ADMINFLAG_T_REQUEST);	/* request user unmuting */
 
 	AST_LIST_UNLOCK(&confs);
 
@@ -3267,10 +3438,19 @@
 	struct ast_flags config_flags = { 0 };
 	const char *val;
 
-	audio_buffers = DEFAULT_AUDIO_BUFFERS;
-
 	if (!(cfg = ast_config_load(CONFIG_FILE_NAME, config_flags)))
 		return;
+
+	audio_buffers = DEFAULT_AUDIO_BUFFERS;
+
+	/*  Scheduling support is off by default */
+	rt_schedule = 0;
+	fuzzystart = 0;
+	earlyalert = 0;
+	endalert = 0;
+
+	/*  Logging of participants defaults to ON for compatibility reasons */
+	rt_log_members = 1;  
 
 	if ((val = ast_variable_retrieve(cfg, "general", "audiobuffers"))) {
 		if ((sscanf(val, "%d", &audio_buffers) != 1)) {
@@ -3283,6 +3463,29 @@
 		}
 		if (audio_buffers != DEFAULT_AUDIO_BUFFERS)
 			ast_log(LOG_NOTICE, "Audio buffers per channel set to %d\n", audio_buffers);
+	}
+
+	if ((val = ast_variable_retrieve(cfg, "general", "schedule")))
+		rt_schedule = ast_true(val);
+	if ((val = ast_variable_retrieve(cfg, "general", "logmembercount")))
+		rt_log_members = ast_true(val);
+	if ((val = ast_variable_retrieve(cfg, "general", "fuzzystart"))) {
+		if ((sscanf(val, "%d", &fuzzystart) != 1)) {
+			ast_log(LOG_WARNING, "fuzzystart must be a number, not '%s'\n", val);
+			fuzzystart = 0;
+		} 
+	}
+	if ((val = ast_variable_retrieve(cfg, "general", "earlyalert"))) {
+		if ((sscanf(val, "%d", &earlyalert) != 1)) {
+			ast_log(LOG_WARNING, "earlyalert must be a number, not '%s'\n", val);
+			earlyalert = 0;
+		} 
+	}
+	if ((val = ast_variable_retrieve(cfg, "general", "endalert"))) {
+		if ((sscanf(val, "%d", &endalert) != 1)) {
+			ast_log(LOG_WARNING, "endalert must be a number, not '%s'\n", val);
+			endalert = 0;
+		} 
 	}
 
 	ast_config_destroy(cfg);

Modified: team/russell/chan_refcount/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_minivm.c?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/apps/app_minivm.c (original)
+++ team/russell/chan_refcount/apps/app_minivm.c Wed Nov 21 13:29:32 2007
@@ -2997,12 +2997,12 @@
 
 /*! \brief CLI commands for Mini-voicemail */
 static struct ast_cli_entry cli_minivm[] = {
-	NEW_CLI(handle_minivm_show_users, "List defined mini-voicemail boxes"),
-	NEW_CLI(handle_minivm_show_zones, "List zone message formats"),
-	NEW_CLI(handle_minivm_list_templates, "List message templates"),	
-	NEW_CLI(handle_minivm_reload, "Reload Mini-voicemail configuration"),
-	NEW_CLI(handle_minivm_show_stats, "Show some mini-voicemail statistics"),
-	NEW_CLI(handle_minivm_show_settings, "Show mini-voicemail general settings"),
+	AST_CLI_DEFINE(handle_minivm_show_users, "List defined mini-voicemail boxes"),
+	AST_CLI_DEFINE(handle_minivm_show_zones, "List zone message formats"),
+	AST_CLI_DEFINE(handle_minivm_list_templates, "List message templates"),	
+	AST_CLI_DEFINE(handle_minivm_reload, "Reload Mini-voicemail configuration"),
+	AST_CLI_DEFINE(handle_minivm_show_stats, "Show some mini-voicemail statistics"),
+	AST_CLI_DEFINE(handle_minivm_show_settings, "Show mini-voicemail general settings"),
 };
 
 static struct ast_custom_function minivm_counter_function = {

Modified: team/russell/chan_refcount/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_mixmonitor.c?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/apps/app_mixmonitor.c (original)
+++ team/russell/chan_refcount/apps/app_mixmonitor.c Wed Nov 21 13:29:32 2007
@@ -364,43 +364,40 @@
 	return 0;
 }
 
-static int mixmonitor_cli(int fd, int argc, char **argv) 
+static char *handle_cli_mixmonitor(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct ast_channel *chan;
 
-	if (argc < 3)
-		return RESULT_SHOWUSAGE;
-
-	if (!(chan = ast_channel_get_by_name_prefix(argv[2], strlen(argv[2])))) {
-		ast_cli(fd, "No channel matching '%s' found.\n", argv[2]);
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "mixmonitor [start|stop]";
+		e->usage =
+			"Usage: mixmonitor <start|stop> <chan_name> [args]\n"
+			"       The optional arguments are passed to the MixMonitor\n"
+			"       application when the 'start' command is used.\n";
+		return NULL;
+	case CLI_GENERATE:
+		return ast_complete_channels(a->line, a->word, a->pos, a->n, 2);
+	}
+
+	if (a->argc < 3)
+		return CLI_SHOWUSAGE;
+
+	if (!(chan = ast_channel_get_by_name_prefix(a->argv[2], strlen(a->argv[2])))) {
+		ast_cli(a->fd, "No channel matching '%s' found.\n", a->argv[2]);
 		return RESULT_SUCCESS;
 	}
 
-	if (!strcasecmp(argv[1], "start"))
-		mixmonitor_exec(chan, argv[3]);
+	if (!strcasecmp(a->argv[1], "start"))
+		mixmonitor_exec(chan, a->argv[3]);
 	else
 		ast_audiohook_detach_source(chan, mixmonitor_spy_type);
 
-	return RESULT_SUCCESS;
-}
-
-static char *complete_mixmonitor_cli(const char *line, const char *word, int pos, int state)
-{
-	char *options[] = {"start", "stop", NULL};
-
-	if (pos == 1)
-		return ast_cli_complete (word, options, state);
-
-	return ast_complete_channels(line, word, pos, state, 2);
+	return CLI_SUCCESS;
 }
 
 static struct ast_cli_entry cli_mixmonitor[] = {
-	{ { "mixmonitor", NULL, NULL },
-	mixmonitor_cli, "Execute a MixMonitor command.",
-	"mixmonitor <start|stop> <chan_name> [args]\n\n"
-	"The optional arguments are passed to the\n"
-	"MixMonitor application when the 'start' command is used.\n",
-	complete_mixmonitor_cli },
+	AST_CLI_DEFINE(handle_cli_mixmonitor, "Execute a MixMonitor command")
 };
 
 static int unload_module(void)

Modified: team/russell/chan_refcount/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_osplookup.c?view=diff&rev=89497&r1=89496&r2=89497
==============================================================================
--- team/russell/chan_refcount/apps/app_osplookup.c (original)
+++ team/russell/chan_refcount/apps/app_osplookup.c Wed Nov 21 13:29:32 2007
@@ -520,8 +520,8 @@
 	int res;
 	int tokenlen;
 	unsigned char tokenstr[OSP_TOKSTR_SIZE];
-	char src[OSP_TOKSTR_SIZE];
-	char dst[OSP_TOKSTR_SIZE];
+	char src[OSP_NORSTR_SIZE];
+	char dst[OSP_NORSTR_SIZE];
 	unsigned int authorised;
 	unsigned int dummy = 0;
 	int error;
@@ -1861,10 +1861,7 @@
 	return 0;
 }
 
-static int osp_show(
-	int fd,
-	int argc,
-	char* argv[])
+static char *handle_cli_osp_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	int i;
 	int found = 0;
@@ -1872,12 +1869,21 @@
 	const char* provider = NULL;
 	const char* tokenalgo;
 
-	if ((argc < 2) || (argc > 3)) {
-		return RESULT_SHOWUSAGE;
-	}
-	if (argc > 2) {
-		provider = argv[2];
-	}
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "osp show";
+		e->usage =
+			"Usage: osp show\n"
+			"       Displays information on Open Settlement Protocol support\n";
+		return NULL;
+	case CLI_GENERATE:
+		return NULL;
+	}
+
+	if ((a->argc < 2) || (a->argc > 3))
+		return CLI_SHOWUSAGE;
+	if (a->argc > 2) 

[... 29049 lines stripped ...]



More information about the asterisk-commits mailing list