<div dir="ltr">you can't run session:execute() if there is no active session. if you run it outside a call you can (for testing) maybe try running <font face="Courier New">local session = freeswitch.Session() </font><font face="arial,helvetica,sans-serif">before running the curl</font></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 4, 2016 at 4:23 PM, Don Hawkins <span dir="ltr"><<a href="mailto:hawkins@hawkinsegroup.com" target="_blank">hawkins@hawkinsegroup.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Tried the other way as well (without the API)<div><br></div><div><div>session:execute("curl", "<a href="http://myurl.com/test3.php" target="_blank">http://myurl.com/test3.php</a> post name=myname")</div><div>curl_response_code = session:getVariable("curl_<wbr>response_code")</div><div>curl_response = session:getVariable("curl_<wbr>response_data")</div></div><div><br></div><div>Getting this error:</div><div><br></div><div><div>[ERR] mod_lua.cpp:203 /usr/share/freeswitch/scripts/<wbr>test.lua:1: attempt to index global 'session' (a nil value)</div><div>stack traceback:</div><div> /usr/share/freeswitch/scripts/<wbr>test.lua:1: in main chunk</div></div><div><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Aug 4, 2016 at 2:51 PM, Don Hawkins <span dir="ltr"><<a href="mailto:hawkins@hawkinsegroup.com" target="_blank">hawkins@hawkinsegroup.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>root@debian:/usr/share/freeswi<wbr>tch/scripts# vi test.lua</div><div><br></div><div>api = freeswitch.API();</div><div>api:execute("curl", "<a href="http://myurl.com/test3.php" target="_blank">http://myurl.com/test3.php</a> post name1=value1")</div><div><br></div><div><br></div><div>Snatched the code straight from the the example shown at the URL below. FS does execute the script but never reaches my URL with the POST request. Did I miss something?</div><div><br></div><div><a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_curl" target="_blank">https://freeswitch.org/conflue<wbr>nce/display/FREESWITCH/mod_<wbr>curl</a><br></div><div><br></div><div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(102,102,102)"><span>Sincerely,<br>Don Hawkins<br>CEO<br>Hawkins Enterprise Group LLC<br><a href="http://hawkinsegroup.com" target="_blank">http://hawkinsegroup.com</a><br><a href="http://zello.com" target="_blank">Zello PTT</a>: push2don<br></span></span></div><div><span style="color:rgb(102,102,102)"><span>P: <a href="tel:469-214-5044" target="_blank" value="+14692145044">469-214-5044</a><br></span></span></div><div dir="ltr"><span style="color:rgb(102,102,102)"><span><a value="+12146991224"></a></span></span></div></div></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank" rel="noreferrer">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank" rel="noreferrer">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank" rel="noreferrer">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" target="_blank" rel="noreferrer">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" rel="noreferrer">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank" rel="noreferrer">http://www.freeswitch.org</a><br></blockquote></div><br></div>