<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div>you can try to launch such lua script via bgapi. Also you can send variables you need via args.</div><div><span style="font-size: 10pt; ">bgapi lua scriptname.lua arg1 arg2 etc...</span></div><div><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: rml@tollfreeforwarding.com<br>To: freeswitch-users@lists.freeswitch.org<br>CC: nasida@live.ru<br>Subject: RE: [Freeswitch-users] File upload - mod_curl<br>Date: Fri, 27 Apr 2012 19:18:07 +0000<br><br><style><!--
.ExternalClass .ecxshape
{;}
--></style><style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman","serif";}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman","serif";}
.ExternalClass p.ecxMsoAcetate, .ExternalClass li.ecxMsoAcetate, .ExternalClass div.ecxMsoAcetate
{margin-bottom:.0001pt;font-size:8.0pt;font-family:"Tahoma","sans-serif";}
.ExternalClass p.ecxecxmsonormal, .ExternalClass li.ecxecxmsonormal, .ExternalClass div.ecxecxmsonormal
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman","serif";}
.ExternalClass p.ecxecxmsochpdefault, .ExternalClass li.ecxecxmsochpdefault, .ExternalClass div.ecxecxmsochpdefault
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman","serif";}
.ExternalClass span.ecxecxmsohyperlink
{;}
.ExternalClass span.ecxecxmsohyperlinkfollowed
{;}
.ExternalClass span.ecxecxemailstyle17
{;}
.ExternalClass p.ecxecxmsonormal1, .ExternalClass li.ecxecxmsonormal1, .ExternalClass div.ecxecxmsonormal1
{margin-right:0in;margin-bottom:0in;margin-left:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";}
.ExternalClass span.ecxecxmsohyperlink1
{color:blue;text-decoration:underline;}
.ExternalClass span.ecxecxmsohyperlinkfollowed1
{color:purple;text-decoration:underline;}
.ExternalClass span.ecxecxemailstyle171
{font-family:"Calibri","sans-serif";color:windowtext;}
.ExternalClass p.ecxecxmsochpdefault1, .ExternalClass li.ecxecxmsochpdefault1, .ExternalClass div.ecxecxmsochpdefault1
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Calibri","sans-serif";}
.ExternalClass span.ecxBalloonTextChar
{font-family:"Tahoma","sans-serif";}
.ExternalClass span.ecxEmailStyle30
{font-family:"Calibri","sans-serif";color:#1F497D;}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;}
.ExternalClass div.ecxWordSection1
{page:WordSection1;}

--></style><div class="ecxWordSection1"><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">In my use I am using outbound socket for FAX</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">After receiving a ‘CUTOM - spandsp::rxfaxresult ’ event , I need to call curl/http application &nbsp;to upload the received fax from remote FreeSWITCH to storage.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I want to run the file upload process in background – <b>bgapi </b></span><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">curl <a href="http://192.168.9.152/upload" target="_blank">http://192.168.9.152/upload</a> post -F <a href="mailto:file=@/tmp/log/callcontrol.log">file=@/tmp/log/callcontrol.log</a></span></b><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">.</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"></span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Regards</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">RaviRaj.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;</span></p><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in"><p class="ecxMsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] <b>On Behalf Of </b>Yuriy Nasida<br><b>Sent:</b> Friday, April 27, 2012 11:57 AM<br><b>To:</b> freeswitch-users@lists.freeswitch.org<br><b>Subject:</b> Re: [Freeswitch-users] File upload - mod_curl</span></p></div></div><p class="ecxMsoNormal">&nbsp;</p><div><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">For example , you can to launch some lua script from FS dialplan and invoke linux command from lua via&nbsp; </span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;background:white">io.popen()</span><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"></span></p><div><p class="ecxMsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"><a href="http://wiki.freeswitch.org/wiki/Mod_lua#Run_a_shell_command" target="_blank">http://wiki.freeswitch.org/wiki/Mod_lua#Run_a_shell_command</a>&nbsp;</span></p><div><div class="ecxMsoNormal" align="center" style="text-align:center"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"><hr size="2" width="100%" align="center" id="ecxstopSpelling"></span></div><p class="ecxMsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From: <a href="mailto:rml@tollfreeforwarding.com">rml@tollfreeforwarding.com</a><br>To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>Date: Fri, 27 Apr 2012 00:01:30 +0000<br>Subject: [Freeswitch-users] File upload - mod_curl</span></p><div><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Hi </span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Please let me know how can I upload a file from fs_cli using curl or other http application of FreeSWITCH.</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><u><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From Linux command prompt</span></u><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"></span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">SUCCESS</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">curl -F <a href="mailto:file=@/tmp/log/callcontrol.log">file=@/tmp/log/callcontrol.log</a> <a href="http://192.168.9.152/upload" target="_blank">http://192.168.9.152/upload</a></span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><u><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From fs_cli</span></u><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"></span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">curl <a href="http://192.168.9.152/upload" target="_blank">http://192.168.9.152/upload</a> post file=%40%2Ftmp%2Flog%2Fcallcontrol.log</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">curl <a href="http://192.168.9.152/upload" target="_blank">http://192.168.9.152/upload</a> post -F file=%40%2Ftmp%2Fccv5%2Flog%2Fcallcontrol.log</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">curl <a href="http://192.168.9.152/upload" target="_blank">http://192.168.9.152/upload</a> post -F <a href="mailto:file=@/tmp/log/callcontrol.log">file=@/tmp/log/callcontrol.log</a></span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">curl <a href="http://192.168.9.152/upload" target="_blank">http://192.168.9.152/upload</a> post <a href="mailto:file=@/tmp/log/callcontrol.log">file=@/tmp/log/callcontrol.log</a></span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">All the above results in</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&lt;html&gt;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&lt;head&gt;&lt;title&gt;415 Unsupported Media Type&lt;/title&gt;&lt;/head&gt;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&lt;body bgcolor="white"&gt;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&lt;center&gt;&lt;h1&gt;415 Unsupported Media Type&lt;/h1&gt;&lt;/center&gt;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&lt;hr&gt;&lt;center&gt;nginx/1.2.0&lt;/center&gt;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&lt;/body&gt;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&lt;/html&gt;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><u><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">FreeSWITCH version</span></u><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"></span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">FreeSWITCH Version 1.1.beta1 (git-65c4f76 2012-04-25 17-58-41 +0000)</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">&nbsp;</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Thanks</span></p><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">RaviRaj.</span></p></div><p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"><br>_________________________________________________________________________ Professional FreeSWITCH Consulting Services: <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a> <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a> FreeSWITCH-powered IP PBX: The CudaTel Communication Server <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a> Official FreeSWITCH Sites <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a> <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> FreeSWITCH-users mailing list <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span></p></div></div></div></div></div></div>                                               </div></body>
</html>