[sr-dev] git:master:8c910452: app_perl: print the error string if execution of perl script sets it

Daniel-Constantin Mierla miconda at gmail.com
Fri Jul 8 13:20:00 CEST 2022


Module: kamailio
Branch: master
Commit: 8c910452cf6090f87156d7c0e14477ef5956b59d
URL: https://github.com/kamailio/kamailio/commit/8c910452cf6090f87156d7c0e14477ef5956b59d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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/8c910452cf6090f87156d7c0e14477ef5956b59d.diff
Patch: https://github.com/kamailio/kamailio/commit/8c910452cf6090f87156d7c0e14477ef5956b59d.patch

---

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;




More information about the sr-dev mailing list