[SR-Users] JSONRPC commands
Daniel-Constantin Mierla
miconda at gmail.com
Wed Sep 23 16:00:57 CEST 2015
Forgot to say that you need to listen on tcp for getting http requests
on sip port.
Daniel
On 23/09/15 15:46, Daniel-Constantin Mierla wrote:
> Ctl module is listening for a custom binary protocol, not for jsonrpc
> over http.
>
> You need to load xhttp module as well, see the config example at:
>
> http://kamailio.org/docs/modules/4.3.x/modules/jsonrpc-s.html#jsonrpc-s.f.jsonrpc_dispatch
>
> Be sure you have also the tcp_accept_no_cl parameter.
>
> Daniel
>
> On 23/09/15 13:15, Loïc Boissy wrote:
>> Yes, ctl module is listening on port 80 and i send the request on the
>> same port.
>> SIP port is 5060.
>>
>> I am not sure to well understand.
>> 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).
>>
>> best regards.
>> Loic
>>
>>
>>
>> 2015-09-23 12:07 GMT+02:00 Daniel-Constantin Mierla <miconda at gmail.com>:
>>
>> 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.
>>
>> Cheers,
>> Daniel
>>
>>
>> On 23/09/15 12:00, Loïc Boissy wrote:
>>> Yes, when i send my request i can see (debug is set to 3):
>>> 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
>>> 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 *
>>> 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
>>> and that's all...
>>>
>>> Yes, there are double quotes in my command. But for me it is
>>> correct, when i check the frame using wireshark, i see
>>> {"id": 1, "jsonrpc": "2.0", "method": "ul.dump"}
>>> ....
>>>
>>> Thank
>>> Loic
>>>
>>>
>>>
>>> 2015-09-23 11:50 GMT+02:00 Daniel-Constantin Mierla
>>> <miconda at gmail.com <mailto:miconda at gmail.com>>:
>>>
>>> Hello,
>>>
>>> can you look at network traffic (e.g., ngrep) or start
>>> kamailio with debug=3 in kamailio.cfg?
>>>
>>> You should see what is processed.
>>>
>>> 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.
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> On 23/09/15 11:46, Loïc Boissy wrote:
>>>> Hello
>>>>
>>>> I am trying to use JSONRPC-S Kamailio module to request for
>>>> example the content of the location table. More generally,
>>>> i would like to send RPC commands to my kamailio server
>>>> using http request.
>>>> For the moment, kamailio server always returns "400 bad
>>>> request: corrupted packet".
>>>>
>>>> To send my request, i use curl. For example:
>>>>
>>>> curl --header 'Content-Type: application/json'
>>>> --data-binary "{"id": 1, "jsonrpc": "2.0", "method":
>>>> "ul.dump" }" http://XXX.XXX.XXX.XXX/RPC/
>>>>
>>>> Is there specific syntax to respect?
>>>> Kamailio server version is 4.3.2.
>>>>
>>>> Thank you in advance.
>>>> Loic BOISSY
>>>>
>>>>
>>>> Visit Digigram at IBC2015 at Stand
>>>> 8.C51, Sept. 11-15 in Amsterdam
>>>> Register here <http://www.ibc.org/page.cfm/link=478> for
>>>> your *FREE* pass with Digigram's Exhibitor Customer Code *4462*
>>>>
>>>>
>>>> _______________________________________________
>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>> sr-users at lists.sip-router.org
>>>> <mailto:sr-users at lists.sip-router.org>
>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>> --
>>> Daniel-Constantin Mierla
>>> http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> - http://www.linkedin.com/in/miconda
>>> Book: SIP Routing With Kamailio - http://www.asipto.com
>>> Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - http://asipto.com/u/kat
>>>
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
>>> mailing list
>>> sr-users at lists.sip-router.org
>>> <mailto:sr-users at lists.sip-router.org>
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-user
>>> <http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users>
>>>
>> --
>> Daniel-Constantin Mierla
>> http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> - http://www.linkedin.com/in/miconda
>> Book: SIP Routing With Kamailio - http://www.asipto.com
>> Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - http://asipto.com/u/kat
>>
>>
>> Visit Digigram at IBC2015 at Stand 8.C51, Sept. 11-15 in Amsterdam
>> Register here <http://www.ibc.org/page.cfm/link=478> for
>> your *FREE* pass with Digigram's Exhibitor Customer Code *4462*
>
> --
> Daniel-Constantin Mierla
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Book: SIP Routing With Kamailio - http://www.asipto.com
> Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - http://asipto.com/u/kat
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - http://asipto.com/u/kat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150923/1332abb0/attachment.html>
More information about the sr-users
mailing list