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

Function pv_get_hdr_prolog

pvar.c:2892–2924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2890}
2891
2892static int pv_get_hdr_prolog(struct sip_msg *msg, pv_param_t *param, pv_value_t *res, pv_value_t* tv)
2893{
2894 if(msg==NULL || res==NULL || param==NULL)
2895 return -1;
2896
2897 /* get the name */
2898 if(param->pvn.type == PV_NAME_PVAR)
2899 {
2900 if(pv_get_spec_name(msg, param, tv)!=0 || (!(tv->flags&PV_VAL_STR)))
2901 {
2902 LM_ERR("invalid name\n");
2903 return -1;
2904 }
2905 if (pv_resolve_hdr_name(&tv->rs, tv) < 0)
2906 return -1;
2907 } else {
2908 if(param->pvn.u.isname.type == AVP_NAME_STR)
2909 {
2910 tv->flags = PV_VAL_STR;
2911 tv->rs = param->pvn.u.isname.name.s;
2912 } else {
2913 tv->flags = 0;
2914 tv->ri = param->pvn.u.isname.name.n;
2915 }
2916 }
2917 /* we need to be sure we have parsed all headers */
2918 if(parse_headers(msg, HDR_EOH_F, 0)<0)
2919 {
2920 LM_ERR("error parsing headers\n");
2921 return pv_get_null(msg, param, res);
2922 }
2923 return 1;
2924}
2925
2926static int pv_get_hdrcnt(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
2927{

Callers 2

pv_get_hdrcntFunction · 0.85
pv_get_hdrFunction · 0.85

Calls 3

pv_get_spec_nameFunction · 0.85
pv_resolve_hdr_nameFunction · 0.85
pv_get_nullFunction · 0.85

Tested by

no test coverage detected