From 402a67ce2b5f0cf0bff527983d62d48a446d385b Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 11 Sep 2026 11:53:36 -0400 Subject: [PATCH] MT#55283 lightweight sdps Change-Id: Ia6a576878873256bd47cf8f07d81c9d85e891cdc --- daemon/call.c | 2 +- daemon/call_interfaces.c | 2 +- include/call.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index cfb506447..3b59ef24f 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -5549,7 +5549,7 @@ static call_t *call_create(const str *callid) { c->tags = str_ml_ht_new(); c->viabranches = str_ml_ht_new(); c->labels = str_ml_ht_new(); - c->sdps = str_ml_ht_new(); + c->sdps = alloc_str_ml_ht_new(); c->endpoints = endpoint_ml_ht_new(); call_memory_arena_set(c); c->callid = memory_arena_str_cpy_lw(callid); diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 0ae8f8c27..2cc894ced 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -647,7 +647,7 @@ static const char *call_offer_answer_ng(ng_command_ctx_t *ctx, const char *addr) call_set_dtmf_block(call, from_ml, &flags); if (flags.alias_key == AK_SDP) - t_hash_table_insert(call->sdps, call_str_dup(&sdp), from_ml); + t_hash_table_replace(call->sdps, memory_arena_str_dup_lw(&sdp), from_ml); else if (flags.alias_key == AK_ADDRESS && streams.length && streams.head->data->rtp_endpoint.port) t_hash_table_insert(call->endpoints, memory_arena_objdup(streams.head->data->rtp_endpoint), from_ml); diff --git a/include/call.h b/include/call.h index 753482b2c..3d8738084 100644 --- a/include/call.h +++ b/include/call.h @@ -704,6 +704,8 @@ struct call_monologue { typedef IQUEUE(struct call_monologue, link) monologues_in_call_q; TYPED_GHASHTABLE(str_ml_ht, str, struct call_monologue, str_hash, str_equal, NULL, NULL) +TYPED_GHASHTABLE(alloc_str_ml_ht, str, struct call_monologue, str_hash, str_equal, + memory_arena_str_dup_free_lw, NULL) struct sdp_fragment; TYPED_GQUEUE(fragment, struct sdp_fragment) @@ -814,7 +816,7 @@ struct call { str_ml_ht tags; str_ml_ht viabranches; str_ml_ht labels; - str_ml_ht sdps; + alloc_str_ml_ht sdps; endpoint_ml_ht endpoints; fragments_ht sdp_fragments; streams_in_call_q streams;