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

Function pv_get_mq_size

modules/mqueue/mqueue_api.c:493–514  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

491 *
492 */
493int pv_get_mq_size(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
494{
495 int mqs = -1;
496
497 if (!param)
498 return pv_get_null(msg, param, res);
499
500 if(pv_get_spec_name(msg, param, res)!=0 || (!(res->flags&PV_VAL_STR))) {
501 LM_ERR("invalid name\n");
502 return -1;
503 }
504
505 LM_DBG("Getting size of [%.*s]\n", res->rs.len, res->rs.s);
506 mqs = _mq_get_csize(&res->rs);
507
508 if(mqs < 0) {
509 LM_ERR("mqueue not found: %.*s\n", res->rs.len, res->rs.s);
510 return -1;
511 }
512
513 return pv_get_sintval(msg, param, res, mqs);
514}
515
516/**
517 * Return head->csize for a given queue

Callers

nothing calls this directly

Calls 4

pv_get_nullFunction · 0.85
pv_get_spec_nameFunction · 0.85
_mq_get_csizeFunction · 0.85
pv_get_sintvalFunction · 0.85

Tested by

no test coverage detected