<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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1242177642;
        mso-list-type:hybrid;
        mso-list-template-ids:1741991244 1732517832 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-style-link:botelist;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:40.5pt;
        text-indent:-.25in;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:76.5pt;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:112.5pt;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:148.5pt;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:184.5pt;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:220.5pt;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:256.5pt;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:292.5pt;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:328.5pt;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>I do not know what your script does, and that determines the best approach to solve the problem.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In the only case with which I have experience, I run a perl script as a stand-alone linux process using the normal perl interpreter. This script then connects to FreeSWITCH via ESL (the Event Socket Library) and listens for certain FreeSWITCH events, then reacts to them. This removes the script from the telephony processing loop in the dialplan and eliminates any possible blocking of telephony processing in the dialplan (which seems to be a common problem with many script implementations when called from the dialplan).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This method requires compiling the ESL.pm module which is part of the FS source; this module provides the connection from perl to FS. Install it using these instructions:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><a href="https://freeswitch.org/confluence/display/FREESWITCH/Event+Socket+Library#EventSocketLibrary-Installation">https://freeswitch.org/confluence/display/FREESWITCH/Event+Socket+Library#EventSocketLibrary-Installation</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>There are perl examples on this wiki page:<o:p></o:p></p><p class=MsoNormal><a href="https://freeswitch.org/confluence/display/FREESWITCH/Perl+ESL">https://freeswitch.org/confluence/display/FREESWITCH/Perl+ESL</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>That’s not much, but I hope it helps.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;color:#7F7F7F'>--- <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#7F7F7F'>John Boteler <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#7F7F7F'>BnC Group U.S.A. <o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> FreeSWITCH-users <freeswitch-users-bounces@lists.freeswitch.org> <b>On Behalf Of </b>Frederic Jean<br><b>Sent:</b> Thursday, 8 October, 2020 10:38<br><b>To:</b> freeswitch-users@lists.freeswitch.org<br><b>Subject:</b> [Freeswitch-users] Defunct processes from starting a script<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'>Dear community,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'>Newbie here; I am currently experiencing aleatory defunct processes by starting a Perl script this way:<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'><action application="set" data= "ivr_path=/usr/local/freeswitch/scripts/myscript.pl"/><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'><action application="socket" data="127.0.0.1:9080 sync full"/><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'>Are there any better ways to have it executed and avoid these?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'>Regards<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'>Fred<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Segoe UI",sans-serif'><o:p> </o:p></span></p></div></div></body></html>