[asterisk-commits] branch russell/make_output - r8598 in /team/russell/make_output: ./ channels/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 24 15:44:45 MST 2006


Author: russell
Date: Tue Jan 24 16:44:42 2006
New Revision: 8598

URL: http://svn.digium.com/view/asterisk?rev=8598&view=rev
Log:
Conflicts on files I haven't touched are starting to get on my nerves.



Merged revisions 8571-8572,8574,8582,8587,8589-8593 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r8571 | russell | 2006-01-24 15:20:05 -0500 (Tue, 24 Jan 2006) | 2 lines

convert ast_channel list to use linked list macros (issue #6338)

................
r8572 | russell | 2006-01-24 15:27:09 -0500 (Tue, 24 Jan 2006) | 2 lines

store the list of 'atexit' functions using linked list macros (issue #6329)

................
r8574 | oej | 2006-01-24 15:41:08 -0500 (Tue, 24 Jan 2006) | 2 lines

Don't reset scheduled ID until we actually end the scheduled event.

................
r8582 | mattf | 2006-01-24 16:45:42 -0500 (Tue, 24 Jan 2006) | 2 lines

Updates from royk to safe_asterisk (#5207) Thanks!

................
r8587 | mattf | 2006-01-24 17:06:37 -0500 (Tue, 24 Jan 2006) | 2 lines

Make sure safe_asterisk retains previous script defaults

................
r8589 | kpfleming | 2006-01-24 17:33:58 -0500 (Tue, 24 Jan 2006) | 1 line


................
r8590 | kpfleming | 2006-01-24 17:34:06 -0500 (Tue, 24 Jan 2006) | 1 line


................
r8591 | kpfleming | 2006-01-24 17:38:17 -0500 (Tue, 24 Jan 2006) | 10 lines

Merged revisions 8588 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8588 | kpfleming | 2006-01-24 16:32:09 -0600 (Tue, 24 Jan 2006) | 2 lines

ensure that channel cannot become zombie after we check but before we try to start indications

........

................
r8592 | kpfleming | 2006-01-24 17:40:20 -0500 (Tue, 24 Jan 2006) | 1 line


................
r8593 | kpfleming | 2006-01-24 17:40:57 -0500 (Tue, 24 Jan 2006) | 1 line


................

Modified:
    team/russell/make_output/   (props changed)
    team/russell/make_output/asterisk.c
    team/russell/make_output/channel.c
    team/russell/make_output/channels/chan_sip.c
    team/russell/make_output/contrib/scripts/safe_asterisk
    team/russell/make_output/include/asterisk/channel.h

Propchange: team/russell/make_output/
------------------------------------------------------------------------------
    automerge = blah

Propchange: team/russell/make_output/
------------------------------------------------------------------------------
--- svnmerge-blocked (original)
+++ svnmerge-blocked Tue Jan 24 16:44:42 2006
@@ -1,1 +1,1 @@
-/branches/1.2:7490,7497,7517,7529,7546,7550,7552,7557,7580,7586,7595,7605,7641,7663,7706,7738,7771,7792,7812,7870-7871,7898-7900,7915,7960,7965,7970,7976,8047,8112,8394,8412,8418,8445,8562
+/branches/1.2:7490,7497,7517,7529,7546,7550,7552,7557,7580,7586,7595,7605,7641,7663,7706,7738,7771,7792,7812,7870-7871,7898-7900,7915,7960,7965,7970,7976,8047,8112,8134,8394,8412,8418,8429,8433,8445,8562,8573

Propchange: team/russell/make_output/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 24 16:44:42 2006
@@ -1,1 +1,1 @@
-/trunk:1-8568
+/trunk:1-8593

Modified: team/russell/make_output/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/russell/make_output/asterisk.c?rev=8598&r1=8597&r2=8598&view=diff
==============================================================================
--- team/russell/make_output/asterisk.c (original)
+++ team/russell/make_output/asterisk.c Tue Jan 24 16:44:42 2006
@@ -167,12 +167,12 @@
 	pthread_t t;			/*!< Thread of handler */
 };
 
-static struct ast_atexit {
+struct ast_atexit {
 	void (*func)(void);
-	struct ast_atexit *next;
-} *atexits = NULL;
-
-AST_MUTEX_DEFINE_STATIC(atexitslock);
+	AST_LIST_ENTRY(ast_atexit) list;
+};
+
+static AST_LIST_HEAD_STATIC(atexits, ast_atexit);
 
 time_t ast_startuptime;
 time_t ast_lastreloadtime;
@@ -355,35 +355,29 @@
 	struct ast_atexit *ae;
 	ast_unregister_atexit(func);
 	ae = malloc(sizeof(struct ast_atexit));
-	ast_mutex_lock(&atexitslock);
+	AST_LIST_LOCK(&atexits);
 	if (ae) {
 		memset(ae, 0, sizeof(struct ast_atexit));
-		ae->next = atexits;
+		AST_LIST_INSERT_HEAD(&atexits, ae, list);
 		ae->func = func;
-		atexits = ae;
 		res = 0;
 	}
-	ast_mutex_unlock(&atexitslock);
+	AST_LIST_UNLOCK(&atexits);
 	return res;
 }
 
 void ast_unregister_atexit(void (*func)(void))
 {
-	struct ast_atexit *ae, *prev = NULL;
-	ast_mutex_lock(&atexitslock);
-	ae = atexits;
-	while(ae) {
+	struct ast_atexit *ae;
+	AST_LIST_LOCK(&atexits);
+	AST_LIST_TRAVERSE_SAFE_BEGIN(&atexits, ae, list) {
 		if (ae->func == func) {
-			if (prev)
-				prev->next = ae->next;
-			else
-				atexits = ae->next;
+			AST_LIST_REMOVE_CURRENT(&atexits, list);
 			break;
 		}
-		prev = ae;
-		ae = ae->next;
-	}
-	ast_mutex_unlock(&atexitslock);
+	}
+	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_UNLOCK(&atexits);
 }
 
 static int fdprint(int fd, const char *s)
@@ -806,14 +800,12 @@
 static void ast_run_atexits(void)
 {
 	struct ast_atexit *ae;
-	ast_mutex_lock(&atexitslock);
-	ae = atexits;
-	while(ae) {
+	AST_LIST_LOCK(&atexits);
+	AST_LIST_TRAVERSE(&atexits, ae, list) {
 		if (ae->func) 
 			ae->func();
-		ae = ae->next;
-	}
-	ast_mutex_unlock(&atexitslock);
+	}
+	AST_LIST_UNLOCK(&atexits);
 }
 
 static void quit_handler(int num, int nice, int safeshutdown, int restart)

Modified: team/russell/make_output/channel.c
URL: http://svn.digium.com/view/asterisk/team/russell/make_output/channel.c?rev=8598&r1=8597&r2=8598&view=diff
==============================================================================
--- team/russell/make_output/channel.c (original)
+++ team/russell/make_output/channel.c Tue Jan 24 16:44:42 2006
@@ -108,11 +108,9 @@
 /*! the list of registered channel types */
 static AST_LIST_HEAD_NOLOCK_STATIC(backends, chanlist);
 
-/*! the list of channels we have */
-static struct ast_channel *channels = NULL;
-
-/*! Protect the channel list, both backends and channels. */
-AST_MUTEX_DEFINE_STATIC(chlock);
+/*! the list of channels we have. Note that the lock for this list is used for
+    both the channels list and the backends list.  */
+static AST_LIST_HEAD_STATIC(channels, ast_channel);
 
 /*! map AST_CAUSE's to readable string representations */
 const struct ast_cause {
@@ -174,7 +172,7 @@
 
 	ast_cli(fd, FORMAT, "Type", "Description",       "Devicestate", "Indications", "Transfer");
 	ast_cli(fd, FORMAT, "----------", "-----------", "-----------", "-----------", "--------");
-	if (ast_mutex_lock(&chlock)) {
+	if (AST_LIST_LOCK(&channels)) {
 		ast_log(LOG_WARNING, "Unable to lock channel list\n");
 		return -1;
 	}
@@ -185,12 +183,85 @@
 			(cl->tech->transfer) ? "yes" : "no");
 		count_chan++;
 	}
-	ast_mutex_unlock(&chlock);
+	AST_LIST_UNLOCK(&channels);
 	ast_cli(fd, "----------\n%d channel drivers registered.\n", count_chan);
 	return RESULT_SUCCESS;
 
 #undef FORMAT
 
+}
+
+static int show_channeltype(int fd, int argc, char *argv[])
+{
+	struct chanlist *cl = NULL;
+
+	if (argc != 3)
+		return RESULT_SHOWUSAGE;
+	
+	if (AST_LIST_LOCK(&channels)) {
+		ast_log(LOG_WARNING, "Unable to lock channel list\n");
+		return RESULT_FAILURE;
+	}
+
+	AST_LIST_TRAVERSE(&backends, cl, list) {
+		if (!strncasecmp(cl->tech->type, argv[2], strlen(cl->tech->type))) {
+			break;
+		}
+	}
+
+
+	if (!cl) {
+		ast_cli(fd, "\n%s is not a registered channel driver.\n", argv[2]);
+		AST_LIST_UNLOCK(&channels);
+		return RESULT_FAILURE;
+	} 
+
+	ast_cli(fd,
+		"-- Info about channel driver: %s --\n"
+		"  Device State: %s\n"
+		"    Indication: %s\n"
+		"     Transfer : %s\n"
+		"  Capabilities: %d\n"
+		"    Send Digit: %s\n"
+		"    Send HTML : %s\n"
+		" Image Support: %s\n"
+		"  Text Support: %s\n",
+		cl->tech->type,
+		(cl->tech->devicestate) ? "yes" : "no",
+		(cl->tech->indicate) ? "yes" : "no",
+		(cl->tech->transfer) ? "yes" : "no",
+		(cl->tech->capabilities) ? cl->tech->capabilities : -1,
+		(cl->tech->send_digit) ? "yes" : "no",
+		(cl->tech->send_html) ? "yes" : "no",
+		(cl->tech->send_image) ? "yes" : "no",
+		(cl->tech->send_text) ? "yes" : "no"
+		
+	);
+
+	AST_LIST_UNLOCK(&channels);
+	return RESULT_SUCCESS;
+}
+
+static char *complete_channeltypes(const char *line, const char *word, int pos, int state)
+{
+	struct chanlist *cl;
+	int which = 0;
+	int wordlen;
+	char *ret = NULL;
+
+	if (pos != 2)
+		return NULL;
+
+	wordlen = strlen(word);
+
+	AST_LIST_TRAVERSE(&backends, cl, list) {
+		if (!strncasecmp(word, cl->tech->type, wordlen) && ++which > state) {
+			ret = strdup(cl->tech->type);
+			break;
+		}
+	}
+	
+	return ret;
 }
 
 static char show_channeltypes_usage[] = 
