[asterisk-commits] dlee: branch dlee/playback-rebase r388813 - in /team/dlee/playback-rebase: ./...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 15 08:53:43 CDT 2013


Author: dlee
Date: Wed May 15 08:53:41 2013
New Revision: 388813

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388813
Log:
Merged revisions 388751-388770 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/dlee/playback-rebase/   (props changed)
    team/dlee/playback-rebase/configure
    team/dlee/playback-rebase/configure.ac
    team/dlee/playback-rebase/include/asterisk/autoconfig.h.in
    team/dlee/playback-rebase/include/asterisk/stasis.h
    team/dlee/playback-rebase/main/app.c
    team/dlee/playback-rebase/main/asterisk.c
    team/dlee/playback-rebase/main/devicestate.c
    team/dlee/playback-rebase/main/named_acl.c
    team/dlee/playback-rebase/main/presencestate.c
    team/dlee/playback-rebase/main/stasis.c
    team/dlee/playback-rebase/main/stasis_cache.c
    team/dlee/playback-rebase/main/stasis_endpoints.c
    team/dlee/playback-rebase/main/test.c
    team/dlee/playback-rebase/res/res_srtp.c
    team/dlee/playback-rebase/res/res_stasis_test.c

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

Propchange: team/dlee/playback-rebase/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed May 15 08:53:41 2013
@@ -1,1 +1,1 @@
-/trunk:1-388729
+/trunk:1-388812

Modified: team/dlee/playback-rebase/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/configure.ac?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/configure.ac (original)
+++ team/dlee/playback-rebase/configure.ac Wed May 15 08:53:41 2013
@@ -469,6 +469,7 @@
 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
 AST_EXT_LIB_SETUP([SQLITE3], [SQLite], [sqlite3])
 AST_EXT_LIB_SETUP([SRTP], [Secure RTP], [srtp])
+AST_EXT_LIB_SETUP_OPTIONAL([SRTP_SHUTDOWN], [SRTP Library Shutdown Function], [SRTP], [srtp])
 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer], [ssl])
 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
@@ -2179,6 +2180,7 @@
     CFLAGS="${saved_cflags}"
 fi
 
+AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h])
 
 for ver in 2.0 2.2 2.4 2.6; do
 	AST_PKG_CONFIG_CHECK([GMIME], gmime-$ver)

Modified: team/dlee/playback-rebase/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/include/asterisk/autoconfig.h.in?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/include/asterisk/autoconfig.h.in (original)
+++ team/dlee/playback-rebase/include/asterisk/autoconfig.h.in Wed May 15 08:53:41 2013
@@ -294,7 +294,7 @@
 /* Define if your system has the GLOB_NOMAGIC headers. */
 #undef HAVE_GLOB_NOMAGIC
 
-/* Define to 1 if you have the GMime library. */
+/* Define if your system has the GMIME libraries. */
 #undef HAVE_GMIME
 
 /* Define to indicate the GSM library */
@@ -306,7 +306,7 @@
 /* Define to indicate that gsm.h has no prefix for its location */
 #undef HAVE_GSM_HEADER
 
-/* Define to 1 if you have the gtk2 library. */
+/* Define if your system has the GTK2 libraries. */
 #undef HAVE_GTK2
 
 /* Define to 1 if you have the Hoard Memory Allocator library. */
@@ -324,7 +324,7 @@
 /* Define to 1 if you have the Iksemel Jabber library. */
 #undef HAVE_IKSEMEL
 
-/* Define to 1 if you have the System iLBC library. */
+/* Define if your system has the ILBC libraries. */
 #undef HAVE_ILBC
 
 /* Define if your system has the UW IMAP Toolkit c-client library. */
@@ -376,7 +376,7 @@
 /* Define to 1 if you have the OpenLDAP library. */
 #undef HAVE_LDAP
 
-/* Define to 1 if you have the NetBSD Editline library library. */
+/* Define if your system has the LIBEDIT libraries. */
 #undef HAVE_LIBEDIT
 
 /* Define to 1 if you have the <libintl.h> header file. */
@@ -551,7 +551,7 @@
 /* Define to indicate presence of the pg_encoding_to_char API. */
 #undef HAVE_PGSQL_pg_encoding_to_char
 
