Browse Source

remove obsolete redis restore function arguments

Change-Id: Ia45cf4316ffa7a3d4fd813c74a1c76ee5dc38058
changes/85/12185/1
Richard Fuchs 9 years ago
parent
commit
7088e1586a
4 changed files with 15 additions and 17 deletions
  1. +0
    -2
      daemon/call.h
  2. +2
    -0
      daemon/cdr.h
  3. +1
    -0
      daemon/recording.c
  4. +12
    -15
      daemon/redis.c

+ 0
- 2
daemon/call.h View File

@ -474,8 +474,6 @@ void add_total_calls_duration_in_interval(struct callmaster *cm, struct timeval
void __payload_type_free(void *p); void __payload_type_free(void *p);
void __rtp_stats_update(GHashTable *dst, GHashTable *src); 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); const struct rtp_payload_type *__rtp_stats_codec(struct call_media *m);
#include "str.h" #include "str.h"


+ 2
- 0
daemon/cdr.h View File

@ -12,8 +12,10 @@
struct call; struct call;
enum tag_type; enum tag_type;
enum call_opmode;
const char *get_tag_type_text(enum tag_type t); 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); void cdr_update_entry(struct call* c);
#endif /* CDR_H_ */ #endif /* CDR_H_ */

+ 1
- 0
daemon/recording.c View File

@ -19,6 +19,7 @@
#include "kernel.h" #include "kernel.h"
#include "bencode.h" #include "bencode.h"
#include "rtplib.h" #include "rtplib.h"
#include "cdr.h"


+ 12
- 15
daemon/redis.c View File

@ -13,6 +13,9 @@
#include <hiredis/async.h> #include <hiredis/async.h>
#include <hiredis/adapters/libevent.h> #include <hiredis/adapters/libevent.h>
#include <event2/thread.h> #include <event2/thread.h>
#include <stdlib.h>
#include <glib-object.h>
#include <json-glib/json-glib.h>
#include "compat.h" #include "compat.h"
#include "aux.h" #include "aux.h"
@ -26,9 +29,6 @@
#include "rtplib.h" #include "rtplib.h"
#include "str.h" #include "str.h"
#include <stdlib.h>
#include <glib-object.h>
#include <json-glib/json-glib.h>
INLINE redisReply *redis_expect(int type, redisReply *r) { INLINE redisReply *redis_expect(int type, redisReply *r) {
if (!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 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) const char *key, unsigned int id, JsonReader *root_reader)
{ {
static unsigned int MAXKEYLENGTH = 512; static unsigned int MAXKEYLENGTH = 512;
char key_concatted[MAXKEYLENGTH]; char key_concatted[MAXKEYLENGTH];
int rc=0; int rc=0;
if (!c)
goto err;
if (id == -1) { if (id == -1) {
rc = snprintf(key_concatted, MAXKEYLENGTH, "%s",key); rc = snprintf(key_concatted, MAXKEYLENGTH, "%s",key);
} else { } 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); 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 char *key,
const struct redis_hash *rh, const char *rh_num_key, JsonReader *root_reader) 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; goto err1;
for (i = 0; i < out->len; i++) { 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; goto err2;
} }
@ -1419,22 +1416,22 @@ static void json_restore_call(struct redis *r, struct callmaster *m, const str *
goto err2; goto err2;
err = "'call' data incomplete"; 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; goto err2;
err = "'tags' incomplete"; 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; goto err3;
err = "'sfds' incomplete"; 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; goto err4;
err = "'streams' incomplete"; 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; goto err5;
err = "'medias' incomplete"; 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; goto err6;
err = "'maps' incomplete"; 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; goto err7;
err = "missing 'created' timestamp"; err = "missing 'created' timestamp";


Loading…
Cancel
Save