From 5953d04d0b94f81ca2a261e4fddfdb970d801937 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 8 Sep 2021 11:55:23 -0400 Subject: [PATCH] TT#139650 fix GHashTable string lookup against GString regression from TT#98401 Change-Id: I91132c11c823da3dba31999d072acb4c2f6818c0 --- cdr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cdr.c b/cdr.c index d81365d..1c9cc72 100644 --- a/cdr.c +++ b/cdr.c @@ -1556,7 +1556,7 @@ void cdr_set_provider(cdr_entry_t *cdr) if(strcmp("0", cdr->source_user_id->str) != 0) { - if((val = g_hash_table_lookup(med_uuid_table, cdr->source_user_id)) != NULL) + if((val = g_hash_table_lookup(med_uuid_table, cdr->source_user_id->str)) != NULL) { g_string_assign(cdr->source_provider_id, val); } @@ -1568,14 +1568,14 @@ void cdr_set_provider(cdr_entry_t *cdr) else if (cdr->source_lcr_id) { g_string_printf(cdr->source_provider_id, "%llu", (unsigned long long) cdr->source_lcr_id); - val = g_hash_table_lookup(med_peer_id_table, cdr->source_provider_id); + val = g_hash_table_lookup(med_peer_id_table, cdr->source_provider_id->str); g_string_assign(cdr->source_provider_id, val ? : "0"); } - else if((val = g_hash_table_lookup(med_peer_ip_table, cdr->source_domain)) != NULL) + else if((val = g_hash_table_lookup(med_peer_ip_table, cdr->source_domain->str)) != NULL) { g_string_assign(cdr->source_provider_id, val); } - else if((val = g_hash_table_lookup(med_peer_host_table, cdr->source_domain)) != NULL) + else if((val = g_hash_table_lookup(med_peer_host_table, cdr->source_domain->str)) != NULL) { g_string_assign(cdr->source_provider_id, val); } @@ -1586,7 +1586,7 @@ void cdr_set_provider(cdr_entry_t *cdr) if(strcmp("0", cdr->destination_user_id->str) != 0) { - if((val = g_hash_table_lookup(med_uuid_table, cdr->destination_user_id)) != NULL) + if((val = g_hash_table_lookup(med_uuid_table, cdr->destination_user_id->str)) != NULL) { g_string_assign(cdr->destination_provider_id, val); } @@ -1598,14 +1598,14 @@ void cdr_set_provider(cdr_entry_t *cdr) else if (cdr->destination_lcr_id) { g_string_printf(cdr->destination_provider_id, "%llu", (unsigned long long) cdr->destination_lcr_id); - val = g_hash_table_lookup(med_peer_id_table, cdr->destination_provider_id); + val = g_hash_table_lookup(med_peer_id_table, cdr->destination_provider_id->str); g_string_assign(cdr->destination_provider_id, val ? : "0"); } - else if((val = g_hash_table_lookup(med_peer_ip_table, cdr->destination_domain)) != NULL) + else if((val = g_hash_table_lookup(med_peer_ip_table, cdr->destination_domain->str)) != NULL) { g_string_assign(cdr->destination_provider_id, val); } - else if((val = g_hash_table_lookup(med_peer_host_table, cdr->destination_domain)) != NULL) + else if((val = g_hash_table_lookup(med_peer_host_table, cdr->destination_domain->str)) != NULL) { g_string_assign(cdr->destination_provider_id, val); }