@@ -237,10 +308,10 @@
 	struct ast_channel *c;
 	shutting_down = 1;
 	if (hangup) {
-		ast_mutex_lock(&chlock);
-		for (c = channels; c; c = c->next)
+		AST_LIST_LOCK(&channels);
+		AST_LIST_TRAVERSE(&channels, c, list)
 			ast_softhangup(c, AST_SOFTHANGUP_SHUTDOWN);
-		ast_mutex_unlock(&chlock);
+		AST_LIST_UNLOCK(&channels);
 	}
 }
 
@@ -249,10 +320,10 @@
 {
 	struct ast_channel *c;
 	int cnt = 0;
-	ast_mutex_lock(&chlock);
-	for (c = channels; c; c = c->next)
+	AST_LIST_LOCK(&channels);
+	AST_LIST_TRAVERSE(&channels, c, list)
 		cnt++;
-	ast_mutex_unlock(&chlock);
+	AST_LIST_UNLOCK(&channels);
 	return cnt;
 }
 
@@ -313,12 +384,12 @@
 {
 	struct chanlist *chan;
 
-	ast_mutex_lock(&chlock);
+	AST_LIST_LOCK(&channels);
 
 	AST_LIST_TRAVERSE(&backends, chan, list) {
 		if (!strcasecmp(tech->type, chan->tech->type)) {
 			ast_log(LOG_WARNING, "Already have a handler for type '%s'\n", tech->type);
-			ast_mutex_unlock(&chlock);
+			AST_LIST_UNLOCK(&channels);
 			return -1;
 		}
 	}
@@ -326,7 +397,7 @@
 	chan = malloc(sizeof(*chan));
 	if (!chan) {
 		ast_log(LOG_WARNING, "Out of memory\n");
-		ast_mutex_unlock(&chlock);
+		AST_LIST_UNLOCK(&channels);
 		return -1;
 	}
 	chan->tech = tech;
@@ -339,7 +410,7 @@
 		ast_verbose(VERBOSE_PREFIX_2 "Registered channel type '%s' (%s)\n", chan->tech->type,
 			    chan->tech->description);
 
-	ast_mutex_unlock(&chlock);
+	AST_LIST_UNLOCK(&channels);
 	return 0;
 }
 
