| 669 | #define PVE_NAME_PVAR 2 |
| 670 | |
| 671 | static int pv_parse_rtpstat(pv_spec_p sp, const str *in) |
| 672 | { |
| 673 | enum rtpe_stat s; |
| 674 | pv_elem_t *format; |
| 675 | if (!in || in->s == NULL || in->len == 0 || sp == NULL) |
| 676 | return -1; |
| 677 | |
| 678 | LM_DBG("RTP stat name %p with name <%.*s>\n", &sp->pvp.pvn, in->len, in->s); |
| 679 | if (pv_parse_format(in, &format)!=0) { |
| 680 | LM_ERR("failed to parse statistic name format <%.*s> \n", |
| 681 | in->len,in->s); |
| 682 | return -1; |
| 683 | } |
| 684 | if (format->next==NULL && format->spec.type==PVT_NONE) { |
| 685 | s = rtpe_get_stat_by_name(in); |
| 686 | if (s == STAT_UNKNOWN) { |
| 687 | LM_ERR("Unknown RTP statistic %.*s\n", in->len, in->s); |
| 688 | return -1; |
| 689 | } |
| 690 | sp->pvp.pvn.type = PVE_NAME_INTSTR; |
| 691 | sp->pvp.pvn.u.isname.type = 0; |
| 692 | sp->pvp.pvn.u.isname.name.n = s; |
| 693 | } else { |
| 694 | sp->pvp.pvn.type = PVE_NAME_PVAR; |
| 695 | sp->pvp.pvn.u.isname.type = 0; |
| 696 | sp->pvp.pvn.u.isname.name.s.s = (char*)(void*)format; |
| 697 | sp->pvp.pvn.u.isname.name.s.len = 0; |
| 698 | } |
| 699 | return 0; |
| 700 | } |
| 701 | |
| 702 | static int pv_rtpengine_index(pv_spec_p sp, const str *in) |
| 703 | { |
nothing calls this directly
no test coverage detected