[svn-commits] branch group/autoconf_and_menuselect r18312 - in /team/group/autoconf_and_men...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Apr 7 09:51:57 MST 2006


Author: russell
Date: Fri Apr  7 11:51:55 2006
New Revision: 18312

URL: http://svn.digium.com/view/asterisk?rev=18312&view=rev
Log:
more missing files

Added:
    team/group/autoconf_and_menuselect/configs/func_odbc.conf.sample   (with props)
    team/group/autoconf_and_menuselect/contrib/init.d/rc.suse.asterisk   (with props)
    team/group/autoconf_and_menuselect/contrib/scripts/safe_asterisk_restart   (with props)
    team/group/autoconf_and_menuselect/doc/00README.1st   (with props)
    team/group/autoconf_and_menuselect/include/asterisk/sha1.h   (with props)
Modified:
    team/group/autoconf_and_menuselect/formats/msgsm.h

Added: team/group/autoconf_and_menuselect/configs/func_odbc.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/configs/func_odbc.conf.sample?rev=18312&view=auto
==============================================================================
--- team/group/autoconf_and_menuselect/configs/func_odbc.conf.sample (added)
+++ team/group/autoconf_and_menuselect/configs/func_odbc.conf.sample Fri Apr  7 11:51:55 2006
@@ -1,0 +1,37 @@
+;
+; func_odbc.conf
+;
+; Each context is a separately defined function.  By convention, all
+; functions are entirely uppercase, so the defined contexts should also
+; be all-uppercase, but there is nothing that enforces this.  All functions
+; are case-sensitive, however.
+;
+; For substitution, you have ${ARG1}, ${ARG2} ... ${ARGn}
+; for the arguments to each SQL statement.
+;
+; In addition, for write statements, you have ${VAL1}, ${VAL2} ... ${VALn}
+; parsed, just like arguments, for the values.  In addition, if you want the
+; whole value, never mind the parsing, you can get that with ${VALUE}.
+;
+;
+; If you have data which may potentially contain single ticks, you may wish
+; to use the dialplan function SQL_ESC() to escape the data prior to its
+; inclusion in the SQL statement.
+
+
+; ODBC_SQL - Allow an SQL statement to be built entirely in the dialplan
+[SQL]
+dsn=mysql1
+read=${ARG1}
+
+; ODBC_ANTIGF - A blacklist.
+[ANTIGF]
+dsn=mysql1
+read=SELECT COUNT(*) FROM exgirlfriends WHERE callerid='${SQL_ESC(${ARG1})}'
+
+; ODBC_PRESENCE - Retrieve and update presence
+[PRESENCE]
+dsn=mysql1
+read=SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}'
+write=UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}'
+

Propchange: team/group/autoconf_and_menuselect/configs/func_odbc.conf.sample
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/autoconf_and_menuselect/configs/func_odbc.conf.sample
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/autoconf_and_menuselect/configs/func_odbc.conf.sample
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/group/autoconf_and_menuselect/contrib/init.d/rc.suse.asterisk
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/contrib/init.d/rc.suse.asterisk?rev=18312&view=auto
==============================================================================
--- team/group/autoconf_and_menuselect/contrib/init.d/rc.suse.asterisk (added)
+++ team/group/autoconf_and_menuselect/contrib/init.d/rc.suse.asterisk Fri Apr  7 11:51:55 2006
@@ -1,0 +1,118 @@
+#!/bin/sh
+# $Id: asterisk,v 1.3 2005/11/17 22:30:01 Gregory Boehnlein <damin at nacs.net>
+#
+# asterisk    Starts, Stops and Reloads Asterisk.
+#
+# chkconfig: 2345 40 60
+# description: Asterisk PBX and telephony daemon.
+# processname: asterisk
+# pidfile: /var/run/asterisk.pid
+#
+# Thu Nov 17 2005 Gregory Boehnlein <damin at nacs.net>
+# - Updated Version to 1.3
+# - Reversed behavior of LD_ASSUME_KERNEL=2.4.1
+# - Added detailed failure messages
+#
+# Sun Jul 18 2004 Gregory Boehnlein <damin at nacs.net>
+# - Updated Version to 1.2
+# - Added test for safe_asterisk
+# - Verified SIGTERM issued by "killproc" ensures "stop gracefully"
+# - Added support for -U and -G command line options
+# - Modified "reload" to call asterisk -rx 'reload' 
+
+# Source function library.
+. /lib/lsb/init-functions
+
+if ! [ -x /usr/sbin/asterisk ] ; then
+	echo "ERROR: /usr/sbin/asterisk not found"
+	exit 0
+fi
+
+if ! [ -d /etc/asterisk ] ; then
+	echo "ERROR: /etc/asterisk directory not found"
+	exit 0
+fi
+
+# Uncomment this ONLY if you know what you are doing.
+# export LD_ASSUME_KERNEL=2.4.1
+
+# Full path to asterisk binary
+DAEMON=/usr/sbin/asterisk
+
+# Full path to safe_asterisk script
+SAFE_ASTERISK=/usr/sbin/safe_asterisk
+
+# Uncomment the following and set them to the user/groups that you
+# want to run Asterisk as. NOTE: this requires substantial work to
+# be sure that Asterisk's environment has permission to write the
+# files required  for  its  operation, including logs, its comm
+# socket, the asterisk database, etc.
+#AST_USER="asterisk"
+#AST_GROUP="asterisk"
+
+RETVAL=0
+
+start() {
+	# Start daemons.
+	echo -n $"Starting asterisk: "
+        if [ -f $SAFE_ASTERISK ] ; then
+		DAEMON=$SAFE_ASTERISK
+	fi
+	if [ $AST_USER ] ; then
+		ASTARGS="-U $AST_USER"
+	fi
+	if [ $AST_GROUP ] ; then
+		ASTARGS="`echo $ASTARGS` -G $AST_GROUP"
+	fi
+	$DAEMON $ASTARGS
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk
+	echo
+	return $RETVAL
+}
+
+stop() {
+	# Stop daemons.
+	echo -n $"Shutting down asterisk: "
+	killproc asterisk
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/asterisk
+	echo
+	return $RETVAL
+}
+
+restart() {
+	stop
+	start
+}
+
+reload() {
+	$DAEMON -rx 'reload' > /dev/null 2> /dev/null
+}
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart)
+	restart
+	;;
+  reload)
+	reload
+	;;
+  condrestart)
+	[ -f /var/lock/subsys/asterisk ] && restart || :
+	;;
+  status)
+	status asterisk
+	;;
+  *)
+	echo "Usage: asterisk {start|stop|restart|reload|condrestart|status}"
+	exit 1
+esac
+
+exit $?

