Hi,
The easiest way to communicate with the JSONRPCS module is probably to use HTTP, in the
form of the `xhttp` module:
https://kamailio.org/docs/modules/5.6.x/modules/xhttp.html
You will need...
1) To enable the HTTP transport in the `jsonrpcs` module;
2) A TCP or TLS listener (listen= config directive) to accept the traffic;
3) An xhttp `event_route[xhttp:request]` route, as detailed in that module's docs:
https://kamailio.org/docs/modules/5.6.x/modules/xhttp.html#xhttp.f.xhttp_re…
4) Probably some measure of security / authentication for #3.
The example from jsonrpc_dispatch() is perfectly sufficient to get you started:
https://kamailio.org/docs/modules/5.6.x/modules/jsonrpcs.html#jsonrpcs.f.js…
You should then be able to do things like:
# curl \
-X POST \
-d '{"jsonrpc": "2.0", "id": "abc123",
"method": "ul.dump"}' \
http://${KAMAILIO_IP}:5060/RPC <http://${kamailio_ip}:5060/RPC>
-- Alex
On Feb 24, 2023, at 12:07 PM,
sadik.oualla.mohamed(a)gmail.com wrote:
Dear Kamailio community,
I am a newbie in Kamailio and I am currently working on a project that involves
communicating with Kamailio using Python. I have been exploring the Kamailio documentation
and I have come across RPC, JSONRPCS..., which I believe can help me achieve my goal.
However, I am not sure about the steps to follow in the Kamailio configuration file to
create my own script to communicate with Kamailio using Python (the script is on an other
machine on the same LAN). I would be grateful if someone could guide me through the
process.
I have already set up Kamailio (builed it from the source code 5.5.5) and Python on my
machines and I have basic knowledge of Kamailio configuration. I just need some guidance
on how to set up the RPC module in Kamailio and how to create a Python script to
communicate with it. I found that I can use RPyC library of python.
I would appreciate any help or suggestions from the Kamailio community. Thank you in
advance for your time and assistance.
Best regards,
Wild Coder.
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave(a)lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web:
https://evaristesys.com
Tel: +1-706-510-6800 e