[svn-commits] mmichelson: trunk r400335 - in /trunk: ./ channels/ include/asterisk/ main/ r...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Oct 2 17:22:20 CDT 2013


Author: mmichelson
Date: Wed Oct  2 17:22:17 2013
New Revision: 400335

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400335
Log:
Multiple revisions 400318-400319

........
  r400318 | mmichelson | 2013-10-02 17:08:49 -0500 (Wed, 02 Oct 2013) | 12 lines
  
  Remove unnecessary waits from stasis.
  
  Since caches are updated on publisher threads, there is no need
  to wait for the cache updates to occur after a stasis message
  is published.
  
  In the case of chan_pjsip device state changes, this set of
  changes caused an improvement to performance.
  
  Review: https://reviewboard.asterisk.org/r/2890
........
  r400319 | mmichelson | 2013-10-02 17:10:54 -0500 (Wed, 02 Oct 2013) | 3 lines
  
  Remove svn:mergeinfo property.
........

Merged revisions 400318-400319 from http://svn.asterisk.org/svn/asterisk/branches/12

Removed:
    trunk/main/stasis_wait.c
Modified:
    trunk/   (props changed)
    trunk/channels/chan_pjsip.c
    trunk/include/asterisk/stasis.h
    trunk/include/asterisk/stasis_endpoints.h
    trunk/main/stasis.c
    trunk/main/stasis_endpoints.c
    trunk/res/ari/resource_endpoints.c
    trunk/tests/test_cel.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Wed Oct  2 17:22:17 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-400181,400194,400196,400205,400217,400227,400236,400245,400254,400256,400265,400268,400270,400281,400284,400286,400291,400303,400312,400316
+/branches/12:1-398558,398560-398577,398579-399305,399307-400181,400194,400196,400205,400217,400227,400236,400245,400254,400256,400265,400268,400270,400281,400284,400286,400291,400303,400312,400316,400318-400319

