[asterisk-commits] oej: branch oej/moremanager r64156 - in /team/oej/moremanager: ./ channels/ c...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 14 00:40:47 MST 2007


Author: oej
Date: Mon May 14 02:40:47 2007
New Revision: 64156

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

Modified:
    team/oej/moremanager/   (props changed)
    team/oej/moremanager/Makefile
    team/oej/moremanager/channels/chan_iax2.c
    team/oej/moremanager/channels/chan_sip.c
    team/oej/moremanager/contrib/scripts/safe_asterisk
    team/oej/moremanager/main/manager.c
    team/oej/moremanager/res/res_features.c

Propchange: team/oej/moremanager/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/moremanager/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/oej/moremanager/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May 14 02:40:47 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-63781
+/branches/1.4:1-64155

Modified: team/oej/moremanager/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/Makefile?view=diff&rev=64156&r1=64155&r2=64156
==============================================================================
--- team/oej/moremanager/Makefile (original)
+++ team/oej/moremanager/Makefile Mon May 14 02:40:47 2007
@@ -419,7 +419,7 @@
 	$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
 	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
 	if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
-		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
 		chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
 	fi
 	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)

Modified: team/oej/moremanager/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/channels/chan_iax2.c?view=diff&rev=64156&r1=64155&r2=64156
==============================================================================
--- team/oej/moremanager/channels/chan_iax2.c (original)
+++ team/oej/moremanager/channels/chan_iax2.c Mon May 14 02:40:47 2007
@@ -2390,7 +2390,8 @@
 	iaxq.count++;
 	AST_LIST_UNLOCK(&iaxq.queue);
 	/* Wake up the network and scheduler thread */
-	pthread_kill(netthreadid, SIGURG);
+	if (netthreadid != AST_PTHREADT_NULL)
+		pthread_kill(netthreadid, SIGURG);
 	signal_condition(&sched_lock, &sched_cond);
 	return 0;
 }

Modified: team/oej/moremanager/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/channels/chan_sip.c?view=diff&rev=64156&r1=64155&r2=64156
==============================================================================
--- team/oej/moremanager/channels/chan_sip.c (original)
+++ team/oej/moremanager/channels/chan_sip.c Mon May 14 02:40:47 2007
@@ -776,8 +776,9 @@
 #define SIP_PAGE2_T38SUPPORT_RTP	(2 << 20)	/*!< 21: T38 Fax Passthrough Support (not implemented) */
 #define SIP_PAGE2_T38SUPPORT_TCP	(4 << 20)	/*!< 22: T38 Fax Passthrough Support (not implemented) */
 #define SIP_PAGE2_CALL_ONHOLD		(3 << 23)	/*!< Call states */
-#define SIP_PAGE2_CALL_ONHOLD_ONEDIR	(1 << 23)	/*!< 23: One directional hold */
-#define SIP_PAGE2_CALL_ONHOLD_INACTIVE	(1 << 24)	/*!< 24: Inactive  */
+#define SIP_PAGE2_CALL_ONHOLD_ACTIVE    (1 << 23)       /*!< 23: Active hold */
+#define SIP_PAGE2_CALL_ONHOLD_ONEDIR	(2 << 23)	/*!< 23: One directional hold */
+#define SIP_PAGE2_CALL_ONHOLD_INACTIVE	(3 << 23)	/*!< 23: Inactive hold */
 #define SIP_PAGE2_RFC2833_COMPENSATE    (1 << 25)	/*!< 25: ???? */
 #define SIP_PAGE2_BUGGY_MWI		(1 << 26)	/*!< 26: Buggy CISCO MWI fix */
 #define SIP_PAGE2_OUTGOING_CALL         (1 << 27)       /*!< 27: Is this an outgoing call? */
@@ -5282,6 +5283,8 @@
 			ast_set_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_ONEDIR);
 		else if (sendonly == 2)	/* Inactive stream */
 			ast_set_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_INACTIVE);
+		else
+			ast_set_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_ACTIVE);
 		if (global_notifyhold)
 			sip_peer_hold(p, 1);
 	}
@@ -6253,9 +6256,9 @@
 	snprintf(connection, sizeof(connection), "c=IN IP4 %s\r\n", ast_inet_ntoa(dest.sin_addr));
 	ast_build_string(&m_audio_next, &m_audio_left, "m=audio %d RTP/AVP", ntohs(dest.sin_port));
 
-	if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_ONEDIR))
+	if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) == SIP_PAGE2_CALL_ONHOLD_ONEDIR)
 		hold = "a=recvonly\r\n";
-	else if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_INACTIVE))
+	else if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) == SIP_PAGE2_CALL_ONHOLD_INACTIVE)
 		hold = "a=inactive\r\n";
 	else
 		hold = "a=sendrecv\r\n";

Modified: team/oej/moremanager/contrib/scripts/safe_asterisk
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/contrib/scripts/safe_asterisk?view=diff&rev=64156&r1=64155&r2=64156
==============================================================================
--- team/oej/moremanager/contrib/scripts/safe_asterisk (original)
+++ team/oej/moremanager/contrib/scripts/safe_asterisk Mon May 14 02:40:47 2007
@@ -10,6 +10,7 @@
 DUMPDROP=/tmp
 SLEEPSECS=4
 ASTSBINDIR=__ASTERISK_SBIN_DIR__
