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

Function w_exec

modules/exec/exec_mod.c:244–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242
243
244inline 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
276inline static int w_async_exec(struct sip_msg* msg, async_ctx *ctx,

Callers

nothing calls this directly

Calls 6

get_avp_values_listFunction · 0.85
replace_envFunction · 0.85
release_varsFunction · 0.85
release_hf_structFunction · 0.85
exec_syncFunction · 0.85
unset_envFunction · 0.85

Tested by

no test coverage detected