Asterisk-CoroManager

 view release on metacpan or  search on metacpan

lib/Asterisk/CoroManager.pm  view on Meta::CPAN

                                          secret => 'test',
                                          host   => 'localhost',
                                        });

  $astman->connect || die "Could not connect to " . $astman->host . "!\n";

  my $ping = $astman->sendcommand({ Action => 'Ping' }, { timeout => '2' });

  if( $ping ) {
      # $ping->{Response} should be 'Pong'
      print "Yay, we're alive! We got ". $ping->{Response} ."\n";
  }
  else {
      print "Got no pong in 2 seconds :-(\n";
  }

  $astman->disconnect;

=head1 DESCRIPTION

This module provides a dependable, event-based interface to the

lib/Asterisk/CoroManager.pm  view on Meta::CPAN

    return;
}


##############################################################################

=head2 check_connection

  $astman->check_connection();

Checks if the connection is still alive.  Tries to reconnect if it
isn't.

=cut

sub check_connection {
    my( $astman ) = @_;

    if( $astman->connected ) {
	$astman->debug("...connection appears to be fine...");
    }



( run in 0.931 second using v1.01-cache-2.11-cpan-df04353d9ac )