+ASTPIDFILE=__ASTERISK_VARRUN_DIR__/asterisk.pid
 
 # comment this line out to have this script _not_ kill all mpg123 processes when
 # asterisk exits
@@ -96,6 +97,11 @@
 fi
 
 #
+# Don't die if stdout/stderr can't be written to
+#
+trap '' SIGPIPE
+
+#
 # Run scripts to set any environment variables or do any other system-specific setup needed
 #
 
@@ -114,10 +120,10 @@
 		if [ "$TTY" != "" ]; then
 			cd /tmp
 			stty sane < /dev/${TTY}
-			nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
+			nice -n $PRIORITY ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
 		else
 			cd /tmp
-			nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS}
+			nice -n $PRIORITY ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS}
 		fi
 		EXITSTATUS=$?
 		echo "Asterisk ended with exit status $EXITSTATUS"
@@ -135,7 +141,11 @@
 			if [ "$EXEC" != "" ]; then
 				$EXEC
 			fi
-			if [ -f /tmp/core ]; then
+
+			PID=`cat ${ASTPIDFILE}`
+			if [ -f /tmp/core.${PID} ]; then
+				mv /tmp/core.${PID} ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
+			elif [ -f /tmp/core ]; then
 				mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
 			fi
 		else
@@ -144,7 +154,11 @@
 				exit 0
 			else
 				echo "Asterisk died with code $EXITSTATUS."
-				if [ -f /tmp/core ]; then
+
+				PID=`cat ${ASTPIDFILE}`
+				if [ -f /tmp/core.${PID} ]; then
+					mv /tmp/core.${PID} ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
+				elif [ -f /tmp/core ]; then
 					mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
 				fi
 			fi

Modified: team/oej/moremanager/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/manager.c?view=diff&rev=64156&r1=64155&r2=64156
==============================================================================
--- team/oej/moremanager/main/manager.c (original)
+++ team/oej/moremanager/main/manager.c Mon May 14 02:40:47 2007
@@ -69,6 +69,7 @@
 #include "asterisk/threadstorage.h"
 #include "asterisk/linkedlists.h"
 #include "asterisk/version.h"
+#include "asterisk/term.h"
 
 struct fast_originate_helper {
 	char tech[AST_MAX_EXTENSION];
@@ -479,7 +480,7 @@
 		"          write: %s\n"
 		"displayconnects: %s\n",
 		(user->username ? user->username : "(N/A)"),
-		(user->secret ? user->secret : "(N/A)"),
+		(user->secret ? "<Set>" : "(N/A)"),
 		(user->deny ? user->deny : "(N/A)"),
 		(user->permit ? user->permit : "(N/A)"),
 		(user->read ? user->read : "(N/A)"),
@@ -946,6 +947,11 @@
 							ast_config_destroy(cfg);
 							return -1;
 						}
+					} else {
+						ast_log(LOG_DEBUG, "MD5 authentication is not possible.  challenge: '%s'\n", 
+							S_OR(s->challenge, ""));
+						ast_config_destroy(cfg);
+						return -1;
 					}
 				} else if (password && !strcmp(password, pass)) {
 					break;
@@ -1613,7 +1619,7 @@
 {
 	const char *cmd = astman_get_header(m, "Command");
 	const char *id = astman_get_header(m, "ActionID");
-	char *buf;
+	char *buf, *final_buf;
 	char template[] = "/tmp/ast-ami-XXXXXX";	/* template for temporary file */
 	int fd = mkstemp(template);
 	off_t l;
@@ -1624,13 +1630,16 @@
 	/* FIXME: Wedge a ActionID response in here, waiting for later changes */
 	ast_cli_command(fd, cmd);	/* XXX need to change this to use a FILE * */
 	l = lseek(fd, 0, SEEK_END);	/* how many chars available */
-	buf = alloca(l+1);
+	buf = alloca(l + 1);
+	final_buf = alloca(l + 1);
 	lseek(fd, 0, SEEK_SET);
 	read(fd, buf, l);
 	buf[l] = '\0';
 	close(fd);
 	unlink(template);
-	astman_append(s, buf);
+	term_strip(final_buf, buf, l);
+	final_buf[l] = '\0';
+	astman_append(s, final_buf);
 	astman_append(s, "--END COMMAND--\r\n\r\n");
 	return 0;
 }

Modified: team/oej/moremanager/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/res/res_features.c?view=diff&rev=64156&r1=64155&r2=64156
==============================================================================
--- team/oej/moremanager/res/res_features.c (original)
+++ team/oej/moremanager/res/res_features.c Mon May 14 02:40:47 2007
@@ -329,6 +329,7 @@
 			return 0;	/* Continue execution if possible */
 		}
 		ast_copy_string(pu->parkingexten, parkingexten, sizeof(pu->parkingexten));
+		x = atoi(parkingexten);
 	} else {
 		/* Select parking space within range */
 		parking_range = parking_stop - parking_start+1;



More information about the asterisk-commits mailing list