Module: kamailio
Branch: master
Commit: 8c910452cf6090f87156d7c0e14477ef5956b59d
URL:
https://github.com/kamailio/kamailio/commit/8c910452cf6090f87156d7c0e14477e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-07-08T13:19:14+02:00
app_perl: print the error string if execution of perl script sets it
---
Modified: src/modules/app_perl/perlfunc.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8c910452cf6090f87156d7c0e14477e…
Patch:
https://github.com/kamailio/kamailio/commit/8c910452cf6090f87156d7c0e14477e…
---
diff --git a/src/modules/app_perl/perlfunc.c b/src/modules/app_perl/perlfunc.c
index 1f67628169..ddb442220d 100644
--- a/src/modules/app_perl/perlfunc.c
+++ b/src/modules/app_perl/perlfunc.c
@@ -147,6 +147,11 @@ int perl_exec2(struct sip_msg* _msg, char* fnc, char* mystr) {
PUTBACK; /* make local stack pointer global */
call_pv(fnc, G_EVAL|G_SCALAR); /* call the function */
+
+ if(SvTRUE(ERRSV)) {
+ LM_WARN("perl error: %s\n", SvPV_nolen(ERRSV));
+ }
+
SPAGAIN; /* refresh stack pointer */
/* pop the return value from stack */
retval = POPi;