Coder Social home page Coder Social logo

jsonrpc not working about siremis HOT 9 CLOSED

asipto avatar asipto commented on September 3, 2024
jsonrpc not working

from siremis.

Comments (9)

miconda avatar miconda commented on September 3, 2024

Can you paste here the content of your siremis/modules/sipadmin/service/siremisJRCommands.xml?

from siremis.

powerpbx avatar powerpbx commented on September 3, 2024

That file was not changed so it is whatever is currently in master branch.

<?xml version="1.0" standalone="no"?>
<PluginService Name="siremisJRCommands" Package="asipto" Class="siremisJRCommands">
    <JRConfig name="JRConfig" type="unixsock" mode="rich">
		<!-- used for type="http" -->
		<RSocket name="rsocket" address="http://127.0.0.1:5060/RPC2" timeout="3"
                 username="alice" password="wonderland"/>
		<!-- used for type="udp" -->
		<UDPLocal name="udplocal" address="127.0.0.1" port="8044" timeout="3.0"/>
		<UDPRemote name="udpremote" address="127.0.0.1" port="8033" timeout="3.0"/>
		<!-- used for type="unixsock" *** note: avoid sockets in /tmp/ if you haven't reconfigured systemd -->
		<UnixSockLocal name="unixsocklocal" address="/var/run/siremis/siremis_rpc.sock" timeout="3.0"/>
		<UnixSockRemote name="unixsockremote" address="/var/run/kamailio/kamailio_rpc.sock" timeout="3.0"/>
        <JRCommands>
			<cmd name="help" title="List RPC Commands" command="system.listMethods"/>
			<cmd name="uptime" title="Server - Uptime" command="core.uptime"/>
			<cmd name="psx" title="Server - List Processes" command="core.psx"/>
			<cmd name="getstatsall" title="Server - All Statistics" command="stats.get_statistics all"/>
			<cmd name="corexsockets" title="Server - Listen Sockets" command="corex.list_sockets"/>
			<cmd name="corexaliases" title="Server - Domain Aliases" command="corex.list_aliases"/>
			<cmd name="dslist" title="Dispatcher - List Records" command="dispatcher.list"/>
			<cmd name="dsreload" title="Dispatcher - Reload Records" command="dispatcher.reload"/>
			<cmd name="uldump" title="UsrLoc - Location Records" command="ul.dump"/>
			<cmd name="uldumpbrief" title="UsrLoc - Brief Location Records" command="ul.dump brief"/>
			<cmd name="addrlist" title="Permissions - List IP Address Records" command="permissions.addressDump"/>
			<cmd name="subnlist" title="Permissions - List IP Subnet Records" command="permissions.subnetDump"/>
			<cmd name="addrreload" title="Permissions - Reload DB Address Records" command="permissions.addressReload"/>
			<cmd name="mtlist" title="MTree - List Records" command="mtree.list"/>
			<cmd name="mtreload" title="MTree - Reload Records" command="mtree.reload"/>
			<cmd name="pdtlist" title="PDT - List Records" command="pdt.list"/>
			<cmd name="pdtreload" title="PDT - Reload Records" command="pdt.reload"/>
        </JRCommands>
    </JRConfig>
</PluginService>

from siremis.

miconda avatar miconda commented on September 3, 2024

Based on siremis config, the path for jsonrpcs socket has to be /var/run/kamailio/kamailio_rpc.sock, try to set:

modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock")

The folder /var/run/siremis/ has to be created with web server having permissions to write to it.

Also be sure that there are enough permissions for the web server and kamailio to access the the two unixsocket files.

The alternative to try is to use udp sockets.

from siremis.

powerpbx avatar powerpbx commented on September 3, 2024

Thank you,

The permission of the sock file was the problem. The solution was.

modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock")
modparam("jsonrpcs", "dgram_mode", 0666)

from siremis.

yboujraf avatar yboujraf commented on September 3, 2024

Dear,

I followed how to install siremis 5.1 with kamailio 5.3 and enabling jsonrpcs module but I still have this error message in /var/log/apache2/error.log

[Mon Nov 04 03:55:40.741085 2019] [php7:warn] [pid 772] [client 192.168.0.230:50058] PHP Warning: strstr() expects parameter 1 to be string, resource given in /var/www/siremis/openbiz/bin/ErrorHandler.php on line 158, referer: http://10.0.100.226/siremis/sipadmin/jrcmds
[Mon Nov 04 03:55:40.742481 2019] [php7:notice] [pid 772] [client 192.168.0.230:50058] socket bind failed: No such file or directory, referer: http://10.0.100.226/siremis/sipadmin/jrcmds

I added those lines in the kamailio.cfg 👍
modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock")
modparam("jsonrpcs", "dgram_mode", 0666)

but no change.

Best Regards,
Youssef

from siremis.

josefig avatar josefig commented on September 3, 2024

@yboujraf did you find any solution? I'm trying to do the same with kamailio 5.3 and didn't work on Centos 7. I have the same problem that you had.

from siremis.

yboujraf avatar yboujraf commented on September 3, 2024

@josefig

No answer from the time i poster my issue.

from siremis.

josefig avatar josefig commented on September 3, 2024

I found the solution: It seems I needed to create the folder for /var/run/siremis which described is in the siremis/modules/sipadmin/service/siremisJRCommands.xml file and give permissions to the apache server to write.
In addition, I added the following in kamailio.cfg :

modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock")
modparam("jsonrpcs", "dgram_mode", 0666)

and worked! It seems the siremis PHP code is kind of old and must be easier to add a validator (Exception handler or something) to that folder or even on the installation process create it.

from siremis.

yboujraf avatar yboujraf commented on September 3, 2024

from siremis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.