<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Further hints here: the allocated size for private memory is
      rather low at 4MB (-M 4), try at least with 8. The set also
      memjoin=yes global parameter.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 19.11.19 13:01, David Villasmil
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFGRPVoq_ho_6tz4UC3vQG6o1eb8ZfGKweybexCKk9GThtj8YA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>
          <div dir="auto">Nov 19 02:44:45 MY-HOSTNAME
            /usr/sbin/kamailio[14928]: ERROR: <core>
            [core/mem/q_malloc.c:291]: qm_find_free():
            qm_find_free(0x7f8b8cdcd000, 65728); Free fragment not
            found!<br>
            Nov 19 02:44:45 MY-HOSTNAME /usr/sbin/kamailio[14928]:
            ERROR: <core> [core/mem/q_malloc.c:425]: qm_malloc():
            qm_malloc(0x7f8b8cdcd000, 65728) called from websocket:
            ws_conn.c: wsconn_add(197), module: websocket; Free fragment
            not found!<br>
          </div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">Can you try increasing the memory?</div>
        </div>
      </div>
      <div><br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Tue, 19 Nov 2019 at
            02:22, Tom D <<a href="mailto:dworakowski.tom@gmail.com"
              target="_blank" moz-do-not-send="true">dworakowski.tom@gmail.com</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">As a supplement to the above:
              <div><br>
              </div>
              <div>Kamailio is launched with -m 64 -M 4. </div>
              <div>After researching, I've doubled the values and we'll
                see shortly.</div>
              <div><br>
              </div>
              <div>kamctl stats shmem<br>
                {<br>
                  "jsonrpc":  "2.0",<br>
                  "result": [<br>
                    "shmem:fragments = 11935",<br>
                    "shmem:free_size = 36995032",<br>
                    "shmem:max_used_size = 66744520",<br>
                    "shmem:real_used_size = 30113832",<br>
                    "shmem:total_size = 67108864",<br>
                    "shmem:used_size = 20683936"<br>
                  ],<br>
                  "id": 30547<br>
                }<br>
                <br>
                kamcmd pkg.stats returns<br>
                {<br>
                        entry: 0<br>
                        pid: 14908<br>
                        rank: 0<br>
                        used: 1684296<br>
                        free: 1567448<br>
                        real_used: 2626856<br>
                        total_size: 4194304<br>
                        total_frags: 1974<br>
                }<br>
                {<br>
                        entry: 1<br>
                        pid: 14909<br>
                        rank: 1<br>
                        used: 1776064<br>
                        free: 1285152<br>
                        real_used: 2909152<br>
                        total_size: 4194304<br>
                        total_frags: 2283<br>
                }<br>
                {<br>
                        entry: 2<br>
                        pid: 14910<br>
                        rank: 2<br>
                        used: 1776608<br>
                        free: 1397344<br>
                        real_used: 2796960<br>
                        total_size: 4194304<br>
                        total_frags: 1200<br>
                }<br>
                {<br>
                        entry: 3<br>
                        pid: 14911<br>
                        rank: 3<br>
                        used: 1776504<br>
                        free: 1398488<br>
                        real_used: 2795816<br>
                        total_size: 4194304<br>
                        total_frags: 1190<br>
                }<br>
                {<br>
                        entry: 4<br>
                        pid: 14912<br>
                        rank: 4<br>
                        used: 1776616<br>
                        free: 1397440<br>
                        real_used: 2796864<br>
                        total_size: 4194304<br>
                        total_frags: 1199<br>
                }<br>
                {<br>
                        entry: 5<br>
                        pid: 14913<br>
                        rank: 5<br>
                        used: 1776696<br>
                        free: 1395072<br>
                        real_used: 2799232<br>
                        total_size: 4194304<br>
                        total_frags: 1226<br>
                }<br>
                {<br>
                        entry: 6<br>
                        pid: 14914<br>
                        rank: 6<br>
                        used: 1776808<br>
                        free: 1399120<br>
                        real_used: 2795184<br>
                        total_size: 4194304<br>
                        total_frags: 1186<br>
                }<br>
                {<br>
                        entry: 7<br>
                        pid: 14915<br>
                        rank: 7<br>
                        used: 1776800<br>
                        free: 1399544<br>
                        real_used: 2794760<br>
                        total_size: 4194304<br>
                        total_frags: 1182<br>
                }<br>
                {<br>
                        entry: 8<br>
                        pid: 14916<br>
                        rank: 8<br>
                        used: 1776808<br>
                        free: 1399536<br>
                        real_used: 2794768<br>
                        total_size: 4194304<br>
                        total_frags: 1182<br>
                }<br>
                {<br>
                        entry: 9<br>
                        pid: 14917<br>
                        rank: -1<br>
                        used: 1775848<br>
                        free: 1416200<br>
                        real_used: 2778104<br>
                        total_size: 4194304<br>
                        total_frags: 1045<br>
                }<br>
                {<br>
                        entry: 10<br>
                        pid: 14918<br>
                        rank: -1<br>
                        used: 1775848<br>
                        free: 1416200<br>
                        real_used: 2778104<br>
                        total_size: 4194304<br>
                        total_frags: 1045<br>
                }<br>
                {<br>
                        entry: 11<br>
                        pid: 14919<br>
                        rank: -1<br>
                        used: 1775848<br>
                        free: 1416928<br>
                        real_used: 2777376<br>
                        total_size: 4194304<br>
                        total_frags: 1038<br>
                }<br>
                {<br>
                        entry: 12<br>
                        pid: 14920<br>
                        rank: -2<br>
                        used: 1775848<br>
                        free: 1416928<br>
                        real_used: 2777376<br>
                        total_size: 4194304<br>
                        total_frags: 1038<br>
                }<br>
                {<br>
                        entry: 13<br>
                        pid: 14921<br>
                        rank: -2<br>
                        used: 1841304<br>
                        free: 1351368<br>
                        real_used: 2842936<br>
                        total_size: 4194304<br>
                        total_frags: 1038<br>
                }<br>
                {<br>
                        entry: 14<br>
                        pid: 14922<br>
                        rank: -2<br>
                        used: 1786392<br>
                        free: 1405864<br>
                        real_used: 2788440<br>
                        total_size: 4194304<br>
                        total_frags: 1032<br>
                }<br>
                {<br>
                        entry: 15<br>
                        pid: 14923<br>
                        rank: -1<br>
                        used: 1778072<br>
                        free: 1414392<br>
                        real_used: 2779912<br>
                        total_size: 4194304<br>
                        total_frags: 1032<br>
                }<br>
                {<br>
                        entry: 16<br>
                        pid: 14924<br>
                        rank: -1<br>
                        used: 1778072<br>
                        free: 1414392<br>
                        real_used: 2779912<br>
                        total_size: 4194304<br>
                        total_frags: 1032<br>
                }<br>
                {<br>
                        entry: 17<br>
                        pid: 14925<br>
                        rank: -1<br>
                        used: 1778072<br>
                        free: 1414392<br>
                        real_used: 2779912<br>
                        total_size: 4194304<br>
                        total_frags: 1032<br>
                }<br>
                {<br>
                        entry: 18<br>
                        pid: 14926<br>
                        rank: -1<br>
                        used: 1778464<br>
                        free: 1413896<br>
                        real_used: 2780408<br>
                        total_size: 4194304<br>
                        total_frags: 1031<br>
                }<br>
                {<br>
                        entry: 19<br>
                        pid: 14927<br>
                        rank: -1<br>
                        used: 1778072<br>
                        free: 1414392<br>
                        real_used: 2779912<br>
                        total_size: 4194304<br>
                        total_frags: 1032<br>
                }<br>
                {<br>
                        entry: 20<br>
                        pid: 14928<br>
                        rank: 9<br>
                        used: 1858696<br>
                        free: 1331272<br>
                        real_used: 2863032<br>
                        total_size: 4194304<br>
                        total_frags: 1035<br>
                }<br>
                {<br>
                        entry: 21<br>
                        pid: 14929<br>
                        rank: 10<br>
                        used: 1858552<br>
                        free: 1331520<br>
                        real_used: 2862784<br>
                        total_size: 4194304<br>
                        total_frags: 1034<br>
                }<br>
                {<br>
                        entry: 22<br>
                        pid: 14930<br>
                        rank: 11<br>
                        used: 1858672<br>
                        free: 1331504<br>
                        real_used: 2862800<br>
                        total_size: 4194304<br>
                        total_frags: 1033<br>
                }<br>
                {<br>
                        entry: 23<br>
                        pid: 14933<br>
                        rank: 12<br>
                        used: 1858552<br>
                        free: 1331416<br>
                        real_used: 2862888<br>
                        total_size: 4194304<br>
                        total_frags: 1035<br>
                }<br>
                {<br>
                        entry: 24<br>
                        pid: 14934<br>
                        rank: -4<br>
                        used: 1765848<br>
                        free: 1485584<br>
                        real_used: 2708720<br>
                        total_size: 4194304<br>
                        total_frags: 1974</div>
            </div>
            <div dir="ltr">
              <div><br>
                }<br>
                <br>
                <div class="gmail_quote">
                  <div dir="ltr" class="gmail_attr">---------- Forwarded
                    message ---------<br>
                    From: <strong class="gmail_sendername" dir="auto">Tom
                      D</strong> <span dir="auto"><<a
                        href="mailto:dworakowski.tom@gmail.com"
                        target="_blank" moz-do-not-send="true">dworakowski.tom@gmail.com</a>></span><br>
                    Date: Mon, Nov 18, 2019 at 7:59 PM<br>
                    Subject: Websocket immediately disconnecting<br>
                    To: <<a href="mailto:sr-users@lists.kamailio.org"
                      target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a>><br>
                  </div>
                  <br>
                  <br>
                  <div dir="ltr">Hi David,
                    <div><br>
                    </div>
                    <div>Thanks for your reply.</div>
                    <div><br>
                    </div>
                    <div>After increasing the verbosity of the
                      debugging, I found the following entries. So am I
                      understanding the log correctly: the websocket
                      module is trying to get some free memory (from
                      Kamilio's general pool?). It doesn't receive any
                      yet proceeds with parsing the response (I get this
                      same parsing error even when it's working) and
                      ultimately, it doesn't register the websocket?</div>
                    <div><br>
                    </div>
                    <div>I appreciate your (or anyone's) thoughts.</div>
                    <div><br>
                      Regards, Tom</div>
                    <div><br>
                    </div>
                    <div>Nov 19 02:44:44 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: CRITICAL: tls
                      [tls_domain.c:737]: sr_ssl_ctx_info_callback():
                      SSL handshake started<br>
                      Nov 19 02:44:44 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: CRITICAL: tls
                      [tls_domain.c:749]: sr_ssl_ctx_info_callback():
                      SSL handshake done<br>
                      Nov 19 02:44:44 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: CRITICAL: tls
                      [tls_domain.c:753]: sr_ssl_ctx_info_callback():
                      SSL disable renegotiation<br>
                      Nov 19 02:44:44 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: CRITICAL: tls
                      [tls_server.c:431]: tls_accept(): tls_accept: new
                      connection from HI.DD.E.N:63356 using TLSv1/SSLv3
                      AES256-GCM-SHA384 256<br>
                      Nov 19 02:44:44 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: CRITICAL: tls
                      [tls_server.c:434]: tls_accept(): tls_accept:
                      local socket: HI.DD.E.N:8089<br>
                      Nov 19 02:44:44 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: CRITICAL: tls
                      [tls_server.c:445]: tls_accept(): tls_accept:
                      client did not present a certificate<br>
                      Nov 19 02:44:45 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: CRITICAL:
                      <script>: 857:HTTP Request Received<br>
                      Nov 19 02:44:45 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: ERROR: <core>
                      [core/mem/q_malloc.c:291]: qm_find_free():
                      qm_find_free(0x7f8b8cdcd000, 65728); Free fragment
                      not found!<br>
                      Nov 19 02:44:45 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: ERROR: <core>
                      [core/mem/q_malloc.c:425]: qm_malloc():
                      qm_malloc(0x7f8b8cdcd000, 65728) called from
                      websocket: ws_conn.c: wsconn_add(197), module:
                      websocket; Free fragment not found!<br>
                      Nov 19 02:44:45 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: ERROR: websocket
                      [ws_conn.c:199]: wsconn_add(): allocating shared
                      memory<br>
                      Nov 19 02:44:45 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: ERROR: <core>
                      [core/parser/parse_fline.c:262]:
                      parse_first_line(): parse_first_line: bad message
                      (offset: 22)<br>
                      Nov 19 02:44:45 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: ERROR: <core>
                      [core/parser/msg_parser.c:681]: parse_msg():
                      ERROR: parse_msg: message=<HTTP/1.1 101
                      Switching Protocols#015#012Sia: SIP/2.0/TLS
                      HI.DD.E.N:63356#015#012Access-Control-Allow-Origin:
                      <a
                        href="https://www.doubango.org#015%23012Sec-WebSocket-Protocol"
                        target="_blank" moz-do-not-send="true">https://www.doubango.org#015#012Sec-WebSocket-Protocol</a>:
                      sip#015#012Upgrade: websocket#015#012Connection:
                      upgrade#015#012Sec-WebSocket-Accept:
                      taS0s3Z7t4tOhklSbJDLGmSSYsY=#015#012Server:
                      kamailio (5.2.5
                      (x86_64/linux))#015#012Content-Length:
                      0#015#012#015#012><br>
                      Nov 19 02:44:45 MY-HOSTNAME
                      /usr/sbin/kamailio[14928]: ERROR: websocket
                      [ws_frame.c:583]: ws_frame_receive(): WebSocket
                      connection not found<br>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            _______________________________________________<br>
            Kamailio (SER) - Users Mailing List<br>
            <a href="mailto:sr-users@lists.kamailio.org" target="_blank"
              moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
            <a
              href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
          </blockquote>
        </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>
Kamailio World Conference - April 27-29, 2020, in Berlin -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>