Module: sip-router Branch: 3.3 Commit: f2b89129941c93ffae99c2d2b35990333b339eb0 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f2b89129...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed Jul 31 13:51:34 2013 +0200
perl: push the sip msg structure to perl after initializing it
- reported by David Cunningham - backport from amster commit 341f810dca0cc0596e22f2ac1bca86de0b8d142d
---
modules_k/perl/perlfunc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules_k/perl/perlfunc.c b/modules_k/perl/perlfunc.c index 9684a0d..47886c6 100644 --- a/modules_k/perl/perlfunc.c +++ b/modules_k/perl/perlfunc.c @@ -131,12 +131,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, "OpenSER::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... */