mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Revert "endpoint/stasis: Eliminate duplicate events on endpoint status change"
This reverts commit 35c699086a
.
Change-Id: Ia98c2b4820cf579a5b9bb75e9e05d7a233205fb7
This commit is contained in:
@@ -138,11 +138,20 @@ struct stasis_cp_single *stasis_cp_single_create(struct stasis_cp_all *all,
|
||||
{
|
||||
RAII_VAR(struct stasis_cp_single *, one, NULL, ao2_cleanup);
|
||||
|
||||
one = stasis_cp_single_create_only(all, name);
|
||||
one = ao2_t_alloc(sizeof(*one), one_dtor, name);
|
||||
if (!one) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
one->topic = stasis_topic_create(name);
|
||||
if (!one->topic) {
|
||||
return NULL;
|
||||
}
|
||||
one->topic_cached = stasis_caching_topic_create(one->topic, all->cache);
|
||||
if (!one->topic_cached) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
one->forward_topic_to_all = stasis_forward_all(one->topic, all->topic);
|
||||
if (!one->forward_topic_to_all) {
|
||||
return NULL;
|
||||
@@ -157,46 +166,6 @@ struct stasis_cp_single *stasis_cp_single_create(struct stasis_cp_all *all,
|
||||
return one;
|
||||
}
|
||||
|
||||
struct stasis_cp_single *stasis_cp_single_create_only(struct stasis_cp_all *all,
|
||||
const char *name)
|
||||
{
|
||||
RAII_VAR(struct stasis_cp_single *, one, NULL, ao2_cleanup);
|
||||
|
||||
one = ao2_t_alloc(sizeof(*one), one_dtor, name);
|
||||
if (!one) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
one->topic = stasis_topic_create(name);
|
||||
if (!one->topic) {
|
||||
return NULL;
|
||||
}
|
||||
one->topic_cached = stasis_caching_topic_create(one->topic, all->cache);
|
||||
if (!one->topic_cached) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ao2_ref(one, +1);
|
||||
return one;
|
||||
}
|
||||
|
||||
int stasis_cp_single_forward(struct stasis_cp_single *from, struct stasis_cp_single *to)
|
||||
{
|
||||
from->forward_topic_to_all = stasis_forward_all(from->topic, to->topic);
|
||||
if (!from->forward_topic_to_all) {
|
||||
return -1;;
|
||||
}
|
||||
|
||||
from->forward_cached_to_all = stasis_forward_all(
|
||||
stasis_caching_get_topic(from->topic_cached),
|
||||
stasis_caching_get_topic(to->topic_cached));
|
||||
if (!from->forward_cached_to_all) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void stasis_cp_single_unsubscribe(struct stasis_cp_single *one)
|
||||
{
|
||||
if (!one) {
|
||||
|
Reference in New Issue
Block a user