Module: kamailio
Branch: master
Commit: 140d0c6fc89d3c72bbd45627ca627e19e45b4e53
URL:
https://github.com/kamailio/kamailio/commit/140d0c6fc89d3c72bbd45627ca627e1…
Author: kelchy <kelchy(a)bitbucket.org>
Committer: kelchy <kelchy(a)bitbucket.org>
Date: 2015-07-06T19:21:41+08:00
prevent jansson from shuffling key order in json
---
Modified: modules/jansson/jansson_utils.c
---
Diff:
https://github.com/kamailio/kamailio/commit/140d0c6fc89d3c72bbd45627ca627e1…
Patch:
https://github.com/kamailio/kamailio/commit/140d0c6fc89d3c72bbd45627ca627e1…
---
diff --git a/modules/jansson/jansson_utils.c b/modules/jansson/jansson_utils.c
index 85f87ad..4919b0e 100644
--- a/modules/jansson/jansson_utils.c
+++ b/modules/jansson/jansson_utils.c
@@ -33,7 +33,7 @@ int jansson_to_val(pv_value_t* val, char** freeme, json_t* v) {
val->flags = 0;
if(json_is_object(v) || json_is_array(v)) {
- const char* value = json_dumps(v, JSON_COMPACT);
+ const char* value = json_dumps(v, JSON_COMPACT|JSON_PRESERVE_ORDER);
*freeme = (char*)value;
val->rs.s = (char*)value;
val->rs.len = strlen(value);