-/* Define to 1 if you have the PJPROJECT library. */
+/* Define if your system has the PJPROJECT libraries. */
 #undef HAVE_PJPROJECT
 
 /* Define to 1 if your system defines IP_PKTINFO. */
@@ -765,6 +765,9 @@
 /* Define to 1 if you have the Secure RTP library. */
 #undef HAVE_SRTP
 
+/* Define to 1 if SRTP has the SRTP Library Shutdown Function feature. */
+#undef HAVE_SRTP_SHUTDOWN
+
 /* Define to 1 if you have the ISDN SS7 library. */
 #undef HAVE_SS7
 
@@ -854,19 +857,19 @@
 /* Define to 1 if you have the `strtoq' function. */
 #undef HAVE_STRTOQ
 
-/* Define to 1 if `ifr_ifru.ifru_hwaddr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_ifru.ifru_hwaddr' is a member of `struct ifreq'. */
 #undef HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR
 
-/* Define to 1 if `uid' is member of `struct sockpeercred'. */
+/* Define to 1 if `uid' is a member of `struct sockpeercred'. */
 #undef HAVE_STRUCT_SOCKPEERCRED_UID
 
-/* Define to 1 if `st_blksize' is member of `struct stat'. */
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_BLKSIZE
 
-/* Define to 1 if `cr_uid' is member of `struct ucred'. */
+/* Define to 1 if `cr_uid' is a member of `struct ucred'. */
 #undef HAVE_STRUCT_UCRED_CR_UID
 
-/* Define to 1 if `uid' is member of `struct ucred'. */
+/* Define to 1 if `uid' is a member of `struct ucred'. */
 #undef HAVE_STRUCT_UCRED_UID
 
 /* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -1144,11 +1147,11 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
-
-/* Define to 1 if the C compiler supports function prototypes. */
-#undef PROTOTYPES
 
 /* Define to necessary symbol if this constant uses a non-standard name on
    your system. */
@@ -1168,11 +1171,6 @@
 
 /* Define to the type of arg 5 for `select'. */
 #undef SELECT_TYPE_ARG5
-
-/* Define to 1 if the `setvbuf' function takes the buffering type as its
-   second argument and the buffer pointer as the third, as on System V before
-   release 3. */
-#undef SETVBUF_REVERSED
 
 /* The size of `char *', as computed by sizeof. */
 #undef SIZEOF_CHAR_P
@@ -1209,23 +1207,38 @@
 /* Define to a type of the same size as fd_set.fds_bits[[0]] */
 #undef TYPEOF_FD_SET_FDS_BITS
 
-/* Define to 1 if on AIX 3.
-   System headers sometimes define this.
-   We just want to avoid a redefinition error message.  */
+/* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-
-/* Define to 1 if running on Darwin. */
-#undef _DARWIN_UNLIMITED_SELECT
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define to 1 if running on Darwin. */
+#undef _DARWIN_UNLIMITED_SELECT
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
 
 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
 #undef _LARGEFILE_SOURCE
@@ -1242,20 +1255,6 @@
 
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
-
-/* Enable extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-
-/* Define like PROTOTYPES; this can be used by system headers. */
-#undef __PROTOTYPES
 
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const

