From 45cb995b19105750df70bbe8de40a7758da26264 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 23 Dec 2021 11:04:55 -0500 Subject: [PATCH] TT#156052 add call->destroyed timestamp Change-Id: I76e973faee5797c00b1f5a1e01a73df903874ccb --- daemon/call.c | 2 ++ daemon/redis.c | 2 ++ include/call.h | 1 + 3 files changed, 5 insertions(+) diff --git a/daemon/call.c b/daemon/call.c index e84e72623..69624f3b3 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -4148,6 +4148,8 @@ del_all: monologue_stop(ml); } + c->destroyed = rtpe_now; + if (delete_delay > 0) { ilog(LOG_INFO, "Scheduling deletion of entire call in %d seconds", delete_delay); c->deleted = rtpe_now.tv_sec + delete_delay; diff --git a/daemon/redis.c b/daemon/redis.c index 8d60030c7..2126c06ac 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -1883,6 +1883,7 @@ static void json_restore_call(struct redis *r, const str *callid, bool foreign) err = "missing 'created' timestamp"; if (redis_hash_get_timeval(&c->created, &call, "created")) goto err8; + redis_hash_get_timeval(&c->destroyed, &call, "destroyed"); c->last_signal = last_signal; if (redis_hash_get_int(&i, &call, "tos")) c->tos = 184; @@ -2201,6 +2202,7 @@ char* redis_encode_json(struct call *c) { { JSON_SET_SIMPLE("created","%lli", timeval_us(&c->created)); + JSON_SET_SIMPLE("destroyed","%lli", timeval_us(&c->destroyed)); JSON_SET_SIMPLE("last_signal","%ld",(long int) c->last_signal); JSON_SET_SIMPLE("tos","%u",(int) c->tos); JSON_SET_SIMPLE("deleted","%ld",(long int) c->deleted); diff --git a/include/call.h b/include/call.h index 45cfc6235..73748aa37 100644 --- a/include/call.h +++ b/include/call.h @@ -520,6 +520,7 @@ struct call { str callid; struct timeval created; + struct timeval destroyed; time_t last_signal; time_t deleted; time_t ml_deleted;