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

Function get_avp_values_list

modules/exec/exec_mod.c:201–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201static struct hf_wrapper* get_avp_values_list(struct sip_msg* msg, pv_param_p avp)
202{
203
204 int avp_name, idx=0;
205 unsigned short name_type;
206 int_str value;
207 struct usr_avp* avp_ptr=0;
208 struct hf_wrapper *hf=0, *hf_head;
209
210 if (pv_get_avp_name(msg, avp, &avp_name, &name_type) < 0) {
211 LM_ERR("cannot get avp name\n");
212 return 0;
213 }
214
215 if ((avp_ptr=search_first_avp( name_type, avp_name, &value, 0)) == 0) {
216 LM_ERR("cannot get first avp value\n");
217 return 0;
218 }
219
220 hf=pkg_malloc(sizeof(struct hf_wrapper));
221 if (!hf)
222 goto memerr;
223
224 setenvvar(&hf, &value, (avp_ptr->flags & AVP_VAL_STR), idx++);
225 hf_head=hf;
226
227 while ((avp_ptr = search_next_avp( avp_ptr, &value)) != 0) {
228 hf->next_other=pkg_malloc(sizeof(struct hf_wrapper));
229 hf=hf->next_other;
230
231 if (!hf)
232 goto memerr;
233
234 setenvvar(&hf, &value, (avp_ptr->flags & AVP_VAL_STR), idx++);
235 }
236
237 return hf_head;
238memerr:
239 LM_ERR("no more pkg mem\n");
240 return 0;
241}
242
243
244inline static int w_exec(struct sip_msg* msg, str* cmd, str* in,

Callers 2

w_execFunction · 0.85
w_async_execFunction · 0.85

Calls 4

pv_get_avp_nameFunction · 0.85
search_first_avpFunction · 0.85
setenvvarFunction · 0.85
search_next_avpFunction · 0.85

Tested by

no test coverage detected