[asterisk-commits] branch rizzo/base r9705 - in /team/rizzo/base: ./ channels/ configs/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Feb 12 10:10:57 MST 2006


Author: rizzo
Date: Sun Feb 12 11:10:53 2006
New Revision: 9705

URL: http://svn.digium.com/view/asterisk?rev=9705&view=rev
Log:
Add support for automatic config file extraction from
source files. See the trivial instruction in configs/Makefile,
and an example in channels/chan_oss.c


Added:
    team/rizzo/base/configs/Makefile
    team/rizzo/base/configs/get_config.awk
Removed:
    team/rizzo/base/configs/oss.conf.sample
Modified:
    team/rizzo/base/Makefile
    team/rizzo/base/channels/chan_oss.c

Modified: team/rizzo/base/Makefile
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/Makefile?rev=9705&r1=9704&r2=9705&view=diff
==============================================================================
--- team/rizzo/base/Makefile (original)
+++ team/rizzo/base/Makefile Sun Feb 12 11:10:53 2006
@@ -364,7 +364,7 @@
 #ASTCFLAGS+= -fomit-frame-pointer 
 endif
 
-SUBDIRS=res channels pbx apps codecs formats agi cdr funcs utils stdtime
+SUBDIRS=res channels pbx apps codecs formats agi cdr funcs utils stdtime configs
 
 OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
 	translate.o file.o say2.o pbx.o cli.o md5.o term.o \

Modified: team/rizzo/base/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/channels/chan_oss.c?rev=9705&r1=9704&r2=9705&view=diff
==============================================================================
--- team/rizzo/base/channels/chan_oss.c (original)
+++ team/rizzo/base/channels/chan_oss.c Sun Feb 12 11:10:53 2006
@@ -94,24 +94,51 @@
 START_CONFIG
 
 [general]
-; general config options, default values are shown
-; all but debug can go also in the device-specific sections.
-; debug=0x0		; misc debug flags, default is 0
+    ; General config options, with default values shown.
+    ; You should use one section per device, with [general] being used
+    ; for the first device and also as a template for other devices.
+    ;
+    ; All but 'debug' can go also in the device-specific sections.
+    ;
+    ; debug = 0x0		; misc debug flags, default is 0
+
+    ; Set the device to use for I/O
+    ; device = /dev/dsp
+
+    ; Optional mixer command to run upon startup (e.g. to set
+    ; volume levels, mutes, etc.
+    ; mixer =
+
+    ; Software mic volume booster (or attenuator), useful for sound
+    ; cards or microphones with poor sensitivity. The volume level
+    ; is in dB, ranging from -20.0 to +20.0
+    ; boost = n			; mic volume boost in dB
+
+    ; Set the callerid for outgoing calls
+    ; callerid = John Doe <555-1234>
+
+    ; autoanswer = no		; no autoanswer on call
+    ; autohangup = yes		; hangup when other party closes
+    ; extension = s		; default extension to call
+    ; context = default		; default context for outgoing calls
+    ; language = ""		; default language
+
+    ; If you set overridecontext to 'yes', then the whole dial string
+    ; will be interpreted as an extension, which is extremely useful
+    ; to dial SIP, IAX and other extensions which use the '@' character.
+    ; The default is 'no' just for backward compatibility, but the
+    ; suggestion is to change it.
+    ; overridecontext = no	; if 'no', the last @ will start the context
+				; if 'yes' the whole string is an extension.
+
+    ; low level device parameters in case you have problems with the
+    ; device driver on your operating system. You should not touch these
+    ; unless you know what you are doing.
+    ; queuesize = 10		; frames in device driver
+    ; frags = 8			; argument to SETFRAGMENT
 
 [card1]
-; autoanswer = no	; no autoanswer on call
-; autohangup = yes	; hangup when other party closes
-; extension=s		; default extension to call
-; context=default	; default context
-; language=""		; default language
-; overridecontext=yes	; the whole dial string is considered an extension.
-			; if no, the last @ will start the context
-
-; device=/dev/dsp	; device to open
-; mixer="-f /dev/mixer0 pcm 80 ; mixer command to run on start
-; queuesize=10		; frames in device driver
-; frags=8		; argument to SETFRAGMENT
-; boost = n		; mic volume boost in dB
+    ; device = /dev/dsp1	; alternate device
 
 END_CONFIG
 

Added: team/rizzo/base/configs/Makefile
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/configs/Makefile?rev=9705&view=auto
==============================================================================
--- team/rizzo/base/configs/Makefile (added)
+++ team/rizzo/base/configs/Makefile Sun Feb 12 11:10:53 2006
@@ -1,0 +1,27 @@
+#
+# support for automatic generation of config files from sources.
+#
+# The source file should contain the sample config in a comment
+# between lines starting with START_CONFIG and END_CONFIG.
+#
+# Then for each source file, add the name to TARGETS
+# and a rule of the kind
+#
+#    foo.conf.sample: ../channels/chan_foo.c
+#	${CMD} $< > $@
+#
+
+TARGETS= oss.conf.sample
+CMD= awk -f get_config.awk
+
+all:	${TARGETS}
+
+clean:
+	rm -rf ${TARGETS}
+
+install:
+	# empty target here, samples are installed with "make samples"
+
+oss.conf.sample:	../channels/chan_oss.c
+	${CMD} $< > $@   
+

Added: team/rizzo/base/configs/get_config.awk
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/configs/get_config.awk?rev=9705&view=auto
==============================================================================
--- team/rizzo/base/configs/get_config.awk (added)
+++ team/rizzo/base/configs/get_config.awk Sun Feb 12 11:10:53 2006
@@ -1,0 +1,8 @@
+# awk script for automatic config file extraction
+#
+
+NR == 1		{ printf "#\n# Automatically generated from %s\n#\n",
+			FILENAME; }
+/^START_CONFIG/ {       echo = 1; next; }
+/^END_CONFIG/   {       exit;           }
+		{       if (echo) print $0; } 



More information about the asterisk-commits mailing list