[SR-Users] Issue while using jsonrpc-s module in kamailio 4.4.

Deepen Patel deepen at lintelindia.com
Mon Apr 30 13:47:36 CEST 2018


Hi All,

I am configuring Kamailio version 4.4 with jsonrpc-s and xhttp module. My
aim is to use Kamailio commands using RPC from a remote server. I need help
to solve error. After send rpc command, I got execution error in response.

I am attaching code in kamailio.cfg file for jsonrp.

event_route[xhttp:request] {
        if(src_ip!=127.0.0.1){
                xhttp_reply("403", "Forbidden", "text/html",
                        "<html><body>Not allowed from $si</body></html>"
                );
                exit;
        }
        if ($hu =~ "^/RPC"){
                xlog("json rpc dispatch");
                # xlog($jsonrpl(method));
                jsonrpc_exec('{"jsonrpc": "2.0", "method":
"dispatcher.reload", "id": 1}');
                jsonrpc_dispatch();
                # xlog($jsonrpl(code));
                # xlog($jsonrpl(text));
                # xlog($jsonrpl(body));
                xhttp_reply("200", "OK", "text/html", "<html><body>
$jsonrpl(text), $jsonrpl(body)</body></html>");
        } else {
                xhttp_reply("200", "OK", "text/html",
            "<html><body>Wrong URL $hu</body></html>");
        }
        return;
}

Also, I am attaching logs. which could help you.



If you can dream it, we will deliver it.

<https://www.facebook.com/linteltechnologies/>
<https://www.linkedin.com/company/7045679/> <http://blog.lintel.in/>

Deepen Patel

Python Developer

A  507, Ashwamegh Elegance-2, Beside Central Mall,

Ahmedabad - 380015 Gujarat, India

P +1(281) 205-9247  M +91-898-077-3553

E deepen at lintelindia.com

Skype deepenpatel.lintel W <http://lintel.in>http://lintel.in

The science of today is Technology of tomorrow.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180430/0ff5e63c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kamailio_jsonrpc_error
Type: application/octet-stream
Size: 6998 bytes
Desc: not available
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180430/0ff5e63c/attachment.obj>


More information about the sr-users mailing list