[asterisk-commits] qwell: branch qwell/fun_with_transports r385111 - in /team/qwell/fun_with_tra...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 9 10:44:31 CDT 2013


Author: qwell
Date: Tue Apr  9 10:44:27 2013
New Revision: 385111

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385111
Log:
Multiple revisions 384992,385052,385090,385107,385110

........
  r384992 | root | 2013-04-08 14:17:44 -0500 (Mon, 08 Apr 2013) | 7 lines
  
  Clean up Makefile "warning" clutter when makeopts doesn't exist.
  
  Review: https://reviewboard.asterisk.org/r/2304
  ........
  
  Merged revisions 384989 from file:///srv/subversion/repos/asterisk/trunk
........
  r385052 | root | 2013-04-08 19:17:38 -0500 (Mon, 08 Apr 2013) | 13 lines
  
  Modified the list of keys for the driver backends for sake of sample clarity
  
  Added a line showing the mapping of "mysql" to res_config_mysql available in add-ons. We used "mysql" as an example driver key in the sample, but didn't show what module it mapped too. Also added a subtitle above the list of keys for driver backends.
  ........
  
  Merged revisions 385047 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 385048 from http://svn.asterisk.org/svn/asterisk/branches/11
  ........
  
  Merged revisions 385049 from file:///srv/subversion/repos/asterisk/trunk
........
  r385090 | root | 2013-04-09 01:17:38 -0500 (Tue, 09 Apr 2013) | 11 lines
  
  Add inheritance support to FEATURE()/FEATUREMAP().
  
  The settings saved on the channel for FEATURE()/FEATUREMAP() were only
  for that channel.  This patch adds the ability to have these settings
  inherited to child channels if you set FEATURE(inherit)=yes.
  
  Review: https://reviewboard.asterisk.org/r/2415/
  ........
  
  Merged revisions 385088 from file:///srv/subversion/repos/asterisk/trunk
........
  r385107 | file | 2013-04-09 09:53:54 -0500 (Tue, 09 Apr 2013) | 2 lines
  
  Now that res_sorcery_astdb is in trunk make the default for contacts to be astdb so they are persisted across restarts.
........
  r385110 | file | 2013-04-09 10:24:03 -0500 (Tue, 09 Apr 2013) | 2 lines
  
  Be more tolerate within res_sip_session of res_sip failing to load properly, plus I want Bamboo to run for kicks.
........

Merged revisions 384992,385052,385090,385107,385110 from http://svn.asterisk.org/svn/asterisk/team/group/pimp_my_sip

Modified:
    team/qwell/fun_with_transports/   (props changed)
    team/qwell/fun_with_transports/CHANGES
    team/qwell/fun_with_transports/Makefile
    team/qwell/fun_with_transports/build_tools/make_buildopts_h
    team/qwell/fun_with_transports/build_tools/make_linker_version_script
    team/qwell/fun_with_transports/build_tools/make_version
    team/qwell/fun_with_transports/build_tools/mkpkgconfig
    team/qwell/fun_with_transports/configs/extconfig.conf.sample
    team/qwell/fun_with_transports/main/features.c
    team/qwell/fun_with_transports/res/res_sip/location.c
    team/qwell/fun_with_transports/res/res_sip_session.c

Propchange: team/qwell/fun_with_transports/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/qwell/fun_with_transports/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Apr  9 10:44:27 2013
@@ -1,1 +1,1 @@
-/team/group/pimp_my_sip:1-384989 /trunk:1-383466
+/team/group/pimp_my_sip:1-385110 /trunk:1-383466

Modified: team/qwell/fun_with_transports/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/CHANGES?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/CHANGES (original)
+++ team/qwell/fun_with_transports/CHANGES Tue Apr  9 10:44:27 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/qwell/fun_with_transports/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/Makefile?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/Makefile (original)
+++ team/qwell/fun_with_transports/Makefile Tue Apr  9 10:44:27 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/qwell/fun_with_transports/build_tools/make_buildopts_h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/build_tools/make_buildopts_h?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/build_tools/make_buildopts_h (original)
+++ team/qwell/fun_with_transports/build_tools/make_buildopts_h Tue Apr  9 10:44:27 2013
@@ -1,4 +1,7 @@
 #!/bin/sh
+
+GREP=${GREP:-grep}
+MD5=${MD5:-md5sum}
 
 cat << END
 /*

Modified: team/qwell/fun_with_transports/build_tools/make_linker_version_script
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/build_tools/make_linker_version_script?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/build_tools/make_linker_version_script (original)
+++ team/qwell/fun_with_transports/build_tools/make_linker_version_script Tue Apr  9 10:44:27 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/qwell/fun_with_transports/build_tools/make_version
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/build_tools/make_version?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/build_tools/make_version (original)
+++ team/qwell/fun_with_transports/build_tools/make_version Tue Apr  9 10:44:27 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/qwell/fun_with_transports/build_tools/mkpkgconfig
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/build_tools/mkpkgconfig?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/build_tools/mkpkgconfig (original)
+++ team/qwell/fun_with_transports/build_tools/mkpkgconfig Tue Apr  9 10:44:27 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/qwell/fun_with_transports/configs/extconfig.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/configs/extconfig.conf.sample?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/configs/extconfig.conf.sample (original)
+++ team/qwell/fun_with_transports/configs/extconfig.conf.sample Tue Apr  9 10:44:27 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/qwell/fun_with_transports/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/main/features.c?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/main/features.c (original)
+++ team/qwell/fun_with_transports/main/features.c Tue Apr  9 10:44:27 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);

Modified: team/qwell/fun_with_transports/res/res_sip/location.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/res/res_sip/location.c?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/res/res_sip/location.c (original)
+++ team/qwell/fun_with_transports/res/res_sip/location.c Tue Apr  9 10:44:27 2013
@@ -261,7 +261,7 @@
 /*! \brief Initialize sorcery with location support */
 int ast_sip_initialize_sorcery_location(struct ast_sorcery *sorcery)
 {
-	ast_sorcery_apply_default(sorcery, "contact", "memory", NULL);
+	ast_sorcery_apply_default(sorcery, "contact", "astdb", "registrar");
 	ast_sorcery_apply_default(sorcery, "aor", "config", "res_sip.conf,criteria=type=aor");
 
 	if (ast_sorcery_object_register(sorcery, "contact", contact_alloc, NULL, NULL) ||

Modified: team/qwell/fun_with_transports/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/res/res_sip_session.c?view=diff&rev=385111&r1=385110&r2=385111
==============================================================================
--- team/qwell/fun_with_transports/res/res_sip_session.c (original)
+++ team/qwell/fun_with_transports/res/res_sip_session.c Tue Apr  9 10:44:27 2013
@@ -1755,6 +1755,9 @@
 static int load_module(void)
 {
 	pjsip_endpoint *endpt;
+	if (!ast_sip_get_sorcery() || !ast_sip_get_pjsip_endpoint()) {
+		return AST_MODULE_LOAD_DECLINE;
+	}
 	if (!(nat_hook = ast_sorcery_alloc(ast_sip_get_sorcery(), "nat_hook", NULL))) {
 		return AST_MODULE_LOAD_DECLINE;
 	}




More information about the asterisk-commits mailing list