Propchange: team/group/autoconf_and_menuselect/contrib/init.d/rc.suse.asterisk
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/autoconf_and_menuselect/contrib/init.d/rc.suse.asterisk
------------------------------------------------------------------------------
    svn:executable = *

Propchange: team/group/autoconf_and_menuselect/contrib/init.d/rc.suse.asterisk
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/autoconf_and_menuselect/contrib/init.d/rc.suse.asterisk
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/group/autoconf_and_menuselect/contrib/scripts/safe_asterisk_restart
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/contrib/scripts/safe_asterisk_restart?rev=18312&view=auto
==============================================================================
--- team/group/autoconf_and_menuselect/contrib/scripts/safe_asterisk_restart (added)
+++ team/group/autoconf_and_menuselect/contrib/scripts/safe_asterisk_restart Fri Apr  7 11:51:55 2006
@@ -1,0 +1,110 @@
+#!/bin/bash
+# vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent
+#
+# this scripts prompts the user thrice, then tells asterisk to please shut down,
+# then kills asterisk and related processes with SIGTERM, then kills asterisk
+# and related processes with SIGKILL, and then starts asterisk with
+# safe_asterisk. Three arguments are currently supported, --no-countdown,
+# --no-prompt and --no-stop-now-first
+
+LOGFILE=/var/log/asterisk/safe_asterisk_restart.log
+ASTERISK=/usr/sbin/asterisk
+SAFE_ASTERISK=/usr/sbin/safe_asterisk
+
+DELAY=1					# Seconds between steps in countdown
+COUNTDOWN_FROM=5			# Steps to count down
+DO_COUNTDOWN=1				# Should I do a countdown before restarting asterisk?
+DO_PROMPT=1				# Should I prompt the user?
+TRY_STOP_NOW_FIRST=1			# Attempt a 'stop now' before killing processes. Note
+					# that this might make this script hang if asterisk
+					# can't respond to the command.
+
+# processes to kill. Please list all AGI scripts here as well as the asterisk
+# processes, since asterisk may leave them unkilled.
+PROCVICTIMS="safe_asterisk asterisk mpg123"
+
+# helper functions
+# die ["string to print"]
+function die {
+	if [[ "$1" != "" ]]; then
+		echo $1
+	else
+		echo "ok. no harm done..."
+	fi
+	exit
+}
+
+# docmd "string to print" "cmd"
+function docmd {
+	printf "$1..."
+	`$2 >> $LOGFILE 2>&1`
+	RETCODE=$?
+	sleep $DELAY
+	if [[ "$RETCODE" == "0" ]]; then
+		echo " OK"
+	else
+		echo " FAILED"
+	fi
+}
+
+# prompt "string" "positive answer"
+function prompt {
+	printf "$1"
+	read answer
+	if [[ "$answer" != "$2" ]]; then
+		die
+	fi
+}
+
+# countdown secs
+function countdown {
+	echo -n "$1 "
+	if [[ $1 > 0 ]]; then
+		sleep 1
+		countdown $[ $1 - 1 ]
+	else
+		echo "boom!"
+	fi
+}
+
+# am I really root?
+if [[ "$UID" != "0" ]]; then
+	echo "Sorry, only root can do this." >&2
+	exit;
+fi
+
+echo "`date`: $0 invoked" >> $LOGFILE
+
+# bash
+for i
+do
+	if [[ "$i" == "--no-countdown" ]]
+	then
+		unset DO_COUNTDOWN
+	fi
+	if [[ "$i" == "--no-prompt" ]]
+	then
+		unset DO_PROMPT
+	fi
+	if [[ "$i" == "--no-stop-now-first" ]]
+	then
+		unset TRY_STOP_NOW_FIRST
+	fi
+done
+
+[[ $DO_PROMPT ]] && prompt "Are you sure you want to restart asterisk? (yes/no)? " "yes"
+[[ $DO_PROMPT ]] && prompt "Really sure? (yes/no)? " "yes"
+[[ $DO_PROMPT ]] && prompt "Absolutely positive? (YES/no)? " "YES"
+
+[[ $DO_COUNTDOWN ]] && echo "OK, I'll do it, but if you're not sure about this, press ctrl+c now."
+[[ $DO_COUNTDOWN ]] && countdown $COUNTDOWN_FROM
+
+# doing the dirty work
+[[ $TRY_STOP_NOW_FIRST ]] && docmd "Asking asterisk kindly to shutdown" "$ASTERISK -rx 'stop now'"
+docmd "Sending asterisk processes the TERM signal" "killall -15 $PROCVICTIMS"
+docmd "Sending asterisk processes KILL signal" "killall -9 $PROCVICTIMS"
+docmd "Starting safe_asterisk" "$SAFE_ASTERISK"
+for i in $PROCVICTIMS
+do
+	ps axf | grep -w $i | grep -v grep
+done

