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

Function pv_get_rtpstat_line

modules/rtpengine/rtpengine.c:4161–4185  ·  view source on GitHub ↗

* Returns the current RTP-Statistics from the RTP-Proxy */

Source from the content-addressed store, hash-verified

4159 * Returns the current RTP-Statistics from the RTP-Proxy
4160 */
4161static inline void pv_get_rtpstat_line(bencode_item_t *dict, pv_value_t *res)
4162{
4163 static char buf[256];
4164 bencode_item_t *tot, *rtp, *rtcp;
4165 str ret;
4166
4167 tot = bencode_dictionary_get_expect(dict, "totals", BENCODE_DICTIONARY);
4168 rtp = bencode_dictionary_get_expect(tot, "RTP", BENCODE_DICTIONARY);
4169 rtcp = bencode_dictionary_get_expect(tot, "RTCP", BENCODE_DICTIONARY);
4170 if (!rtp || !rtcp) {
4171 pv_get_null(NULL, NULL, res);
4172 return;
4173 }
4174 ret.s = buf;
4175 ret.len = snprintf(buf, sizeof(buf),
4176 "RTP: %lli bytes, %lli packets, %lli errors; "
4177 "RTCP: %lli bytes, %lli packets, %lli errors",
4178 bencode_dictionary_get_integer(rtp, "bytes", -1),
4179 bencode_dictionary_get_integer(rtp, "packets", -1),
4180 bencode_dictionary_get_integer(rtp, "errors", -1),
4181 bencode_dictionary_get_integer(rtcp, "bytes", -1),
4182 bencode_dictionary_get_integer(rtcp, "packets", -1),
4183 bencode_dictionary_get_integer(rtcp, "errors", -1));
4184 pv_get_strval(NULL, NULL, res, &ret);
4185}
4186
4187#define BENCODE_GET_STR(_be, _s) \
4188 do { \

Callers 1

pv_get_rtpstat_fFunction · 0.85

Calls 4

pv_get_nullFunction · 0.85
pv_get_strvalFunction · 0.85

Tested by

no test coverage detected