Subject: | Deep recursion on subroutine |
If the connection with the asterisk is dropped, the module consumes all
available memory, an error:
Deep recursion on subroutine "Asterisk::AMI::_on_error" at
/usr/lib64/perl5/site_perl/5.12.2/Asterisk/AMI.pm line 925.
Deep recursion on subroutine "Asterisk::AMI:estroy" at
/usr/lib64/perl5/site_perl/5.12.2/Asterisk/AMI.pm line 847.
Deep recursion on subroutine "Asterisk::AMI:ESTROY" at
/usr/lib64/perl5/site_perl/5.12.2/Asterisk/AMI.pm line 1587.
Deep recursion on subroutine "Asterisk::AMI::send_action" at
/usr/lib64/perl5/site_perl/5.12.2/Asterisk/AMI.pm line 1605.
Deep recursion on subroutine "AnyEvent::Handle:ush_write" at
/usr/lib64/perl5/site_perl/5.12.2/Asterisk/AMI.pm line 1215.
this can be corrected if the sub DESTROY change
#Logoff
if ($self->{LOGGEDIN}) {
$self->send_action({ Action => 'Logoff' });
undef $self->{LOGGEDIN};
}
on
#Logoff
if ($self->{LOGGEDIN}) {
undef $self->{LOGGEDIN};
$self->send_action({ Action => 'Logoff' });
}
that is, free $self->{LOGGEDIN} before calling the subroutine $self-
Show quoted text
>send_action, otherwise the program loops and leads to crash the server