[asterisk-commits] pabelanger: trunk r261124 - in /trunk: Makefile configs/asterisk.conf.sample

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 4 19:22:36 CDT 2010


Author: pabelanger
Date: Tue May  4 19:22:32 2010
New Revision: 261124

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=261124
Log:
New static asterisk.conf.sample file.

This simply moves the functionality from the Makefile (cleaning it up) into an external
asterisk.conf.samples file.  Also updates formatting (easier to read) and grammar
changes to asterisk.conf.samples.

(closes issue #17027)
Reported by: pabelanger
Patches:
      0017027.asterisk.conf.v6.patch uploaded by pabelanger (license 224)
Tested by: qwell, lmadsen, pabelanger, chappell

Review: https://reviewboard.asterisk.org/r/616/

Added:
    trunk/configs/asterisk.conf.sample   (with props)
Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/Makefile?view=diff&rev=261124&r1=261123&r2=261124
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Tue May  4 19:22:32 2010
@@ -60,6 +60,7 @@
 export ASTSBINDIR
 export AGI_DIR
 export ASTCONFPATH
+export ASTKEYDIR
 
 export OSARCH			# Operating system
 export PROC			# Processor type
@@ -701,73 +702,22 @@
 		echo "Installing file $$x"; \
 		$(INSTALL) -m 644 $$x $${dst} ;\
 	done
-	@if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
-		echo "Creating asterisk.conf"; \
-		( \
-		echo "[directories](!) ; remove the (!) to enable this" ; \
-		echo "astetcdir => $(ASTETCDIR)" ; \
-		echo "astmoddir => $(MODULES_DIR)" ; \
-		echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
-		echo "astdbdir => $(ASTDBDIR)" ; \
-		echo "astkeydir => $(ASTKEYDIR)" ; \
-		echo "astdatadir => $(ASTDATADIR)" ; \
-		echo "astagidir => $(AGI_DIR)" ; \
-		echo "astspooldir => $(ASTSPOOLDIR)" ; \
-		echo "astrundir => $(ASTVARRUNDIR)" ; \
-		echo "astlogdir => $(ASTLOGDIR)" ; \
-		echo "" ; \
-		echo "[options]" ; \
-		echo ";verbose = 3" ; \
-		echo ";debug = 3" ; \
-		echo ";alwaysfork = yes ; same as -F at startup" ; \
-		echo ";nofork = yes ; same as -f at startup" ; \
-		echo ";quiet = yes ; same as -q at startup" ; \
-		echo ";timestamp = yes ; same as -T at startup" ; \
-		echo ";execincludes = yes ; support #exec in config files" ; \
-		echo ";console = yes ; Run as console (same as -c at startup)" ; \
-		echo ";highpriority = yes ; Run realtime priority (same as -p at startup)" ; \
-		echo ";initcrypto = yes ; Initialize crypto keys (same as -i at startup)" ; \
-		echo ";nocolor = yes ; Disable console colors" ; \
-		echo ";dontwarn = yes ; Disable some warnings" ; \
-		echo ";dumpcore = yes ; Dump core on crash (same as -g at startup)" ; \
-		echo ";languageprefix = yes ; Use the new sound prefix path syntax" ; \
-		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 conjunction with cache_record_files)" ; \
-		echo ";transmit_silence = yes ; Transmit silence while a channel is in a waiting state, a recording only state, or when DTMF is" ; \
-		echo "                        ; being generated.  Note that the silence internally is generated in raw signed linear format." ; \
-		echo "                        ; This means that it must be transcoded into the native format of the channel before it can be sent" ; \
-		echo "                        ; to the device.  It is for this reason that this is optional, as it may result in requiring a" ; \
-		echo "                        ; temporary codec translation path for a channel that may not otherwise require one." ; \
-		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 ";lightbackground = yes ; If your terminal is set for a light-colored background" ; \
-		echo "documentation_language = en_US ; Set the Language you want Documentation displayed in. Value is in the same format as locale names" ; \
-		echo ";hideconnect = yes ; Hide messages displayed when a remote console connects and disconnects" ; \
-		echo ";lockconfdir = no ; Protect the directory containing the configuration files (/etc/asterisk) with a lock" ; \
-		echo "" ; \
-		echo "; Changing the following lines may compromise your security." ; \
-		echo ";[files]" ; \
-		echo ";astctlpermissions = 0660" ; \
-		echo ";astctlowner = root" ; \
-		echo ";astctlgroup = apache" ; \
-		echo ";astctl = asterisk.ctl" ; \
-		echo "" ; \
-		echo "[compat]" ; \
-		echo "pbx_realtime=1.6" ; \
-		echo "res_agi=1.6" ; \
-		echo "app_set=1.6" ; \
-		) > $(DESTDIR)$(ASTCONFPATH) ; \
-	else \
-		echo "Skipping asterisk.conf creation"; \
-	fi
+	if [ "$(OVERWRITE)" = "y" ]; then \
+		echo "Updating asterisk.conf"; \
+		sed \
+			-e 's|^;astetcdir.*$$|;astetcdir => $(ASTETCDIR)|' \
+			-e 's|^;astmoddir.*$$|;astmoddir => $(MODULES_DIR)|' \
+			-e 's|^;astvarlibdir.*$$|;astvarlibdir => $(ASTVARLIBDIR)|' \
+			-e 's|^;astdbdir.*$$|;astdbdir => $(ASTDBDIR)|' \
+			-e 's|^;astkeydir.*$$|;astkeydir => $(ASTKEYDIR)|' \
+			-e 's|^;astdatadir.*$$|;astdatadir => $(ASTDATADIR)|' \
+			-e 's|^;astagidir.*$$|;astagidir => $(AGI_DIR)|' \
+			-e 's|^;astspooldir.*$$|;astspooldir => $(ASTSPOOLDIR)|' \
+			-e 's|^;astrundir.*$$|;astrundir => $(ASTVARRUNDIR)|' \
+			-e 's|^;astlogdir.*$$|;astlogdir => $(ASTLOGDIR)|' \
+			$(DESTDIR)$(ASTCONFPATH) > $(DESTDIR)$(ASTCONFPATH).tmp \
+			&& mv $(DESTDIR)$(ASTCONFPATH).tmp $(DESTDIR)$(ASTCONFPATH); \
+	fi ;\
 	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
 	build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
 	@mkdir -p $(DESTDIR)$(ASTDATADIR)/phoneprov

Added: trunk/configs/asterisk.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/asterisk.conf.sample?view=auto&rev=261124
==============================================================================
--- trunk/configs/asterisk.conf.sample (added)
+++ trunk/configs/asterisk.conf.sample Tue May  4 19:22:32 2010
@@ -1,0 +1,83 @@
+[directories]
+;astetcdir => /etc/asterisk
+;astmoddir => /usr/lib/asterisk/modules
+;astvarlibdir => /var/lib/asterisk
+;astdbdir => /var/lib/asterisk
+;astkeydir => /var/lib/asterisk
+;astdatadir => /var/lib/asterisk
+;astagidir => /var/lib/asterisk/agi-bin
+;astspooldir => /var/spool/asterisk
+;astrundir => /var/run/asterisk
+;astlogdir => /var/log/asterisk
+
+[options]
+;verbose = 3
+;debug = 3
+;alwaysfork = yes		; Same as -F at startup.
+;nofork = yes			; Same as -f at startup.
+;quiet = yes			; Same as -q at startup.
+;timestamp = yes		; Same as -T at startup.
+;execincludes = yes		; Support #exec in config files.
+;console = yes			; Run as console (same as -c at startup).
+;highpriority = yes		; Run realtime priority (same as -p at
+				; startup).
+;initcrypto = yes		; Initialize crypto keys (same as -i at
+				; startup).
+;nocolor = yes			; Disable console colors.
+;dontwarn = yes			; Disable some warnings.
+;dumpcore = yes			; Dump core on crash (same as -g at startup).
+;languageprefix = yes		; Use the new sound prefix path syntax.
+;internal_timing = yes
+;systemname = my_system_name	; Prefix uniqueid with a system name for
+				; Global uniqueness issues.
+;autosystemname = yes		; Automatically set systemname to hostname,
+				; uses 'localhost' on failure, or systemname if
+				; set.
+;maxcalls = 10			; Maximum amount of calls allowed.
+;maxload = 0.9			; Asterisk stops accepting new calls if the
+				; load average exceed this limit.
+;maxfiles = 1000		; Maximum amount of openfiles.
+;minmemfree = 1			; In MBs, Asterisk stops accepting new calls if
+				; the amount of free memory falls below this
+				; watermark.
+;cache_record_files = yes	; Cache recorded sound files to another
+				; directory during recording.
+;record_cache_dir = /tmp	; Specify cache directory (used in conjunction
+				; with cache_record_files).
+;transmit_silence = yes		; Transmit silence while a channel is in a
+				; waiting state, a recording only state, or
+				; when DTMF is being generated.  Note that the
+				; silence internally is generated in raw signed
+				; linear format. This means that it must be
+				; transcoded into the native format of the
+				; channel before it can be sent to the device.
+				; It is for this reason that this is optional,
+				; as it may result in requiring a temporary
+				; codec translation path for a channel that may
+				; not otherwise require one.
+;transcode_via_sln = yes	; Build transcode paths via SLINEAR, instead of
+				; directly.
+;runuser = asterisk		; The user to run as.
+;rungroup = asterisk		; The group to run as.
+;lightbackground = yes		; If your terminal is set for a light-colored
+				; background.
+documentation_language = en_US	; Set the language you want documentation
+				; displayed in. Value is in the same format as
+				; locale names.
+;hideconnect = yes		; Hide messages displayed when a remote console
+				; connects and disconnects.
+;lockconfdir = no		; Protect the directory containing the
+				; configuration files (/etc/asterisk) with a
+				; lock.
+
+; Changing the following lines may compromise your security.
+;[files]
+;astctlpermissions = 0660
+;astctlowner = root
+;astctlgroup = apache
+;astctl = asterisk.ctl
+
+[compat]
+pbx_realtime=1.6
+res_agi=1.6
+app_set=1.6

Propchange: trunk/configs/asterisk.conf.sample
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/configs/asterisk.conf.sample
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/configs/asterisk.conf.sample
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list