@@ -350,7 +421,7 @@
 	if (option_debug)
 		ast_log(LOG_DEBUG, "Unregistering channel type '%s'\n", tech->type);
 
-	ast_mutex_lock(&chlock);
+	AST_LIST_LOCK(&channels);
 
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&backends, chan, list) {
 		if (chan->tech == tech) {
@@ -363,7 +434,7 @@
 	}
 	AST_LIST_TRAVERSE_SAFE_END
 
-	ast_mutex_unlock(&chlock);
+	AST_LIST_UNLOCK(&channels);
 }
 
 const struct ast_channel_tech *ast_get_channel_tech(const char *name)
@@ -371,7 +442,7 @@
 	struct chanlist *chanls;
 	const struct ast_channel_tech *ret = NULL;
 
-	if (ast_mutex_lock(&chlock)) {
+	if (AST_LIST_LOCK(&channels)) {
 		ast_log(LOG_WARNING, "Unable to lock channel tech list\n");
 		return NULL;
 	}
@@ -383,7 +454,7 @@
 		}
 	}
 
-	ast_mutex_unlock(&chlock);
+	AST_LIST_UNLOCK(&channels);
 	
 	return ret;
 }
@@ -584,11 +655,9 @@
 
 	tmp->tech = &null_tech;
 
