MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / pv_get_rtpstat_f

Function pv_get_rtpstat_f

modules/rtpengine/rtpengine.c:4472–4499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4470}
4471
4472static int
4473pv_get_rtpstat_f(struct sip_msg *msg, pv_param_t *param,
4474 pv_value_t *res)
4475{
4476 bencode_buffer_t bencbuf;
4477 bencode_item_t *dict;
4478 int rc;
4479
4480 rc = rtpe_fetch_stats(msg, &bencbuf, &dict);
4481 if (rc < 0)
4482 return -1;
4483
4484 if (param->pvn.type == PVE_NAME_NONE)
4485 pv_get_rtpstat_line(dict, res);
4486 else if (pv_get_rtpstat(msg, param, res, dict) < 0) {
4487 LM_ERR("cannot fetch RTP statistic!\n");
4488 goto error;
4489 }
4490
4491 if (!rc)
4492 bencode_buffer_free(&bencbuf);
4493 return 0;
4494
4495error:
4496 if (!rc)
4497 bencode_buffer_free(&bencbuf);
4498 return -1;
4499}
4500
4501static cJSON *bson2json(bencode_item_t *i)
4502{

Callers

nothing calls this directly

Calls 4

rtpe_fetch_statsFunction · 0.85
pv_get_rtpstat_lineFunction · 0.85
pv_get_rtpstatFunction · 0.85
bencode_buffer_freeFunction · 0.85

Tested by

no test coverage detected