<div dir="ltr">Hi Daniel,<div>Taking a second look at the NGREP Trace I think I can see what is going wrong. The message in the third packet was discarded by Evapi module. If you look at the first two packets carefully, the first packet ends at Dev and the second packet is the continuation of first packet which starts with "iceId". The first two packets are processed perfectly fine.</div><div>Now the third packet is a new message,<span style="line-height:1.5"> but Kamailio is trying to continue the third packet again with the first packet. So even when the third packet starts with '146:' Kamailio considers it to be starting with 'Dev146'. This causes the evapi to discard this message since it does not remain a valid netstring then. Here the three packets that I'm talking about:</span></div><div><span style="line-height:1.5"><br></span></div><div><pre style="color:rgb(0,0,0);line-height:normal;word-wrap:break-word;white-space:pre-wrap">T <a href="http://198.24.63.45:48905">198.24.63.45:48905</a> -> <a href="http://198.24.63.39:3927">198.24.63.39:3927</a> [A]
  146:{"event":"REGISTER","tindex":"43213","tlabel":"220429340","PhoneNumber":"11151","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10932-15480@198.24.63.39">10932-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"52174","tlabel":"708781916","PhoneNumber":"11150","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10933-15480@198.24.63.39">10933-15480@198.24.63.39</a>"},147:{"event":"REGISTER","tindex":"34251","tlabel":"1354642017","PhoneNumber":"11153","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10935-15480@198.24.63.39">10935-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"7366","tlabel":"1368396808","PhoneNumber":"11154","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10936-15480@198.24.63.39">10936-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"25289","tlabel":"119788881","PhoneNumber":"11152","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10934-15480@198.24.63.39">10934-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"16327","tlabel":"971937029","PhoneNumber":"11155","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10937-15480@198.24.63.39">10937-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"22242","tlabel":"609737074","PhoneNumber":"11156","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10938-15480@198.24.63.39">10938-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"10720","tlabel":"930036340","PhoneNumber":"11157","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10939-15480@198.24.63.39">10939-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"61133","tlabel":"450961398","PhoneNumber":"11158","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10940-15480@198.24.63.39">10940-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"43210","tlabel":"639090568","PhoneNumber":"11160","Dev                                                                                                         

T <a href="http://198.24.63.45:48905">198.24.63.45:48905</a> -> <a href="http://198.24.63.39:3927">198.24.63.39:3927</a> [AP]
  iceId":"abcd1234abcd1234","CallId":"<a href="mailto:10942-15480@198.24.63.39">10942-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"4559","tlabel":"1701553747","PhoneNumber":"11159","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10941-15480@198.24.63.39">10941-15480@198.24.63.39</a>"},
                                                                                                                                                                                               
T <a href="http://198.24.63.45:48905">198.24.63.45:48905</a> -> <a href="http://198.24.63.39:3927">198.24.63.39:3927</a> [AP]
  146:{"event":"REGISTER","tindex":"52171","tlabel":"748030241","PhoneNumber":"11161","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10943-15480@198.24.63.39">10943-15480@198.24.63.39</a>"},</pre></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 29, 2015 at 4:43 PM Jayesh Nambiar <<a href="mailto:jayesh1017@gmail.com">jayesh1017@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Daniel:<div>I did a new test where I stopped as soon as I saw one message that got discarded. Basically the following message got discarded:</div><div>{"event":"REGISTER","tindex":"52171","tlabel":"748030241","PhoneNumber":"11161","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10943-15480@198.24.63.39" target="_blank">10943-15480@198.24.63.39</a>"}<br></div><div>The CallId parameter in the above json is auto incremented, so I tried gathering logs for messages with following CallIds:</div><div>"CallId":"<a href="mailto:10940-15480@198.24.63.39" target="_blank">10940-15480@198.24.63.39</a>"<br></div><div>"CallId":"<a href="mailto:10941-15480@198.24.63.39" target="_blank">10941-15480@198.24.63.39</a>"<br></div><div>"CallId":"<a href="mailto:10942-15480@198.24.63.39" target="_blank">10942-15480@198.24.63.39</a>"<br></div><div>"CallId":"<a href="mailto:10943-15480@198.24.63.39" target="_blank">10943-15480@198.24.63.39</a>"<br></div><div>"CallId":"<a href="mailto:10944-15480@198.24.63.39" target="_blank">10944-15480@198.24.63.39</a>"<br></div><div>"CallId":"<a href="mailto:10945-15480@198.24.63.39" target="_blank">10945-15480@198.24.63.39</a>"<br></div><div><br></div><div>And the message with CallID <span style="line-height:1.5">"CallId":"</span>10943-15480<span style="line-height:1.5">@<a href="http://198.24.63.39" target="_blank">198.24.63.39</a>" got discarded.</span></div><div><br></div><div><span style="line-height:1.5">Here's the bunch of kamailio logs printed by the evapi module:</span></div><div><b>Logs for processed messages just before the discarded message:</b></div><div><div>DEBUG: evapi [evapi_dispatch.c:492]: evapi_recv_notify(): received [0x7f43da494ad0] [146:{"event":"REGISTER","tindex":"61133","tlabel":"450961398","PhoneNumber":"11158","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10940-15480@198.24.63.39" target="_blank">10940-15480@198.24.63.39</a>"},] (151)</div><div><br></div><div>NOTICE: evapi_recv_client(): {0} [<a href="http://198.24.63.45:48905" target="_blank">198.24.63.45:48905</a>] - received [147:{"event":"REGISTER","tindex":"25291","tlabel":"2047024302","PhoneNumber":"11132","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10914-15480@198.24.63.39" target="_blank">10914-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"61136","tlabel":"839735223","PhoneNumber":"11148","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10930-15480@198.24.63.39" target="_blank">10930-15480@198.24.63.39</a>"},143:{"event":"REGISTER","tindex":"4562","tlabel":"6586867","PhoneNumber":"11149","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10931-15480@198.24.63.39" target="_blank">10931-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"43213","tlabel":"220429340","PhoneNumber":"11151","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10932-15480@198.24.63.39" target="_blank">10932-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"52174","tlabel":"708781916","PhoneNumber":"11150","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10933-15480@198.24.63.39" target="_blank">10933-15480@198.24.63.39</a>"},147:{"event":"REGISTER","tindex":"34251","tlabel":"1354642017","PhoneNumber":"11153","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10935-15480@198.24.63.39" target="_blank">10935-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"7366","tlabel":"1368396808","PhoneNumber":"11154","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10936-15480@198.24.63.39" target="_blank">10936-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"25289","tlabel":"119788881","PhoneNumber":"11152","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10934-15480@198.24.63.39" target="_blank">10934-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"16327","tlabel":"971937029","PhoneNumber":"11155","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10937-15480@198.24.63.39" target="_blank">10937-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"22242","tlabel":"609737074","PhoneNumber":"11156","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10938-15480@198.24.63.39" target="_blank">10938-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"10720","tlabel":"930036340","PhoneNumber":"11157","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10939-15480@198.24.63.39" target="_blank">10939-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"61133","tlabel":"450961398","PhoneNumber":"11158","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10940-15480@198.24.63.39" target="_blank">10940-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"43210","tlabel":"639090568","PhoneNumber":"11160","Dev] (1899) (0)</div><div><br></div><div><br></div><div>evapi_recv_client(): executing event route for frame: [{"event":"REGISTER","tindex":"61133","tlabel":"450961398","PhoneNumber":"11158","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10940-15480@198.24.63.39" target="_blank">10940-15480@198.24.63.39</a>"}] (146)</div><div><br></div><div>Sep 29 05:35:14 v39 /usr/local/kamailio-dev/sbin/kamailio[15387]: DEBUG: evapi [evapi_dispatch.c:492]: evapi_recv_notify(): received [0x7f43da4b67e0] [146:{"event":"REGISTER","tindex":"4559","tlabel":"1701553747","PhoneNumber":"11159","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10941-15480@198.24.63.39" target="_blank">10941-15480@198.24.63.39</a>"},] (151)</div><div><br></div><div>NOTICE: evapi [evapi_dispatch.c:290]: evapi_recv_client(): {0} [<a href="http://198.24.63.45:48905" target="_blank">198.24.63.45:48905</a>] - received [iceId":"abcd1234abcd1234","CallId":"<a href="mailto:10942-15480@198.24.63.39" target="_blank">10942-15480@198.24.63.39</a>"},146:{"event":"REGISTER","tindex":"4559","tlabel":"1701553747","PhoneNumber":"11159","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10941-15480@198.24.63.39" target="_blank">10941-15480@198.24.63.39</a>"},] (214) (88)</div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:370]: evapi_recv_client(): executing event route for frame: [{"event":"REGISTER","tindex":"4559","tlabel":"1701553747","PhoneNumber":"11159","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10941-15480@198.24.63.39" target="_blank">10941-15480@198.24.63.39</a>"}] (146)</div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:492]: evapi_recv_notify(): received [0x7f43d93c2a70] [146:{"event":"REGISTER","tindex":"43210","tlabel":"639090568","PhoneNumber":"11160","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10942-15480@198.24.63.39" target="_blank">10942-15480@198.24.63.39</a>"},] (151)</div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:370]: evapi_recv_client(): executing event route for frame: [{"event":"REGISTER","tindex":"43210","tlabel":"639090568","PhoneNumber":"11160","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10942-15480@198.24.63.39" target="_blank">10942-15480@198.24.63.39</a>"}] (146)</div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:353]: evapi_recv_client(): residual data [146:{"event":"REGISTER","tindex":"43210","tlabel":"639090568","PhoneNumber":"11160","Dev] (88)<br></div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:361]: evapi_recv_client(): frame size mismatch the ending char ("): [{"event":"REGISTER","tindex":"43210","tlabel":"639090568","PhoneNumber":"11160","Dev146:{"event":"REGISTER","tindex":"52171","tlabel":"748030241",] (146)</div><div><br></div><div><b>Logs for discarded message:</b></div><div><div>DEBUG: evapi [evapi_dispatch.c:492]: evapi_recv_notify(): received [0x7f43da3e69a0] [146:{"event":"REGISTER","tindex":"52171","tlabel":"748030241","PhoneNumber":"11161","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10943-15480@198.24.63.39" target="_blank">10943-15480@198.24.63.39</a>"},] (151)</div><div><br></div><div>NOTICE: evapi [evapi_dispatch.c:290]: evapi_recv_client(): {0} [<a href="http://198.24.63.45:48905" target="_blank">198.24.63.45:48905</a>] - received [146:{"event":"REGISTER","tindex":"52171","tlabel":"748030241","PhoneNumber":"11161","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10943-15480@198.24.63.39" target="_blank">10943-15480@198.24.63.39</a>"},] (151) (88)</div></div><div><br></div><div><b>Logs for messages after the discarded message:</b></div><div><div>DEBUG: evapi [evapi_dispatch.c:492]: evapi_recv_notify(): received [0x7f43da3e6aa0] [146:{"event":"REGISTER","tindex":"25286","tlabel":"809034258","PhoneNumber":"11163","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10944-15480@198.24.63.39" target="_blank">10944-15480@198.24.63.39</a>"},] (151)</div><div><br></div><div>NOTICE: evapi [evapi_dispatch.c:290]: evapi_recv_client(): {0} [<a href="http://198.24.63.45:48905" target="_blank">198.24.63.45:48905</a>] - received [146:{"event":"REGISTER","tindex":"25286","tlabel":"809034258","PhoneNumber":"11163","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10944-15480@198.24.63.39" target="_blank">10944-15480@198.24.63.39</a>"},] (151) (0)</div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:370]: evapi_recv_client(): executing event route for frame: [{"event":"REGISTER","tindex":"25286","tlabel":"809034258","PhoneNumber":"11163","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10944-15480@198.24.63.39" target="_blank">10944-15480@198.24.63.39</a>"}] (146)</div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:492]: evapi_recv_notify(): received [0x7f43d9598778] [146:{"event":"REGISTER","tindex":"34248","tlabel":"187029249","PhoneNumber":"11162","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10945-15480@198.24.63.39" target="_blank">10945-15480@198.24.63.39</a>"},] (151)</div><div><br></div><div>NOTICE: evapi [evapi_dispatch.c:290]: evapi_recv_client(): {0} [<a href="http://198.24.63.45:48905" target="_blank">198.24.63.45:48905</a>] - received [146:{"event":"REGISTER","tindex":"34248","tlabel":"187029249","PhoneNumber":"11162","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10945-15480@198.24.63.39" target="_blank">10945-15480@198.24.63.39</a>"},] (151) (0)</div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:370]: evapi_recv_client(): executing event route for frame: [{"event":"REGISTER","tindex":"34248","tlabel":"187029249","PhoneNumber":"11162","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10945-15480@198.24.63.39" target="_blank">10945-15480@198.24.63.39</a>"}] (146)</div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:492]: evapi_recv_notify(): received [0x7f43d9598878] [145:{"event":"REGISTER","tindex":"7363","tlabel":"949153805","PhoneNumber":"11164","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10946-15480@198.24.63.39" target="_blank">10946-15480@198.24.63.39</a>"},] (150)</div><div><br></div><div>NOTICE: evapi [evapi_dispatch.c:290]: evapi_recv_client(): {0} [<a href="http://198.24.63.45:48905" target="_blank">198.24.63.45:48905</a>] - received [145:{"event":"REGISTER","tindex":"7363","tlabel":"949153805","PhoneNumber":"11164","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10946-15480@198.24.63.39" target="_blank">10946-15480@198.24.63.39</a>"},] (150) (0)</div><div><br></div><div>DEBUG: evapi [evapi_dispatch.c:370]: evapi_recv_client(): executing event route for frame: [{"event":"REGISTER","tindex":"7363","tlabel":"949153805","PhoneNumber":"11164","DeviceId":"abcd1234abcd1234","CallId":"<a href="mailto:10946-15480@198.24.63.39" target="_blank">10946-15480@198.24.63.39</a>"}] (145)</div></div><div><br></div><div>Just in case if you need to see the NGREP trace for the above messages, it is here:</div><div><a href="http://pastebin.com/4zTKmBJX" target="_blank">http://pastebin.com/4zTKmBJX</a><br></div><div><br></div><div>Thanks,</div><div><br></div><div>- Jayesh</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 29, 2015 at 12:16 PM Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    can you send here the log messages printed by evapi that contain "]
    - received [" which have:<br>
    <br>
    - the previous bunch of json documents that were processed ok (just
    before the one that was discarded)<br>
    - the bunch of json documents that were discarded<br>
    - the next bunch of json documents that were processed ok<br>
    <br>
    The logs were sent on could of emails and pastebin, so it is hard to
    track them -- if you have the logs, just locate the log messages
    with the discarded json and send it here along with the previous and
    next logs.<br>
    <br>
    Cheers,<br>
    Daniel</div><div bgcolor="#FFFFFF" text="#000000"><br>
    <br>
    <div>On 28/09/15 17:04, Jayesh Nambiar
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Thank you daniel.
        <div>Yes, they all get printed by the evapi module even when
          they get discarded. If you once again check the paste-bin, the
          logs pasted as Kamailio Logs are all discarded packets but
          show up as received by evapi module.</div>
        <div>I believe they got discarded because a packet that came
          before them was partial and evapi discarded the remaining part
          of the message in the new packet and encountered error.</div>
        <div dir="ltr">
          <div>- Jayesh</div>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr">On Mon, Sep 28, 2015 at 11:13 AM
            Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
              <br>
              I will look over it during next days.<br>
              <br>
              One more thing, are the packages sent by you printed by
              evapi module, even not they are not processed (but
              discarded)?<br>
              <br>
              Cheers,<br>
              Daniel</div>
            <div bgcolor="#FFFFFF" text="#000000"><br>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
    </div><div bgcolor="#FFFFFF" text="#000000"><pre cols="72">-- 
Daniel-Constantin Mierla
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
</pre>
  </div></blockquote></div></blockquote></div>