| 242 | |
| 243 | |
| 244 | inline static int w_exec(struct sip_msg* msg, str* cmd, str* in, |
| 245 | pv_spec_t* out, pv_spec_t* err, pv_spec_t* avp_env) |
| 246 | { |
| 247 | int ret; |
| 248 | struct hf_wrapper *hf=0; |
| 249 | environment_t* backup_env=0; |
| 250 | |
| 251 | if (msg == 0 || cmd == 0) |
| 252 | return -1; |
| 253 | |
| 254 | if (avp_env != NULL) { |
| 255 | if ((hf=get_avp_values_list(msg, &(avp_env->pvp))) == 0) |
| 256 | return -1; |
| 257 | backup_env=replace_env(hf); |
| 258 | if (!backup_env) { |
| 259 | LM_ERR("replace env failed\n"); |
| 260 | release_vars(hf); |
| 261 | release_hf_struct(hf); |
| 262 | return -1; |
| 263 | } |
| 264 | release_hf_struct(hf); |
| 265 | } |
| 266 | |
| 267 | ret = exec_sync(msg, cmd, in, out, err); |
| 268 | |
| 269 | if (backup_env) |
| 270 | unset_env(backup_env); |
| 271 | |
| 272 | return ret; |
| 273 | } |
| 274 | |
| 275 | |
| 276 | inline static int w_async_exec(struct sip_msg* msg, async_ctx *ctx, |
nothing calls this directly
no test coverage detected