| 4470 | } |
| 4471 | |
| 4472 | static int |
| 4473 | pv_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 | |
| 4495 | error: |
| 4496 | if (!rc) |
| 4497 | bencode_buffer_free(&bencbuf); |
| 4498 | return -1; |
| 4499 | } |
| 4500 | |
| 4501 | static cJSON *bson2json(bencode_item_t *i) |
| 4502 | { |
nothing calls this directly
no test coverage detected