[Freeswitch-users] curl zombie_exec

Marcel Haldemann m.hald at outlook.com
Tue Apr 28 11:22:01 UTC 2020


Would be a nice patch.
Currently I’m using an ugly hack, doing it like so (as os.execute seems to have the zombie flag):

        dat = env:serialize("json")
        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 &")


Von: FreeSWITCH-users <freeswitch-users-bounces at lists.freeswitch.org> Im Auftrag von Seven Du
Gesendet: Dienstag, 28. April 2020 10:22
An: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
Betreff: Re: [Freeswitch-users] curl zombie_exec

you have to patch mod_curl do to that like below. please make a pr if it works for you.

    SWITCH_ADD_APP(app_interface, "curl", "Perform a http request", "Perform a http request",
                   curl_app_function, SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC);


On Tue, Apr 28, 2020 at 4:07 AM Mai Duy Quang <quang at telepro.me<mailto:quang at telepro.me>> wrote:
Hi,

I call curl in lua script but has this error, been googling all day long but no hope. Any have fix for that?

Channel is hungup and application curl does not have the zombie_exec flag.

my lua code:
-- to allow curl after the call
session:execute("set_zombie_exec");

freeswitch.consoleLog("notice", "[curl][ring groups][missed]  " .. missed_call_data .. "  ");

session:execute("curl", missed_call_data .. " phone=" .. caller_id_number .. "&target=" .. ring_group_name);
curl_response_code = session:getVariable("curl_response_code")
curl_response      = session:getVariable("curl_response_data”)


Many thanks,
Johnathan Mai
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com<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>
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community<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>

Professional FreeSWITCH Services
sales at freeswitch.com<mailto:sales at freeswitch.com>
https://freeswitch.com<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>

Official FreeSWITCH Sites
https://freeswitch.com/oss<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>
https://freeswitch.org/confluence<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>
https://cluecon.com<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>

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<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>
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<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>
https://freeswitch.com<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>


--
About: http://about.me/dujinfang<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>
Blog: http://www.dujinfang.com<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>
Proj:  http://www.freeswitch.org.cn<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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20200428/db915106/attachment-0001.html>


More information about the FreeSWITCH-users mailing list