<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<tt>Jeff,<br>
<br>
Can you replace <br>
LM_ERR("function %s failed to return anything\n",fnc);<br>
with<br>
LM_ERR("function %s failed to return anything (reports %d)
\n",fnc,cnt);<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 07.07.2016 18:29, Jeff Pyle wrote:<br>
</div>
<blockquote
cite="mid:CACYJG3KWrXjLiLyqYqnBbe5jt=WMzNNGrk4oHMy5snfVvnNMfQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hi Bogdan,</div>
<div><br>
</div>
<div>The patch gives errors.</div>
<div><br>
</div>
<div>I have two perl functions:</div>
<div><br>
</div>
<div>
<div>sub return1 {</div>
<div><span class="" style="white-space:pre">        </span>return 1;</div>
<div>}</div>
<div><br>
</div>
<div>sub returnminus1 {</div>
<div><span class="" style="white-space:pre">        </span>return -1;</div>
<div>}</div>
</div>
<div><br>
</div>
<div>In the OpenSIPS script I have:</div>
<div><br>
</div>
<div>
<div>route {</div>
<div> perl_exec_simple("return1");</div>
<div> xlog("L_INFO", "$retcode\n");</div>
<div> perl_exec_simple("returnminus1");</div>
<div> xlog("L_INFO", "$retcode\n");</div>
<div><br>
</div>
<div> perl_exec("return1");</div>
<div> xlog("L_INFO", "$retcode\n");</div>
<div> perl_exec("returnminus1");</div>
<div> xlog("L_INFO", "$retcode\n");</div>
<div><br>
</div>
<div> sl_send_reply("600", "Road Closed");</div>
<div> drop;</div>
<div> exit;</div>
</div>
<div>}</div>
<div><br>
</div>
<div>Syslog shows:</div>
<div><br>
</div>
<div>
<div> /usr/sbin/opensips[22354]: ERROR:perl:perl_exec_simple:
function return1 failed to return anything</div>
<div> /usr/sbin/opensips[22354]: -1</div>
<div> /usr/sbin/opensips[22354]: ERROR:perl:perl_exec_simple:
function returnminus1 failed to return anything</div>
<div> /usr/sbin/opensips[22354]: -1</div>
<div> /usr/sbin/opensips[22354]: 1</div>
<div> /usr/sbin/opensips[22354]: -1</div>
</div>
<div><br>
</div>
<div>perl_exec() still works okay, but perl_exec_simple() gives
errors.</div>
<div><br>
</div>
<div><br>
</div>
<div>- Jeff</div>
<div><br>
</div>
<div><br>
</div>
<div class="gmail_extra">
<div>
<div class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div title="Page 1"
style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><br>
</div>
<div title="Page 1"
style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">On Thu, Jul 7, 2016 at 5:44 AM,
Bogdan-Andrei Iancu <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:bogdan@opensips.org"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:bogdan@opensips.org">bogdan@opensips.org</a></a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <tt>Hi Jeff,<br>
<br>
I think the difference is a mis. Could you please test
the attached patch.<br>
<br>
Regards,<br>
</tt>
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
<div>
<div class="h5">
<div>On 07.07.2016 04:42, Jeff Pyle wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div class="h5">
<div dir="ltr">Hello,<br>
<div><br>
</div>
<div>I'm using 2.1 cloned from git earlier
today. I notice when I use
perl_exec_simple(), the return code is always
1, regardless of the return code at the end of
the perl function. With perl_exec(), however,
the return code matches the return code in the
function. Is this difference intentional?</div>
<div><br>
</div>
<div><br>
</div>
<div>- Jeff</div>
<div><br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>