summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/app_minivm.c8
-rw-r--r--apps/app_queue.c8
-rw-r--r--main/aoc.c33
3 files changed, 24 insertions, 25 deletions
diff --git a/apps/app_minivm.c b/apps/app_minivm.c
index fb7c22aa4..789a48aab 100644
--- a/apps/app_minivm.c
+++ b/apps/app_minivm.c
@@ -1853,10 +1853,10 @@ static int notify_new_message(struct ast_channel *chan, const char *templatename
}
mwi_state->snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(chan));
- json_object = ast_json_pack("{s: s, s: s}",
- "Event", "MiniVoiceMail"
- "Action", "SentNotification",
- "Counter", counter);
+ json_object = ast_json_pack("{s: s, s: s, s: s}",
+ "Event", "MiniVoiceMail",
+ "Action", "SentNotification",
+ "Counter", counter ?: "");
if (!json_object) {
goto notify_cleanup;
}
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 45b5683ed..79a19c8f6 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -7199,12 +7199,10 @@ static void set_queue_member_pause(struct call_queue *q, struct member *mem, con
}
mem->paused = paused;
- if (paused) {
- if (!ast_strlen_zero(reason)) {
- ast_copy_string(mem->reason_paused, reason, sizeof(mem->reason_paused));
- }
+ if (paused && !ast_strlen_zero(reason)) {
+ ast_copy_string(mem->reason_paused, reason, sizeof(mem->reason_paused));
} else {
- ast_copy_string(mem->reason_paused, "", sizeof(mem->reason_paused));
+ mem->reason_paused[0] = '\0';
}
ast_devstate_changed(mem->paused ? QUEUE_PAUSED_DEVSTATE : QUEUE_UNPAUSED_DEVSTATE,
diff --git a/main/aoc.c b/main/aoc.c
index 4ab931536..258525e65 100644
--- a/main/aoc.c
+++ b/main/aoc.c
@@ -1667,8 +1667,8 @@ static struct ast_json *charge_to_json(const struct ast_aoc_decoded *decoded)
if (decoded->charge_type != AST_AOC_CHARGE_CURRENCY &&
decoded->charge_type != AST_AOC_CHARGE_UNIT) {
- return ast_json_pack("{s:s}", "Type",
- aoc_charge_type_str(decoded->charge_type));
+ return ast_json_pack("{s:s}",
+ "Type", aoc_charge_type_str(decoded->charge_type));
}
if (decoded->charge_type == AST_AOC_CHARGE_CURRENCY) {
@@ -1680,8 +1680,7 @@ static struct ast_json *charge_to_json(const struct ast_aoc_decoded *decoded)
obj = units_to_json(decoded);
}
- return ast_json_pack(
- "{s:s, s:s, s:s, s:o}",
+ return ast_json_pack("{s:s, s:s, s:s, s:o}",
"Type", aoc_charge_type_str(decoded->charge_type),
"BillingID", aoc_billingid_str(decoded->billing_id),
"TotalType", aoc_type_of_totaling_str(decoded->total_type),
@@ -1697,8 +1696,7 @@ static struct ast_json *association_to_json(const struct ast_aoc_decoded *decode
"Number", decoded->charging_association.charge.number.number,
"Plan", decoded->charging_association.charge.number.plan);
case AST_AOC_CHARGING_ASSOCIATION_ID:
- return ast_json_pack(
- "{s:i}", "ID", decoded->charging_association.charge.id);
+ return ast_json_pack("{s:i}", "ID", decoded->charging_association.charge.id);
case AST_AOC_CHARGING_ASSOCIATION_NA:
default:
return ast_json_null();
@@ -1752,10 +1750,12 @@ static struct ast_json *s_to_json(const struct ast_aoc_decoded *decoded)
"Scale", decoded->aoc_s_entries[i].rate.duration.granularity_time_scale);
}
- type = ast_json_pack("{s:o, s:s, s:o, s:o}", "Currency", ast_json_ref(currency), "ChargingType",
- decoded->aoc_s_entries[i].rate.duration.charging_type ?
- "StepFunction" : "ContinuousCharging", "Time", ast_json_ref(time),
- "Granularity", granularity ? ast_json_ref(granularity) : ast_json_ref(ast_json_null()));
+ type = ast_json_pack("{s:o, s:s, s:o, s:o}",
+ "Currency", ast_json_ref(currency),
+ "ChargingType", decoded->aoc_s_entries[i].rate.duration.charging_type
+ ? "StepFunction" : "ContinuousCharging",
+ "Time", ast_json_ref(time),
+ "Granularity", granularity ? ast_json_ref(granularity) : ast_json_null());
break;
}
@@ -1773,21 +1773,22 @@ static struct ast_json *s_to_json(const struct ast_aoc_decoded *decoded)
decoded->aoc_s_entries[i].rate.volume.amount,
decoded->aoc_s_entries[i].rate.volume.multiplier);
- type = ast_json_pack(
- "{s:s, s:o}", "Unit", aoc_volume_unit_str(
+ type = ast_json_pack("{s:s, s:o}",
+ "Unit", aoc_volume_unit_str(
decoded->aoc_s_entries[i].rate.volume.volume_unit),
"Currency", ast_json_ref(currency));
break;
case AST_AOC_RATE_TYPE_SPECIAL_CODE:
- type = ast_json_pack("{s:i}", "SpecialCode",
- decoded->aoc_s_entries[i].rate.special_code);
+ type = ast_json_pack("{s:i}",
+ "SpecialCode", decoded->aoc_s_entries[i].rate.special_code);
break;
default:
break;
}
- rate = ast_json_pack("{s:s, s:o}", "Chargeable", charge_item,
- aoc_rate_type_str(decoded->aoc_s_entries[i].rate_type), ast_json_ref(type));
+ rate = ast_json_pack("{s:s, s:o}",
+ "Chargeable", charge_item,
+ aoc_rate_type_str(decoded->aoc_s_entries[i].rate_type), ast_json_ref(type));
if (ast_json_array_append(rates, rate)) {
break;
}