<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Forgot to say that you need to listen on tcp for getting http
    requests on sip port.<br>
    <br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 23/09/15 15:46, Daniel-Constantin
      Mierla wrote:<br>
    </div>
    <blockquote cite="mid:5602AD2F.3040805@gmail.com" type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      Ctl module is listening for a custom binary protocol, not for
      jsonrpc over http.<br>
      <br>
      You need to load xhttp module as well, see the config example at:<br>
      <br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://kamailio.org/docs/modules/4.3.x/modules/jsonrpc-s.html#jsonrpc-s.f.jsonrpc_dispatch">http://kamailio.org/docs/modules/4.3.x/modules/jsonrpc-s.html#jsonrpc-s.f.jsonrpc_dispatch</a><br>
      <br>
      Be sure you have also the tcp_accept_no_cl parameter.<br>
      <br>
      Daniel<br>
      <br>
      <div class="moz-cite-prefix">On 23/09/15 13:15, Loïc Boissy wrote:<br>
      </div>
      <blockquote
cite="mid:CAHrc+6mdYiQe6G4AL2k+269D0Shyspx=bAib0kBdTuciCSq3iQ@mail.gmail.com"
        type="cite">
        <div dir="ltr">Yes, ctl module is listening on port 80 and i
          send the request on the same port.
          <div>SIP port is 5060.</div>
          <div><br>
          </div>
          <div>I am not sure to well understand.</div>
          <div>If i set the ctl module listen port to 80, sip port to
            5060, i can't send my http request on port 5060 (connection
            failed).<br>
          </div>
          <div><br>
          </div>
          <div>best regards.</div>
          <div>Loic</div>
          <div><br>
            <div><br>
              <div class="gmail_extra"><br>
                <div class="gmail_quote">2015-09-23 12:07 GMT+02:00
                  Daniel-Constantin Mierla <span dir="ltr"><<a
                      moz-do-not-send="true"
                      class="moz-txt-link-abbreviated"
                      href="mailto:miconda@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a></a>></span>:<br>
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                    <div bgcolor="#FFFFFF" text="#000000"> Do you send
                      the request to the port on which ctl module is
                      listening? if yes, that is not correct one, you
                      have to send it to the port for sip packets.<br>
                      <br>
                      Cheers,<br>
                      Daniel
                      <div>
                        <div class="h5"><br>
                          <br>
                          <div>On 23/09/15 12:00, Loïc Boissy wrote:<br>
                          </div>
                          <blockquote type="cite">
                            <div dir="ltr">
                              <div>Yes, when i send my request i can see
                                (debug is set to 3):</div>
                              <div>Sep 23 11:52:22 dcloud-03
                                /usr/sbin/kamailio[22020]: DEBUG: ctl
                                [../../io_wait.h:376]: io_watch_add():
                                DBG: io_watch_add(0x7f5bd6304460, 14, 3,
                                0x1ab22e0), fd_no=2</div>
                              <div>Sep 23 11:52:22 dcloud-03
                                /usr/sbin/kamailio[22020]: DEBUG: ctl
                                [io_listener.c:442]:
                                handle_new_connect(): handle_stream
                                read: new connection (1) on *</div>
                              <div>Sep 23 11:52:22 dcloud-03
                                /usr/sbin/kamailio[22020]: DEBUG: ctl
                                [../../io_wait.h:598]: io_watch_del():
                                DBG: io_watch_del (0x7f5bd6304460, 14,
                                -1, 0x10) fd_no=3 called</div>
                              <div>and that's all...</div>
                              <div><br>
                              </div>
                              <div>Yes, there are double quotes in my
                                command. But for me it is correct, when
                                i check the frame using wireshark, i see</div>
                              <div><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">{"id":


                                  1, "jsonrpc": "2.0", "method":
                                  "ul.dump"}</span><br>
                              </div>
                              <div><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">....</span></div>
                              <div><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify"><br>
                                </span></div>
                              <div><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">Thank</span></div>
                              <div><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">Loic</span></div>
                              <div><br>
                              </div>
                              <div><br>
                              </div>
                            </div>
                            <div class="gmail_extra"><br>
                              <div class="gmail_quote">2015-09-23 11:50
                                GMT+02:00 Daniel-Constantin Mierla <span
                                  dir="ltr"><<a
                                    moz-do-not-send="true"
                                    href="mailto:miconda@gmail.com"
                                    target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a></a>></span>:<br>
                                <blockquote class="gmail_quote"
                                  style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                                  <div bgcolor="#FFFFFF" text="#000000">
                                    Hello,<br>
                                    <br>
                                    can you look at network traffic
                                    (e.g., ngrep) or start kamailio with
                                    debug=3 in kamailio.cfg?<br>
                                    <br>
                                    You should see what is processed.<br>
                                    <br>
                                    At a quick look, you command line is
                                    using double quotes to wrap all the
                                    json string, which has other double
                                    quotes inside, so the shell will
                                    split that -- but maybe that is just
                                    an example posted here, not the
                                    actual command you used.<br>
                                    <br>
                                    Cheers,<br>
                                    Daniel
                                    <div>
                                      <div><br>
                                        <br>
                                        <div>On 23/09/15 11:46, Loïc
                                          Boissy wrote:<br>
                                        </div>
                                      </div>
                                    </div>
                                    <blockquote type="cite">
                                      <div>
                                        <div>
                                          <div dir="ltr">Hello
                                            <div><br clear="all">
                                              <div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px">I
                                                  am trying to use
                                                  JSONRPC-S Kamailio
                                                  module to request for
                                                  example <span
                                                    style="color:rgb(0,0,0);font-family:Helvetica,Arial;text-align:justify">the



                                                    content of the
                                                    location table. More
                                                    generally, i would
                                                    like to send RPC
                                                    commands to my
                                                    kamailio server
                                                    using http request.</span></div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px"><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;text-align:justify">For



                                                    the moment, kamailio
                                                    server always
                                                    returns "400 bad
                                                    request: corrupted
                                                    packet".</span></div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px"><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;text-align:justify"><br>
                                                  </span></div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px"><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;text-align:justify">To



                                                    send my request, i
                                                    use curl. For
                                                    example:</span></div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px"><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;text-align:justify"><br>
                                                  </span></div>
                                                <div><span
                                                    style="text-align:justify"><font
                                                      face="Helvetica,
                                                      Arial"
                                                      color="#000000"><span
