<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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:"Open Sans";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.E-MailFormatvorlage20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 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="DE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi David,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">have not looked into the specific problems in detail, but I would suggest to at least upgrade to the latest 5.3.7 or 5.4.2 release. There might be several bugfixes included that helps
 here for these problems.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">If the problems persist after that, I would suggest to create individual issues on our tracker about that.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Henning<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">-- <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Henning Westerholt –
</span><span style="mso-fareast-language:EN-US"><a href="https://skalatan.de/blog/"><span lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a></span><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Kamailio services –
</span><span style="mso-fareast-language:EN-US"><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a></span><span style="mso-fareast-language:EN-US">
<span lang="EN-GB"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<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>From:</b> sr-dev <sr-dev-bounces@lists.kamailio.org>
<b>On Behalf Of </b>David Escartin<br>
<b>Sent:</b> Monday, November 30, 2020 11:19 AM<br>
<b>To:</b> Kamailio (SER) - Development Mailing List <sr-dev@lists.kamailio.org><br>
<b>Subject:</b> [sr-dev] issue using evapi module with evapi_relay<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Dear all<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">we have been testing this module with the following setup<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">kamailio 5.3.2<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">evapi params<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">modparam("evapi", "workers", 4)<br>
modparam("evapi", "netstring_format", 0)<br>
modparam("evapi", "bind_addr", "<a href="http://127.0.0.1:8448/" target="_blank">127.0.0.1:8448</a>")<br>
modparam("evapi", "max_clients", 32)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">then in the configuration we do evapi_relay of avp including a json data (which can be quite long), like this<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">{"key" : "<a href="mailto:aarp2q0tcpqhs0cpucuhukjs2ah2j00q@10.18.5.64" target="_blank">aarp2q0tcpqhs0cpucuhukjs2ah2j00q@10.18.5.64</a>" , "msg" : {"rg_in":"701","ani_init":{"ani_source":"pai", ....... }}}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">We have an application listening on the tcp socket and writing those messages to a kafka cluster, and this works ok, and in the previous manual tests we have done no issue was found.<br>
But when making some load tests, and passing some live traffic we see some issues<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">seems like some times, when there are messages to be sent to the tcp socket at the same time, they are sent in the same message, when normally each data sent using evapi_relay is sent in 1 message<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">We do sometimes see something like this on the application consuming from the tcp socket<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">2020-11-25 15:20:01.744 UTC [error] <0.706.0>@evapi_kafka_listener:handle_info:167 body "{\"key\" : \"<a href="mailto:6142651aa63616c6c04a783cd@72.21.24.130" target="_blank">6142651aa63616c6c04a783cd@72.21.24.130</a>\"
 , \"msg\" : {\"rg_in\":\"677\",\"ani_init\":{\"ani_source\":\"fro\",.......}}}{\"key\" : \"<a href="mailto:isbc7caT4001915251VabcGhEfHdNiF0i@172.16.120.1" target="_blank">isbc7caT4001915251VabcGhEfHdNiF0i@172.16.120.1</a>\" , \"msg\" : {\"rg_in\":\"22\",\"ani_init\":{\"ani_source\":\"pai\",
 ....... ,\"translate" not valid json; error = {691,invalid_trailing_data}<br>
2020-11-25 15:20:01.745 UTC [error] <0.706.0>@evapi_kafka_listener:handle_info:167 body "dPartition\":\"-1\",......}}}" not valid json; error = {1,invalid_json}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">and we do see that the application cannot parse the json message fine, because we have like 2 json objects together ......{\"ani_source\":\"fro\",.......}}}{\"key\" : \"isbc7caT4001915251Vabc............<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">This happens with 2 different UDP receivers processing messages and calling evapi_relay at the same time. But i don't think this happens all the time. Seems like some issue when several processes try to use evapi
 workers at the same time.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">We tried to increase evapi workers and it's the same<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">We also saw another issue I think. Seems when the avp sent to evapi socket is bigger than ~1680 char, the json is also truncated, and also happens when we use the socket in Lo interface which has an MTU of 65535.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Could you please take a look to see if there is any problem or limitation, or if we are using something wrong?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">thanks and best regards <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">david<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt">-- <o:p></o:p></p>
<div>
<div>
<table class="MsoNormalTable" border="0" cellspacing="10" cellpadding="0" width="100%" style="width:100.0%;margin-left:35.4pt">
<tbody>
<tr>
<td width="150" style="width:112.5pt;border:none;border-right:dotted #009BDF 2.25pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-family:"Times New Roman",serif"><img border="0" width="99" height="100" style="width:1.0312in;height:1.0416in" id="_x0000_i1025" src="https://www.sonoc.io/wp-content/uploads/2020/07/Logo_SONOC_emails.png" alt="Logo"></span><span style="font-family:"Times New Roman",serif"><o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p><span style="font-size:10.5pt;font-family:"Open Sans",serif;color:#102F4A">David Escartín Almudévar</span><span style="font-family:"Times New Roman",serif"><br>
</span><span style="font-size:9.0pt;font-family:"Open Sans",serif;color:#102F4A">VoIP/Switch Engineer</span><span style="font-family:"Times New Roman",serif"><br>
</span><span style="font-size:9.0pt;font-family:"Open Sans",serif"><a href="mailto:descartin@sonoc.io" target="_blank"><span style="color:#009BDF">descartin@sonoc.io</span></a></span><span style="font-family:"Times New Roman",serif"><o:p></o:p></span></p>
<p><strong><span style="font-size:10.5pt;font-family:"Open Sans",serif;color:#102F4A">SONOC</span></strong><span style="font-family:"Times New Roman",serif"><br>
</span><span style="font-size:9.0pt;font-family:"Open Sans",serif;color:#102F4A">C/ Josefa Amar y Borbón, 10, 4ª · 50001 Zaragoza, España</span><span style="font-size:10.5pt;font-family:"Open Sans",serif;color:#102F4A"><br>
</span><span style="font-size:10.0pt;font-family:"Open Sans",serif;color:#102F4A">Tlf: +34 917019888 · </span><span style="font-size:10.0pt;font-family:"Open Sans",serif"><a href="http://www.sonoc.io" target="_blank"><span style="color:#009BDF">www.sonoc.io</span></a></span><span style="font-family:"Times New Roman",serif"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>