<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>OK, good it was sorted out, body being indeed added in two places
      with the first config.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 06.06.18 17:41, Asgaroth wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:e5e6ce1c-346d-9207-e295-7a4b3133473b@gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <tt>Updating the event route to:<br>
        <br>
        event_route[xhttp:request] {<br>
            $var(xhttp_uri) = $(hu{s.tolower});<br>
        <br>
            xlog("L_INFO", "event_route[xhttp:request] : hu = '$hu'
        var(xhttp_uri) = '$var(xhttp_uri)'");<br>
        <br>
            if ( $var(xhttp_uri) =~ "^/rpc") {<br>
                jsonrpc_dispatch();<br>
            } else if ( $var(xhttp_uri) =~ "^/http_rpc") {<br>
                dispatch_xhttp_rpc();<br>
            } else {<br>
                xhttp_reply("200", "OK", "text/html",
        "<html><body>Wrong URL
        $hu</body></html>");<br>
            }<br>
            return;<br>
        }<br>
        <br>
        Fixed the issue, sorry for the noise :)<br>
      </tt><br>
      <div class="moz-cite-prefix">On 06/06/18 15:47, Asgaroth wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:94b2bdad-c5cd-6ca8-54b9-ddb271c1b997@gmail.com">
        <meta http-equiv="Content-Type" content="text/html;
          charset=utf-8">
        <tt>Hi,<br>
          <br>
          I performed the following:<br>
          <br>
          # kamcmd dbg.trace on</tt><br>
        <tt># curl --header 'Content-Type: application/json' \</tt><tt><br>
        </tt><tt>    </tt><tt>--data-binary '{\</tt><tt><br>
        </tt><tt>      </tt><tt>"jsonrpc": "2.0", \</tt><tt><br>
        </tt><tt>      </tt><tt>"method": "ul.lookup", \</tt><tt><br>
        </tt><tt>      </tt><tt>"params": [ "location",</tt><tt><a
            class="moz-txt-link-rfc2396E" href="mailto:user@example.com"
            moz-do-not-send="true">"user@example.com"</a></tt><tt> ], \</tt><tt><br>
        </tt><tt>      </tt><tt>"id": 3 }' </tt><tt><a
            class="moz-txt-link-freetext"
            href="http://registrar.example.com/rpc"
            moz-do-not-send="true">http://registrar.example.com/rpc</a></tt><tt><br>
          # kamcmd dbg.trace off<br>
          <br>
          And the following was presented in the log file<br>
          <br>
          [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request]
          c=[/etc/kamailio/routing_logic.cfg] l=301 a=63 n=assign<br>
          [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request]
          c=[/etc/kamailio/routing_logic.cfg] l=305 a=16 n=if<br>
          [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request]
          c=[/etc/kamailio/routing_logic.cfg] l=303 a=24
          n=jsonrpc_dispatch<br>
          [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request]
          c=[/etc/kamailio/routing_logic.cfg] l=305 a=63 n=assign<br>
          [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request]
          c=[/etc/kamailio/routing_logic.cfg] l=313 a=16 n=if<br>
          [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request]
          c=[/etc/kamailio/routing_logic.cfg] l=314 a=28 n=xhttp_reply<br>
          [5843]: ERROR: <core> [core/data_lump_rpl.c:83]:
          add_lump_rpl2(): LUMP_RPL_BODY already added!<br>
          [5843]: ERROR: xhttp [xhttp_mod.c:410]: xhttp_send_reply():
          Error while adding reply lump<br>
          <br>
          The relevent request route is as follows:<br>
          <br>
          # Handling HTTP events<br>
          event_route[xhttp:request] {<br>
                  $var(xhttp_rpc_root) = $(hu{s.substr,0,4});<br>
                  if ($var(xhttp_rpc_root) == "/rpc") {<br>
                          jsonrpc_dispatch();<br>
                  }<br>
                  $var(xhttp_rpc_root) = $(hu{s.substr,0,9});<br>
                  if ($var(xhttp_rpc_root) == "/http_rpc") {<br>
                          dispatch_xhttp_rpc();<br>
                  }<br>
                  #$var(xhttp_rpc_root) = $(hu{s.substr,0,8});<br>
                  #if ($var(xhttp_rpc_root) == "/http_pi") {<br>
                  #        dispatch_xhttp_pi();<br>
                  #}<br>
                  xhttp_reply("200", "OK", "text/html",<br>
                          "<html><body>Wrong URL
          $hu</body></html>");<br>
          }<br>
          <br>
          Just looking at the above event route, do I need to "exit" the
          if statements above, would the last xhttp_reply be causing
          this error?<br>
          <br>
          Thanks<br>
          <br>
        </tt><br>
        <div class="moz-cite-prefix">On 18/05/18 13:52,
          Daniel-Constantin Mierla wrote:<br>
        </div>
        <blockquote type="cite"
          cite="mid:ba37ebd9-12d4-044f-6441-6504d23a02cc@gmail.com">
          <pre wrap="">this sounds like the body for reply was already set. Can you enable
cfgtrace in debugger module and see what actions are executed in that
situation?</pre>
        </blockquote>
        <br>
      </blockquote>
      <br>
      <!--'"--><br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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>
    <br>
    <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 -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>