| 884 | |
| 885 | |
| 886 | int pv_get_stat(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) |
| 887 | { |
| 888 | stat_var *stat; |
| 889 | |
| 890 | if(msg==NULL || res==NULL) |
| 891 | return -1; |
| 892 | |
| 893 | if (get_stat_name( msg, &(param->pvn), 0, &stat)!=0) { |
| 894 | LM_ERR("failed to generate/get statistic name\n"); |
| 895 | return -1; |
| 896 | } |
| 897 | |
| 898 | if (stat==NULL) |
| 899 | return pv_get_null(msg, param, res); |
| 900 | |
| 901 | res->ri = (int)get_stat_val( stat ); |
| 902 | res->rs.s = sint2str(res->ri, &res->rs.len); |
| 903 | res->flags = PV_VAL_INT|PV_VAL_STR|PV_TYPE_INT; |
| 904 | |
| 905 | return 0; |
| 906 | } |
| 907 | |
| 908 | #define get_stat_series_slot(_ss, _ts) \ |
| 909 | (((_ts) % ((_ss)->profile->window * 1000)) / (_ss)->profile->slot_size) |
nothing calls this directly
no test coverage detected