Hi,
Is there any possibilities of "on the fly" option in kamailio.cfg.
For Example:
I need to change my carrier IP address in the lcr_gw table, kamailio.cfg should takes it on the fly. Without restarting the kamailio.
Thanks & Kind Regards, Logeshwaran G
Hello,
most of the modules that load data from database have the option to reload at runtime without restart.
LCR has also such option (the command is in example):
- https://www.kamailio.org/docs/modules/stable/modules/lcr.html#idp49185860
Cheers, Daniel
On 16.08.17 07:57, Logeshwaran G wrote:
Hi,
Is there any possibilities of "on the fly" option in kamailio.cfg.
For Example:
I need to change my carrier IP address in the lcr_gw table, kamailio.cfg should takes it on the fly. Without restarting the kamailio.
Thanks & Kind Regards, Logeshwaran G
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello.
You can just change parameter in SQL table and reload changes with kamctl.
Generally, (I think) Kamailio restart is a relatively safe. Established calls don't need any SIP exchange to continue, and RTP stream flows thru another program like rtpproxy which is untouched and keeps running when you restart Kami.
16.08.2017 8:57, Logeshwaran G пишет:
Hi,
Is there any possibilities of "on the fly" option in kamailio.cfg.
For Example:
I need to change my carrier IP address in the lcr_gw table, kamailio.cfg should takes it on the fly. Without restarting the kamailio.
Sure. Thanks For your Input.
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 1:05 PM, Yu Boot yu@yu-boot.ru wrote:
Hello.
You can just change parameter in SQL table and reload changes with kamctl.
Generally, (I think) Kamailio restart is a relatively safe. Established calls don't need any SIP exchange to continue, and RTP stream flows thru another program like rtpproxy which is untouched and keeps running when you restart Kami.
16.08.2017 8:57, Logeshwaran G пишет:
Hi,
Is there any possibilities of "on the fly" option in kamailio.cfg.
For Example:
I need to change my carrier IP address in the lcr_gw table, kamailio.cfg should takes it on the fly. Without restarting the kamailio.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Is it possible to use the LCR reload command with the xmlrpc module?
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 1:14 PM, Logeshwaran G logeshwarangs@gmail.com wrote:
Sure. Thanks For your Input.
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 1:05 PM, Yu Boot yu@yu-boot.ru wrote:
Hello.
You can just change parameter in SQL table and reload changes with kamctl.
Generally, (I think) Kamailio restart is a relatively safe. Established calls don't need any SIP exchange to continue, and RTP stream flows thru another program like rtpproxy which is untouched and keeps running when you restart Kami.
16.08.2017 8:57, Logeshwaran G пишет:
Hi,
Is there any possibilities of "on the fly" option in kamailio.cfg.
For Example:
I need to change my carrier IP address in the lcr_gw table, kamailio.cfg should takes it on the fly. Without restarting the kamailio.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi,
On Wed, Aug 16, 2017 at 11:02 AM, Logeshwaran G logeshwarangs@gmail.com wrote:
Is it possible to use the LCR reload command with the xmlrpc module?
Of course. You can use xmlrpc or jsonrpc, whichever you prefer. You need the xhttp module as a dependency though.
Best Regards, Sebastian
Thanks.
But I am not have the clear cut idea of using the lcr reload command.
I have enabled the jsonrpcs loadmodule ""jsonrpc.so"
params also added modparam("jsonrpcs", "pretty_format", 1),
But Where Should I mention the "kamcmd lcr.reload"
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 2:58 PM, Sebastian Damm damm@sipgate.de wrote:
Hi,
On Wed, Aug 16, 2017 at 11:02 AM, Logeshwaran G logeshwarangs@gmail.com wrote:
Is it possible to use the LCR reload command with the xmlrpc module?
Of course. You can use xmlrpc or jsonrpc, whichever you prefer. You need the xhttp module as a dependency though.
Best Regards, Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Whether I can use the below format:
jsonrpc_exec({"jsonrpc": "2.0", "method": "lcr.reload", "id": 1}');
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 3:14 PM, Logeshwaran G logeshwarangs@gmail.com wrote:
Thanks.
But I am not have the clear cut idea of using the lcr reload command.
I have enabled the jsonrpcs loadmodule ""jsonrpc.so"
params also added modparam("jsonrpcs", "pretty_format", 1),
But Where Should I mention the "kamcmd lcr.reload"
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 2:58 PM, Sebastian Damm damm@sipgate.de wrote:
Hi,
On Wed, Aug 16, 2017 at 11:02 AM, Logeshwaran G logeshwarangs@gmail.com wrote:
Is it possible to use the LCR reload command with the xmlrpc module?
Of course. You can use xmlrpc or jsonrpc, whichever you prefer. You need the xhttp module as a dependency though.
Best Regards, Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Unless you want to trigger that after receiving some kind of "SIP control packet", you would rather add something like this in your kamailio.cfg:
event_route[xhttp:request] { if ($hu =~ "^/jsonrpc") { xlog("L_NOTICE", "Got jsonrpc request, body '$rb'\n"); jsonrpc_dispatch(); } else { xhttp_reply("500", "Internal Server Error", "text/html", "<html><body>Unsupported URL $hu</body></html>"); } return; }
Then you would use curl or a script in the language of your choice and send a request to http://kamailio_ip:kamailio_tcp_listen_port/jsonrpc with the json string in the body.
Best Regards, Sebastian
Thanks for detailed explanation.
Kindly provide me the example json key parameter for lcr.reload.
It will be much helpful
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 4:31 PM, Sebastian Damm damm@sipgate.de wrote:
Unless you want to trigger that after receiving some kind of "SIP control packet", you would rather add something like this in your kamailio.cfg:
event_route[xhttp:request] { if ($hu =~ "^/jsonrpc") { xlog("L_NOTICE", "Got jsonrpc request, body '$rb'\n"); jsonrpc_dispatch(); } else { xhttp_reply("500", "Internal Server Error", "text/html", "<html><body>Unsupported URL $hu</body></html>"); } return; }
Then you would use curl or a script in the language of your choice and send a request to http://kamailio_ip:kamailio_tcp_listen_port/jsonrpc with the json string in the body.
Best Regards, Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
I need to pass the json values through HTTP Request, (i.e Invoking through browser like postman client)
Kindly provide me the json lcr.reload key values.
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 5:05 PM, Logeshwaran G logeshwarangs@gmail.com wrote:
Thanks for detailed explanation.
Kindly provide me the example json key parameter for lcr.reload.
It will be much helpful
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 4:31 PM, Sebastian Damm damm@sipgate.de wrote:
Unless you want to trigger that after receiving some kind of "SIP control packet", you would rather add something like this in your kamailio.cfg:
event_route[xhttp:request] { if ($hu =~ "^/jsonrpc") { xlog("L_NOTICE", "Got jsonrpc request, body '$rb'\n"); jsonrpc_dispatch(); } else { xhttp_reply("500", "Internal Server Error", "text/html", "<html><body>Unsupported URL $hu</body></html>"); } return; }
Then you would use curl or a script in the language of your choice and send a request to http://kamailio_ip:kamailio_tcp_listen_port/jsonrpc with the json string in the body.
Best Regards, Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Wed, Aug 16, 2017 at 1:59 PM, Logeshwaran G logeshwarangs@gmail.com wrote:
I need to pass the json values through HTTP Request, (i.e Invoking through browser like postman client)
Kindly provide me the json lcr.reload key values.
Something like this should work:
curl -X POST --data '{"id":260,"method":"lcr.reload","jsonrpc":"2.0","params":[]}' http://$kamailio_ip:$kamailio_port/jsonrpc
BR Sebastian
I am using the below config :
event_route[xhttp:request] {
if ($hu =~ "^/RPCHIDDEN/") { //jsonrpc_dispatch(); set_reply_no_connect(); # optional dispatch_rpc(); } else { xhttp_reply("403", "OK", "text/html", "<html><body>Forbidden</body></html>"); } return; }
I have enabled : #!ifdef WITH_XMLRPC # ----- xmlrpc params ----- modparam("xmlrpc", "route", "XMLRPC"); modparam("xmlrpc", "url_match", "^/RPCHIDDEN/") #!endif
While executing kamailio.cfg the below error occured:
0(7342) ERROR: <core> [core/cfg.y:3274]: yyparse(): cfg. parser: failed to find command dispatch_rpc (params 0)
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 6:11 PM, Sebastian Damm damm@sipgate.de wrote:
On Wed, Aug 16, 2017 at 1:59 PM, Logeshwaran G logeshwarangs@gmail.com wrote:
I need to pass the json values through HTTP Request, (i.e Invoking
through
browser like postman client)
Kindly provide me the json lcr.reload key values.
Something like this should work:
curl -X POST --data '{"id":260,"method":"lcr.reload","jsonrpc":"2.0","params":[]}' http://$kamailio_ip:$kamailio_port/jsonrpc
BR Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Also If I commented the dispatch_rpc();
Kamailio is running but it dosent accepting the http request.
Please Guide me.
Thanks & Kind Regards, Logeshwaran G
On Thu, Aug 17, 2017 at 12:39 PM, Logeshwaran G logeshwarangs@gmail.com wrote:
I am using the below config :
event_route[xhttp:request] {
if ($hu =~ "^/RPCHIDDEN/") { //jsonrpc_dispatch(); set_reply_no_connect(); # optional dispatch_rpc(); } else { xhttp_reply("403", "OK", "text/html", "<html><body>Forbidden</body></html>"); } return;
}
I have enabled : #!ifdef WITH_XMLRPC # ----- xmlrpc params ----- modparam("xmlrpc", "route", "XMLRPC"); modparam("xmlrpc", "url_match", "^/RPCHIDDEN/") #!endif
While executing kamailio.cfg the below error occured:
0(7342) ERROR: <core> [core/cfg.y:3274]: yyparse(): cfg. parser: failed to find command dispatch_rpc (params 0)
Thanks & Kind Regards, Logeshwaran G
On Wed, Aug 16, 2017 at 6:11 PM, Sebastian Damm damm@sipgate.de wrote:
On Wed, Aug 16, 2017 at 1:59 PM, Logeshwaran G logeshwarangs@gmail.com wrote:
I need to pass the json values through HTTP Request, (i.e Invoking
through
browser like postman client)
Kindly provide me the json lcr.reload key values.
Something like this should work:
curl -X POST --data '{"id":260,"method":"lcr.reload","jsonrpc":"2.0","params":[]}' http://$kamailio_ip:$kamailio_port/jsonrpc
BR Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Thu, Aug 17, 2017 at 9:13 AM, Logeshwaran G logeshwarangs@gmail.com wrote:
Also If I commented the dispatch_rpc(); Kamailio is running but it dosent accepting the http request. Please Guide me.
Actually, it is all documented in the xmlrpc module. My example was for using jsonrpc, xmlrpc works a bit different.
http://www.kamailio.net/docs/modules/5.0.x/modules/xmlrpc.html
The xmlrpc module doesn't depend on the xhttp module, it works standalone. You need to specify the route name where xmlrpc requests will end up. In this route you call dispatch_rpc(), just as example 1.8 shows you: http://www.kamailio.net/docs/modules/5.0.x/modules/xmlrpc.html#idp29963340
BR Sebastian
Thanks.
Yes I am having the route config as well:
# XMLRPC routing #!ifdef WITH_XMLRPC route[XMLRPC] { # allow XMLRPC from localhost if ((method=="POST" || method=="GET") && (src_ip==127.0.0.1)) { # close connection only for xmlrpclib user agents (there is a bug in # xmlrpclib: it waits for EOF before interpreting the response). if ($hdr(User-Agent) =~ "xmlrpclib") set_reply_close(); set_reply_no_connect(); dispatch_rpc(); exit; } send_reply("403", "Forbidden"); exit; } #!endif
But I am not sure , where I have missed in the config.
Thanks & Kind Regards, Logeshwaran G
On Thu, Aug 17, 2017 at 1:05 PM, Sebastian Damm damm@sipgate.de wrote:
On Thu, Aug 17, 2017 at 9:13 AM, Logeshwaran G logeshwarangs@gmail.com wrote:
Also If I commented the dispatch_rpc(); Kamailio is running but it dosent accepting the http request. Please Guide me.
Actually, it is all documented in the xmlrpc module. My example was for using jsonrpc, xmlrpc works a bit different.
http://www.kamailio.net/docs/modules/5.0.x/modules/xmlrpc.html
The xmlrpc module doesn't depend on the xhttp module, it works standalone. You need to specify the route name where xmlrpc requests will end up. In this route you call dispatch_rpc(), just as example 1.8 shows you: http://www.kamailio.net/docs/modules/5.0.x/modules/xmlrpc. html#idp29963340
BR Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Sebastian,
I have followed your configuration: event_route[xhttp:request] { *xlog("ALERT", "Logesh \n");* if ($hu =~ "^/jsonrpc") { xlog("L_NOTICE", "Got jsonrpc request, body '$rb'\n"); jsonrpc_dispatch(); } else { xhttp_reply("500", "Internal Server Error", "text/html", "<html><body>Unsupported URL $hu</body></html>"); } return; }
and I have added one more log to make sure the http hit is coming in .
I have used the http postman as you have suggested
http://$serverip:$server_port/jsonrpc
'{"id":260,"method":"lcr.reload","jsonrpc":"2.0","params":[]}' http://$kamailio_ip:$kamailio_port/jsonrpc
Eventhough The Http hit is not coming inside, I am not sure where I need to correct the mistake.
Please guide me.
Thanks & Kind Regards, Logeshwaran G
On Thu, Aug 17, 2017 at 1:26 PM, Logeshwaran G logeshwarangs@gmail.com wrote:
Thanks.
Yes I am having the route config as well:
# XMLRPC routing #!ifdef WITH_XMLRPC route[XMLRPC] { # allow XMLRPC from localhost if ((method=="POST" || method=="GET") && (src_ip==127.0.0.1)) { # close connection only for xmlrpclib user agents (there is a bug in # xmlrpclib: it waits for EOF before interpreting the response). if ($hdr(User-Agent) =~ "xmlrpclib") set_reply_close(); set_reply_no_connect(); dispatch_rpc(); exit; } send_reply("403", "Forbidden"); exit; } #!endif
But I am not sure , where I have missed in the config.
Thanks & Kind Regards, Logeshwaran G
On Thu, Aug 17, 2017 at 1:05 PM, Sebastian Damm damm@sipgate.de wrote:
On Thu, Aug 17, 2017 at 9:13 AM, Logeshwaran G logeshwarangs@gmail.com wrote:
Also If I commented the dispatch_rpc(); Kamailio is running but it dosent accepting the http request. Please Guide me.
Actually, it is all documented in the xmlrpc module. My example was for using jsonrpc, xmlrpc works a bit different.
http://www.kamailio.net/docs/modules/5.0.x/modules/xmlrpc.html
The xmlrpc module doesn't depend on the xhttp module, it works standalone. You need to specify the route name where xmlrpc requests will end up. In this route you call dispatch_rpc(), just as example 1.8 shows you: http://www.kamailio.net/docs/m odules/5.0.x/modules/xmlrpc.html#idp29963340
BR Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
I'm afraid I have no idea what you are doing. You already had the requests coming to your Kamailio this morning when you tried using dispatch_rpc() inside your xhttp event route. You posted an error log line.
I don't know what the "http postman" is and what it does. All I know is that my example code is coming from a Kamailio in my setup where it is working.
I guess you need to use tcpdump or ngrep to see what's going on.
Sebastian
I am using postman for http hit.
I am using the below header and body:
application/json
{"jsonrpc": "2.0", "method": "dispatcher.reload", "id": 1}
Kamailio.cfg started well, but the http hit is not invoking properly?
Thanks & Kind Regards, Logeshwaran G
On Thu, Aug 17, 2017 at 8:02 PM, Sebastian Damm damm@sipgate.de wrote:
I'm afraid I have no idea what you are doing. You already had the requests coming to your Kamailio this morning when you tried using dispatch_rpc() inside your xhttp event route. You posted an error log line.
I don't know what the "http postman" is and what it does. All I know is that my example code is coming from a Kamailio in my setup where it is working.
I guess you need to use tcpdump or ngrep to see what's going on.
Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users