<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>to what port do you connect for evapi?</p>
    <p>The logs indicate connection to sip tcp port.<br>
    </p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 14.09.20 18:06, David Escartin
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CADvHuE_GCgtYDas0QSYAKMrQwN0Eph1vLAhLSXbxD_4BHM=yWQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Dear all</div>
        <div><br>
        </div>
        <div>We are trying to use the evapi module to send some data to
          an external application but I'm having problems getting the
          clients connected.</div>
        <div><br>
        </div>
        <div>I have the kamailio (version 5.3) running with a  tcp
          socket <a href="http://127.0.0.1:8228" moz-do-not-send="true">127.0.0.1:8228</a>,
          and the evapi params are just</div>
        <div>modparam("evapi", "workers", 4)<br>
          modparam("evapi", "netstring_format", 0)<br>
          modparam("evapi", "bind_addr", "<a
            href="http://127.0.0.1:8448" moz-do-not-send="true">127.0.0.1:8448</a>")<br>
          modparam("evapi", "max_clients", 32)</div>
        <div><br>
        </div>
        <div>I tried a different number of workers and netstring_format
          1 too.</div>
        <div>When I start the kamailio i added some debug to the code,
          and seems when doing the mod init of the evapi dispatcher</div>
        <div>38(4779) DEBUG: <core> [core/sr_module.c:779]:
          init_mod_child(): idx 38 rank -2: evapi [EvAPI Dispatcher]<br>
        </div>
        <div>it reaches to </div>
        <div>        while(1) {<br>
                          ev_loop (loop, 0);<br>
                  }<br>
        </div>
        <div>at evapi_run_dispatcher function.</div>
        <div>I guess if I connected to the tcp socket and sent some
          event, I would see the client accepted and the event route
          evapi:connection-new would be triggered. But i'm not able to
          do that.</div>
        <div>I tried to use the prime option, a tcp input client
          connection from logstash, so i could relay the data to the
          logstash using the evapi relay, but i only see the tcp socket
          being created but no client accepted.</div>
        <div>I also tried to connect with an erlang gen_tcp client, but
          it's the same<br clear="all">
          <div>i only see</div>
          <div><br>
          </div>
          <div>47(4798) DEBUG: <core> [core/ip_addr.c:229]:
            print_ip(): tcpconn_new: new tcp connection: 127.0.0.1<br>
            47(4798) DEBUG: <core> [core/tcp_main.c:1174]:
            tcpconn_new(): on port 54537, type 2, socket 105<br>
            47(4798) DEBUG: <core> [core/tcp_main.c:1497]:
            tcpconn_add(): hashes: 1117:1187:1505, 1<br>
            47(4798) DEBUG: <core> [core/io_wait.h:375]:
            io_watch_add(): DBG: io_watch_add(0xad0880, 105, 2,
            0x7fc211712d58), fd_no=53<br>
          </div>
          <div>and if i try to send any data</div>
          <div><br>
          </div>
          <div>47(4798) DEBUG: <core> [core/io_wait.h:600]:
            io_watch_del(): DBG: io_watch_del (0xad0880, 105, -1, 0x0)
            fd_no=54 called<br>
            47(4798) DEBUG: <core> [core/tcp_main.c:4456]:
            handle_tcpconn_ev(): sending to child, events 1<br>
            47(4798) DEBUG: <core> [core/tcp_main.c:4129]:
            send2child(): selected tcp worker idx:0 proc:43 pid:4791 for
            activity on [tcp:<a href="http://127.0.0.1:8448"
              moz-do-not-send="true">127.0.0.1:8448</a>], 0x7fc211712d58<br>
            43(4791) DEBUG: <core> [core/tcp_read.c:1749]:
            handle_io(): received n=8 con=0x7fc211712d58, fd=39<br>
            43(4791) DEBUG: <core> [core/io_wait.h:375]:
            io_watch_add(): DBG: io_watch_add(0xb3c720, 39, 2,
            0x7fc211712d58), fd_no=1<br>
            43(4791) DEBUG: <core> [core/io_wait.h:600]:
            io_watch_del(): DBG: io_watch_del (0xb3c720, 39, -1, 0x10)
            fd_no=2 called<br>
            43(4791) DEBUG: <core> [core/tcp_read.c:1671]:
            release_tcpconn(): releasing con 0x7fc211712d58, state 1,
            fd=39, id=1 ([127.0.0.1]:54537 -> [127.0.0.1]:8448)<br>
            43(4791) DEBUG: <core> [core/tcp_read.c:1672]:
            release_tcpconn(): extra_data (nil)<br>
            47(4798) DEBUG: <core> [core/tcp_main.c:3559]:
            handle_tcp_child(): reader response= 7fc211712d58, 1 from 0
            <br>
            47(4798) DEBUG: <core> [core/io_wait.h:375]:
            io_watch_add(): DBG: io_watch_add(0xad0880, 105, 2,
            0x7fc211712d58), fd_no=53<br>
            47(4798) DEBUG: <core> [core/tcp_main.c:3686]:
            handle_tcp_child(): CONN_RELEASE  0x7fc211712d58 refcnt= 1<br>
          </div>
          <div><br>
          </div>
          <div>and when i try to send any data</div>
          <div>38(10867) DEBUG: evapi [evapi_dispatch.c:610]:
            evapi_recv_notify(): received [0x7f17d23fc628] [{"test" :
            "1.1.1.1", "uuid" : "<a href="mailto:1-31629@3.3.3.3"
              moz-do-not-send="true">1-31629@3.3.3.3</a>" , "pdd" :
            "4"}] (75)<br>
            38(10867) DEBUG: evapi [evapi_dispatch.c:316]:
            evapi_dispatch_notify(): the message was sent to 0 clients<br>
          </div>
          <div><br>
          </div>
          <div>I don't know what i'm missing, or if i'm understanding
            the use of the module correctly</div>
          <div><br>
          </div>
          <div>could you please take a look?</div>
          <div>thanks a lot</div>
          <div>David</div>
          <div><br>
          </div>
          <div><br>
          </div>
          -- <br>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <table style="font-family:"Times New Roman""
                width="100%" cellspacing="10" cellpadding="0" border="0">
                <tbody>
                  <tr>
                    <td border="0" cellpadding="0" cellspacing="0"
                      style="border-right:3px dotted rgb(0,155,223)"
                      width="150" valign="center" align="center"><img
                        alt="Logo"
src="https://www.sonoc.io/wp-content/uploads/2020/07/Logo_SONOC_emails.png"
                        moz-do-not-send="true" hspace="5" height="100"></td>
                    <td style="padding:0px" valign="center" align="left">
                      <p><span style="color:rgb(16,47,74)"><font
                            style="font-size:14px" face="Open Sans">David
                            Escartín Almudévar</font></span><br>
                        <span style="color:rgb(16,47,74)"><font
                            style="font-size:14px" face="Open Sans"><font
                              style="font-size:12px" face="Open Sans">VoIP/Switch
                              Engineer</font></font></span><br>
                        <font style="font-size:14px" face="Open Sans"><font
                            style="font-size:12px" face="Open Sans"><a
                              href="mailto:descartin@sonoc.io"
                              style="color:rgb(0,153,204)"
                              target="_blank" moz-do-not-send="true"><span
                                style="color:rgb(0,155,223)">descartin@sonoc.io</span></a><span
                              style="color:rgb(0,155,223)"></span></font></font></p>
                      <p><span style="color:rgb(16,47,74)"><font
                            style="font-size:14px" face="Open Sans"><strong><font
                                face="Open Sans">SONOC</font></strong></font></span><br>
                        <span style="color:rgb(16,47,74)"><font
                            style="font-size:14px" face="Open Sans"><font
                              style="font-size:12px" face="Open Sans">C/
                              Josefa Amar y Borbón, 10, 4ª · 50001
                              Zaragoza, España</font><br>
                            <font size="-1" face="Open Sans">Tlf: +34
                              917019888 ·</font></font></span><font
                          style="font-size:14px" face="Open Sans"
                          color="#102f4a"><font size="-1" face="Open
                            Sans" color="#102f4a"> </font></font><font
                          style="font-size:14px" face="Open Sans"><font
                            size="-1" face="Open Sans"><font size="-1"
                              face="Open Sans"><a
                                href="http://www.sonoc.io"
                                style="color:rgb(0,153,204)"
                                target="_blank" moz-do-not-send="true"><span
                                  style="color:rgb(0,155,223)">www.sonoc.io</span></a></font></font></font></p>
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
  </body>
</html>