summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-12-18 11:57:17 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-12-18 11:57:17 -0600
commit38bf1f3a718676e932b7cd088dd67a08adae3ed6 (patch)
treeb1d469ad49e953d8ad6ca53cc1f048b480116086 /res
parent902309fd0422382eb6de4ba1d92724be437c2561 (diff)
parentd17d9a92886429b185b7bc2e02e429fc43d39652 (diff)
Merge "json: Audit ast_json_* usage for thread safety."
Diffstat (limited to 'res')
-rw-r--r--res/res_fax.c4
-rw-r--r--res/res_stasis.c6
-rw-r--r--res/res_stasis_playback.c4
-rw-r--r--res/res_stasis_recording.c4
-rw-r--r--res/stasis/app.c4
5 files changed, 11 insertions, 11 deletions
diff --git a/res/res_fax.c b/res/res_fax.c
index 62fe726de..f171af92a 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -2028,14 +2028,14 @@ static int report_receive_fax_status(struct ast_channel *chan, const char *filen
fax_bitrate = ast_strdupa(fax_bitrate);
}
- json_object = ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: s, s: O}",
+ json_object = ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: s, s: o}",
"type", "receive",
"remote_station_id", S_OR(remote_station_id, ""),
"local_station_id", S_OR(local_station_id, ""),
"fax_pages", S_OR(fax_pages, ""),
"fax_resolution", S_OR(fax_resolution, ""),
"fax_bitrate", S_OR(fax_bitrate, ""),
- "filenames", json_array);
+ "filenames", ast_json_ref(json_array));
if (!json_object) {
return -1;
}
diff --git a/res/res_stasis.c b/res/res_stasis.c
index abca895ee..63c565d44 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -150,10 +150,10 @@ static struct ast_json *stasis_start_to_json(struct stasis_message *message,
return NULL;
}
- msg = ast_json_pack("{s: s, s: O, s: O, s: o}",
+ msg = ast_json_pack("{s: s, s: o, s: o, s: o}",
"type", "StasisStart",
- "timestamp", ast_json_object_get(payload->blob, "timestamp"),
- "args", ast_json_object_get(payload->blob, "args"),
+ "timestamp", ast_json_copy(ast_json_object_get(payload->blob, "timestamp")),
+ "args", ast_json_deep_copy(ast_json_object_get(payload->blob, "args")),
"channel", ast_channel_snapshot_to_json(payload->channel, NULL));
if (!msg) {
ast_log(LOG_ERROR, "Failed to pack JSON for StasisStart message\n");
diff --git a/res/res_stasis_playback.c b/res/res_stasis_playback.c
index 9abfe3d17..74336abdc 100644
--- a/res/res_stasis_playback.c
+++ b/res/res_stasis_playback.c
@@ -105,9 +105,9 @@ static struct ast_json *playback_to_json(struct stasis_message *message,
return NULL;
}
- return ast_json_pack("{s: s, s: O}",
+ return ast_json_pack("{s: s, s: o}",
"type", type,
- "playback", blob);
+ "playback", ast_json_deep_copy(blob));
}
STASIS_MESSAGE_TYPE_DEFN(stasis_app_playback_snapshot_type,
diff --git a/res/res_stasis_recording.c b/res/res_stasis_recording.c
index 02ad875a8..dcabfa699 100644
--- a/res/res_stasis_recording.c
+++ b/res/res_stasis_recording.c
@@ -91,9 +91,9 @@ static struct ast_json *recording_to_json(struct stasis_message *message,
return NULL;
}
- return ast_json_pack("{s: s, s: O}",
+ return ast_json_pack("{s: s, s: o}",
"type", type,
- "recording", blob);
+ "recording", ast_json_deep_copy(blob));
}
STASIS_MESSAGE_TYPE_DEFN(stasis_app_recording_snapshot_type,
diff --git a/res/stasis/app.c b/res/stasis/app.c
index 5002a0ba8..6e5a396be 100644
--- a/res/stasis/app.c
+++ b/res/stasis/app.c
@@ -609,11 +609,11 @@ static int message_received_handler(const char *endpoint_id, struct ast_json *js
return -1;
}
- app_send(app, ast_json_pack("{s: s, s: o, s: o, s: O}",
+ app_send(app, ast_json_pack("{s: s, s: o, s: o, s: o}",
"type", "TextMessageReceived",
"timestamp", ast_json_timeval(ast_tvnow(), NULL),
"endpoint", json_endpoint,
- "message", json_msg));
+ "message", ast_json_ref(json_msg)));
return 0;
}