git-svn-id: svn://192.168.202.10@367 3d104415-ff17-0410-8863-d5cf3c621b8a

This commit is contained in:
jaywhy
2006-11-01 19:17:04 +00:00
parent 366d2fddf6
commit d24affff8d
@@ -0,0 +1,86 @@
package Astguiclient::Daemon::Dialer;
use strict;
use Astguiclient::Dialer;
use base qw/Astguiclient::Daemon Class::Accessor::Fast/;
__PACKAGE__->mk_accessors( qw/ dialer / );
=head1 NAME
Astguiclient::Daemon::Dialer - Dialer module.
=head1 DESCRIPTION
This modules creates a daemon for auto dialing.
=head2 loop
Called by daemon.
=cut
sub loop {
my $self = shift;
$self->dialer->run();
# Check dialer status.
if( $self->dialer->status() eq 'off') {
# No agents are signed in. Reset sleep timer.
$self->sleep(30);
} else {
$self->sleep(2);
}
}
=head2 init
Called by daemon in init process.
=cut
sub init {
my $self = shift;
$self->dialer( Astguiclient::Dialer->new() );
$self->SUPER::init();
}
=head2 cleanup {
Called when process is killed.
=cut
sub cleanup {
my $self = shift;
$self->dialer->cleanup();
$self->SUPER::cleanup();
}
=head1 AUTHOR
Jason Yates <jaywhy@gmail.com>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2006 Matt Florell <vicidial@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
=cut
1;