Propchange: team/group/autoconf_and_menuselect/contrib/scripts/safe_asterisk_restart
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/autoconf_and_menuselect/contrib/scripts/safe_asterisk_restart
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/autoconf_and_menuselect/contrib/scripts/safe_asterisk_restart
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/group/autoconf_and_menuselect/doc/00README.1st
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/doc/00README.1st?rev=18312&view=auto
==============================================================================
--- team/group/autoconf_and_menuselect/doc/00README.1st (added)
+++ team/group/autoconf_and_menuselect/doc/00README.1st Fri Apr  7 11:51:55 2006
@@ -1,0 +1,72 @@
+Files in the /doc directory:
+----------------------------
+In addition to these files, there is a lot of documentation of various
+configuration options in the sample configuration files, in the /configs
+directory of your source code
+
+Start here
+----------
+security.txt		IMPORTANT INFORMATION ABOUT ASTERISK SECURITY
+hardware.txt		Hardware supported by Asterisk
+
+Configuration
+-------------
+configuration.txt	Features in the configuration parser
+extensions.txt		Basics about the dialplan
+extconfig.txt		How to use databases for configuration of Asterisk (ARA)
+ip-tos.txt		About the IP Type Of Service settings
+realtime.txt		The Asterisk Realtime Architecture - database support
+freetds.txt		Information about the FreeTDS support
+ael.txt			Information about the Asterisk Extension Language
+
+Misc
+----
+PEERING			The General Peering Agreement for Dundi
+ajam.txt		About the HTTP-based manager interface
+app_sms.txt		How to configure the SMS application
+asterisk.conf.txt	Documentation of various options in asterisk.conf
+callingpres.txt		Settings for Caller ID presentation
+billing.txt		Call Data Record information
+cliprompt.txt		How to change the Asterisk CLI prompt
+dundi.txt		Dundi - a discovery protocol
+enum.txt		Enum support in Asterisk
+ices.txt		Integrating ICEcast streaming in Asterisk
+jitterbuffer.txt	About the IAX2 jitterbuffer implementation
+math.txt		About the math() application
+mp3.txt			About MP3 support in Asterisk
+musiconhold-fpm.txt	Free Music On Hold music
+mysql.txt		About MYSQL support in Asterisk
+odbcstorage.txt		Voicemail storage of messages in UnixODBC
+privacy.txt		Privacy enhancements in Asterisk
+queuelog.txt		Agent and queue logging
+channelvariables.txt	Channel variables
+cdrdrivers.txt		About CDR storage in various databases (needs update)
+asterisk-mib.txt	SNMP mib for Asterisk (net-snmp)
+digium-mib.txt		SNMP mib for Asterisk (net-snmp)
+
+Channel drivers
+---------------
+misdn.txt		The mISDN channel driver for ISDN BRI cards
+h323.txt		How to compile and configure the H.323 channel
+chaniax.txt		About the IAX2 protocol support in Asterisk
+localchannel.txt	The local channel is a "gosub" in the dialplan
+
+Portability
+-----------
+cygwin.txt		Compiling Asterisk on CygWin platforms (Windows)
+
+For developers
+--------------
+See http://www.asterisk.org/developers for more information
+
+manager.txt		About the AMI - Asterisk Manager Interface
+			for third party call control and PBX management
+backtrace.txt		How to produce a backtrace when Asterisk crashes
+CODING-GUIDELINES	Guidelines for developers
+channels.txt		What is a channel?
+externalivr.txt		Documentation of the protocol used in externalivr()
+linkedlists.txt		How to develop linked lists in Asterisk (old)
+iax.txt			About the IAX protocol
+apps.txt		About application development
+model.txt		About the call model in Asterisk (old)
+modules.txt		How Asterisk modules work

