Browse Source

MT#55283 fix DB metadata output

Delay writing of call DB entry until a metadata has been set, even if
empty. This is so that we can know whether "skip DB" was set or not.

Check DB entry status with every event, not just when streams are
created. Stream may get created before all relevant data for DB entries
is there.

Change-Id: I4834c83d83cd367c9570840d7c57e9a3223c195f
pull/1998/head
Richard Fuchs 4 months ago
parent
commit
e2e4d8f401
3 changed files with 14 additions and 9 deletions
  1. +2
    -0
      recording-daemon/db.c
  2. +4
    -4
      recording-daemon/metafile.c
  3. +8
    -5
      recording-daemon/packet.c

+ 2
- 0
recording-daemon/db.c View File

@ -258,6 +258,8 @@ static void db_do_call_id(metafile_t *mf) {
return;
if (mf->skip_db)
return;
if (!mf->metadata)
return;
MYSQL_BIND b[2];
my_cstr(&b[0], mf->call_id);


+ 4
- 4
recording-daemon/metafile.c View File

@ -101,11 +101,11 @@ static void meta_mix_file_output(metafile_t *mf) {
return;
}
if (mf->mix)
return;
if (!mf->mix) {
mf->mix_out = output_new_ext(mf, "mix", "mixed", "mix");
mf->mix = mix_new(&mf->mix_lock, &mf->mix_out->sink, mf->media_rec_slots);
}
mf->mix_out = output_new_ext(mf, "mix", "mixed", "mix");
mf->mix = mix_new(&mf->mix_lock, &mf->mix_out->sink, mf->media_rec_slots);
db_do_stream(mf, mf->mix_out, NULL, 0);
}


+ 8
- 5
recording-daemon/packet.c View File

@ -75,11 +75,14 @@ out:
dbg("Init for SSRC %s%lx%s of stream #%lu", FMT_M(ret->ssrc), stream->id);
if (mf->recording_on && !ret->output && output_single) {
char buf[16];
snprintf(buf, sizeof(buf), "%08lx", ssrc);
tag_t *tag = tag_get(mf, stream->tag);
ret->output = output_new_ext(mf, buf, "single", tag->label);
if (mf->recording_on && output_single) {
if (!ret->output) {
char buf[16];
snprintf(buf, sizeof(buf), "%08lx", ssrc);
tag_t *tag = tag_get(mf, stream->tag);
ret->output = output_new_ext(mf, buf, "single", tag->label);
}
db_do_stream(mf, ret->output, stream, ssrc);
}


Loading…
Cancel
Save