Closed #360.
---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/360#event-184817940___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
@@ -243,6 +246,48 @@ exec_getenv(HOSTNAME);
exec_getenv(HOSTNAME, $avp(localhost));
...
+1.4.5. exec(command, [output], [input], [envavp])
+
+ Executes an external command. The input is passed to the
+ standard input of the new process, if specified, and the output
+ is saved
You can merge this Pull Request by running:
git pull https://github.com/ionutrazvanionita/opensips master
Or you can view, comment on it, or merge it online at:
https://github.com/OpenSIPS/opensips/pull/360
-- Commit Summary --
* added exec(cmd,output,input,avpenv) function for exec
+ * output - pseudovariable where to store the output from the
+ standard output of the command. Keep in mind that if this
+ parameter is set, the async paramater will not be taken in
+ consideration.
+ * input - String to be passed to the standard input of the
+
+ } else if (outvar) {
+ pid = __popen(command-s, r, pout);
+ } else {
+ pid = fork();
+ if (pid == 0) {
+ execl(/bin/sh, /bin/sh, -c, command-s, NULL);
+ exit(-1);
+ }
+ }
+
+ if
@@ -243,6 +246,48 @@ exec_getenv(HOSTNAME);
exec_getenv(HOSTNAME, $avp(localhost));
...
+1.4.5. exec(command, [output], [input], [envavp])
+
+ Executes an external command. The input is passed to the
+ standard input of the new process, if specified, and the output
+ is saved
+
+ if (ferror(pin)) {
+ LM_ERR(writing pipe: %s\n, strerror(errno));
+ ser_error=E_EXEC;
+ goto error;
+ }
+ pclose(pin);
+ }
+
+ schedule_to_kill(pid);
+ wait(exit_status);
+