[svn-commits] oej: branch oej/queuepine-1.8-call-speedup r415189 - in /team/oej/queuepine-1...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 5 04:16:44 CDT 2014


Author: oej
Date: Thu Jun  5 04:16:37 2014
New Revision: 415189

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=415189
Log:
Setting up automerge

Modified:
    team/oej/queuepine-1.8-call-speedup/   (props changed)
    team/oej/queuepine-1.8-call-speedup/apps/app_confbridge.c
    team/oej/queuepine-1.8-call-speedup/contrib/scripts/safe_asterisk

Propchange: team/oej/queuepine-1.8-call-speedup/
------------------------------------------------------------------------------
    automerge = Is-there-life-off-net?

Propchange: team/oej/queuepine-1.8-call-speedup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jun  5 04:16:37 2014
@@ -1,1 +1,1 @@
-/branches/1.8:1-415051
+/branches/1.8:1-415188

Modified: team/oej/queuepine-1.8-call-speedup/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/queuepine-1.8-call-speedup/apps/app_confbridge.c?view=diff&rev=415189&r1=415188&r2=415189
==============================================================================
--- team/oej/queuepine-1.8-call-speedup/apps/app_confbridge.c (original)
+++ team/oej/queuepine-1.8-call-speedup/apps/app_confbridge.c Thu Jun  5 04:16:37 2014
@@ -149,7 +149,7 @@
 });
 
 /* Maximum length of a conference bridge name */
-#define MAX_CONF_NAME 32
+#define MAX_CONF_NAME AST_MAX_EXTENSION
 
 /* Number of buckets our conference bridges container can have */
 #define CONFERENCE_BRIDGE_BUCKETS 53
@@ -735,15 +735,20 @@
 		AST_APP_ARG(options);
 	);
 
