| 4728 | } |
| 4729 | |
| 4730 | static inline int rtpproxy_all_stats_f(struct sip_msg *msg, pv_spec_t *pavp, |
| 4731 | nh_set_param_t *pset, pv_spec_t *pvar) |
| 4732 | { |
| 4733 | int nitems; |
| 4734 | struct usr_avp *avp; |
| 4735 | struct rtpp_node *node; |
| 4736 | struct rtpp_set *set; |
| 4737 | char *result, *p; |
| 4738 | int error; |
| 4739 | struct rtpproxy_vcmd *vstat; |
| 4740 | str callid = {0, 0}; |
| 4741 | unsigned short type; |
| 4742 | int_str val; |
| 4743 | int avals; |
| 4744 | int nrstats = 0; |
| 4745 | str nr; |
| 4746 | int chunk; |
| 4747 | int ret = -1; |
| 4748 | |
| 4749 | if (pv_get_avp_name(msg, &pavp->pvp, &avals, &type) < 0) { |
| 4750 | LM_ERR("cannot resolve AVP!\n"); |
| 4751 | return -1; |
| 4752 | } |
| 4753 | avp = NULL; |
| 4754 | do { |
| 4755 | if (avp) destroy_avp(avp); |
| 4756 | avp = search_first_avp(type, avals, NULL, NULL); |
| 4757 | }while(avp); |
| 4758 | |
| 4759 | if (rtpp_build_stats(msg, &vstat, &nitems, &callid) < 0) |
| 4760 | return -1; |
| 4761 | |
| 4762 | set = get_rtpp_set(pset); |
| 4763 | if (!set) { |
| 4764 | LM_ERR("could not find rtpproxy set\n"); |
| 4765 | return 0; |
| 4766 | } |
| 4767 | |
| 4768 | if (nh_lock) { |
| 4769 | lock_start_read( nh_lock ); |
| 4770 | } |
| 4771 | |
| 4772 | node = select_rtpp_node(msg, callid, set, pvar, 1); |
| 4773 | if (!node) { |
| 4774 | LM_ERR("no available proxies\n"); |
| 4775 | goto error; |
| 4776 | } |
| 4777 | if (!HAS_CAP(node, STATS_EXTRA)) { |
| 4778 | LM_ERR("RTPProxy does not support all statistics query!\n"); |
| 4779 | goto error; |
| 4780 | } |
| 4781 | |
| 4782 | ret = -2; |
| 4783 | for (chunk = 0; chunk < rtpp_stats_chunks_no; chunk++) { |
| 4784 | vstat->vu[nitems] = rtpp_stats_chunks[chunk]; |
| 4785 | result = send_rtpp_command(node, vstat, nitems + 1); |
| 4786 | if (!result) { |
| 4787 | LM_DBG("no result from RTPProxy!\n"); |
nothing calls this directly
no test coverage detected