Modified: trunk/channels/chan_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_pjsip.c?view=diff&rev=400335&r1=400334&r2=400335
==============================================================================
--- trunk/channels/chan_pjsip.c (original)
+++ trunk/channels/chan_pjsip.c Wed Oct  2 17:22:17 2013
@@ -896,7 +896,11 @@
 	}
 
 	endpoint_snapshot = ast_endpoint_latest_snapshot(ast_endpoint_get_tech(endpoint->persistent),
-		ast_endpoint_get_resource(endpoint->persistent), 1);
+		ast_endpoint_get_resource(endpoint->persistent));
+
+	if (!endpoint_snapshot) {
+		return AST_DEVICE_INVALID;
+	}
 
 	if (endpoint_snapshot->state == AST_ENDPOINT_OFFLINE) {
 		state = AST_DEVICE_UNAVAILABLE;
@@ -916,7 +920,6 @@
 		RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
 		struct ast_channel_snapshot *snapshot;
 
-		stasis_topic_wait(ast_channel_topic_all_cached());
 		msg = stasis_cache_get(cache, ast_channel_snapshot_type(),
 			endpoint_snapshot->channel_ids[num]);
 

Modified: trunk/include/asterisk/stasis.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/stasis.h?view=diff&rev=400335&r1=400334&r2=400335
==============================================================================
--- trunk/include/asterisk/stasis.h (original)
+++ trunk/include/asterisk/stasis.h Wed Oct  2 17:22:17 2013
@@ -347,15 +347,6 @@
  */
 void stasis_publish(struct stasis_topic *topic, struct stasis_message *message);
 
-/*!
- * \brief Wait for all pending messages on a given topic to be processed.
- * \param topic Topic to await pending messages on.
- * \return 0 on success.
- * \return Non-zero on error.
- * \since 12
- */
-int stasis_topic_wait(struct stasis_topic *topic);
-
 /*! @} */
 
 /*! @{ */
@@ -868,11 +859,6 @@
  */
 int stasis_config_init(void);
 
-/*!
- * \internal
- */
-int stasis_wait_init(void);
-
 /*! @} */
 
 /*!

Modified: trunk/include/asterisk/stasis_endpoints.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/stasis_endpoints.h?view=diff&rev=400335&r1=400334&r2=400335
==============================================================================
--- trunk/include/asterisk/stasis_endpoints.h (original)
+++ trunk/include/asterisk/stasis_endpoints.h Wed Oct  2 17:22:17 2013
@@ -194,14 +194,12 @@
  *
  * \param tech Name of the endpoint's technology.
  * \param resource Resource name of the endpoint.
- * \param guaranteed Whether to require all pending messages to have been processed or not.
  * \return Snapshot of the endpoint with the given name.
  * \return \c NULL if endpoint is not found, or on error.
  * \since 12
  */
 struct ast_endpoint_snapshot *ast_endpoint_latest_snapshot(const char *tech,
-	const char *resource,
-	unsigned int guaranteed
+	const char *resource
 );
 
 /*! @} */

Modified: trunk/main/stasis.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis.c?view=diff&rev=400335&r1=400334&r2=400335
==============================================================================
--- trunk/main/stasis.c (original)
+++ trunk/main/stasis.c Wed Oct  2 17:22:17 2013
@@ -814,11 +814,6 @@
 	/* Be sure the types are cleaned up after the message bus */
 	ast_register_cleanup(stasis_cleanup);
 
-	if (stasis_wait_init() != 0) {
-		ast_log(LOG_ERROR, "Stasis initialization failed\n");
-		return -1;
-	}
-
 	cache_init = stasis_cache_init();
 	if (cache_init != 0) {
 		return -1;

Modified: trunk/main/stasis_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis_endpoints.c?view=diff&rev=400335&r1=400334&r2=400335
==============================================================================
--- trunk/main/stasis_endpoints.c (original)
+++ trunk/main/stasis_endpoints.c Wed Oct  2 17:22:17 2013
@@ -187,7 +187,7 @@
 }
 
 struct ast_endpoint_snapshot *ast_endpoint_latest_snapshot(const char *tech,
-	const char *name, unsigned int guaranteed)
+	const char *name)
 {
 	RAII_VAR(char *, id, NULL, ast_free);
 	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
@@ -196,10 +196,6 @@
 	ast_asprintf(&id, "%s/%s", tech, name);
 	if (!id) {
 		return NULL;
-	}
-
-	if (guaranteed) {
-		stasis_topic_wait(ast_endpoint_topic_all_cached());
 	}
 
 	msg = stasis_cache_get(ast_endpoint_cache(),

Modified: trunk/res/ari/resource_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/ari/resource_endpoints.c?view=diff&rev=400335&r1=400334&r2=400335
==============================================================================
--- trunk/res/ari/resource_endpoints.c (original)
+++ trunk/res/ari/resource_endpoints.c Wed Oct  2 17:22:17 2013
@@ -140,7 +140,7 @@
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	RAII_VAR(struct ast_endpoint_snapshot *, snapshot, NULL, ao2_cleanup);
 
-	snapshot = ast_endpoint_latest_snapshot(args->tech, args->resource, 0);
+	snapshot = ast_endpoint_latest_snapshot(args->tech, args->resource);
 	if (!snapshot) {
 		ast_ari_response_error(response, 404, "Not Found",
 			"Endpoint not found");

Modified: trunk/tests/test_cel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/tests/test_cel.c?view=diff&rev=400335&r1=400334&r2=400335
==============================================================================
--- trunk/tests/test_cel.c (original)
+++ trunk/tests/test_cel.c Wed Oct  2 17:22:17 2013
@@ -254,7 +254,6 @@
 	ast_hangup((channel)); \
 	HANGUP_EVENT(channel, cause, dialstatus); \
 	APPEND_EVENT(channel, AST_CEL_CHANNEL_END, NULL, NULL); \
-	stasis_topic_wait(ast_channel_topic_all_cached()); \
 	ao2_cleanup(stasis_cache_get(ast_channel_cache(), \
 		ast_channel_snapshot_type(), ast_channel_uniqueid(channel))); \
 	ao2_cleanup(channel); \




More information about the svn-commits mailing list