diff --git a/daemon/call.h b/daemon/call.h index bf23d2d16..c786bb074 100644 --- a/daemon/call.h +++ b/daemon/call.h @@ -474,8 +474,6 @@ void add_total_calls_duration_in_interval(struct callmaster *cm, struct timeval void __payload_type_free(void *p); void __rtp_stats_update(GHashTable *dst, GHashTable *src); -const char *get_opmode_text(enum call_opmode); - const struct rtp_payload_type *__rtp_stats_codec(struct call_media *m); #include "str.h" diff --git a/daemon/cdr.h b/daemon/cdr.h index cc42ae3a9..2ea19b54f 100644 --- a/daemon/cdr.h +++ b/daemon/cdr.h @@ -12,8 +12,10 @@ struct call; enum tag_type; +enum call_opmode; const char *get_tag_type_text(enum tag_type t); +const char *get_opmode_text(enum call_opmode); void cdr_update_entry(struct call* c); #endif /* CDR_H_ */ diff --git a/daemon/recording.c b/daemon/recording.c index 0a6958dbd..4bd854bb9 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -19,6 +19,7 @@ #include "kernel.h" #include "bencode.h" #include "rtplib.h" +#include "cdr.h" diff --git a/daemon/redis.c b/daemon/redis.c index a281e2b8e..fde2ff9e3 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -13,6 +13,9 @@ #include #include #include +#include +#include +#include #include "compat.h" #include "aux.h" @@ -26,9 +29,6 @@ #include "rtplib.h" #include "str.h" -#include -#include -#include INLINE redisReply *redis_expect(int type, redisReply *r) { if (!r) @@ -699,16 +699,13 @@ INLINE str *json_reader_get_string_value_uri_enc(JsonReader *root_reader) { return out; // must be free'd } -static int json_get_hash(struct redis_hash *out, struct call* c, +static int json_get_hash(struct redis_hash *out, const char *key, unsigned int id, JsonReader *root_reader) { static unsigned int MAXKEYLENGTH = 512; char key_concatted[MAXKEYLENGTH]; int rc=0; - if (!c) - goto err; - if (id == -1) { rc = snprintf(key_concatted, MAXKEYLENGTH, "%s",key); } else { @@ -915,7 +912,7 @@ static int json_build_list(GQueue *q, struct call *c, const char *key, const str return json_build_list_cb(q, c, key, idx, list, rbl_cb_simple, NULL, root_reader); } -static int json_get_list_hash(struct redis_list *out, struct call* c, +static int json_get_list_hash(struct redis_list *out, const char *key, const struct redis_hash *rh, const char *rh_num_key, JsonReader *root_reader) { @@ -931,7 +928,7 @@ static int json_get_list_hash(struct redis_list *out, struct call* c, goto err1; for (i = 0; i < out->len; i++) { - if (json_get_hash(&out->rh[i], c, key, i, root_reader)) + if (json_get_hash(&out->rh[i], key, i, root_reader)) goto err2; } @@ -1419,22 +1416,22 @@ static void json_restore_call(struct redis *r, struct callmaster *m, const str * goto err2; err = "'call' data incomplete"; - if (json_get_hash(&call, c, "json", -1, root_reader)) + if (json_get_hash(&call, "json", -1, root_reader)) goto err2; err = "'tags' incomplete"; - if (json_get_list_hash(&tags, c, "tag", &call, "num_tags", root_reader)) + if (json_get_list_hash(&tags, "tag", &call, "num_tags", root_reader)) goto err3; err = "'sfds' incomplete"; - if (json_get_list_hash(&sfds, c, "sfd", &call, "num_sfds", root_reader)) + if (json_get_list_hash(&sfds, "sfd", &call, "num_sfds", root_reader)) goto err4; err = "'streams' incomplete"; - if (json_get_list_hash(&streams, c, "stream", &call, "num_streams", root_reader)) + if (json_get_list_hash(&streams, "stream", &call, "num_streams", root_reader)) goto err5; err = "'medias' incomplete"; - if (json_get_list_hash(&medias, c, "media", &call, "num_medias", root_reader)) + if (json_get_list_hash(&medias, "media", &call, "num_medias", root_reader)) goto err6; err = "'maps' incomplete"; - if (json_get_list_hash(&maps, c, "map", &call, "num_maps", root_reader)) + if (json_get_list_hash(&maps, "map", &call, "num_maps", root_reader)) goto err7; err = "missing 'created' timestamp";