<html 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=Windows-1252">
<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:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas",serif;}
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:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="en-FI" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="FI" style="font-size:11.0pt;mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FI" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">Im not sure if this helps you with that problem but I noticed that when I use acc_json, I needed to enable cdr also in the acc—module.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">So try to add modparam("acc", "cdr_enable", 1) and see if it helps.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">-Pyry<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Alexis Prodhomme <alexis.prodhomme@sewan.fr><br>
<b>Date: </b>Friday, 7. October 2022 at 12.53<br>
<b>To: </b>sr-users@lists.kamailio.org <sr-users@lists.kamailio.org><br>
<b>Subject: </b>[SR-Users] cannot register ACC CDR JSON engine when using acc_json module<o:p></o:p></span></p>
</div>
<p>Hi everyone,<o:p></o:p></p>
<p>I have some troubles using acc_json module. I can't load it and I don't understand why it fails.<br>
The configuration is quite basic: Debian 10 and Kamailio (fails in 5.5 and 5.6) installed using APT repository.<o:p></o:p></p>
<p>Here is parts of my config: <o:p></o:p></p>
<pre>loadmodule "kex.so"<o:p></o:p></pre>
<pre>loadmodule "corex.so"<o:p></o:p></pre>
<pre>loadmodule "tm.so"<o:p></o:p></pre>
<pre>loadmodule "tmx.so"<o:p></o:p></pre>
<pre>loadmodule "rr.so"<o:p></o:p></pre>
<pre>loadmodule "pv.so"<o:p></o:p></pre>
<pre>loadmodule "dialog.so"<o:p></o:p></pre>
<pre>loadmodule "acc.so"<o:p></o:p></pre>
<pre>loadmodule "acc_json.so"<o:p></o:p></pre>
<pre>modparam("acc_json", "cdr_enable", 1)<o:p></o:p></pre>
<p>I also tried with those 4 additionnal settings with no success:<o:p></o:p></p>
<pre>modparam("acc_json", "cdr_output_syslog", 1)<o:p></o:p></pre>
<pre>modparam("acc_json", "cdr_log_facility", "LOG_LOCAL3")<o:p></o:p></pre>
<pre>modparam("acc_json", "cdr_enable", 1)<o:p></o:p></pre>
<pre>modparam("acc_json", "cdr_expired_dlg_enable", 1)<o:p></o:p></pre>
<p>As soon as I set cdr_enable to 1, it displays the "<b>cannot register ACC CDR JSON engine</b>".<o:p></o:p></p>
<p>Here is logs:<o:p></o:p></p>
<pre> 0(2488) DEBUG: <core> [core/sr_module.c:969]: init_mod(): acc_json<o:p></o:p></pre>
<pre> 0(2488) DEBUG: <core> [core/sr_module.c:722]: find_mod_export_record(): found export of <bind_acc> in module acc [/usr/lib/x86_64-linux-gnu/kamailio/modules/acc.so]<o:p></o:p></pre>
<pre> 0(2488) INFO: acc_json [acc_json_mod.c:159]: mod_init(): janson version : 2.12<o:p></o:p></pre>
<pre> 0(2488) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f0a6b154010, 56) called from acc: acc_mod.c: acc_register_engine(725)<o:p></o:p></pre>
<pre> 0(2488) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f0a6b154010, 56) returns address 0x7f0a6b220b40 frag. 0x7f0a6b220b08 (size=56) on 1 -th hit<o:p></o:p></pre>
<pre> 0(2488) DEBUG: acc_json [acc_json_mod.c:269]: acc_json_init():  init ...<o:p></o:p></pre>
<pre> 0(2488) DEBUG: acc [acc_mod.c:741]: acc_register_engine(): new acc engine registered: json<o:p></o:p></pre>
<pre> 0(2488) DEBUG: <core> [core/sr_module.c:722]: find_mod_export_record(): found export of <load_dlg> in module dialog [/usr/lib/x86_64-linux-gnu/kamailio/modules/dialog.so]<o:p></o:p></pre>
<pre> 0(2488) ERROR: acc_json [acc_json_mod.c:245]: mod_init(): cannot register ACC CDR JSON engine<o:p></o:p></pre>
<pre> 0(2488) ERROR: <core> [core/sr_module.c:974]: init_mod(): Error while initializing module acc_json (/usr/lib/x86_64-linux-gnu/kamailio/modules/acc_json.so)<o:p></o:p></pre>
<pre>ERROR: error while initializing modules<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<p>May it be related to the Jansson version ? I use the native one from Debian 10, v2.12.<br>
Do you have any advice, or some tips to debug my issue ?<o:p></o:p></p>
<p>I don't really want to use acc module and parse CDRs manually from syslog, json is far easiest for this job.<o:p></o:p></p>
<p>Thank you<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Alexis<o:p></o:p></pre>
<pre>R&D<o:p></o:p></pre>
<pre>Sewan<o:p></o:p></pre>
</div>
</body>
</html>