TT#136952 split up CLI tag info writer

Change-Id: I40f9e89d11edb3857ae7d1b6663b9afb0efc5c78
mika/coverity
Richard Fuchs 4 years ago
parent 31ad47af33
commit ef141e6810

@ -168,6 +168,7 @@ static const cli_handler_t cli_params_handlers[] = {
static void cli_list_call_info(struct cli_writer *cw, struct call *c);
static void cli_list_tag_info(struct cli_writer *cw, struct call_monologue *ml);
@ -564,13 +565,7 @@ static void cli_incoming_list_callid(str *instr, struct cli_writer *cw) {
static void cli_list_call_info(struct cli_writer *cw, struct call *c) {
struct call_monologue *ml;
struct call_media *md;
struct packet_stream *ps;
GList *l;
GList *k, *o;
struct timeval tim_result_duration;
struct timeval now;
char *local_addr;
cw->cw_printf(cw,
"\ncallid: %s\ndeletionmark: %s\ncreated: %i\nproxy: %s\ntos: %u\nlast_signal: %llu\n"
@ -581,6 +576,19 @@ static void cli_list_call_info(struct cli_writer *cw, struct call *c) {
for (l = c->monologues.head; l; l = l->next) {
ml = l->data;
cli_list_tag_info(cw, ml);
}
cw->cw_printf(cw, "\n");
}
static void cli_list_tag_info(struct cli_writer *cw, struct call_monologue *ml) {
struct call_media *md;
struct packet_stream *ps;
struct timeval tim_result_duration;
struct timeval now;
char *local_addr;
if (!ml->terminated.tv_sec)
gettimeofday(&now, NULL);
else
@ -604,8 +612,14 @@ static void cli_list_call_info(struct cli_writer *cw, struct call *c) {
cw->cw_printf(cw, "--- subscribed to '" STR_FORMAT_M "'\n",
STR_FMT_M(&csm->tag));
}
for (GList *sub = ml->subscriptions.head; sub; sub = sub->next) {
struct call_subscription *cs = sub->data;
struct call_monologue *csm = cs->monologue;
cw->cw_printf(cw, "--- subscription of '" STR_FORMAT_M "'\n",
STR_FMT_M(&csm->tag));
}
for (k = ml->medias.head; k; k = k->next) {
for (GList *k = ml->medias.head; k; k = k->next) {
md = k->data;
const struct rtp_payload_type *rtp_pt = __rtp_stats_codec(md);
@ -619,7 +633,7 @@ static void cli_list_call_info(struct cli_writer *cw, struct call *c) {
else
cw->cw_printf(cw, STR_FORMAT "\n", STR_FMT(&rtp_pt->encoding_with_params));
for (o = md->streams.head; o; o = o->next) {
for (GList *o = md->streams.head; o; o = o->next) {
ps = o->data;
if (PS_ISSET(ps, FALLBACK_RTCP))
@ -649,8 +663,6 @@ static void cli_list_call_info(struct cli_writer *cw, struct call *c) {
cw->cw_printf(cw, "\n");
}
}
}
cw->cw_printf(cw, "\n");
}

Loading…
Cancel
Save