Browse code

kazoo: replaced obsolete json is_error() macro

(cherry picked from commit 7d3766614832ef22433e36ef0791fa41796829a2)
(cherry picked from commit 53f46ab7b6eb311137033f6cdb27ef73d87cb3f2)

Daniel-Constantin Mierla authored on 07/06/2018 08:33:26
Showing 2 changed files
... ...
@@ -1241,7 +1241,7 @@ int kz_amqp_publish(struct sip_msg* msg, char* exchange, char* routing_key, char
1241 1241
 
1242 1242
 		struct json_object *j = json_tokener_parse(json_s.s);
1243 1243
 
1244
-		if (is_error(j)) {
1244
+		if (j==NULL) {
1245 1245
 			LM_ERR("empty or invalid JSON payload : %.*s\n", json_s.len, json_s.s);
1246 1246
 			return -1;
1247 1247
 		}
... ...
@@ -1304,7 +1304,7 @@ int kz_amqp_async_query(struct sip_msg* msg, char* _exchange, char* _routing_key
1304 1304
 
1305 1305
 	  json_obj = json_tokener_parse(json_s.s);
1306 1306
 
1307
-	  if (is_error(json_obj)) {
1307
+	  if (json_obj==NULL) {
1308 1308
 		  LM_ERR("empty or invalid JSON payload : %*.s\n", json_s.len, json_s.s);
1309 1309
 		  goto error;
1310 1310
 	  }
... ...
@@ -1457,7 +1457,7 @@ int kz_amqp_query_ex(struct sip_msg* msg, char* exchange, char* routing_key, cha
1457 1457
 
1458 1458
 		struct json_object *j = json_tokener_parse(json_s.s);
1459 1459
 
1460
-		if (is_error(j)) {
1460
+		if (j==NULL) {
1461 1461
 			LM_ERR("empty or invalid JSON payload : %*.s\n", json_s.len, json_s.s);
1462 1462
 			return -1;
1463 1463
 		}
... ...
@@ -132,7 +132,7 @@ struct json_object * kz_json_get_field_object(str* json, str* field)
132 132
   struct json_object *j = json_tokener_parse(dup);
133 133
   pkg_free(dup);
134 134
 
135
-  if (is_error(j)) {
135
+  if (j==NULL) {
136 136
 	  LM_ERR("empty or invalid JSON\n");
137 137
 	  return NULL;
138 138
   }