I was converting my Asterisk commands to the closest equivalent FreeSWITCH command so I could display the data in the FMS Pandora Console. Nothing fancy here – just totals of registrations and current call counts (and channels – a subtle difference as a channel is one leg of a call). I was after numbers of registrations but the FreeSWITCH command line interface (fs_cli) didn’t list this as an option when you did a help on the show command.
But it really does have a show registrations with a switch for the totals i.e. show registrations count only the module source code didn’t have this in its help text. I’ll log it as a trivial bug.
Here is my Pandora FMS pandora_agent.conf snippet,
module_begin module_name FSRegnsCount module_type generic_data module_exec /usr/local/freeswitch/bin/fs_cli -x "show registrations count" | awk '{if (match($0,"total")) { printf("%d",$1);}}' module_description FreeSWITCH registrations module_end
I will be adding more of thee snippets of Pandora agent configs to a special page on our web site here – http://www.openmutual.org/resources/pandora-fms-agent/
The “show” command help syntax is just a #define in /usr/local/src/freeswitch/src/mod/applications/mod_commands/mod_commands.c so easy to fix.