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

Function pv_get_rl_count

modules/ratelimit/ratelimit.c:1106–1125  ·  view source on GitHub ↗

pseudo-variable functions */

Source from the content-addressed store, hash-verified

1104
1105/* pseudo-variable functions */
1106static int pv_get_rl_count(struct sip_msg *msg, pv_param_t *param,
1107 pv_value_t *res)
1108{
1109 int counter;
1110
1111 if (!param)
1112 return pv_get_null(msg, param, res);
1113
1114 if(pv_get_spec_name(msg, param, res)!=0 || (!(res->flags&PV_VAL_STR))) {
1115 LM_ERR("invalid name\n");
1116 return -1;
1117 }
1118
1119 counter = rl_get_counter_value(&res->rs);
1120 if (counter < 0) {
1121 return pv_get_null(msg, param, res);
1122 }
1123
1124 return pv_get_uintval(msg, param, res, counter);
1125}
1126
1127static int pv_parse_rl_count(pv_spec_p sp, const str *in)
1128{

Callers

nothing calls this directly

Calls 4

pv_get_nullFunction · 0.85
pv_get_spec_nameFunction · 0.85
rl_get_counter_valueFunction · 0.85
pv_get_uintvalFunction · 0.85

Tested by

no test coverage detected