}
ast_json_ref(json_filenames);
json_object = ast_json_pack("{s: s, s: s, s: s, s: i, s: i, s: i, s: o}",
- "type", s->direction ? "send" : "receive",
- "remote_station_id", far_ident,
- "local_station_id", local_ident,
- "fax_pages", pages_transferred,
- "fax_resolution", stat.y_resolution,
- "fax_bitrate", stat.bit_rate,
- "filenames", json_filenames);
+ "type", s->direction ? "send" : "receive",
+ "remote_station_id", AST_JSON_UTF8_VALIDATE(far_ident),
+ "local_station_id", AST_JSON_UTF8_VALIDATE(local_ident),
+ "fax_pages", pages_transferred,
+ "fax_resolution", stat.y_resolution,
+ "fax_bitrate", stat.bit_rate,
+ "filenames", json_filenames);
message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(s->chan), ast_channel_fax_type(), json_object);
if (!message) {
return;
}
blob = ast_json_pack("{s: s, s: s, s: s, s: i, s: i, s: s}",
- "Queue", queuename,
- "Interface", member->interface,
- "MemberName", member->membername,
- "HoldTime", (long)(callstart - holdstart),
- "TalkTime", (long)(time(NULL) - callstart),
- "Reason", reason);
+ "Queue", queuename,
+ "Interface", member->interface,
+ "MemberName", member->membername,
+ "HoldTime", (long)(callstart - holdstart),
+ "TalkTime", (long)(time(NULL) - callstart),
+ "Reason", reason ?: "");
queue_publish_multi_channel_snapshot_blob(ast_queue_topic(queuename), caller, peer,
queue_agent_complete_type(), blob);
static struct ast_json *currency_to_json(const char *name, int cost,
enum ast_aoc_currency_multiplier mult)
{
- return ast_json_pack("{s:s, s:i, s:s}", "Name", name,
- "Cost", cost, "Multiplier", aoc_multiplier_str(mult));
+ return ast_json_pack("{s:s, s:i, s:s}",
+ "Name", AST_JSON_UTF8_VALIDATE(name),
+ "Cost", cost,
+ "Multiplier", aoc_multiplier_str(mult));
}
static struct ast_json *charge_to_json(const struct ast_aoc_decoded *decoded)
{
switch (decoded->charging_association.charging_type) {
case AST_AOC_CHARGING_ASSOCIATION_NUMBER:
- return ast_json_pack(
- "{s:s, s:i}",
- "Number", decoded->charging_association.charge.number.number,
+ return ast_json_pack("{s:s, s:i}",
+ "Number", AST_JSON_UTF8_VALIDATE(decoded->charging_association.charge.number.number),
"Plan", decoded->charging_association.charge.number.plan);
case AST_AOC_CHARGING_ASSOCIATION_ID:
return ast_json_pack(
decoded->aoc_s_entries[i].rate.duration.amount,
decoded->aoc_s_entries[i].rate.duration.multiplier);
- time = ast_json_pack(
- "{s:i, s:s}",
+ time = ast_json_pack("{s:i, s:i}",
"Length", decoded->aoc_s_entries[i].rate.duration.time,
"Scale", decoded->aoc_s_entries[i].rate.duration.time_scale);
if (decoded->aoc_s_entries[i].rate.duration.granularity_time) {
- granularity = ast_json_pack(
- "{s:i, s:s}",
+ granularity = ast_json_pack("{s:i, s:i}",
"Length", decoded->aoc_s_entries[i].rate.duration.granularity_time,
"Scale", decoded->aoc_s_entries[i].rate.duration.granularity_time_scale);
}
if (parked_payload->retriever) {
extra = ast_json_pack("{s: s, s: s}",
- "reason", reason,
+ "reason", reason ?: "",
"retriever", parked_payload->retriever->name);
} else {
- extra = ast_json_pack("{s: s}", "reason", reason);
+ extra = ast_json_pack("{s: s}", "reason", reason ?: "");
}
if (extra) {
}
json_object = ast_json_pack("{s: s, s: s, s: s, s: s, s: o}",
- "type", "status",
- "operation", (details->caps & AST_FAX_TECH_GATEWAY) ? "gateway" : (details->caps & AST_FAX_TECH_RECEIVE) ? "receive" : "send",
- "status", status,
- "local_station_id", details->localstationid,
- "filenames", json_filenames);
+ "type", "status",
+ "operation", (details->caps & AST_FAX_TECH_GATEWAY)
+ ? "gateway"
+ : (details->caps & AST_FAX_TECH_RECEIVE) ? "receive" : "send",
+ "status", status,
+ "local_station_id", AST_JSON_UTF8_VALIDATE(details->localstationid),
+ "filenames", json_filenames);
if (!json_object) {
return -1;
}
"type", "ChannelDialplan",
"timestamp", ast_json_timeval(*tv, NULL),
"dialplan_app", new_snapshot->appl,
- "dialplan_app_data", new_snapshot->data,
+ "dialplan_app_data", AST_JSON_UTF8_VALIDATE(new_snapshot->data),
"channel", json_channel);
}