<div dir="ltr">Hello, Kamailio community,<br>we are implementing evapi communication to our Kamailio server. We have implemented and tested it on our testing server. Everything was working OK.<br><br>Now we are testing it on our production servers with a lot more calls and we have some problems here. <br>Every n seconds we are requesting from Kamailio list of all dialogs. And this list of dialogs (from jsonrpc <b>dlg.list</b>) is sent to evapi connection.<br><div>Here is a snippet of our <b>Kamailio code</b>:</div><div><br></div><div><span style="font-family:monospace">route[CGR_DLG_LIST]<br>{<br>        xlog("L_INFO", "XLOG: $ci [CGR_DLG_LIST] Requested dialog list");<br>        # CGRateS connection is still alive, set check to true<br>        $sht(cgrconn=>check) = 1;<br>        if $sht(cgrconn=>cgr) == $null {<br>                sl_send_reply("503","Charging controller unreachable");<br>                exit;<br>        }<br>        jsonrpc_exec('{"jsonrpc":"2.0","id":1, "method":"dlg.list","params":[]}');<br>        xlog("L_INFO", "XLOG: $ci [CGR_DLG_LIST] Test1: $jsonrpl(body)");<br><br>        evapi_relay("{\"event\":\"CGR_DLG_LIST_REPLY\",<br>                        \"jsonrpl_body\":$jsonrpl(body)}");<br>}</span><br></div><br><div>During a higher number of calls Kamailio is generating ERROR messages from evapi module. Here is the syslog:</div><div><br></div><span style="font-family:monospace">Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: INFO: <script>: XLOG: 123 [CGR_DLG_LIST] Requested dialog list<br>Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: INFO: <script>: <br>Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: DEBUG: evapi [evapi_dispatch.c:740]: _evapi_relay(): relaying event data [<br>Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: ERROR: evapi [evapi_dispatch.c:764]: _evapi_relay(): cannot serialize event<br>Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: ERROR: evapi [evapi_mod.c:265]: w_evapi_relay(): failed to relay event: <br></span><div><br></div><div><b>We are expecting something like this when nobody is calling</b><br></div><div><span style="font-family:monospace">Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: INFO: <script>: XLOG: 123 [CGR_DLG_LIST] Requested dialog list<br>Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: INFO: <script>: XLOG: 123 [CGR_DLG_LIST] Test1: {<br>#011"jsonrpc":#011"2.0",<br>#011"result":#011[],<br>#011"id":#0111<br>}<br>Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: DEBUG: evapi [evapi_dispatch.c:740]: _evapi_relay(): relaying event data [{"event":"CGR_DLG_LIST_REPLY",<br>#011#011#011"jsonrpl_body":{<br>#011"jsonrpc":#011"2.0",<br>#011"result":#011[],<br>#011"id":#0111<br>}}] (96)<br>Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: DEBUG: evapi [evapi_dispatch.c:778]: _evapi_relay(): sending [0x169ff674] [96:{"event":"CGR_DLG_LIST_REPLY",<br>#011#011#011"jsonrpl_body":{<br>#011"jsonrpc":#011"2.0",<br>#011"result":#011[],<br>#011"id":#0111<br>}},] (100)<br>Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: DEBUG: evapi [evapi_dispatch.c:789]: _evapi_relay(): dispatching [0x169ff674] [96:{"event":"CGR_DLG_LIST_REPLY",<br>#011#011#011"jsonrpl_body":{<br>#011"jsonrpc":#011"2.0",<br>#011"result":#011[],<br>#011"id":#0111<br>}},] (100)</span></div><div><br></div><div><br></div><div>We enabled debug messages for module evapi and are trying to understand where is the problem. To make this work to this state we needed to increase the <b>pv_buffer</b> to really big size (2097152).</div><div>It looks like $jsonrpl(body) is not ready and everything concated with it is not working.</div><div><br></div><div><pre><span style="font-family:arial,sans-serif"><code><code><span style="font-family:arial,sans-serif">Any help or suggestion is welcomed.</span><br></code></code></span></pre><pre><code><code><span style="font-family:arial,sans-serif">Sincerely Michal</span></code></code></pre></div><div><br></div><div><br></div><div><br></div></div>