[asterisk-commits] file: branch file/stasis_peerevent r390509 - /team/file/stasis_peerevent/chan...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 5 11:58:46 CDT 2013


Author: file
Date: Wed Jun  5 11:58:44 2013
New Revision: 390509

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390509
Log:
Only use the aggregate device state if it is not invalid, and ensure device state is updated before starting the PBX.

Modified:
    team/file/stasis_peerevent/channels/chan_gulp.c

Modified: team/file/stasis_peerevent/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/file/stasis_peerevent/channels/chan_gulp.c?view=diff&rev=390509&r1=390508&r2=390509
==============================================================================
--- team/file/stasis_peerevent/channels/chan_gulp.c (original)
+++ team/file/stasis_peerevent/channels/chan_gulp.c Wed Jun  5 11:58:44 2013
@@ -660,7 +660,7 @@
 		ao2_ref(caching_topic, +1);
 
 		for (num = 0; num < endpoint_snapshot->num_channels; num++) {
-			RAII_VAR(struct stasis_message *, msg, stasis_cache_get(caching_topic, ast_channel_snapshot_type(), endpoint_snapshot->channel_ids[num]), ao2_cleanup);
+			RAII_VAR(struct stasis_message *, msg, stasis_cache_get_extended(caching_topic, ast_channel_snapshot_type(), endpoint_snapshot->channel_ids[num], 1), ao2_cleanup);
 			struct ast_channel_snapshot *snapshot;
 
 			if (!msg) {
@@ -682,7 +682,7 @@
 
 		if (endpoint->devicestate_busy_at && (inuse == endpoint->devicestate_busy_at)) {
 			state = AST_DEVICE_BUSY;
-		} else {
+		} else if (ast_devstate_aggregate_result(&aggregate) != AST_DEVICE_INVALID) {
 			state = ast_devstate_aggregate_result(&aggregate);
 		}
 	}
@@ -1403,6 +1403,9 @@
 	}
 
 	ast_setstate(session->channel, AST_STATE_RING);
+
+	ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "Gulp/%s", ast_sorcery_object_get_id(session->endpoint));
+
 	res = ast_pbx_start(session->channel);
 
 	switch (res) {




More information about the asterisk-commits mailing list