From a4ea37540f49d139cf76afade3e119bb166960a6 Mon Sep 17 00:00:00 2001 From: Lucian Balaceanu Date: Mon, 17 Feb 2025 18:07:04 +0200 Subject: [PATCH] MT#55283 fix calling redis_delete when call is not persisted to db Fixes a corner case that happens when trying to delete a call created with ng offer and no-redis-update flag and for which no ng answer was received. In such cases, one would receive warning messages from Redis "ERR DB index is out of range". What happens is that on call creation redis_hosted_db defaults to -1. This value is changed when writing to Redis, but the writing is not done for a ng offer with no-redis-update. Kudos go to Pawel Kuzak. Closes #1910 Change-Id: Iad19ec8ac69b169e6352662697b17eb23e6970fb (cherry picked from commit bba9625b2544c5fc05e33ee6c7b65b25b0366427) (cherry picked from commit c177d06b33c8d840c7aa59c2e2c67eb45cdf4955) --- daemon/call.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/call.c b/daemon/call.c index 7f8fef9e6..3216f00d1 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -3742,7 +3742,8 @@ void call_destroy(call_t *c) { statistics_update_ip46_inc_dec(c, CMC_DECREMENT); statistics_update_foreignown_dec(c); - redis_delete(c, rtpe_redis_write); + if (c->redis_hosted_db >= 0) + redis_delete(c, rtpe_redis_write); __call_iterator_remove(c);