<div dir="ltr">Yep,<div><br></div><div>That's right.</div><div>I made a mistake.</div><div>Works well now.</div><div><br></div><div>Thak you for your help.</div><div>Best regards.</div><div>Loic</div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-23 16:00 GMT+02:00 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Forgot to say that you need to listen on tcp for getting http
requests on sip port.<span><font color="#888888"><br>
<br>
Daniel</font></span><div><div><br>
<br>
<div>On 23/09/15 15:46, Daniel-Constantin
Mierla wrote:<br>
</div>
<blockquote type="cite">
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 href="http://kamailio.org/docs/modules/4.3.x/modules/jsonrpc-s.html#jsonrpc-s.f.jsonrpc_dispatch" target="_blank">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>On 23/09/15 13:15, Loïc Boissy wrote:<br>
</div>
<blockquote 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 href="mailto:miconda@gmail.com" target="_blank"></a><a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</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><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 href="mailto:miconda@gmail.com" target="_blank"></a><a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</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 href="http://XXX.XXX.XXX.XXX/RPC/" target="_blank"></a><a href="http://XXX.XXX.XXX.XXX/RPC/" target="_blank">http://XXX.XXX.XXX.XXX/RPC/</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 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 href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a 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 href="http://twitter.com/#%21/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>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a 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 href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a 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 href="http://twitter.com/#%21/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>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a 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">Amsterdam</span></div>
<div style="font-size:12.8000001907349px"><font face="arial,
sans-serif" color="#545454"><span style="line-height:18.2000007629395px">Register <a 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 cols="72">--
Daniel-Constantin Mierla
<a href="http://twitter.com/#%21/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>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a></pre>
</blockquote>
<br>
<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>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a></pre>
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div style="color:rgb(136,136,136)"><div style="color:rgb(34,34,34);font-size:12.8000001907349px"><br></div><div style="color:rgb(34,34,34);font-size:12.8000001907349px"><table style="font-family:Arial"><tbody><tr><td rowspan="7"><a href="http://www.digigram.com/" style="color:rgb(17,85,204)" target="_blank"><img width="129" height="100" border="0" src="http://www.digigram.com/show/img1.png"></a></td></tr><tr><td colspan="5"><b>Loïc BOISSY</b></td></tr><tr><td colspan="5"><i>R&D software engineer</i><i style="font-size:12.8000001907349px"> & Project manager</i><br></td></tr><tr><td colspan="5"><span style="color:rgb(111,185,217);font-weight:bold">office:</span> <a href="tel:%2B33%20%280%294%2076%2052%2053%2016" value="+33476525316" target="_blank">+33 (0)4 76 52 53 16</a></td></tr><tr><td colspan="5"><span style="color:rgb(111,185,217);font-weight:bold">cell:</span> <a href="tel:%2B33%20%280%296%2081%2054%2063%2019" value="+33681546319" target="_blank">+33 (0)6 81 54 63 19</a></td></tr><tr><td colspan="5"><span style="color:rgb(111,185,217);font-weight:bold">fax:</span> <a href="tel:%2B33%20%280%294%2076%2052%2018%2044" value="+33476521844" target="_blank">+33 (0)4 76 52 18 44</a></td></tr><tr><td><a href="http://www.digigram.com/company/pressroom.php" style="color:rgb(17,85,204)" target="_blank"><img width="23" height="22" border="0" src="http://www.digigram.com/show/img2.png" style="vertical-align:middle"></a> <a href="https://www.facebook.com/Digigram.Official?ref=hl" style="color:rgb(17,85,204)" target="_blank"><img width="25" height="22" border="0" src="http://www.digigram.com/show/img3.png" style="vertical-align:middle"></a> <a href="https://plus.google.com/+Digigram" style="color:rgb(17,85,204)" target="_blank"><img width="24" height="22" border="0" src="http://www.digigram.com/show/img4.png" style="vertical-align:middle"></a> <a href="https://www.linkedin.com/company/digigram" style="color:rgb(17,85,204)" target="_blank"><img width="25" height="25" border="0" src="http://www.digigram.com/show/img5.png" style="vertical-align:middle"></a> <a href="https://twitter.com/digigram" style="color:rgb(17,85,204)" target="_blank"><img width="24" height="26" border="0" src="http://www.digigram.com/show/img6.png" style="vertical-align:middle"></a></td></tr></tbody></table></div></div></div></div></div></div></div></div></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 color="#545454" face="arial, sans-serif"><span style="line-height:18.2000007629395px">Register <a 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>