[asterisk-commits] dlee: branch dlee/stasis-res r385121 - in /team/dlee/stasis-res: ./ build_too...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 9 13:56:11 CDT 2013


Author: dlee
Date: Tue Apr  9 13:56:07 2013
New Revision: 385121

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385121
Log:
Merged revisions 384989-385088 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/dlee/stasis-res/   (props changed)
    team/dlee/stasis-res/CHANGES
    team/dlee/stasis-res/Makefile
    team/dlee/stasis-res/build_tools/make_buildopts_h
    team/dlee/stasis-res/build_tools/make_linker_version_script
    team/dlee/stasis-res/build_tools/make_version
    team/dlee/stasis-res/build_tools/mkpkgconfig
    team/dlee/stasis-res/configs/extconfig.conf.sample
    team/dlee/stasis-res/main/features.c

Propchange: team/dlee/stasis-res/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/dlee/stasis-res/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Apr  9 13:56:07 2013
@@ -1,1 +1,1 @@
-/trunk:1-384966
+/trunk:1-385115

Modified: team/dlee/stasis-res/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-res/CHANGES?view=diff&rev=385121&r1=385120&r2=385121
==============================================================================
--- team/dlee/stasis-res/CHANGES (original)
+++ team/dlee/stasis-res/CHANGES Tue Apr  9 13:56:07 2013
@@ -88,6 +88,10 @@
 
  * PARKINGSLOT and PARKEDLOT channel variables will now be set for a parked
    channel even when comebactoorigin=yes
+
+ * You can now have the settings for a channel updated using the FEATURE()
+   and FEATUREMAP() functions inherited to child channels by setting
+   FEATURE(inherit)=yes.
 
 Logging
 -------------------

Modified: team/dlee/stasis-res/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-res/Makefile?view=diff&rev=385121&r1=385120&r2=385121
==============================================================================
--- team/dlee/stasis-res/Makefile (original)
+++ team/dlee/stasis-res/Makefile Tue Apr  9 13:56:07 2013
@@ -81,6 +81,8 @@
                           # should go directly to ASTLDFLAGS
 
 #--- paths to various commands
+# The makeopts include below tries to set these if they're found during
+# configure.
 export CC
 export CXX
 export AR
@@ -221,10 +223,13 @@
   _ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2 -D__EXTENSIONS__
 endif
 
-ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) GIT=$(GIT) build_tools/make_version .)
-
-ifneq ($(wildcard .version),)
-  ASTERISKVERSIONNUM:=$(shell $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
+ifneq ($(GREP),)
+  ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) GIT=$(GIT) build_tools/make_version .)
+endif
+ifneq ($(AWK),)
+  ifneq ($(wildcard .version),)
+    ASTERISKVERSIONNUM:=$(shell $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
+  endif
 endif
 
 ifneq ($(wildcard .svn),)
@@ -450,7 +455,11 @@
 	done
 	$(MAKE) -C sounds install
 
-doc/core-en_US.xml: makeopts cleantest $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+ifneq ($(GREP),)
+  XML_core_en_US = $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+endif
+
+doc/core-en_US.xml: makeopts cleantest $(XML_core_en_US)
 	@printf "Building Documentation For: "
 	@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
 	@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
@@ -464,7 +473,11 @@
 	@echo
 	@echo "</docs>" >> $@
 
-doc/full-en_US.xml: makeopts cleantest $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+ifneq ($(GREP),)
+  XMX_full_en_US = $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+endif
+
+doc/full-en_US.xml: makeopts cleantest $(XML_full_en_US)
 ifeq ($(PYTHON),:)
 	@echo "--------------------------------------------------------------------------"
 	@echo "---        Please install python to build full documentation           ---"

Modified: team/dlee/stasis-res/build_tools/make_buildopts_h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-res/build_tools/make_buildopts_h?view=diff&rev=385121&r1=385120&r2=385121
==============================================================================
--- team/dlee/stasis-res/build_tools/make_buildopts_h (original)
+++ team/dlee/stasis-res/build_tools/make_buildopts_h Tue Apr  9 13:56:07 2013
@@ -1,4 +1,7 @@
 #!/bin/sh
+
+GREP=${GREP:-grep}
+MD5=${MD5:-md5sum}
 
 cat << END
 /*

Modified: team/dlee/stasis-res/build_tools/make_linker_version_script
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-res/build_tools/make_linker_version_script?view=diff&rev=385121&r1=385120&r2=385121
==============================================================================
--- team/dlee/stasis-res/build_tools/make_linker_version_script (original)
+++ team/dlee/stasis-res/build_tools/make_linker_version_script Tue Apr  9 13:56:07 2013
@@ -1,5 +1,6 @@
 #!/bin/sh
+
+AWK=${AWK:-awk}
 
 test -f ${1}.exports.in && ${AWK} "{sub(\"LINKER_SYMBOL_PREFIX\", \"${2}\"); print;}" ${1}.exports.in > ${1}.exports && exit 0
 test -f ${1}.exports.in || rm -f ${1}.exports && cp ${3}/default.exports ${1}.exports && exit 0
-

Modified: team/dlee/stasis-res/build_tools/make_version
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-res/build_tools/make_version?view=diff&rev=385121&r1=385120&r2=385121
==============================================================================
--- team/dlee/stasis-res/build_tools/make_version (original)
+++ team/dlee/stasis-res/build_tools/make_version Tue Apr  9 13:56:07 2013
@@ -1,4 +1,8 @@
 #!/bin/sh
+
+AWK=${AWK:-awk}
+GIT=${GIT:-git}
+GREP=${GREP:-grep}
 
 if [ -f ${1}/.version ]; then
     cat ${1}/.version
@@ -92,7 +96,7 @@
     # If the first log commit messages indicates that this is checked into
     # subversion, we'll just use the SVN- form of the revision.
     MODIFIED=""
-    SVN_REV=`${GIT} log --pretty=full -1 | grep -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
+    SVN_REV=`${GIT} log --pretty=full -1 | ${GREP} -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
     if [ -z "$SVN_REV" ]; then
         VERSION=GIT-`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`
         if [ $? -ne 0 ]; then
@@ -105,7 +109,7 @@
         fi
         echo ${VERSION}
     else
-        PARTS=`LANG=C ${GIT} log --pretty=full | grep -F "git-svn-id:" | head -1 | awk '{print $2;}' | sed -e s:^.*/svn/$2/:: | sed -e 's:/: :g' | sed -e 's/@.*$//g'`
+        PARTS=`LANG=C ${GIT} log --pretty=full | ${GREP} -F "git-svn-id:" | head -1 | ${AWK} '{print $2;}' | sed -e s:^.*/svn/$2/:: | sed -e 's:/: :g' | sed -e 's/@.*$//g'`
         BRANCH=0
         TEAM=0
         TAG=0

Modified: team/dlee/stasis-res/build_tools/mkpkgconfig
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-res/build_tools/mkpkgconfig?view=diff&rev=385121&r1=385120&r2=385121
==============================================================================
--- team/dlee/stasis-res/build_tools/mkpkgconfig (original)
+++ team/dlee/stasis-res/build_tools/mkpkgconfig Tue Apr  9 13:56:07 2013
@@ -1,5 +1,6 @@
 #!/bin/sh
 PPATH="$1"
+GREP=${GREP:-grep}
 ## Make sure we were called from Makefile
 
 if [ "x$ASTERISKVERSIONNUM" = "x" ]; then

Modified: team/dlee/stasis-res/configs/extconfig.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-res/configs/extconfig.conf.sample?view=diff&rev=385121&r1=385120&r2=385121
==============================================================================
--- team/dlee/stasis-res/configs/extconfig.conf.sample (original)
+++ team/dlee/stasis-res/configs/extconfig.conf.sample Tue Apr  9 13:56:07 2013
@@ -58,13 +58,17 @@
 ; start at 1 and be sequential (i.e. if you have only priorities 1, 2,
 ; and 4, then 4 will be ignored, because there is no 3).
 ;
+;
+; Possible driver backends:
+;
 ; "odbc" is shown in the examples below, but is not the only valid realtime
-; engine.  There is:
+; engine.  Here are several of the possible options:
 ;    odbc ... res_config_odbc
 ;    sqlite ... res_config_sqlite
 ;    pgsql ... res_config_pgsql
 ;    curl ... res_config_curl
 ;    ldap ... res_config_ldap
+;    mysql ... res_config_mysql (available via add-ons in menuselect)
 ;
 ; Note: The res_config_pgsql and res_config_sqlite backends configure the
 ; database used in their respective configuration files and ignore the

Modified: team/dlee/stasis-res/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-res/main/features.c?view=diff&rev=385121&r1=385120&r2=385121
==============================================================================
--- team/dlee/stasis-res/main/features.c (original)
+++ team/dlee/stasis-res/main/features.c Tue Apr  9 13:56:07 2013
@@ -438,6 +438,7 @@
 				<para>The allowed values are:</para>
 				<enumlist>
 					<enum name="parkingtime"><para>Specified in seconds.</para></enum>
+					<enum name="inherit"><para>Inherit feature settings made in FEATURE or FEATUREMAP to child channels.</para></enum>
 				</enumlist>
 			</parameter>
 		</syntax>
@@ -3333,11 +3334,31 @@
 	 * \todo XXX This isn't pretty.  At some point it would be nice to have all
 	 * of the global / [general] options in a config object that we store here
 	 * instead of handling each one manually.
+	 *
+	 * \note If anything gets added here, don't forget to update
+	 * feature_ds_duplicate, as well.
 	 * */
 	unsigned int parkingtime;
 	unsigned int parkingtime_is_set:1;
 };
 
+static int feature_exten_hash(const void *obj, int flags)
+{
+	const struct feature_exten *fe = obj;
+	const char *sname = obj;
+
+	return ast_str_hash(flags & OBJ_KEY ? sname : fe->sname);
+}
+
+static int feature_exten_cmp(void *obj, void *arg, int flags)
+{
+	const struct feature_exten *fe = obj, *fe2 = arg;
+	const char *sname = arg;
+
+	return !strcmp(fe->sname, flags & OBJ_KEY ? sname : fe2->sname) ?
+			CMP_MATCH | CMP_STOP : 0;
+}
+
 static void feature_ds_destroy(void *data)
 {
 	struct feature_ds *feature_ds = data;
@@ -3350,27 +3371,31 @@
 	ast_free(feature_ds);
 }
 
+static void *feature_ds_duplicate(void *data)
+{
+	struct feature_ds *old_ds = data;
+	struct feature_ds *new_ds;
+
+	if (!(new_ds = ast_calloc(1, sizeof(*new_ds)))) {
+		return NULL;
+	}
+
+	if (old_ds->feature_map) {
+		ao2_ref(old_ds->feature_map, +1);
+		new_ds->feature_map = old_ds->feature_map;
+	}
+
+	new_ds->parkingtime = old_ds->parkingtime;
+	new_ds->parkingtime_is_set = old_ds->parkingtime_is_set;
+
+	return new_ds;
+}
+
 static const struct ast_datastore_info feature_ds_info = {
 	.type = "FEATURE",
 	.destroy = feature_ds_destroy,
+	.duplicate = feature_ds_duplicate,
 };
-
-static int feature_exten_hash(const void *obj, int flags)
-{
-	const struct feature_exten *fe = obj;
-	const char *sname = obj;
-
-	return ast_str_hash(flags & OBJ_KEY ? sname : fe->sname);
-}
-
-static int feature_exten_cmp(void *obj, void *arg, int flags)
-{
-	const struct feature_exten *fe = obj, *fe2 = arg;
-	const char *sname = arg;
-
-	return !strcmp(fe->sname, flags & OBJ_KEY ? sname : fe2->sname) ?
-			CMP_MATCH | CMP_STOP : 0;
-}
 
 /*!
  * \internal
@@ -3409,6 +3434,19 @@
 	ast_channel_datastore_add(chan, ds);
 
 	return feature_ds;
+}
+
+static struct ast_datastore *get_feature_chan_ds(struct ast_channel *chan)
+{
+	struct ast_datastore *ds;
+
+	if (!(ds = ast_channel_datastore_find(chan, &feature_ds_info, NULL))) {
+		/* Hasn't been created yet.  Trigger creation. */
+		get_feature_ds(chan);
+		ds = ast_channel_datastore_find(chan, &feature_ds_info, NULL);
+	}
+
+	return ds;
 }
 
 /*!
@@ -8964,6 +9002,16 @@
 
 	if (!strcasecmp(data, "parkingtime")) {
 		snprintf(buf, len, "%u", get_parkingtime(chan, NULL) / 1000);
+	} else if (!strcasecmp(data, "inherit")) {
+		struct ast_datastore *ds;
+		unsigned int inherit;
+
+		ast_channel_lock(chan);
+		ds = get_feature_chan_ds(chan);
+		inherit = ds ? ds->inheritance : 0;
+		ast_channel_unlock(chan);
+
+		snprintf(buf, len, "%s", inherit ? "yes" : "no");
 	} else {
 		ast_log(LOG_WARNING, "Invalid argument '%s' to FEATURE()\n", data);
 		res = -1;
@@ -8993,6 +9041,11 @@
 			ast_log(LOG_WARNING, "'%s' is not a valid parkingtime\n", value);
 			feature_ds->parkingtime_is_set = 0;
 			res = -1;
+		}
+	} else if (!strcasecmp(data, "inherit")) {
+		struct ast_datastore *ds;
+		if ((ds = get_feature_chan_ds(chan))) {
+			ds->inheritance = ast_true(value) ? DATASTORE_INHERIT_FOREVER : 0;
 		}
 	} else {
 		ast_log(LOG_WARNING, "Invalid argument '%s' to FEATURE()\n", data);




More information about the asterisk-commits mailing list