-	ast_mutex_lock(&chlock);
-	tmp->next = channels;
-	channels = tmp;
-
-	ast_mutex_unlock(&chlock);
+	AST_LIST_LOCK(&channels);
+	AST_LIST_INSERT_HEAD(&channels, tmp, list);
+	AST_LIST_UNLOCK(&channels);
 	return tmp;
 }
 
@@ -721,8 +790,8 @@
 	struct ast_channel *c;
 
 	for (retries = 0; retries < 10; retries++) {
-		ast_mutex_lock(&chlock);
-		for (c = channels; c; c = c->next) {
+		AST_LIST_LOCK(&channels);
+		AST_LIST_TRAVERSE(&channels, c, list) {
 			if (!prev) {
 				/* want head of list */
 				if (!name && !exten)
@@ -751,7 +820,7 @@
 						break;
 				}
 			} else if (c == prev) { /* found, return c->next */
-				c = c->next;
+				c = AST_LIST_NEXT(c, list);
 				break;
 			}
 		}
@@ -760,7 +829,7 @@
 		/* this is slightly unsafe, as we _should_ hold the lock to access c->name */
 		if (!done && c)
 			ast_log(LOG_DEBUG, "Avoiding %s for '%s'\n", msg, c->name);
-		ast_mutex_unlock(&chlock);
+		AST_LIST_UNLOCK(&channels);
 		if (done)
 			return c;
 		usleep(1);
@@ -849,7 +918,6 @@
 /*! \brief Free a channel structure */
 void ast_channel_free(struct ast_channel *chan)
 {
-	struct ast_channel *last=NULL, *cur;
 	int fd;
 	struct ast_var_t *vardata;
 	struct ast_frame *f, *fp;
@@ -858,25 +926,12 @@
 	
 	headp=&chan->varshead;
 	
-	ast_mutex_lock(&chlock);
-	for (cur = channels; cur; cur = cur->next) {
-		if (cur == chan) {
-			if (last)
-				last->next = cur->next;
-			else
-				channels = cur->next;
-			break;
-		}
-		last = cur;
-	}
-	if (!cur)
-		ast_log(LOG_WARNING, "Unable to find channel in list\n");
-	else {
-		/* Lock and unlock the channel just to be sure nobody
-		   has it locked still */
-		ast_mutex_lock(&cur->lock);
-		ast_mutex_unlock(&cur->lock);
-	}
+	AST_LIST_LOCK(&channels);
+	AST_LIST_REMOVE(&channels, chan, list);
+	/* Lock and unlock the channel just to be sure nobody
+	   has it locked still */
+	ast_mutex_lock(&chan->lock);
+	ast_mutex_unlock(&chan->lock);
 	if (chan->tech_pvt) {
 		ast_log(LOG_WARNING, "Channel '%s' may not have been hung up properly\n", chan->name);
 		free(chan->tech_pvt);
@@ -927,7 +982,7 @@
 		ast_var_delete(vardata);
 
 	free(chan);
-	ast_mutex_unlock(&chlock);
+	AST_LIST_UNLOCK(&channels);
 
 	ast_device_state_changed_literal(name);
 }
@@ -1988,10 +2043,12 @@
 {
 	int res = -1;
 
+	ast_mutex_lock(&chan->lock);
 	/* Stop if we're a zombie or need a soft hangup */
-	if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) 
+	if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
+		ast_mutex_unlock(&chan->lock);
 		return -1;
-	ast_mutex_lock(&chan->lock);
+	}
 	if (chan->tech->indicate)
 		res = chan->tech->indicate(chan, condition);
 	ast_mutex_unlock(&chan->lock);
@@ -2484,7 +2541,7 @@
 		cause = &foo;
 	*cause = AST_CAUSE_NOTDEFINED;
 
-	if (ast_mutex_lock(&chlock)) {
+	if (AST_LIST_LOCK(&channels)) {
 		ast_log(LOG_WARNING, "Unable to lock channel list\n");
 		return NULL;
 	}
@@ -2498,10 +2555,10 @@
 		res = ast_translator_best_choice(&fmt, &capabilities);
 		if (res < 0) {
 			ast_log(LOG_WARNING, "No translator path exists for channel type %s (native %d) to %d\n", type, chan->tech->capabilities, format);
-			ast_mutex_unlock(&chlock);
+			AST_LIST_UNLOCK(&channels);
 			return NULL;
 		}
-		ast_mutex_unlock(&chlock);
+		AST_LIST_UNLOCK(&channels);
 		if (!chan->tech->requester)
 			return NULL;
 		
@@ -2525,7 +2582,7 @@
 
 	ast_log(LOG_WARNING, "No channel type registered for '%s'\n", type);
 	*cause = AST_CAUSE_NOSUCHDRIVER;
-	ast_mutex_unlock(&chlock);
+	AST_LIST_UNLOCK(&channels);
 
 	return NULL;
 }

Modified: team/russell/make_output/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/make_output/channels/chan_sip.c?rev=8598&r1=8597&r2=8598&view=diff
==============================================================================
--- team/russell/make_output/channels/chan_sip.c (original)
+++ team/russell/make_output/channels/chan_sip.c Tue Jan 24 16:44:42 2006
@@ -1321,7 +1321,6 @@
 {
 	struct sip_pvt *p = data;
 
-	p->autokillid = -1;
 
 	/* If this is a subscription, tell the phone that we got a timeout */
 	if (p->subscribed) {
@@ -1329,9 +1328,16 @@
 		transmit_state_notify(p, AST_EXTENSION_DEACTIVATED, 1, 1);	/* Send first notification */
 		p->subscribed = NONE;
 		append_history(p, "Subscribestatus", "timeout");
+		if (option_debug > 2)
+			ast_log(LOG_DEBUG, "Re-scheduled destruction of SIP subsription %s\n", p->callid ? p->callid : "<unknown>");
 		return 10000;	/* Reschedule this destruction so that we know that it's gone */
 	}
-	ast_log(LOG_DEBUG, "Auto destroying call '%s'\n", p->callid);
+
+	/* Reset schedule ID */
+	p->autokillid = -1;
+
+	if (option_debug)
+		ast_log(LOG_DEBUG, "Auto destroying call '%s'\n", p->callid);
 	append_history(p, "AutoDestroy", "");
 	if (p->owner) {
 		ast_log(LOG_WARNING, "Autodestruct on dialog '%s' with owner in place (Method: %s)\n", p->callid, sip_methods[p->method].text);

Modified: team/russell/make_output/contrib/scripts/safe_asterisk
URL: http://svn.digium.com/view/asterisk/team/russell/make_output/contrib/scripts/safe_asterisk?rev=8598&r1=8597&r2=8598&view=diff
==============================================================================
--- team/russell/make_output/contrib/scripts/safe_asterisk (original)
+++ team/russell/make_output/contrib/scripts/safe_asterisk Tue Jan 24 16:44:42 2006
@@ -1,11 +1,76 @@
 #!/bin/sh
-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
+# 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
 #NOTIFY=ben at alkaloid.net	# Who to notify about crashes
-MACHINE=`hostname`      # To specify which machine has crashed when getting the mail
+MACHINE=`hostname`			# To specify which machine has crashed when getting the mail
 DUMPDROP=/tmp
+SLEEPSECS=4
 ASTSBINDIR=__ASTERISK_SBIN_DIR__
+
+# comment this line out to have this script _not_ kill all mpg123 processes when
+# asterisk exits
+KILLALLMPG123=1
+
+# run asterisk with this priority
+PRIORITY=0
+
+# set system filemax on supported OSes if this variable is set
+# SYSMAXFILES=262144
+
+# set max files open with ulimit. On linux systems, this will be automatically
+# set to the system's maximum files open devided by two, if not set here.
+# MAXFILES=32768
+
+# since we're going to change priority and open files limits, we need to be
+# 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 [ `id -u` != 0 ]
+then
+	echo "Ops. I'm not root. Falling back to standard prio and file max." >&2
+	echo "This is NOT suitable for large systems." >&2
+	PRIORITY=0
+else
+	if `echo $OSTYPE | grep linux 2>&1 > /dev/null `
+	then
+		# maximum number of open files is set to the system maximum divided by two if
+		# MAXFILES is not set.
+		if [ "$MAXFILES" = "" ]
+		then
+			# just check if file-max is readable
+			if [ -r /proc/sys/fs/file-max ]
+			then
+				MAXFILES=$(( `cat /proc/sys/fs/file-max` / 2 ))
+			fi
+		fi
+		SYSCTL_MAXFILES="fs.file-max"
+	elif `echo $OSTYPE | grep darwin 2>&1 > /dev/null `
+	then
+		SYSCTL_MAXFILES="kern.maxfiles"
+	fi
+
+
+	if [ "$SYSMAXFILES" != "" ]
+	then
+		if [ "$SYSCTL_MAXFILES" != "" ]
+		then
+			sysctl -w $SYSCTL_MAXFILES=$SYSMAXFILES
+		fi
+	fi
+
+	# set the process's filemax to whatever set above
+	ulimit -n $MAXFILES
+
+fi
+
+#
+# Let Asterisk dump core
+#
+ulimit -c unlimited
+
 #
 # Don't fork when running "safely"
 #
@@ -29,11 +94,6 @@
 	exit 1
 fi
 
-#
-# Let Asterisk dump core
-#
-ulimit -c unlimited
-
 #launch_asterisk()
 #{
 #}
@@ -45,10 +105,10 @@
 		if [ "$TTY" != "" ]; then
 			cd /tmp
 			stty sane < /dev/${TTY}
-			${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
+			nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
 		else
 			cd /tmp
-			${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS}
+			nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS}
 		fi
 		EXITSTATUS=$?
 		echo "Asterisk ended with exit status $EXITSTATUS"
@@ -63,7 +123,7 @@
 				echo "Asterisk on $MACHINE exited on signal $EXITSIGNAL.  Might want to take a peek." | \
 				mail -s "Asterisk Died" $NOTIFY
 			fi
-                        if [ -f /tmp/core ]; then
+			if [ -f /tmp/core ]; then
 				mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
 			fi
 		else
@@ -72,13 +132,17 @@
 				exit 0
 			else
 				echo "Asterisk died with code $EXITSTATUS."
-	                        if [ -f /tmp/core ]; then
+				if [ -f /tmp/core ]; then
 					mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
 				fi
 			fi
 		fi
 		echo "Automatically restarting Asterisk."
-		sleep 4
+		sleep $SLEEPSECS
+		if [ $KILLALLMPG123 ]
+		then
+			killall -9 mpg123
+		fi
 	done
 }
 

Modified: team/russell/make_output/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/russell/make_output/include/asterisk/channel.h?rev=8598&r1=8597&r2=8598&view=diff
==============================================================================
--- team/russell/make_output/include/asterisk/channel.h (original)
+++ team/russell/make_output/include/asterisk/channel.h Tue Jan 24 16:44:42 2006
@@ -411,7 +411,7 @@
 	struct ast_channel_spy_list *spies;
 
 	/*! For easy linking */
-	struct ast_channel *next;
+	AST_LIST_ENTRY(ast_channel) list;
 };
 
 /* \defgroup chanprop Channel tech properties:



More information about the asterisk-commits mailing list