Module: sip-router
Branch: 4.0
Commit: 3935fedf23f3bf2b6675182193cef6af3bbd903a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3935fed…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Jul 31 12:22:12 2013 +0200
app_perl: push the sip msg structure to perl after initializing it
- reported by David Cunningham
(cherry picked from commit 341f810dca0cc0596e22f2ac1bca86de0b8d142d)
---
modules/app_perl/perlfunc.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/app_perl/perlfunc.c b/modules/app_perl/perlfunc.c
index 90a80d4..06d3314 100644
--- a/modules/app_perl/perlfunc.c
+++ b/modules/app_perl/perlfunc.c
@@ -130,12 +130,13 @@ int perl_exec2(struct sip_msg* _msg, char* fnc, char* mystr) {
ENTER; /* everything created after here */
SAVETMPS; /* ...is a temporary variable. */
PUSHMARK(SP); /* remember the stack pointer */
- XPUSHs(m); /* Our reference to the stack... */
m = sv_newmortal();
sv_setref_pv(m, "Kamailio::Message", (void *)_msg);
SvREADONLY_on(SvRV(m));
+ XPUSHs(m); /* Our reference to the stack... */
+
if (mystr)
XPUSHs(sv_2mortal(newSVpv(mystr, strlen(mystr))));
/* Our string to the stack... */