style="font-size:12px">curl --header 'Content-Type: application/json'
                                                        --data-binary
                                                        "{"id": 1,
                                                        "jsonrpc":
                                                        "2.0", "method":
                                                        "ul.dump" }"</span></font></span><span
style="font-size:12px;color:rgb(0,0,0);font-family:Helvetica,Arial;text-align:justify"> <a
moz-do-not-send="true" class="moz-txt-link-freetext"
                                                      href="http://XXX.XXX.XXX.XXX/RPC/"><a class="moz-txt-link-freetext" href="http://XXX.XXX.XXX.XXX/RPC/">http://XXX.XXX.XXX.XXX/RPC/</a></a></span></div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px"><br>
                                                </div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px">Is


                                                  there specific syntax
                                                  to respect?</div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px">Kamailio



                                                  server version is
                                                  4.3.2.<br>
                                                </div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px"><br>
                                                </div>
                                                <div
                                                  style="font-family:Verdana;font-size:12px">Thank


                                                  you in advance.</div>
                                              </div>
                                              <div>Loic BOISSY</div>
                                              <div><br>
                                              </div>
                                            </div>
                                          </div>
                                          <br>
                                        </div>
                                      </div>
                                      <div
style="color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
                                        <div style="font-size:12.8px"><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2px">Visit</span><span
style="color:rgb(84,84,84);line-height:18.2px"> Digigram at </span><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2px">IBC2015</span><span
style="color:rgb(84,84,84);line-height:18.2px"> at </span><span
                                            style="font-weight:bold;color:rgb(84,84,84);line-height:18.2px">Stand



                                            8</span><span
                                            style="color:rgb(84,84,84);line-height:18.2px">.</span><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2px">C51</span><span
style="color:rgb(84,84,84);line-height:18.2px">, </span><span
                                            style="font-weight:bold;color:rgb(84,84,84);line-height:18.2px">Sept</span><span
style="color:rgb(84,84,84);line-height:18.2px">. </span><span
                                            style="font-weight:bold;color:rgb(84,84,84);line-height:18.2px">11-15</span><span
style="color:rgb(84,84,84);line-height:18.2px"> in </span><span
                                            style="font-weight:bold;color:rgb(84,84,84);line-height:18.2px">Amsterdam</span></div>
                                        <div style="font-size:12.8px"><font
                                            face="arial, sans-serif"
                                            color="#545454"><span
                                              style="line-height:18.2px">Register <a
                                                moz-do-not-send="true"
                                                href="http://www.ibc.org/page.cfm/link=478"
style="color:rgb(17,85,204)" target="_blank">here</a> for your <b>FREE</b> pass

                                              with Digigram's Exhibitor
                                              Customer Code <b>4462</b></span></font></div>
                                      </div>
                                      <br>
                                      <fieldset></fieldset>
                                      <br>
                                      <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span><font color="#888888">
</font></span></pre>
                                      <span><font color="#888888"> </font></span></blockquote>
                                    <span><font color="#888888"> <br>
                                        <pre cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a moz-do-not-send="true" href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a></pre>
                                      </font></span></div>
                                  <br>
_______________________________________________<br>
                                  SIP Express Router (SER) and Kamailio
                                  (OpenSER) - sr-users mailing list<br>
                                  <a moz-do-not-send="true"
                                    href="mailto:sr-users@lists.sip-router.org"
                                    target="_blank">sr-users@lists.sip-router.org</a><br>
                                  <a moz-do-not-send="true"
                                    href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
                                    rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-user</a><br>
                                </blockquote>
                              </div>
                            </div>
                          </blockquote>
                          <pre cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a moz-do-not-send="true" href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a></pre>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br>
        <div
style="color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
          <div style="font-size:12.8000001907349px"><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2000007629395px">Visit</span><span
              style="color:rgb(84,84,84);line-height:18.2000007629395px"> Digigram

              at </span><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2000007629395px">IBC2015</span><span
              style="color:rgb(84,84,84);line-height:18.2000007629395px"> at </span><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2000007629395px">Stand

              8</span><span
              style="color:rgb(84,84,84);line-height:18.2000007629395px">.</span><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2000007629395px">C51</span><span
              style="color:rgb(84,84,84);line-height:18.2000007629395px">, </span><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2000007629395px">Sept</span><span
              style="color:rgb(84,84,84);line-height:18.2000007629395px">. </span><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2000007629395px">11-15</span><span
              style="color:rgb(84,84,84);line-height:18.2000007629395px"> in </span><span
style="font-weight:bold;color:rgb(84,84,84);line-height:18.2000007629395px">Amsterda<wbr>m</span></div>
          <div style="font-size:12.8000001907349px"><font face="arial,
              sans-serif" color="#545454"><span
                style="line-height:18.2000007629395px">Register <a
                  moz-do-not-send="true"
                  href="http://www.ibc.org/page.cfm/link=478"
                  style="color:rgb(17,85,204)" target="_blank">here</a> for

                your <b>FREE</b> pass with Digigram's Exhibitor Customer
                Code <b>4462</b></span></font></div>
        </div>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a></pre>
  </body>
</html>