|
|
|
@ -11,11 +11,12 @@ my $ip;
|
|
|
|
|
my $port;
|
|
|
|
|
my $conffile = '/etc/rtpengine/rtpengine.conf';
|
|
|
|
|
my $listen;
|
|
|
|
|
my $help;
|
|
|
|
|
|
|
|
|
|
Getopt::Long::Configure('require_order');
|
|
|
|
|
|
|
|
|
|
my $optret = GetOptions(
|
|
|
|
|
'help|h' => sub { showusage(); exit 0; },
|
|
|
|
|
'help|h' => \$help,
|
|
|
|
|
'ip=s' => \$ip,
|
|
|
|
|
'port=i' => \$port,
|
|
|
|
|
'config-file=s' => \$conffile,
|
|
|
|
@ -45,9 +46,12 @@ $argumentstring = trim($argumentstring);
|
|
|
|
|
$ip //= '127.0.0.1';
|
|
|
|
|
$port //= 9900;
|
|
|
|
|
|
|
|
|
|
if (!$argumentstring || !$optret || $port <= 0 || $port > 65535) {
|
|
|
|
|
showusage();
|
|
|
|
|
exit 1;
|
|
|
|
|
if ($help || !$argumentstring || !$optret || $port <= 0 || $port > 65535) {
|
|
|
|
|
$argumentstring = 'usage';
|
|
|
|
|
|
|
|
|
|
print "\n";
|
|
|
|
|
print " rtpengine-ctl [ -ip <ipaddress>[:<port>] -port <port> ] <command>\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# create a connecting socket
|
|
|
|
@ -77,121 +81,4 @@ do {
|
|
|
|
|
|
|
|
|
|
$socket->close();
|
|
|
|
|
|
|
|
|
|
sub showusage {
|
|
|
|
|
print "\n";
|
|
|
|
|
print " rtpengine-ctl [ -ip <ipaddress>[:<port>] -port <port> ] <command>\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " Supported commands are:\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " help : generated complete list of commands\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " list <option>\n";
|
|
|
|
|
print " help : generated complete list of sub-commands\n";
|
|
|
|
|
print " numsessions : print the number of sessions\n";
|
|
|
|
|
print " maxsessions : print the number of allowed sessions\n";
|
|
|
|
|
print " maxopenfiles : print the number of allowed open files\n";
|
|
|
|
|
print " maxcpu : print maxmimum CPU usage allowed\n";
|
|
|
|
|
print " maxload : print maxmimum load average allowed\n";
|
|
|
|
|
print " maxbw : print maxmimum bandwidth usage average allowed\n";
|
|
|
|
|
print " sessions <callid> : print detail about one session\n";
|
|
|
|
|
print " sessions all : print one-liner all sessions information\n";
|
|
|
|
|
print " sessions own : print one-liner own sessions information\n";
|
|
|
|
|
print " sessions foreign : print one-liner foreign sessions information\n";
|
|
|
|
|
print " totals : print total statistics\n";
|
|
|
|
|
print " jsonstats : print total statistics in JSON format\n";
|
|
|
|
|
print " timeout : print timeout parameter\n";
|
|
|
|
|
print " silenttimeout : print silent-timeout parameter\n";
|
|
|
|
|
print " finaltimeout : print final-timeout parameter\n";
|
|
|
|
|
print " offertimeout : print offer-timeout parameter\n";
|
|
|
|
|
print " loglevels : print available log levels\n";
|
|
|
|
|
print " loglevel : print current log levels\n";
|
|
|
|
|
print " loglevel <system> : print one current log level\n";
|
|
|
|
|
print " redisallowederrors : print redis-allowed-errors parameter\n";
|
|
|
|
|
print " redisdisabletime : print redis-disable-time parameter\n";
|
|
|
|
|
print " redisconnecttimeout : print redis-connect-timeout parameter\n";
|
|
|
|
|
print " rediscmdtimeout : print redis-cmd-timeout parameter\n";
|
|
|
|
|
print " controltos : print control-tos parameter\n";
|
|
|
|
|
print " deletedelay : print delete-delay parameter\n";
|
|
|
|
|
print " interfaces : print local interface/port statistics\n";
|
|
|
|
|
print " transcoders : print transcoding statistics\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " get : get is an alias for list, same parameters apply\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " terminate <option>\n";
|
|
|
|
|
print " <callid> : session is immediately terminated\n";
|
|
|
|
|
print " all : terminates all current sessions\n";
|
|
|
|
|
print " own : terminates own current sessions\n";
|
|
|
|
|
print " foreign : terminates foreign current sessions\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " set <option>\n";
|
|
|
|
|
print " help : generated complete list of sub-commands\n";
|
|
|
|
|
print " maxsessions <int> : set the max nr of allowed sessions\n";
|
|
|
|
|
print " maxopenfiles <uint> : set the max nr of allowed open files\n";
|
|
|
|
|
print " maxcpu <float> : set maxmimum CPU usage allowed\n";
|
|
|
|
|
print " maxload <float> : set maxmimum load average allowed\n";
|
|
|
|
|
print " maxbw <uint> : set maxmimum bandwidth usage average allowed\n";
|
|
|
|
|
print " timeout <uint> : set the --timeout parameter \n";
|
|
|
|
|
print " silenttimeout <uint> : set the --silent-timeout parameter \n";
|
|
|
|
|
print " finaltimeout <uint> : set the --final-timeout parameter \n";
|
|
|
|
|
print " offertimeout <uint> : set the --offer-timeout parameter \n";
|
|
|
|
|
print " loglevel <uint> : set all log levels to new value (1-7)\n";
|
|
|
|
|
print " loglevel <sys> <uint> : set one log level to new value (1-7)\n";
|
|
|
|
|
print " redisallowederrors : set the --redis-allowed-errors parameter\n";
|
|
|
|
|
print " redisdisabletime : set the --redis-disable-time parameter\n";
|
|
|
|
|
print " redisconnecttimeout : set the --redis-connect-timeout parameter\n";
|
|
|
|
|
print " rediscmdtimeout : set the --redis-cmd-timeout parameter\n";
|
|
|
|
|
print " controltos : set the --control-tos parameter\n";
|
|
|
|
|
print " deletedelay : set the --delete-delay parameter\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " params <option>\n";
|
|
|
|
|
print " start : lists the initial values of all the configuration file parameters\n";
|
|
|
|
|
print " current : lists the present values of all the configuration file parameters\n";
|
|
|
|
|
print " diff : compares initial and present values of all the configuration file parameters and lists the updated parameters\n";
|
|
|
|
|
print " revert : reverts the values of all the configuration file parameters to their initial values\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " ksadd [ keyspace <uint>]\n";
|
|
|
|
|
print " keyspace <uint> : subscribe to 'keyspace' database\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " ksrm [ keyspace <uint>]\n";
|
|
|
|
|
print " keyspace <uint> : unsubscribe to 'keyspace' database\n";
|
|
|
|
|
print " : remove all foreign calls for that 'keyspace'\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " kslist : print all currently subscribed keyspaces\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " active : set all running sessions to 'owned'\n";
|
|
|
|
|
print " standby : set all running sessions to 'foreign'\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " debug <callid> <on/off> : set debugging flag for given call\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " media <option>\n";
|
|
|
|
|
print " list <option>\n";
|
|
|
|
|
print " files : list media files currently in memory\n";
|
|
|
|
|
print " dbs : list database media entries currently in memory\n";
|
|
|
|
|
print " caches : list database media entries currently in file cache\n";
|
|
|
|
|
print " players : list contents of player cache\n";
|
|
|
|
|
print " reload <option>\n";
|
|
|
|
|
print " file <file name> : reload one media file into memory\n";
|
|
|
|
|
print " files : reload all media files currently in memory\n";
|
|
|
|
|
print " db <index> : reload one media entry from database into memory\n";
|
|
|
|
|
print " dbs : reload all media entries from database currently in memory\n";
|
|
|
|
|
print " cache <index> : reload one database media entry into file cache\n";
|
|
|
|
|
print " caches : reload all database media entries currently in file cache\n";
|
|
|
|
|
print " add <option>\n";
|
|
|
|
|
print " file <file name> : add media file into memory\n";
|
|
|
|
|
print " db <index> : add media entry from database into memory\n";
|
|
|
|
|
print " cache <index> : add database media entry into file cache\n";
|
|
|
|
|
print " evict <option>\n";
|
|
|
|
|
print " file <file name> : remove one media file from memory\n";
|
|
|
|
|
print " files : remove all media files from memory\n";
|
|
|
|
|
print " db <index> : remove one database media entry from memory\n";
|
|
|
|
|
print " dbs : remove all database media entries from memory\n";
|
|
|
|
|
print " cache <index> : remove one database media entry from file cache\n";
|
|
|
|
|
print " caches : remove all database media entries from file cache\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
print " Return Value:\n";
|
|
|
|
|
print " 0 on success with output from server side, other values for failure.\n";
|
|
|
|
|
print "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
|
|
|
|
|