| 199 | } |
| 200 | |
| 201 | static 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; |
| 238 | memerr: |
| 239 | LM_ERR("no more pkg mem\n"); |
| 240 | return 0; |
| 241 | } |
| 242 | |
| 243 | |
| 244 | inline static int w_exec(struct sip_msg* msg, str* cmd, str* in, |
no test coverage detected