@@ -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] ?
+ paraemphasiserror/emphasis - pseudovariable where
to store the error from
+ the standard error of the process.
+ /para
+ /listitem
+ listitem
+ paraemphasisenvavp/emphasis - Avp where
+ 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
+
+ /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
@@ -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
+ 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;
+ goto error;
+ }
+
+ if (ferror(pin)) {
+ ser_error=E_EXEC;
+ goto error;
+ }
+ pclose(pin);
+ }
+
+ schedule_to_kill(pid);
+ wait(exit_status);
+
+ if
+ return -1;
+ }
+ }
+
+ if (errvar) {
+ if (read_and_write2var(msg, perr, errvar) 0) {
+ LM_ERR(failed reading stderr from pipe\n);
+ return -1;
+ }
+ }
+
+ ret=1;
+
+ }
+ 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);
+
+
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
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
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
12 matches
Mail list logo