Modified: team/dlee/playback-rebase/include/asterisk/stasis.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/include/asterisk/stasis.h?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/include/asterisk/stasis.h (original)
+++ team/dlee/playback-rebase/include/asterisk/stasis.h Wed May 15 08:53:41 2013
@@ -565,10 +565,17 @@
  */
 #define STASIS_MESSAGE_TYPE_INIT(name)					\
 	({								\
+		ast_assert(_priv_ ## name == NULL);			\
 		_priv_ ## name = stasis_message_type_create(#name);	\
 			_priv_ ## name ? 0 : -1;			\
 	})
 
+/*!
+ * \brief Boiler-plate removing macro for cleaning up message types.
+ *
+ * \param name Name of message type.
+ * \since 12
+ */
 #define STASIS_MESSAGE_TYPE_CLEANUP(name)	\
 	({					\
 		ao2_cleanup(_priv_ ## name);	\

Modified: team/dlee/playback-rebase/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/app.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/main/app.c (original)
+++ team/dlee/playback-rebase/main/app.c Wed May 15 08:53:41 2013
@@ -84,8 +84,9 @@
 
 static struct stasis_topic *mwi_topic_all;
 static struct stasis_caching_topic *mwi_topic_cached;
-static struct stasis_message_type *mwi_state_type;
 static struct stasis_topic_pool *mwi_topic_pool;
+
+STASIS_MESSAGE_TYPE_DEFN(stasis_mwi_state_type);
 
 static void *shaun_of_the_dead(void *data)
 {
@@ -2659,11 +2660,6 @@
 	return mwi_topic_cached;
 }
 
-struct stasis_message_type *stasis_mwi_state_type(void)
-{
-	return mwi_state_type;
-}
-
 struct stasis_topic *stasis_mwi_topic(const char *uniqueid)
 {
 	return stasis_topic_pool_get_topic(mwi_topic_pool, uniqueid);
@@ -2732,8 +2728,7 @@
 	ao2_cleanup(mwi_topic_all);
 	mwi_topic_all = NULL;
 	mwi_topic_cached = stasis_caching_unsubscribe(mwi_topic_cached);
-	ao2_cleanup(mwi_state_type);
-	mwi_state_type = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(stasis_mwi_state_type);
 	ao2_cleanup(mwi_topic_pool);
 	mwi_topic_pool = NULL;
 }
@@ -2748,8 +2743,7 @@
 	if (!mwi_topic_cached) {
 		return -1;
 	}
-	mwi_state_type = stasis_message_type_create("stasis_mwi_state");
-	if (!mwi_state_type) {
+	if (STASIS_MESSAGE_TYPE_INIT(stasis_mwi_state_type) != 0) {
 		return -1;
 	}
 	mwi_topic_pool = stasis_topic_pool_create(mwi_topic_all);

Modified: team/dlee/playback-rebase/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/asterisk.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/main/asterisk.c (original)
+++ team/dlee/playback-rebase/main/asterisk.c Wed May 15 08:53:41 2013
@@ -415,7 +415,7 @@
 static struct stasis_topic *system_topic;
 
 /*!\ brief The \ref stasis_message_type for network changes */
-static struct stasis_message_type *network_change_type;
+STASIS_MESSAGE_TYPE_DEFN(ast_network_change_type);
 
 #if !defined(LOW_MEMORY)
 struct file_version {
@@ -1063,18 +1063,12 @@
 	return system_topic;
 }
 
-struct stasis_message_type *ast_network_change_type(void)
-{
-	return network_change_type;
-}
-
 /*! \brief Cleanup the \ref stasis system level items */
 static void stasis_system_topic_cleanup(void)
 {
 	ao2_ref(system_topic, -1);
 	system_topic = NULL;
-	ao2_ref(network_change_type, -1);
-	network_change_type = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(ast_network_change_type);
 }
 
 /*! \brief Initialize the system level items for \ref stasis */
@@ -1087,8 +1081,7 @@
 		return 1;
 	}
 
-	network_change_type = stasis_message_type_create("network_change");
-	if (!network_change_type) {
+	if (STASIS_MESSAGE_TYPE_INIT(ast_network_change_type) != 0) {
 		return -1;
 	}
 	return 0;

Modified: team/dlee/playback-rebase/main/devicestate.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/devicestate.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/main/devicestate.c (original)
+++ team/dlee/playback-rebase/main/devicestate.c Wed May 15 08:53:41 2013
@@ -197,8 +197,9 @@
 
 static struct stasis_topic *device_state_topic_all;
 static struct stasis_caching_topic *device_state_topic_cached;
-static struct stasis_message_type *device_state_message_type;
 static struct stasis_topic_pool *device_state_topic_pool;
+
+STASIS_MESSAGE_TYPE_DEFN(ast_device_state_message_type);
 
 /* Forward declarations */
 static int getproviderstate(const char *provider, const char *address);
@@ -723,11 +724,6 @@
 	return device_state_topic_cached;
 }
 
-struct stasis_message_type *ast_device_state_message_type(void)
-{
-	return device_state_message_type;
-}
-
 struct stasis_topic *ast_device_state_topic(const char *device)
 {
 	return stasis_topic_pool_get_topic(device_state_topic_pool, device);
@@ -781,8 +777,7 @@
 	ao2_cleanup(device_state_topic_all);
 	device_state_topic_all = NULL;
 	device_state_topic_cached = stasis_caching_unsubscribe(device_state_topic_cached);
-	ao2_cleanup(device_state_message_type);
-	device_state_message_type = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(ast_device_state_message_type);
 	ao2_cleanup(device_state_topic_pool);
 	device_state_topic_pool = NULL;
 }
@@ -797,8 +792,7 @@
 	if (!device_state_topic_cached) {
 		return -1;
 	}
-	device_state_message_type = stasis_message_type_create("ast_device_state_message");
-	if (!device_state_message_type) {
+	if (STASIS_MESSAGE_TYPE_INIT(ast_device_state_message_type) != 0) {
 		return -1;
 	}
 	device_state_topic_pool = stasis_topic_pool_create(ast_device_state_topic_all());

Modified: team/dlee/playback-rebase/main/named_acl.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/named_acl.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/main/named_acl.c (original)
+++ team/dlee/playback-rebase/main/named_acl.c Wed May 15 08:53:41 2013
@@ -360,7 +360,14 @@
 static struct stasis_topic *acl_topic;
 
 /*! \brief Message type for named ACL changes */
-static struct stasis_message_type *named_acl_change_type;
+STASIS_MESSAGE_TYPE_DEFN(ast_named_acl_change_type);
+
+static void acl_stasis_shutdown(void)
+{
+	ao2_cleanup(acl_topic);
+	acl_topic = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(ast_named_acl_change_type);
+}
 
 /*!
  * \internal
@@ -368,18 +375,14 @@
  */
 static void ast_acl_stasis_init(void)
 {
+	ast_register_atexit(acl_stasis_shutdown);
 	acl_topic = stasis_topic_create("ast_acl");
-	named_acl_change_type = stasis_message_type_create("ast_named_acl_change");
+	STASIS_MESSAGE_TYPE_INIT(ast_named_acl_change_type);
 }
 
 struct stasis_topic *ast_acl_topic(void)
 {
 	return acl_topic;
-}
-
-struct stasis_message_type *ast_named_acl_change_type(void)
-{
-	return named_acl_change_type;
 }
 
 /*!

Modified: team/dlee/playback-rebase/main/presencestate.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/presencestate.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/main/presencestate.c (original)
+++ team/dlee/playback-rebase/main/presencestate.c Wed May 15 08:53:41 2013
@@ -53,7 +53,7 @@
 	{ "dnd", AST_PRESENCE_DND},
 };
 
-struct stasis_message_type *presence_state_type;
+STASIS_MESSAGE_TYPE_DEFN(ast_presence_state_message_type);
 struct stasis_topic *presence_state_topic_all;
 struct stasis_caching_topic *presence_state_topic_cached;
 
@@ -289,11 +289,6 @@
 	return ast_presence_state_changed_literal(state, subtype, message, buf);
 }
 
-struct stasis_message_type *ast_presence_state_message_type(void)
-{
-	return presence_state_type;
-}
-
 struct stasis_topic *ast_presence_state_topic_all(void)
 {
 	return presence_state_topic_all;
@@ -321,14 +316,12 @@
 	presence_state_topic_all = NULL;
 	ao2_cleanup(presence_state_topic_cached);
 	presence_state_topic_cached = NULL;
-	ao2_cleanup(presence_state_type);
-	presence_state_type = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(ast_presence_state_message_type);
 }
 
 int ast_presence_state_engine_init(void)
 {
-	presence_state_type = stasis_message_type_create("ast_presence_state_message");
-	if (!presence_state_type) {
+	if (STASIS_MESSAGE_TYPE_INIT(ast_presence_state_message_type) != 0) {
 		return -1;
 	}
 

Modified: team/dlee/playback-rebase/main/stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/stasis.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/main/stasis.c (original)
+++ team/dlee/playback-rebase/main/stasis.c Wed May 15 08:53:41 2013
@@ -47,7 +47,7 @@
 /*! Threadpool for dispatching notifications to subscribers */
 static struct ast_threadpool *pool;
 
-static struct stasis_message_type *__subscription_change_message_type;
+STASIS_MESSAGE_TYPE_DEFN(stasis_subscription_change_type);
 
 /*! \internal */
 struct stasis_topic {
@@ -438,11 +438,6 @@
 	return change;
 }
 
-struct stasis_message_type *stasis_subscription_change_type(void)
-{
-	return __subscription_change_message_type;
-}
-
 static void send_subscription_change_message(struct stasis_topic *topic, char *uniqueid, char *description)
 {
 	RAII_VAR(struct stasis_subscription_change *, change, NULL, ao2_cleanup);
@@ -556,10 +551,9 @@
 /*! \brief Cleanup function */
 static void stasis_exit(void)
 {
-	ao2_cleanup(__subscription_change_message_type);
-	__subscription_change_message_type = NULL;
 	ast_threadpool_shutdown(pool);
 	pool = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(stasis_subscription_change_type);
 }
 
 int stasis_init(void)
@@ -593,8 +587,7 @@
 		return -1;
 	}
 
-	__subscription_change_message_type = stasis_message_type_create("stasis_subscription_change");
-	if (!__subscription_change_message_type) {
+	if (STASIS_MESSAGE_TYPE_INIT(stasis_subscription_change_type) != 0) {
 		return -1;
 	}
 

Modified: team/dlee/playback-rebase/main/stasis_cache.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/stasis_cache.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/main/stasis_cache.c (original)
+++ team/dlee/playback-rebase/main/stasis_cache.c Wed May 15 08:53:41 2013
@@ -240,21 +240,8 @@
 	return cache_dump.cached;
 }
 
-static struct stasis_message_type *cache_clear_type;
-
-struct stasis_message_type *stasis_cache_clear_type(void)
-{
-	ast_assert(cache_clear_type != NULL);
-	return cache_clear_type;
-}
-
-static struct stasis_message_type *cache_update_type;
-
-struct stasis_message_type *stasis_cache_update_type(void)
-{
-	ast_assert(cache_update_type != NULL);
-	return cache_update_type;
-}
+STASIS_MESSAGE_TYPE_DEFN(stasis_cache_clear_type);
+STASIS_MESSAGE_TYPE_DEFN(stasis_cache_update_type);
 
 static void cache_clear_dtor(void *obj)
 {
@@ -442,30 +429,22 @@
 
 static void stasis_cache_exit(void)
 {
-	ao2_cleanup(cache_clear_type);
-	cache_clear_type = NULL;
-	ao2_cleanup(cache_update_type);
-	cache_update_type = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(stasis_cache_clear_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(stasis_cache_update_type);
 }
 
 int stasis_cache_init(void)
 {
 	ast_register_atexit(stasis_cache_exit);
 
-	if (cache_clear_type || cache_update_type) {
-		ast_log(LOG_ERROR, "Stasis cache double initialized\n");
+	if (STASIS_MESSAGE_TYPE_INIT(stasis_cache_clear_type) != 0) {
 		return -1;
 	}
 
-	cache_update_type = stasis_message_type_create("stasis_cache_update");
-	if (!cache_update_type) {
+	if (STASIS_MESSAGE_TYPE_INIT(stasis_cache_update_type) != 0) {
 		return -1;
 	}
 
-	cache_clear_type = stasis_message_type_create("StasisCacheClear");
-	if (!cache_clear_type) {
-		return -1;
-	}
 	return 0;
 }
 

Modified: team/dlee/playback-rebase/main/stasis_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/stasis_endpoints.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/main/stasis_endpoints.c (original)
+++ team/dlee/playback-rebase/main/stasis_endpoints.c Wed May 15 08:53:41 2013
@@ -35,16 +35,11 @@
 #include "asterisk/stasis.h"
 #include "asterisk/stasis_endpoints.h"
 
-static struct stasis_message_type *endpoint_snapshot_type;
+STASIS_MESSAGE_TYPE_DEFN(ast_endpoint_snapshot_type);
 
 static struct stasis_topic *endpoint_topic_all;
 
 static struct stasis_caching_topic *endpoint_topic_all_cached;
-
-struct stasis_message_type *ast_endpoint_snapshot_type(void)
-{
-	return endpoint_snapshot_type;
-}
 
 struct stasis_topic *ast_endpoint_topic_all(void)
 {
@@ -176,12 +171,7 @@
 		return -1;
 	}
 
-	if (!endpoint_snapshot_type) {
-		endpoint_snapshot_type = stasis_message_type_create(
-			"ast_endpoint_snapshot");
-	}
-
-	if (!endpoint_snapshot_type) {
+	if (STASIS_MESSAGE_TYPE_INIT(ast_endpoint_snapshot_type) != 0) {
 		return -1;
 	}
 

Modified: team/dlee/playback-rebase/main/test.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/test.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/main/test.c (original)
+++ team/dlee/playback-rebase/main/test.c Wed May 15 08:53:41 2013
@@ -57,7 +57,7 @@
 /*! \since 12
  * \brief The message type for test suite messages
  */
-static struct stasis_message_type *test_suite_type;
+STASIS_MESSAGE_TYPE_DEFN(ast_test_suite_message_type);
 
 /*! This array corresponds to the values defined in the ast_test_state enum */
 static const char * const test_result2str[] = {
@@ -927,11 +927,6 @@
 	return test_suite_topic;
 }
 
-struct stasis_message_type *ast_test_suite_message_type(void)
-{
-	return test_suite_type;
-}
-
 /*!
  * \since 12
  * \brief A wrapper object that can be ao2 ref counted around an \ref ast_json blob
@@ -1002,8 +997,7 @@
 {
 	ao2_cleanup(test_suite_topic);
 	test_suite_topic = NULL;
-	ao2_cleanup(test_suite_type);
-	test_suite_type = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(ast_test_suite_message_type);
 }
 
 #endif
@@ -1013,10 +1007,14 @@
 #ifdef TEST_FRAMEWORK
 	/* Create stasis topic */
 	test_suite_topic = stasis_topic_create("test_suite_topic");
-	test_suite_type = stasis_message_type_create("test_suite_type");
-	if (!test_suite_topic || !test_suite_type) {
+	if (!test_suite_topic) {
 		return -1;
 	}
+
+	if (STASIS_MESSAGE_TYPE_INIT(ast_test_suite_message_type) != 0) {
+		return -1;
+	}
+
 	/* Register cli commands */
 	ast_cli_register_multiple(test_cli, ARRAY_LEN(test_cli));
 	ast_register_atexit(test_cleanup);

Modified: team/dlee/playback-rebase/res/res_srtp.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/res/res_srtp.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/res/res_srtp.c (original)
+++ team/dlee/playback-rebase/res/res_srtp.c Wed May 15 08:53:41 2013
@@ -546,6 +546,9 @@
 {
 	srtp_install_event_handler(NULL);
 	ast_rtp_engine_unregister_srtp();
+#ifdef HAVE_SRTP_SHUTDOWN
+	srtp_shutdown();
+#endif
 	g_initialized = 0;
 }
 

Modified: team/dlee/playback-rebase/res/res_stasis_test.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/res/res_stasis_test.c?view=diff&rev=388813&r1=388812&r2=388813
==============================================================================
--- team/dlee/playback-rebase/res/res_stasis_test.c (original)
+++ team/dlee/playback-rebase/res/res_stasis_test.c Wed May 15 08:53:41 2013
@@ -35,7 +35,7 @@
 #include "asterisk/module.h"
 #include "asterisk/stasis_test.h"
 
-static struct stasis_message_type *test_message_type;
+STASIS_MESSAGE_TYPE_DEFN(stasis_test_message_type);
 
 static void stasis_message_sink_dtor(void *obj)
 {
@@ -259,23 +259,15 @@
 	return stasis_message_create(stasis_test_message_type(), data);
 }
 
-struct stasis_message_type *stasis_test_message_type(void)
-{
-	return test_message_type;
-}
-
 static int unload_module(void)
 {
-	ao2_cleanup(test_message_type);
-	test_message_type = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(stasis_test_message_type);
 	return 0;
 }
 
 static int load_module(void)
 {
-	test_message_type = stasis_message_type_create(
-		"stasis_test_message");
-	if (!test_message_type) {
+	if (STASIS_MESSAGE_TYPE_INIT(stasis_test_message_type) != 0) {
 		return AST_MODULE_LOAD_FAILURE;
 	}
 




More information about the asterisk-commits mailing list