Rework stasis cache clear events

Stasis cache clear message payloads now consist of a stasis_message
representative of the message to be cleared from the cache. This allows
multiple parallel caches to coexist and be cleared properly by the same
cache clear message even when keyed on different fields.

This change fixes a bug where multiple cache clears could be posted for
channels. The cache clear is now produced in the destructor instead of
ast_hangup.

Additionally, dummy channels are no longer capable of producing channel
snapshots.

Review: https://reviewboard.asterisk.org/r/2596


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2013-06-07 12:56:56 +00:00
parent 6114166237
commit 759a7e4a30
7 changed files with 109 additions and 71 deletions

View File

@@ -716,7 +716,7 @@ AST_TEST_DEFINE(cache)
ao2_ref(test_message2_2, -1);
/* Clear snapshot 1 */
test_message1_clear = stasis_cache_clear_create(cache_type, "1");
test_message1_clear = stasis_cache_clear_create(test_message1_1);
ast_test_validate(test, NULL != test_message1_clear);
stasis_publish(topic, test_message1_clear);
@@ -811,7 +811,7 @@ AST_TEST_DEFINE(cache_dump)
}
/* Clear snapshot 1 */
test_message1_clear = stasis_cache_clear_create(cache_type, "1");
test_message1_clear = stasis_cache_clear_create(test_message1_1);
ast_test_validate(test, NULL != test_message1_clear);
stasis_publish(topic, test_message1_clear);