Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add rpc methods with parameters #10

Open
fnurglewitz opened this issue Mar 4, 2019 · 4 comments
Open

Feature: add rpc methods with parameters #10

fnurglewitz opened this issue Mar 4, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@fnurglewitz
Copy link

Hi, would it be possible to add rpc methods which need parameters?

Adding methods without parameters is quite easy but I'm not sure how I should proceed (I suppose some changes on the binrpc library are needed)

@florentchauveau
Copy link
Owner

Hello!

Could you give me an example of RPC method with parameters so I can make some tests?

Best

@fnurglewitz
Copy link
Author

hello, here's an example:

mod.stats core shm

Thank you

@florentchauveau florentchauveau added the enhancement New feature or request label Mar 4, 2019
@vishal-yadav
Copy link

vishal-yadav commented Apr 11, 2019

Below case is in particular useful where you can scrape any specific (group) statistics listed in kamcmd stats. For example:
kamcmd stats.get_statistics <statistics_name>
kamcmd stats.get_statistics <group:>

@florentchauveau
Copy link
Owner

florentchauveau commented Aug 13, 2019

Hello guys,

The binrpc package can already handle this, command args need to be appended to the WritePacket function.

Like this:

cookie, err := binrpc.WritePacket(conn, "stats.fetch", "current_opened_connections")

Implementing this in the exporter would be trivial, we could split a command by " "(space) in the fetchBINRPC function.

However, it would be interesting to have a more dynamic list of commands I think. Or maybe we just need to implement stats.fetch all that is available since Kamailio 5.X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants