Add support for Device.Services.VoiceService.{i}.CallLog.{i}.Session.{i}.SIPSessionID

This commit is contained in:
Grzegorz Sluja 2022-08-01 14:41:45 +00:00 committed by Amin Ben Ramdhane
parent d8fd09bebb
commit f7d0e4e9e7
4 changed files with 17 additions and 8 deletions

View file

@ -304,6 +304,14 @@ int init_call_log(void)
CHECK_RESULT(end);
DM_STRNCPY(cdr.sessionId, token, end - token + 1);
// SIP Session Id
token = DM_LSTRSTR(token, ",\"");
CHECK_RESULT(token);
token += 2;
end = DM_LSTRSTR(token, "\",");
CHECK_RESULT(end);
DM_STRNCPY(cdr.SIPSessionId, token, end - token + 1);
// SIP IP Address
token = DM_LSTRSTR(token, ",\"");
CHECK_RESULT(token);

View file

@ -32,6 +32,7 @@ struct call_log_entry {
char duration[8];
char termination_cause[32];
char sessionId[20];
char SIPSessionId[33];
char sipIpAddress[40];
char farEndIPAddress[40];
char sipResponseCode[20];

View file

@ -127,6 +127,13 @@ static int get_ServicesVoiceServiceCallLog_SessionId(char *refparam, struct dmct
return 0;
}
static int get_ServicesVoiceServiceCallLog_SIPSessionId(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->SIPSessionId) : "";
return 0;
}
static int get_ServicesVoiceServiceCallLog_CallTerminationCause(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
struct call_log_entry *entry = (struct call_log_entry *)data;
@ -268,6 +275,7 @@ DMLEAF tServicesVoiceServiceCallLogSessionParams[] = {
{"Duration", &DMREAD, DMT_UNINT, get_ServicesVoiceServiceCallLog_Duration, NULL, BBFDM_BOTH},
{"Start", &DMREAD, DMT_TIME, get_ServicesVoiceServiceCallLog_Start, NULL, BBFDM_BOTH},
{"SessionID", &DMREAD, DMT_STRING, get_ServicesVoiceServiceCallLog_SessionId, NULL, BBFDM_BOTH},
{"SIPSessionID", &DMREAD, DMT_STRING, get_ServicesVoiceServiceCallLog_SIPSessionId, NULL, BBFDM_BOTH},
{0}
};

View file

@ -12,13 +12,6 @@
#include "servicesvoiceservicecalllog.h"
#include "common.h"
static int get_ServicesVoiceServiceCallLog_SessionId(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->sessionId) : "0";
return 0;
}
static int get_ServicesVoiceServiceCallLog_SipIpAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
struct call_log_entry *entry = (struct call_log_entry *)data;
@ -151,7 +144,6 @@ static int get_ServicesVoiceServiceCallLog_Dst_PeakJitter(char *refparam, struct
/* *** Device.Services.VoiceService.{i}.CallLog.{i}. *** */
DMLEAF tIOPSYS_VoiceServiceCallLogParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{BBF_VENDOR_PREFIX"SIPSession-ID", &DMREAD, DMT_STRING, get_ServicesVoiceServiceCallLog_SessionId, NULL, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"SIPIPAddress", &DMREAD, DMT_STRING, get_ServicesVoiceServiceCallLog_SipIpAddress, NULL, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"SIPResponseCode", &DMREAD, DMT_UNINT, get_ServicesVoiceServiceCallLog_SipResponseCode, NULL, BBFDM_BOTH},
{0}