echo '{"id": "1", "jsonrpc": "2.0", "method": "core.psx" }' > /dev/udp/127.0.0.1/8090
Oct 8 11:20:47 devsrv devsrv[11468]: DEBUG: jsonrpcs [jsonrpcs_sock.c:608]: jsonrpc_dgram_server(): received {"jsonrpc": "2.0", "method": "core.ps", "id": 1}
Oct 8 11:20:47 devsrv devsrv[11468]: DEBUG: jsonrpcs [jsonrpcs_sock.c:620]: jsonrpc_dgram_server(): buf is {"jsonrpc": "2.0", "method": "core.ps", "id": 1}#012 and we have received 48 bytes
Oct 8 11:20:47 devsrv devsrv[11468]: DEBUG: jsonrpcs [jsonrpcs_sock.c:629]: jsonrpc_dgram_server(): command executed - result: [200] [0x18b5430] [{#012#011"jsonrpc":#011"2.0",#012#011"result":#011[11432, "main process - attendant", 11434, "udp receiver child=0 sock=127.0.0.1:5060", 11435, "udp receiver child=1 sock=127.0.0.1:5060", 11436, "udp receiver child=0 sock=172.16.50.231:5060", 11437, "udp receiver child=1 sock=172.16.50.231:5060", 11438, "udp receiver child=2 sock=172.16.50.231:5060", 11439, "udp receiver child=3 sock=172.16.50.231:5060", 11440, "udp receiver child=4 sock=172.16.50.231:5060", 11441, "udp receiver child=5 sock=172.16.50.231:5060", 11442, "udp receiver child=6 sock=172.16.50.231:5060", 11443, "udp receiver child=7 sock=172.16.50.231:5060", 11444, "udp receiver child=0 sock=192.168.0.10:5060", 11445, "udp receiver child=1sock=192.168.0.10:5060", 11446, "udp receiver child=2 sock=192.168.0.10:5060", 11447, "udp receiver child=3 sock=192.168.0.10:5060", 11448, "udp receiver child=4 sock=192.168.0.10:5060", 11449, "udp receiver child=5 sock=192.168.0.10:5060", 11450, "udp receiver child=6 sock=192.168.0.10:5060", 11451, "udp receiver child=7 sock=192.168.0.10:5060", 11452, "udp receiver child=0 sock=192.168.0.10:5090", 11453, "udp receiver child=1 sock=192.168.0.10:5090", 11454, "udp receiver child=2 sock=192.168.0.10:5090", 11455, "udp receiver child=3 sock=192.168.0.10:5090", 11456, "udp receiver child=4 sock=192.168.0.10:5090", 11457, "udp receiver child=5 sock=192.168.0.10:5090", 11458, "udp receiver child=6 sock=192.168.0.10:5090", 11459, "udp receiver child=7 sock=192.168.0.10:5090", 11460, "slow timer", 11461, "timer", 11462, "secondary timer", 11463, "Async Task Worker", 11464, "Async Task Worker", 11465, "Async Task Worker", 11466, "Async Task Worker", 11467, "JSONRPCS FIFO", 11468, "JSONRPCS DATAGRAM", 11469, "USRLOC Timer", 11470, "USRLOC Timer", 11471, "USRLOC Timer", 11472, "USRLOC Timer", 11473, "Dialog Clean Timer", 11474, "ctl handler", 11475, "TIMER UAC REG", 11476, "SNMP AgentX", 11478, "Http Async Worker", 11479, "tcp receiver (generic) child=0", 11480, "tcp receiver (generic) child=1", 11481, "tcp receiver (generic) child=2", 11482, "tcp receiver (generic) child=3", 11483, "tcp receiver (generic) child=4", 11484, "tcp receiver (generic) child=5", 11485, "tcp receiver (generic) child=6", 11486, "tcp receiver (generic) child=7", 11487, "tcp main process"],#012#011"id":#0111#012}]
echo '{"id": "1", "jsonrpc": "2.0", "method": "ul.dump" }' > /dev/udp/127.0.0.1/8090
Hello,
Your requirement to frequently dump millions of user location entries on a loaded production system sounds a bit odd to me. Maybe you can elaborate a bit on your requirements. If you have the requirement to access this data frequently, maybe getting it from the database directly is the better idea. If you want to get it from kamailio, choose a module that provides the option to configure the number of children (e.g. like dgram_workers in jsonrpcs) and set it to a sufficient number.
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com
From: sr-users <sr-users-bounces@lists.kamailio.org> On Behalf Of Ilie Soltanici
Sent: Tuesday, October 6, 2020 12:29 AM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Subject: [SR-Users] jsonrpcs - safest way to get data
Hello,
I'm trying to periodically get all registered contacts from the Kamailio memory in the json format.
JSONRPCS module have 3 different types of transport to get this data. I just wonder what will be the safest transport for the Kamailio to get all this data? Because all this data it's not so important, I want to gather it without affecting the main process or with the minimal effect on the Kamailio SIP Processing module.
1. The HTTP transport - very useful, working async, but because it depends on the xhttp module - which works synchronously I'm afraid that for big data with contacts this type of transport can affect the kamailio performance.
2. FIFO - this transport also is very fast, working locally - but it's synchronous, I'm not sure how it will affect Kamailio SIP Processing when the local database will have few millions of users registered.
3. DGRAM - also seems to be very fast, working locally or remotely through the UDP protocol, but again it's synchronous and I'm not sure that this transport is returning any output for the request, I tried - but didn't get back anything, while for changing something it worked fine. Maybe it was a misconfiguration in my config file.
What would be your recommendation for this case?
Thank you.