-	if (ast_strlen_zero(data)) {
+	/* We need to make a copy of the input string if we are going to modify it! */
+	parse = ast_strdupa(data);
+
+	AST_STANDARD_APP_ARGS(args, parse);
+
+	if (ast_strlen_zero(args.conf_name)) {
 		ast_log(LOG_WARNING, "%s requires an argument (conference name[,options])\n", app);
 		return -1;
 	}
 
-	/* We need to make a copy of the input string if we are going to modify it! */
-	parse = ast_strdupa(data);
-
-	AST_STANDARD_APP_ARGS(args, parse);
+	if (strlen(args.conf_name) >= MAX_CONF_NAME) {
+		ast_log(LOG_WARNING, "%s does not accept conference names longer than %d\n", app, MAX_CONF_NAME - 1);
+		return -1;
+	}
 
 	if (args.argc == 2) {
 		ast_app_parse_options(app_opts, &conference_bridge_user.flags, conference_bridge_user.opt_args, args.options);

Modified: team/oej/queuepine-1.8-call-speedup/contrib/scripts/safe_asterisk
URL: http://svnview.digium.com/svn/asterisk/team/oej/queuepine-1.8-call-speedup/contrib/scripts/safe_asterisk?view=diff&rev=415189&r1=415188&r2=415189
==============================================================================
--- team/oej/queuepine-1.8-call-speedup/contrib/scripts/safe_asterisk (original)
+++ team/oej/queuepine-1.8-call-speedup/contrib/scripts/safe_asterisk Thu Jun  5 04:16:37 2014
@@ -1,19 +1,18 @@
 #!/bin/sh
-# vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent
-
-CLIARGS="$*"				# Grab any args passed to safe_asterisk
-TTY=9						# TTY (if you want one) for Asterisk to run on
-CONSOLE=yes					# Whether or not you want a console
+
+CLIARGS="$*"			# Grab any args passed to safe_asterisk
+TTY=9				# TTY (if you want one) for Asterisk to run on
+CONSOLE=yes			# Whether or not you want a console
 #NOTIFY=ben at alkaloid.net	# Who to notify about crashes
 #EXEC=/path/to/somescript	# Run this command if Asterisk crashes
 #LOGFILE=/path/to/logfile	# Where to place the normal logfile (disabled if blank)
-#SYSLOG=local0				# Which syslog facility to use (disabled if blank)
-MACHINE=`hostname`			# To specify which machine has crashed when getting the mail
+#SYSLOG=local0			# Which syslog facility to use (disabled if blank)
+MACHINE=`hostname`		# To specify which machine has crashed when getting the mail
 DUMPDROP=/tmp
 SLEEPSECS=4
-ASTSBINDIR=__ASTERISK_SBIN_DIR__
-ASTVARRUNDIR=__ASTERISK_VARRUN_DIR__
-ASTPIDFILE=${ASTVARRUNDIR}/asterisk.pid
+ASTSBINDIR="__ASTERISK_SBIN_DIR__"
+ASTVARRUNDIR="__ASTERISK_VARRUN_DIR__"
+ASTPIDFILE="${ASTVARRUNDIR}/asterisk.pid"
 
 # comment this line out to have this script _not_ kill all mpg123 processes when
 # asterisk exits
@@ -34,19 +33,21 @@
 # MAXFILES=32768
 
 message() {
-	echo "$1" >&2
-	if test "x$SYSLOG" != "x" ; then
-	    logger -p "${SYSLOG}.warn" -t safe_asterisk[$$] "$1"
-	fi
-	if test "x$LOGFILE" != "x" ; then
-	    echo "safe_asterisk[$$]: $1" >> "$LOGFILE"
+	if test -n "$TTY" && test "$TTY" != "no"; then
+		echo "$1" >/dev/${TTY}
+	fi
+	if test -n "$SYSLOG"; then
+		logger -p "${SYSLOG}.warn" -t safe_asterisk[$$] "$1"
+	fi
+	if test -n "$LOGFILE"; then
+		echo "safe_asterisk[$$]: $1" >>"$LOGFILE"
 	fi
 }
 
 # Check if Asterisk is already running.  If it is, then bug out, because
 # starting safe_asterisk when Asterisk is running is very bad.
-VERSION=`${ASTSBINDIR}/asterisk -nrx 'core show version' 2>/dev/null`
-if test "`echo $VERSION | cut -c 1-8`" = "Asterisk" ; then
+VERSION=`"${ASTSBINDIR}/asterisk" -nrx 'core show version' 2>/dev/null`
+if test "`echo $VERSION | cut -c 1-8`" = "Asterisk"; then
 	message "Asterisk is already running.  $0 will exit now."
 	exit 1
 fi
@@ -55,7 +56,7 @@
 # root. if running asterisk as other users, pass that to asterisk on the command
 # line.
 # if we're not root, fall back to standard everything.
-if test `id -u` != 0 ; then
+if test `id -u` != 0; then
 	echo "Oops. I'm not root. Falling back to standard prio and file max." >&2
 	echo "This is NOT suitable for large systems." >&2
 	PRIORITY=0
@@ -64,9 +65,9 @@
 	if `uname -s | grep Linux >/dev/null 2>&1`; then
 		# maximum number of open files is set to the system maximum divided by two if
 		# MAXFILES is not set.
-		if test "x$MAXFILES" = "x" ; then
+		if test -z "$MAXFILES"; then
 			# just check if file-max is readable
-			if test -r /proc/sys/fs/file-max ; then
+			if test -r /proc/sys/fs/file-max; then
 				MAXFILES=$(( `cat /proc/sys/fs/file-max` / 2 ))
 			fi
 		fi
@@ -76,8 +77,8 @@
 	fi
 
 
-	if test "x$SYSMAXFILES" != "x"; then
-		if test "x$SYSCTL_MAXFILES" != "x"; then
+	if test -n "$SYSMAXFILES"; then
+		if test -n "$SYSCTL_MAXFILES"; then
 			sysctl -w $SYSCTL_MAXFILES=$SYSMAXFILES
 		fi
 	fi
@@ -85,14 +86,14 @@
 	# set the process's filemax to whatever set above
 	ulimit -n $MAXFILES
 
-	if test ! -d ${ASTVARRUNDIR} ; then
-		mkdir -p ${ASTVARRUNDIR}
-		chmod 770 ${ASTVARRUNDIR}
-	fi
-
-fi
-
-if test "x$UMASK" != "x"; then
+	if test ! -d "${ASTVARRUNDIR}"; then
+		mkdir -p "${ASTVARRUNDIR}"
+		chmod 770 "${ASTVARRUNDIR}"
+	fi
+
+fi
+
+if test -n "$UMASK"; then
 	umask $UMASK
 fi
 
@@ -105,21 +106,21 @@
 # Don't fork when running "safely"
 #
 ASTARGS=""
-if test "x$TTY" != "x" ; then
-	if test -c /dev/tty${TTY} ; then
+if test -n "$TTY" && test "$TTY" != "no"; then
+	if test -c /dev/tty${TTY}; then
 		TTY=tty${TTY}
-	elif test -c /dev/vc/${TTY} ; then
+	elif test -c /dev/vc/${TTY}; then
 		TTY=vc/${TTY}
 	else
 		message "Cannot find specified TTY (${TTY})"
 		exit 1
 	fi
 	ASTARGS="${ASTARGS} -vvvg"
-	if test "x$CONSOLE" != "xno" ; then
+	if test "$CONSOLE" != "no"; then
 		ASTARGS="${ASTARGS} -c"
 	fi
 fi
-if test ! -w "${DUMPDROP}" ; then	
+if test ! -w "${DUMPDROP}"; then
 	message "Cannot write to ${DUMPDROP}"
 	exit 1
 fi
@@ -133,9 +134,9 @@
 # Run scripts to set any environment variables or do any other system-specific setup needed
 #
 
-if test -d /etc/asterisk/startup.d ; then
+if test -d /etc/asterisk/startup.d; then
 	for script in /etc/asterisk/startup.d/*.sh; do
-		if test -r ${script} ; then
+		if test -r ${script}; then
 			. ${script}
 		fi
 	done
@@ -143,58 +144,61 @@
 
 run_asterisk()
 {
-	while :; do 
-
-		if test "x$TTY" != "x" ; then
+	while :; do
+		if test -n "$TTY" && test "$TTY" != "no"; then
 			cd /tmp
-			stty sane < /dev/${TTY}
-			nice -n $PRIORITY ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}
+			stty sane </dev/${TTY}
+			nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} >/dev/${TTY} 2>&1 </dev/${TTY}
 		else
 			cd /tmp
-			nice -n $PRIORITY ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS}
+			nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} >/dev/null 2>&1 </dev/null
 		fi
 		EXITSTATUS=$?
 		message "Asterisk ended with exit status $EXITSTATUS"
-		if test "x$EXITSTATUS" = "x0" ; then
+		if test $EXITSTATUS -eq 0; then
 			# Properly shutdown....
 			message "Asterisk shutdown normally."
 			exit 0
-		elif test "0$EXITSTATUS" -gt "128" ; then
-			EXITSIGNAL=$(($EXITSTATUS - 128))
+		elif test $EXITSTATUS -gt 128; then
+			EXITSIGNAL=$((EXITSTATUS - 128))
 			echo "Asterisk exited on signal $EXITSIGNAL."
-			if test "x$NOTIFY" != "x" ; then
+			if test -n "$NOTIFY"; then
 				echo "Asterisk on $MACHINE exited on signal $EXITSIGNAL.  Might want to take a peek." | \
 				mail -s "Asterisk Died" $NOTIFY
 				message "Exited on signal $EXITSIGNAL"
 			fi
-			if test "x$EXEC" != "x" ; then
+			if test -n "$EXEC"; then
 				$EXEC
 			fi
 
 			PID=`cat ${ASTPIDFILE}`
 			DATE=`date "+%Y-%m-%dT%H:%M:%S%z"`
-			if test -f /tmp/core.${PID} ; then
-				mv /tmp/core.${PID} ${DUMPDROP}/core.`hostname`-$DATE &
-			elif test -f /tmp/core ; then
-				mv /tmp/core ${DUMPDROP}/core.`hostname`-$DATE &
+			if test -f /tmp/core.${PID}; then
+				mv /tmp/core.${PID} "${DUMPDROP}/core.`hostname`-$DATE" &
+			elif test -f /tmp/core; then
+				mv /tmp/core "${DUMPDROP}/core.`hostname`-$DATE" &
 			fi
 		else
 			message "Asterisk died with code $EXITSTATUS."
 
 			PID=`cat ${ASTPIDFILE}`
 			DATE=`date "+%Y-%m-%dT%H:%M:%S%z"`
-			if test -f /tmp/core.${PID} ; then
-				mv /tmp/core.${PID} ${DUMPDROP}/core.`hostname`-$DATE &
-			elif test -f /tmp/core ; then
-				mv /tmp/core ${DUMPDROP}/core.`hostname`-$DATE &
+			if test -f /tmp/core.${PID}; then
+				mv /tmp/core.${PID} "${DUMPDROP}/core.`hostname`-$DATE" &
+			elif test -f /tmp/core; then
+				mv /tmp/core "${DUMPDROP}/core.`hostname`-$DATE" &
 			fi
 		fi
 		message "Automatically restarting Asterisk."
 		sleep $SLEEPSECS
-		if test "0$KILLALLMPG123" -gt "0" ; then
+		if test "0$KILLALLMPG123" -gt 0; then
 			pkill -9 mpg123
 		fi
 	done
 }
 
-run_asterisk &
+if test -n "$ASTSAFE_FOREGROUND"; then
+	run_asterisk
+else
+	run_asterisk &
+fi




More information about the svn-commits mailing list