<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:x="urn:schemas-microsoft-com:office:excel" 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=iso-8859-1">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 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="FR" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello Henning,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for your reply !<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For the record, I’m using Kamailio module "flatstore" with the flush deactivated. In this situation, when Kamailio is stopped, I’m losing the remaining data in files not yet flushed.<o:p></o:p></p>
<p class="MsoNormal">So my idea was, when destroy is called, to iterate over the connection pools, and flush/close all the opened files properly.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">But I found out that it’s not that simple :/<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Do you think this is something that could be fixed in Kamailio ?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Nicolas.<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 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="mso-fareast-language:FR">De :</span></b><span style="mso-fareast-language:FR"> Henning Westerholt <hw@gilawa.com>
<br>
<b>Envoyé :</b> mardi 26 octobre 2021 20:38<br>
<b>À :</b> Kamailio (SER) - Users Mailing List<br>
<b>Cc :</b> Chaigneau, Nicolas<br>
<b>Objet :</b> RE: No "child_destroy" export ?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="DE" style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE">Hi Nicolas,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">you are right, there is no special function for children destroy. Most modules do not need it, as the data is in shared memory, processes are started over standard kamailio APIs which will be stopped from the core automatically,
 to give some background.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Some modules do it by just iterating over an internal list of their children and then do the cleanup task. You can find an example in cdp module (destroy, diameter_peer_destroy).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-GB">-- <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning Westerholt – </span><span lang="DE"><a href="https://skalatan.de/blog/"><span lang="EN-GB">https://skalatan.de/blog/</span></a></span><span lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio services – </span><span lang="DE"><a href="https://gilawa.com/"><span lang="EN-GB">https://gilawa.com</span></a></span><span lang="EN-GB"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:35.4pt"><b><span lang="DE" style="mso-fareast-language:DE">From:</span></b><span lang="DE" style="mso-fareast-language:DE"> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>Chaigneau, Nicolas<br>
<b>Sent:</b> Tuesday, October 26, 2021 7:14 PM<br>
<b>To:</b> <a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<b>Subject:</b> [SR-Users] No "child_destroy" export ?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt">Hello,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">I have a module, for which I need to perform some processing in the children processes when Kamailio is being stopped.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">I’ve looked at the "struct module_export", in which I see "mod_init", "child_init", "mod_destroy"… but no "child_destroy". :/<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">Is there a way to achieve this ?<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">Thanks for your help.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">Regards,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">Nicolas.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:7.0pt;mso-fareast-language:DE">This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to
 whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and
 delete all copies of this message.</span><span style="mso-fareast-language:DE"><o:p></o:p></span></p>
</div>
</body>
</html>