[OpenSIPS-Users] sql cacher reload via mi http

Ovidiu Sas osas at voipembedded.com
Tue Dec 29 16:27:18 EST 2020


Try to use something like:
curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc":
"2.0", "id": "14457", "method": "sql_cacher_reload", "params":
["push_subscription_cache"]}' http://127.0.0.1:43000/opensips_mi

If you want to specify a key:
curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc":
"2.0", "id": "14457", "method": "sql_cacher_reload", "params":
["push_subscription_cache", "54b2e840197c8824"]}'
http://127.0.0.1:43000/opensips_mi

Alternatively, use the opensips-cli tool and configure it to connect over http.
Read the README here:https://github.com/OpenSIPS/opensips-cli
Adjust the config file:
communication_type: http
url: http://127.0.0.1:43000/opensips_mi

Regards,
Ovidiu Sas

On Tue, Dec 29, 2020 at 8:06 AM sagar malam <sagarmalam at gmail.com> wrote:
>
> Hello All,
>
> I am trying to reload sql cacher via mi http but i am not able to get syntax right. I tried this
>
> Request
> curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"sql_cacher_reload","params":[["push_subscription_cache","54b2e840197c8824"]],"id":10}' http://127.0.0.1:43000/opensips_mi
>
> Response :
> {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params"},"id":10}
>
> and this
>
> Request :
> curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"sql_cacher_reload push_subscription_cache  54b2e840197c8824","id":10}' http://127.0.0.1:43000/opensips_mi
>
> Response :
> {"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found"},"id":10}
>
> but none is working for me.
>
> Here push_subscription_cache is id and 54b2e840197c8824 is key
>
> Please help me on this
>
> https://opensips.org/docs/modules/3.0.x/sql_cacher.html#mi_sql_cacher_reload
> --
> Thanks,
>
> Sagar
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



-- 
VoIP Embedded, Inc.
http://www.voipembedded.com



More information about the Users mailing list