<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE-CH" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Would be a nice patch.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Currently I’m using an ugly hack, doing it like so (as os.execute seems to have the zombie flag):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">        dat = env:serialize("json")     
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">        res = os.execute("curl --header \"Content-Type: application/json\" --connect-timeout 30 --max-time 30 --request POST --data '" .. dat .. "' http://127.0.0.1:8090/api/dialplan
 > /dev/null 2>&1 &")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="DE">Von:</span></b><span lang="DE"> FreeSWITCH-users <freeswitch-users-bounces@lists.freeswitch.org>
<b>Im Auftrag von </b>Seven Du<br>
<b>Gesendet:</b> Dienstag, 28. April 2020 10:22<br>
<b>An:</b> FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org><br>
<b>Betreff:</b> Re: [Freeswitch-users] curl zombie_exec<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">you have to patch mod_curl do to that like below. please make a pr if it works for you.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="line-height:13.5pt;background:#1E1E1E"><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#D4D4D4">   
</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#DCDCAA">SWITCH_ADD_APP</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#D4D4D4">(app_interface,
</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#CE9178">"curl"</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#D4D4D4">,
</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#CE9178">"Perform a http request"</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#D4D4D4">,
</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#CE9178">"Perform a http request"</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#D4D4D4">,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:13.5pt;background:#1E1E1E"><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#D4D4D4">                   curl_app_function, SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC);<o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="line-height:13.5pt;background:#1E1E1E"><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#D4D4D4"><o:p> </o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Apr 28, 2020 at 4:07 AM Mai Duy Quang <<a href="mailto:quang@telepro.me">quang@telepro.me</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I call curl in lua script but has this error, been googling all day long but no hope. Any have fix for that?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#E32400">Channel is hungup and application curl does not have the zombie_exec flag.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">my lua code:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">-- to allow curl after the call<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">session:execute("set_zombie_exec");<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">freeswitch.consoleLog("notice", "[curl][ring groups][missed]  " .. missed_call_data .. "  ");<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">session:execute("curl", missed_call_data .. " phone=" .. caller_id_number .. "&target=" .. ring_group_name);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">curl_response_code = session:getVariable("curl_response_code")<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">curl_response      = session:getVariable("curl_response_data”)<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Many thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Johnathan Mai<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_________________________________________________________________________<br>
<br>
The FreeSWITCH project is sponsored by SignalWire <a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsignalwire.com%2F&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101588615&sdata=LMETlyBxNIf%2B3dEOydL5plCK0zCVqfZ%2FEPOFdf6QnW8%3D&reserved=0" target="_blank">
https://signalwire.com</a><br>
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.<br>
Build your next product on our scalable cloud platform.<br>
<br>
Join our online community to chat in real time <a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsignalwire.community%2F&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101588615&sdata=J31UDdSv6kkEKeCG9NKJPs9YR6XMw22YPQV1AFjfEKY%3D&reserved=0" target="_blank">
https://signalwire.community</a><br>
<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
<a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.com%2F&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101598611&sdata=ZJNjUvLMMfeVH3M9w2MRlV41qJQpn3Mmg5HMMTyVxPo%3D&reserved=0" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.com%2Foss&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101598611&sdata=RWSm5I47FgDOyuvAvjgDDfnJZkTi3XPDWs79pSHYYnQ%3D&reserved=0" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.org%2Fconfluence&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101598611&sdata=333wxW42hnkrkiTsQ0sGWIyy2L014bdvdIUG6eq%2F8p4%3D&reserved=0" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcluecon.com%2F&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101608602&sdata=6jcfxdseSyptWPHMVSwrJVVGyrjy5hCYqqnIo%2BDTr%2FM%3D&reserved=0" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.freeswitch.org%2Fmailman%2Flistinfo%2Ffreeswitch-users&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101608602&sdata=2pnT8BU6NBMW82pV0g51dwdEG2rHy%2Bu21ckRel7vdZs%3D&reserved=0" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.freeswitch.org%2Fmailman%2Foptions%2Ffreeswitch-users&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101618599&sdata=JJ%2BsngM%2BX%2FYoDLX2LwNw1TYooJucMDrkUKWPCALisb0%3D&reserved=0" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.com%2F&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101618599&sdata=Afbk%2FtuEKY9FnWr0KnRmYywxSlljEBTeaAC%2F24ntBl0%3D&reserved=0" target="_blank">https://freeswitch.com</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">About: <a href="https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fdujinfang&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101618599&sdata=Xqq5fkV0IZ24kgMg3doSKrI0GaAQzam1S0%2FU2Ibaqts%3D&reserved=0" target="_blank">
http://about.me/dujinfang</a><br>
Blog: <a href="https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dujinfang.com%2F&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101628595&sdata=KwNCzQCE3gSBo56%2Bft3aMmOaewUq9STaT%2BMas54h%2Byg%3D&reserved=0" target="_blank">
http://www.dujinfang.com</a><br>
Proj:  <a href="https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.freeswitch.org.cn%2F&data=02%7C01%7C%7C16b369bad9e2498c146508d7eb50ec91%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637236605101628595&sdata=7bG6yXsmBxeU5godYW4mgM0J6IWQ5bqpLYwZELcRTog%3D&reserved=0" target="_blank">
http://www.freeswitch.org.cn</a><o:p></o:p></p>
</div>
</div>
</body>
</html>