handle actions diferent to Command with Asterisk::AMI
- by rkmax
I'm learning Asterisk :: AMI, but all examples deal with the action Command.
i've tryed to run the following action (no success)
my $action = $astman->action({
    Action => "Agents"
});
i have the following sub for print response work fine for Action => 'Command' if i try other thing diferent i dont get response in CMD, how i can get response from others Actions?
sub print_response {
    my $action = shift;
    print "\nResponse:  ", $action->{'Response'};
    print "\nMessage:  ", $action->{'Message'};
    print "\nActionID:  ", $action->{'ActionID'};
    if(defined $action->{'CMD'}) {
        print "\nCMD:       ", scalar(@{$action->{'CMD'}});
        print "\n-------------------------------------------\n";
        foreach (@{$action->{'CMD'}}) {
            print $_, "\n";
        }
        print "\n-------------------------------------------\n";
    }
    print "\nCompleted: ", $action->{'COMPLETED'};
    print "\nGood:      ", $action->{'GOOD'};
}