Hello Joel,

A lot of thanks !
It works indeed great 😊

Again thanks for your help


De : sr-users <[email protected]> De la part de Joel Serrano
Envoyé : jeudi 25 octobre 2018 21:57
À : Kamailio (SER) - Users Mailing List <[email protected]>
Objet : Re: [SR-Users] Fwd: Set a system variable in the request route

I just tested and it should work with jsonrpc_exec...

root@sbc02:/etc/kamailio# kamctl rpc cfg.get system shutdownmode
{
  "jsonrpc":  "2.0",
  "result": 0,
  "id": 9809
}
root@sbc02:/etc/kamailio# kamctl rpc cfg.set system shutdownmode 1
{
  "jsonrpc":  "2.0",
  "result": {
  },
  "id": 9890
}
root@sbc02:/etc/kamailio# kamctl rpc cfg.get system shutdownmode
{
  "jsonrpc":  "2.0",
  "result": 1,
  "id": 9925
}
root@sbc02:/etc/kamailio#

Try like this:

jsonrpc_exec('{"jsonrpc": "2.0","method": "cfg.set","params": ["system", 
"shutdownmode", 1],"id": 1}');

or

jsonrpc_exec('{"jsonrpc": "2.0","method": "cfg.set","params": ["system", 
"shutdownmode", "1"],"id": 1}');





On Thu, Oct 25, 2018 at 12:43 PM Nicolas Breuer 
<[email protected]<mailto:[email protected]>> wrote:
Indeed it’s a Kamailio configuration variable


Le 25 oct. 2018 à 21:39, Joel Serrano 
<[email protected]<mailto:[email protected]>> a écrit :
But wait, why are you using jsonrpc_exec for this? What you are talking about 
is a kamailio configuration parameter, not a system wide variable...

I don't know how you can change the value during runtime.

On Thu, Oct 25, 2018 at 12:25 PM Joel Serrano 
<[email protected]<mailto:[email protected]>> wrote:
Hi Nicolas,

I don't think the format of your jsonrpc_exec is correct.

Try adding an 'id' and the 'params' to your jsonrpc_exec line:

jsonrpc_exec('{"jsonrpc": "2.0","method": "cfg.set","params": 
["system.shutdownmode=1"],"id": 1}');

Haven't tried it myself.


On Thu, Oct 25, 2018 at 11:53 AM Nicolas Breuer 
<[email protected]<mailto:[email protected]>> wrote:

Nobody can helps ???


Début du message transféré :
Expéditeur: Nicolas Breuer 
<[email protected]<mailto:[email protected]>>
Date: 22 octobre 2018 à 22:15:10 UTC+2
Destinataire: "Kamailio (SER) - Users Mailing List" 
<[email protected]<mailto:[email protected]>>
Objet: Rép :⁨ [SR-Users] Set a system variable in the request route⁩
Hello,

I tried this but seems not working 😊

jsonrpc_exec('{"jsonrpc": "2.0", "method": "cfg.set", "system.shutdownmode": 
1}');



-----Message d'origine-----
De : Nicolas Breuer
Envoyé : samedi 20 octobre 2018 16:08
À : Kamailio (SER) - Users Mailing List 
<[email protected]<mailto:[email protected]>>
Objet : RE: [SR-Users] Set a system variable in the request route

I set this line into my Kamailio.cfg

system.shutdownmode = "0"

I would like to change the value into the route.


-----Message d'origine-----
De : sr-users 
<[email protected]<mailto:[email protected]>>
 De la part de Alex Balashov Envoyé : vendredi 19 octobre 2018 18:29 À : 
Kamailio (SER) - Users Mailing List 
<[email protected]<mailto:[email protected]>> Objet : Re: 
[SR-Users] Set a system variable in the request route

On Fri, Oct 19, 2018 at 03:26:11PM +0000, Nicolas Breuer wrote:


How can I change a system variable within the route ?

What do you mean by "system variable"?

--
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

_______________________________________________
Kamailio (SER) - Users Mailing List
[email protected]<mailto:[email protected]>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
[email protected]<mailto:[email protected]>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
[email protected]<mailto:[email protected]>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
[email protected]<mailto:[email protected]>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to