- package App::smsg::Command::Status;
- use 5.010;
- use strict;
- use warnings;
- use utf8;
- BEGIN {
- $App::smsg::Command::Status::AUTHORITY = 'https://dr.jones.dk/me#me';
- $App::smsg::Command::Status::VERSION = '0.001';
- }
- use App::smsg -command;
- use namespace::clean;
- use NetSDS::Kannel;
- #use Coro;
- use constant abstract => q (Check status of platform(s).);
- use constant usage_desc => '%c status %o <platform>...';
- use constant description => <<'DESCRIPTION';
- Connect to one or more platforms (Kannel, Jabber, IRC etc.) and check
- operational status.
- DESCRIPTION
- use constant opt_spec => (
- ['kannelserver=s', "the Kannel server to connect to",
- {default => 'localhost'}],
- ['kannelport=i', "the Kannel port to connect to",
- {default => 13013}],
- ['kanneluser=s', "the Kannel users to authenticate as",
- {default => 'tester'}],
- ['kannelpasswd=s', "the Kannel password to authenticate with",
- {default => 'foobar'}],
- ['kannelsmsc=s', "the Kannel SMSC to correspond with"],
- [],
- ['f|follow', "keep connection open and emit each change of state"],
- [],
- # [ 'verbose|v', "print extra stuff"],
- [ 'debug', "print debug stuff"],
- );
- sub execute {
- my ($self, $opt, $args) = @_;
- # TODO: support overriding full URL
- # TODO: use URI module to construct URL
- my $kannel = NetSDS::Kannel->new(
- sendsms_url => 'http://' . $opt->kannelserver . ':' . $opt->kannelport . '/cgi-bin/sendsms',
- sendsms_user => $opt->kanneluser,
- sendsms_passwd => $opt->kannelpasswd,
- default_smsc => $opt->kannelsmsc,
- );
- die 'FIXME: unimplemented!';
- }
- 1;
|