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

2014-10-29 Thread Walter Doekes
@@ -332,6 +332,76 @@ exec_getenv(HOSTNAME, $avp(localhost)); /example /section + section + title + function moreinfo=noneexec(command, [output], [input], [error],[envavp])/function Could you change that to [input], [output], [error] ?

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

2014-10-29 Thread Walter Doekes
+ paraemphasiserror/emphasis - pseudovariable where to store the error from + the standard error of the process. + /para + /listitem + listitem + paraemphasisenvavp/emphasis - Avp where

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

2014-10-29 Thread Walter Doekes
+ para + WARNING: input/output/error parameters are not designed for a large amount of + data so one should be careful when using them because server could considerably be + slowed down. + /para + para +

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

2014-10-29 Thread Walter Doekes
+ /para + para + This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, + LOCAL_ROUTE, STARTUP_ROUTE, TIMER_ROUTE, EVENT_ROUTE, ONREPLY_ROUTE. + /para + example + titlefunction

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

2014-10-29 Thread Walter Doekes
@@ -51,6 +51,7 @@ int schedule_to_kill( int pid ); * @stream: stream to be returned to the caller */ pid_t __popen(const char *cmd, const char *type, FILE **stream); +pid_t ___popen(const char *cmd, FILE **, FILE**, FILE**); That's not very inventively named, is it? :-D Python popen2

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

2014-10-29 Thread Walter Doekes
+ if ((buflen + tmplen) = MAX_BUF_SIZE) { + LM_WARN(no more space in output buffer\n); + break; + } + memcpy(buf+buflen, tmpbuf, tmplen); + buflen += tmplen; + + outval.flags = PV_VAL_STR;

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

2014-10-29 Thread Walter Doekes
+ goto error; + } + + if (ferror(pin)) { + ser_error=E_EXEC; + goto error; + } + pclose(pin); + } + + schedule_to_kill(pid); + wait(exit_status); + + if

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

2014-10-29 Thread Walter Doekes
+ return -1; + } + } + + if (errvar) { + if (read_and_write2var(msg, perr, errvar) 0) { + LM_ERR(failed reading stderr from pipe\n); + return -1; + } + } + + ret=1; +

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

2014-10-29 Thread Walter Doekes
+ } + return 0; +} + +static inline int setenvvar(struct hf_wrapper** hf, int_str* value, int idx) +{ + #define OSIPS_EXEC OSIPS_EXEC_ + + + int len=0; + str sidx; + + sidx.s = int2str((unsigned long)idx, sidx.len); + +

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

2014-10-29 Thread Walter Doekes
Thanks for fixing the other issues :) --- Reply to this email directly or view it on GitHub: https://github.com/OpenSIPS/opensips/pull/375#issuecomment-60891337___ Devel mailing list Devel@lists.opensips.org

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

2014-10-28 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/375 -- Commit Summary -- * added exec(cmd,output,input,error,avpenv) function for

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

2014-10-28 Thread Ionut Ionita
Merged #375. --- Reply to this email directly or view it on GitHub: https://github.com/OpenSIPS/opensips/pull/375#event-184825804___ Devel mailing list Devel@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/devel