From 101e6c8f5d8f5b08d3564c0e198eb7ca68b99714 Mon Sep 17 00:00:00 2001 From: Grzegorz Sluja Date: Thu, 30 Dec 2021 12:11:43 +0100 Subject: [PATCH] Voice: Add support for AverageRoundTripDelay CallLog parameter --- dmtree/tr104/common.c | 7 +++++++ dmtree/tr104/common.h | 1 + dmtree/tr104/servicesvoiceservicecalllog.c | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/dmtree/tr104/common.c b/dmtree/tr104/common.c index e559055d..0c54532a 100644 --- a/dmtree/tr104/common.c +++ b/dmtree/tr104/common.c @@ -458,6 +458,13 @@ int init_call_log(void) end = strstr(token, ","); CHECK_RESULT(end); strncpy(cdr.maxJitter, token, end - token); + + token = strstr(token, ","); + CHECK_RESULT(token); + token += 1; + end = strstr(token, ","); + CHECK_RESULT(end); + strncpy(cdr.averageRoundTripDelay, token, end - token); } // Skip invalid call logs if (cdr.calling_num[0] == '\0' || cdr.called_num[0] == '\0' || diff --git a/dmtree/tr104/common.h b/dmtree/tr104/common.h index 9b67f36c..695a1696 100644 --- a/dmtree/tr104/common.h +++ b/dmtree/tr104/common.h @@ -60,6 +60,7 @@ struct call_log_entry { char txpkts[20]; char jitter[20]; char maxJitter[20]; + char averageRoundTripDelay[20]; }; #define MAX_SUPPORTED_CODECS 8 diff --git a/dmtree/tr104/servicesvoiceservicecalllog.c b/dmtree/tr104/servicesvoiceservicecalllog.c index 540b9857..f5da38d9 100644 --- a/dmtree/tr104/servicesvoiceservicecalllog.c +++ b/dmtree/tr104/servicesvoiceservicecalllog.c @@ -193,6 +193,13 @@ static int get_ServicesVoiceServiceCallLog_Src_MaxJitter(char *refparam, struct return 0; } +static int get_ServicesVoiceServiceCallLog_Src_AverageRoundTripDelay(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + struct call_log_entry *entry = (struct call_log_entry *)data; + *value = (entry) ? dmstrdup(entry->averageRoundTripDelay) : "0"; + return 0; +} + /* Get Alias - Device.Services.VoiceService.{i}.CallLog.{i}. */ static int get_ServicesVoiceServiceCallLog_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -303,5 +310,6 @@ DMLEAF tServicesVoiceServiceCallLogSessionSourceRTPParams[] = { {"FarEndInterarrivalJitter", &DMREAD, DMT_INT, get_ServicesVoiceServiceCallLog_Src_FarEndInterarrivalJitter, NULL, BBFDM_BOTH}, {"FarEndPacketLossRate", &DMREAD, DMT_UNINT, get_ServicesVoiceServiceCallLog_Src_FarEndPacketLossRate, NULL, BBFDM_BOTH}, {"MaxJitter", &DMREAD, DMT_INT, get_ServicesVoiceServiceCallLog_Src_MaxJitter, NULL, BBFDM_BOTH}, +{"AverageRoundTripDelay", &DMREAD, DMT_INT, get_ServicesVoiceServiceCallLog_Src_AverageRoundTripDelay, NULL, BBFDM_BOTH}, {0} };