MT#59993 New field header_ppi (P-Preferred-Identity header)

New field "header_ppi" is now managed and inserted into
cdr_tag_data mysql table.
This field will store into the aggregated cdr data the
P-Preferred-Identity header of the INVITE.

Change-Id: Ib875976fd7332e80ae100f257c7af701ffe9f661
mr12.5.1
Marco Capetta 11 months ago
parent 42dee463e2
commit b2212ef13c

22
cdr.c

@ -545,6 +545,15 @@ static int cdr_parse_srcleg_json(json_object *json, cdr_entry_t *cdr)
goto err;
}
// header_ppi
if (!cdr_parse_json_get_g_string(json, "ppi", cdr->header_ppi)) {
L_ERROR("Call-Id '%s' does not contain 'ppi' key (P-Preferred-Identity header), '%s'", cdr->call_id->str, json_object_get_string(json));
/// Simply return 0 in order to avoid issues with ACC records in the OLD format during an upgrade
/// Added in mr12.5, it should be changed to 'err' in mr13.+
/// goto err;
goto ret;
}
ret:
return 0;
@ -1030,6 +1039,19 @@ static int cdr_parse_srcleg_list(char *srcleg, cdr_entry_t *cdr)
*tmp1 = MED_SEP;
tmp2 = ++tmp1;
tmp1 = strchr(tmp2, MED_SEP);
if(tmp1 == NULL)
{
L_ERROR("Call-Id '%s' has no separated P-Preferred-Identity header, '%s'", cdr->call_id->str, tmp2);
/// Simply return 0 in order to avoid issues with ACC records in the OLD format during an upgrade
/// Added in mr12.5, it should be changed to -1 in mr13.+
return 0;
}
*tmp1 = '\0';
g_string_assign(cdr->header_ppi, tmp2);
*tmp1 = MED_SEP;
tmp2 = ++tmp1;
return 0;
}

@ -38,6 +38,7 @@ F(furnished_charging_info)
F(header_diversion)
F(header_pai)
F(header_u2u)
F(header_ppi)
F(group)

@ -1127,6 +1127,9 @@ int medmysql_insert_cdrs(cdr_entry_t *entries, uint64_t count, struct medmysql_b
if (medmysql_tag_cdr(batch, medmysql_tag_provider_customer, medmysql_tag_direction_source,
"concurrent_calls_count_customer", e->source_concurrent_calls_count_customer, e))
return -1;
if (medmysql_tag_cdr(batch, medmysql_tag_provider_customer, medmysql_tag_direction_source,
"header=P-Preferred-Identity", e->header_ppi, e))
return -1;
if (medmysql_tag_cdr(batch, medmysql_tag_provider_customer, medmysql_tag_direction_destination,
"furnished_charging_info", e->furnished_charging_info, e))

Loading…
Cancel
Save