MT#55984 obsolete `other_tags` table

This serves no useful purpose any more.

Change-Id: Ife6cc85b0364536fb55baa0cc5da4e3126024ff6
pull/1577/head
Richard Fuchs 3 years ago
parent 53dbef7e1a
commit 8712e3b88e

@ -3731,7 +3731,6 @@ static void __call_free(void *p) {
m = g_queue_pop_head(&c->monologues);
g_queue_clear(&m->medias);
g_hash_table_destroy(m->other_tags);
g_hash_table_destroy(m->associated_tags);
g_hash_table_destroy(m->branches);
g_hash_table_destroy(m->media_ids);
@ -3927,7 +3926,6 @@ struct call_monologue *__monologue_create(struct call *call) {
ret->call = call;
ret->created = rtpe_now.tv_sec;
ret->other_tags = g_hash_table_new(str_hash, str_equal);
ret->associated_tags = g_hash_table_new(g_direct_hash, g_direct_equal);
ret->branches = g_hash_table_new(str_hash, str_equal);
ret->media_ids = g_hash_table_new(str_hash, str_equal);
@ -4123,19 +4121,6 @@ static unsigned int monologue_delete_iter(struct call_monologue *a, int delete_d
return ret;
}
/* must be called with call->master_lock held in W */
static void __fix_other_tags(struct call_monologue *one) {
if (!one || !one->tag.len)
return;
for (GList *sub = one->subscribers.head; sub; sub = sub->next) {
struct call_subscription *cs = sub->data;
struct call_monologue *two = cs->monologue;
g_hash_table_insert(one->other_tags, &two->tag, two);
g_hash_table_insert(two->other_tags, &one->tag, one);
}
}
/* must be called with call->master_lock held in W */
struct call_monologue *call_get_monologue(struct call *call, const str *fromtag) {
return g_hash_table_lookup(call->tags, fromtag);
@ -4242,10 +4227,8 @@ ok_check_tag:
struct call_monologue *csm = cs->monologue;
if (!os)
os = csm;
if (totag && totag->s && !csm->tag.s) {
if (totag && totag->s && !csm->tag.s)
__monologue_tag(csm, totag);
__fix_other_tags(ret);
}
break; // there should only be one
// XXX check if there's more than a one-to-one mapping here?
}
@ -4323,7 +4306,6 @@ tag_setup:
dialogue_unkernelize(ft);
dialogue_unkernelize(tt);
__subscribe_offer_answer_both_ways(ft, tt);
__fix_other_tags(ft);
done:
__monologue_unkernelize(ft);

@ -1711,16 +1711,6 @@ static int json_link_tags(struct call *c, struct redis_list *tags, struct redis_
&(struct sink_attrs) { .offer_answer = true });
}
if (json_build_list(&q, c, "other_tags", i, tags, root_reader))
return -1;
for (l = q.head; l; l = l->next) {
other_ml = l->data;
if (!other_ml)
return -1;
g_hash_table_insert(ml->other_tags, &other_ml->tag, other_ml);
}
g_queue_clear(&q);
if (json_build_list(&q, c, "associated_tags", i, tags, root_reader))
return -1;
for (l = q.head; l; l = l->next) {
@ -2507,18 +2497,6 @@ char* redis_encode_json(struct call *c) {
ml = l->data;
// -- we do it again here since the jsonbuilder is linear straight forward
// XXX these should all go into the above loop
k = g_hash_table_get_values(ml->other_tags);
snprintf(tmp, sizeof(tmp), "other_tags-%u", ml->unique_id);
json_builder_set_member_name(builder, tmp);
json_builder_begin_array (builder);
for (m = k; m; m = m->next) {
ml2 = m->data;
JSON_ADD_STRING("%u",ml2->unique_id);
}
json_builder_end_array (builder);
g_list_free(k);
k = g_hash_table_get_values(ml->associated_tags);
snprintf(tmp, sizeof(tmp), "associated_tags-%u", ml->unique_id);
json_builder_set_member_name(builder, tmp);

@ -488,7 +488,6 @@ struct call_monologue {
enum termination_reason term_reason;
const struct logical_intf *logical_intf;
GHashTable *associated_tags;
GHashTable *other_tags;
GHashTable *branches;
GQueue subscriptions; /* who am I subscribed to (sources) */
GHashTable *subscriptions_ht; /* for quick lookup */

Loading…
Cancel
Save