mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-05 12:42:49 +00:00
stasis: Add internal filtering of messages.
This change adds the ability for subscriptions to indicate which message types they are interested in accepting. By doing so the filtering is done before being dispatched to the subscriber, reducing the amount of work that has to be done. This is optional and if a subscriber does not add message types they wish to accept and set the subscription to selective filtering the previous behavior is preserved and they receive all messages. There is also the ability to explicitly force the reception of all messages for cases such as AMI or ARI where a large number of messages are expected that are then generically converted into a different format. ASTERISK-28103 Change-Id: I99bee23895baa0a117985d51683f7963b77aa190
This commit is contained in:
@@ -217,3 +217,21 @@ struct stasis_topic *stasis_cp_single_topic_cached(
|
||||
}
|
||||
return stasis_caching_get_topic(one->topic_cached);
|
||||
}
|
||||
|
||||
int stasis_cp_single_accept_message_type(struct stasis_cp_single *one,
|
||||
struct stasis_message_type *type)
|
||||
{
|
||||
if (!one) {
|
||||
return -1;
|
||||
}
|
||||
return stasis_caching_accept_message_type(one->topic_cached, type);
|
||||
}
|
||||
|
||||
int stasis_cp_single_set_filter(struct stasis_cp_single *one,
|
||||
enum stasis_subscription_message_filter filter)
|
||||
{
|
||||
if (!one) {
|
||||
return -1;
|
||||
}
|
||||
return stasis_caching_set_filter(one->topic_cached, filter);
|
||||
}
|
||||
|
Reference in New Issue
Block a user