Voice: Add support for AverageRoundTripDelay CallLog parameter

This commit is contained in:
Grzegorz Sluja 2021-12-30 12:11:43 +01:00
parent a833276799
commit 101e6c8f5d
3 changed files with 16 additions and 0 deletions

View file

@ -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' ||

View file

@ -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

View file

@ -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}
};