MT#57110 New field r_ua (responder_user_agent)

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

Change-Id: Icf8e80d0d2b63f4b9db006c8a224335989057e86
mr11.4.1
Alessio Garzi 3 years ago
parent d75c9c6183
commit 9e13374cdd

16
cdr.c

@ -731,6 +731,11 @@ static int cdr_parse_dstleg_json(json_object *json, cdr_entry_t *cdr)
L_DEBUG("Call-Id '%s' does not contain 'r_user' key, '%s'", cdr->call_id->str, json_object_get_string(json));
}
// responder_number
if (!cdr_parse_json_get_g_string(json, "r_ua", cdr->r_ua)) {
L_DEBUG("Call-Id '%s' does not contain 'r_ua' key, '%s'", cdr->call_id->str, json_object_get_string(json));
}
ret:
return 0;
@ -1309,6 +1314,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 response user agent, '%s'", cdr->call_id->str, tmp2);
return 0;
}
*tmp1 = '\0';
g_string_assign(cdr->r_ua, tmp2);
*tmp1 = MED_SEP;
tmp2 = ++tmp1;
return 0;
}

@ -49,6 +49,7 @@ F(destination_concurrent_calls_count)
F(destination_concurrent_calls_count_customer)
F(hg_ext_response)
F(r_user)
F(r_ua)
F(source_last_hih)
F(acc_ref)

@ -1148,6 +1148,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,
"r_user", e->r_user, e))
return -1;
if (medmysql_tag_cdr(batch, medmysql_tag_provider_customer, medmysql_tag_direction_destination,
"r_ua", e->r_ua, 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