Propchange: team/group/autoconf_and_menuselect/doc/00README.1st
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/autoconf_and_menuselect/doc/00README.1st
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/autoconf_and_menuselect/doc/00README.1st
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/group/autoconf_and_menuselect/formats/msgsm.h
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/formats/msgsm.h?rev=18312&r1=18311&r2=18312&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/formats/msgsm.h (original)
+++ team/group/autoconf_and_menuselect/formats/msgsm.h Fri Apr  7 11:51:55 2006
@@ -459,9 +459,7 @@
 		unsigned int LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4];
 		/* silence bogus compiler warning */
 		unsigned int xmc[13*4] = { 0, };
-
-			xmc[48] = 0;
-
+ 
                         sr = *c++;
                         LARc[0] = sr & 0x3f;  sr >>= 6;
                         sr |= (uword)*c++ << 2;

Added: team/group/autoconf_and_menuselect/include/asterisk/sha1.h
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/include/asterisk/sha1.h?rev=18312&view=auto
==============================================================================
--- team/group/autoconf_and_menuselect/include/asterisk/sha1.h (added)
+++ team/group/autoconf_and_menuselect/include/asterisk/sha1.h Fri Apr  7 11:51:55 2006
@@ -1,0 +1,81 @@
+/*
+ *  sha1.h
+ *
+ *  Description:
+ *      This is the header file for code which implements the Secure
+ *      Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
+ *      April 17, 1995.
+ *
+ *      Many of the variable names in this code, especially the
+ *      single character names, were used because those were the names
+ *      used in the publication.
+ *
+ *      Please read the file sha1.c for more information.
+ *
+ */
+
+
+#ifndef _SHA1_H_
+#define _SHA1_H_
+
+
+
+#if defined(__OpenBSD__) || defined( __FreeBSD__)
+#include <inttypes.h>
+#else
+#include <stdint.h>
+#endif
+
+/*
+ * If you do not have the ISO standard stdint.h header file, then you
+ * must typdef the following:
+ *    name              meaning
+ *  uint32_t         unsigned 32 bit integer
+ *  uint8_t          unsigned 8 bit integer (i.e., unsigned char)
+ *
+ */
+
+#ifndef _SHA_enum_
+#define _SHA_enum_
+enum
+{
+    shaSuccess = 0,
+    shaNull,            /* Null pointer parameter */
+    shaInputTooLong,    /* input data too long */
+    shaStateError       /* called Input after Result */
+};
+#endif
+#define SHA1HashSize 20
+
+/*
+ *  This structure will hold context information for the SHA-1
+ *  hashing operation
+ */
+typedef struct SHA1Context
+{
+    uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest  */
+
+    uint32_t Length_Low;            /* Message length in bits      */
+    uint32_t Length_High;           /* Message length in bits      */
+
+                               /* Index into message block array   */
+    uint32_t Message_Block_Index;	/* 8 bits actually suffice */
+    uint8_t Message_Block[64];      /* 512-bit message blocks      */
+
+    int Computed;               /* Is the digest computed?         */
+    int Corrupted;             /* Is the message digest corrupted? */
+} SHA1Context;
+
+/*
+ *  Function Prototypes
+ */
+
+
+int SHA1Reset(  SHA1Context *);
+int SHA1Input(  SHA1Context *,
+                const uint8_t *,
+                unsigned int);
+int SHA1Result( SHA1Context *,
+                uint8_t Message_Digest[SHA1HashSize]);
+
+#endif

Propchange: team/group/autoconf_and_menuselect/include/asterisk/sha1.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/autoconf_and_menuselect/include/asterisk/sha1.h
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/autoconf_and_menuselect/include/asterisk/sha1.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain



More information about the svn-commits mailing list