Re: [OpenSIPS-Devel] [opensips] added exec(cmd, output, input, avpenv) function for exec module (#360)

2014-10-28 Thread Ionut Ionita
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

Re: [OpenSIPS-Devel] [opensips] added exec(cmd, output, input, avpenv) function for exec module (#360)

2014-10-17 Thread Walter Doekes
@@ -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

[OpenSIPS-Devel] [opensips] added exec(cmd, output, input, avpenv) function for exec module (#360)

2014-10-16 Thread Ionut Ionita
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

Re: [OpenSIPS-Devel] [opensips] added exec(cmd, output, input, avpenv) function for exec module (#360)

2014-10-16 Thread Walter Doekes
+ * 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 +

Re: [OpenSIPS-Devel] [opensips] added exec(cmd, output, input, avpenv) function for exec module (#360)

2014-10-16 Thread Walter Doekes
+ } 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

Re: [OpenSIPS-Devel] [opensips] added exec(cmd, output, input, avpenv) function for exec module (#360)

2014-10-16 Thread Ionut Ionita
@@ -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

Re: [OpenSIPS-Devel] [opensips] added exec(cmd, output, input, avpenv) function for exec module (#360)

2014-10-16 Thread Walter Doekes
+ + 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); +