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

Function pv_get_mqv

modules/mqueue/mqueue_api.c:466–488  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

464 *
465 */
466int pv_get_mqv(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
467{
468 mq_pv_t *mp = NULL;
469
470 if (!param)
471 return pv_get_null(msg, param, res);
472
473 if(pv_get_spec_name(msg, param, res)!=0 || (!(res->flags&PV_VAL_STR))) {
474 LM_ERR("invalid name\n");
475 return -1;
476 }
477
478 LM_DBG("Getting val from [%.*s]\n", res->rs.len, res->rs.s);
479 if(mq_head_get(&res->rs) == NULL) {
480 LM_ERR("mqueue not found: %.*s\n", res->rs.len, res->rs.s);
481 return -1;
482 }
483
484 mp = mq_pv_get(&res->rs);
485 if(mp == NULL || mp->item == NULL || mp->item->val.len <= 0)
486 return pv_get_null(msg, param, res);
487 return pv_get_strval(msg, param, res, &mp->item->val);
488}
489
490/**
491 *

Callers

nothing calls this directly

Calls 5

pv_get_nullFunction · 0.85
pv_get_spec_nameFunction · 0.85
mq_head_getFunction · 0.85
mq_pv_getFunction · 0.85
pv_get_strvalFunction · 0.85

Tested by

no test coverage detected