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

Function pv_get_spec_value

pvar.c:5504–5535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5502}
5503
5504int pv_get_spec_value(struct sip_msg* msg, const pv_spec_p sp, pv_value_t *value)
5505{
5506 struct sip_msg* pv_msg;
5507
5508 if(msg==NULL || sp==NULL || sp->getf==NULL || value==NULL
5509 || sp->type==PVT_NONE)
5510 {
5511 LM_ERR("bad parameters\n");
5512 return -1;
5513 }
5514
5515 memset(value, 0, sizeof(pv_value_t));
5516
5517 if(sp->pvc && sp->pvc->contextf)
5518 {
5519 LM_DBG("Found context function %p\n", sp->pvc->contextf);
5520 pv_msg = sp->pvc->contextf(msg);
5521 if(pv_msg == NULL || pv_msg==FAKED_REPLY)
5522 {
5523 LM_DBG("Invalid %p pv context message\n",pv_msg);
5524 return pv_get_null( NULL, NULL, value);
5525 }
5526 } else {
5527 pv_msg = msg;
5528 }
5529 if((*sp->getf)(pv_msg, &(sp->pvp), value)!=0)
5530 return pv_get_null( NULL, NULL, value);
5531 if(sp->trans)
5532 if (run_transformations(pv_msg, (trans_t*)sp->trans, value)!=0)
5533 return pv_get_null( NULL, NULL, value);
5534 return 0;
5535}
5536
5537int pv_print_spec(struct sip_msg* msg, const pv_spec_p sp, char *buf, int *len)
5538{

Callers 15

IDXFunction · 0.85
xlog_2Function · 0.85
get_cmd_fixupsFunction · 0.85
do_assignFunction · 0.85
route_params_expandFunction · 0.85
route_param_getFunction · 0.85
do_actionFunction · 0.85
pv_get_return_valueFunction · 0.85
pv_get_spec_nameFunction · 0.85
pv_get_avp_nameFunction · 0.85
pv_get_spec_indexFunction · 0.85
pv_print_specFunction · 0.85

Calls 2

pv_get_nullFunction · 0.85
run_transformationsFunction · 0.85

Tested by

no test coverage detected