MT#57110 New field r_user

New field "r_user" is now managed and inserted into
cdr_tag_data mysql table.
This field will store into the aggregated cdr data table the user part
of the RURI relative to the first 2xx response of an INVITE.

Change-Id: Ie61809e9245adfa09c6babb4b3fa328da8c56cbb
mr11.4.1
Alessio Garzi 2 years ago
parent 274133b957
commit d75c9c6183

19
cdr.c

@ -724,9 +724,11 @@ static int cdr_parse_dstleg_json(json_object *json, cdr_entry_t *cdr)
// hg_ext_response
if (!cdr_parse_json_get_g_string(json, "hg_ext_response", cdr->hg_ext_response)) {
L_DEBUG("Call-Id '%s' does not contain 'hg_ext_response' key (hunt group extension response), '%s'", cdr->call_id->str, json_object_get_string(json));
/// Added in mr8.3, it should be changed to -1 in mr9.+
/// goto err;
goto ret;
}
// r_user
if (!cdr_parse_json_get_g_string(json, "r_user", cdr->r_user)) {
L_DEBUG("Call-Id '%s' does not contain 'r_user' key, '%s'", cdr->call_id->str, json_object_get_string(json));
}
ret:
@ -1296,6 +1298,17 @@ static int cdr_parse_dstleg_list(char *dstleg, cdr_entry_t *cdr)
*tmp1 = MED_SEP;
tmp2 = ++tmp1;
tmp1 = strchr(tmp2, MED_SEP);
if(tmp1 == NULL)
{
L_DEBUG("Call-Id '%s' has no separated responder number, '%s'", cdr->call_id->str, tmp2);
return 0;
}
*tmp1 = '\0';
g_string_assign(cdr->r_user, tmp2);
*tmp1 = MED_SEP;
tmp2 = ++tmp1;
return 0;
}

@ -48,6 +48,7 @@ F(destination_concurrent_calls_quota)
F(destination_concurrent_calls_count)
F(destination_concurrent_calls_count_customer)
F(hg_ext_response)
F(r_user)
F(source_last_hih)
F(acc_ref)

@ -1145,6 +1145,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_destination,
"hg_ext_response", e->hg_ext_response, e))
return -1;
if (medmysql_tag_cdr(batch, medmysql_tag_provider_customer, medmysql_tag_direction_destination,
"r_user", e->r_user, e))
return -1;
if (medmysql_tag_cdr(batch, medmysql_tag_provider_customer, medmysql_tag_direction_source,
"header=History-Info", e->source_last_hih, e))
return -1;

Loading…
Cancel
Save