Branch Coverage

blib/lib/Asterisk/AMI.pm
Criterion Covered Total %
branch 0 218 0.0


line true false branch
641 0 0 if ($self->_configure(%values) and $self->_connect)
654 0 0 if ($hdl->{'rbuf'} =~ s/^(.+)(?:\015\012\015\012)//osx)
706 0 0 if (not exists $config_options{$opt}) { }
0 0 elsif (not defined $val) { }
707 0 0 if warnings::enabled('Asterisk::AMI')
715 0 0 if (ref $val ne $config_options{$opt}) { }
0 0 elsif ($opt eq 'HANDLERS') { }
718 0 0 if ($config_options{$opt} eq 'CODE') { }
0 0 elsif ($config_options{$opt} eq 'HASH') { }
719 0 0 if warnings::enabled('Asterisk::AMI')
722 0 0 if warnings::enabled('Asterisk::AMI')
727 0 0 if ($config_options{$opt} eq 'bool') { }
0 0 elsif ($config_options{$opt} eq 'num') { }
728 0 0 if ($val =~ /[^\d]/x or $val != 0 and $val != 1)
729 0 0 if warnings::enabled('Asterisk::AMI')
734 0 0 if ($val =~ /[^\d]/x)
735 0 0 if warnings::enabled('Asterisk::AMI')
744 0 0 if (not @match) { }
745 0 0 if warnings::enabled('Asterisk::AMI')
756 0 0 if (ref $handler ne 'CODE')
757 0 0 if warnings::enabled('Asterisk::AMI')
769 0 0 unless (exists $self->{'CONFIG'}{$req})
770 0 0 if warnings::enabled('Asterisk::AMI')
776 0 0 if ($self->{'CONFIG'}{'USESSL'})
782 0 0 unless (defined $self->{'CONFIG'}{$opt})
788 0 0 if ($self->{'CONFIG'}{'ORIGINATEHACK'})
790 0 0 if (lc $self->{'CONFIG'}{'EVENTS'} eq 'off') { }
0 0 elsif (not lc($self->{'CONFIG'}{'EVENTS'}) =~ /on|call/x) { }
794 0 0 unless $self->{'CONFIG'}{'HANDLERS'}
809 0 0 if $self->{'CONFIG'}{'KEEPALIVE'}
825 0 0 if (exists $self->{'CONFIG'}{'ON_CONNECT_ERR'}) { }
0 0 elsif (exists $self->{'CONFIG'}{'ON_ERROR'}) { }
849 0 0 if exists $self->{'CONFIG'}{'ON_ERROR'}
870 0 0 if (exists $self->{'CONFIG'}{'ON_DISCONNECT'}) { }
0 0 elsif (exists $self->{'CONFIG'}{'ON_ERROR'}) { }
889 0 0 if (exists $self->{'CONFIG'}{'ON_TIMEOUT'}) { }
0 0 elsif (exists $self->{'CONFIG'}{'ON_ERROR'}) { }
905 0 0 if ($line =~ m[^Asterisk\ Call\ Manager/([0-9]\.[0-9])$]ox) { }
934 0 0 if $self->{'CONFIG'}{'USESSL'}
936 0 0 if $self->{'CONFIG'}{'TCP_KEEPALIVE'}
942 0 0 if $self->{'CONFIG'}{'BLOCKING'}
948 0 0 if defined $self->{'handle'}
961 0 0 if ($line =~ s/--END\ COMMAND--$//ox) { }
975 0 0 if (exists $parsed{'ActionID'}) { }
0 0 elsif (exists $parsed{'Event'}) { }
991 0 0 if (defined $self->{'RESPONSEBUFFER'}{$actionid}{'Response'} and $self->{'RESPONSEBUFFER'}{$actionid}{'Response'} =~ /^(?:Success|Follows|Goodbye|Events Off|Pong)$/ox)
997 0 0 if (defined $self->{'CALLBACKS'}{$actionid}{'cb'})
1024 0 0 unless $self->{'EXPECTED'}{$actionid}
1027 0 0 if (exists $packet->{'Event'}) { }
0 0 elsif (exists $packet->{'Response'}) { }
1029 0 0 if ($packet->{'Event'} =~ /[cC]omplete/ox) { }
1033 0 0 if ($packet->{'Event'} eq 'DBGetResponse' or $packet->{'Event'} eq 'OriginateResponse')
1043 0 0 if ($packet->{'Response'} ne 'Follows')
1045 0 0 unless ($self->{'RESPONSEBUFFER'}{$actionid}{'ASYNC'} or exists $packet->{'Message'} and $packet->{'Message'} =~ /[fF]ollow/ox)
1053 0 0 if ($_ =~ /^(?:Response|Message|ActionID|Privilege|CMD|COMPLETED)$/ox) { }
1061 0 0 if ($self->{'RESPONSEBUFFER'}{$actionid}{'COMPLETED'})
1077 0 0 if ($self->{'CONFIG'}{'HANDLERS'}) { }
1078 0 0 if (exists $self->{'CONFIG'}{'HANDLERS'}{$event->{'Event'}}) { }
0 0 elsif (exists $self->{'CONFIG'}{'HANDLERS'}{'default'}) { }
1085 0 0 if (exists $self->{'CALLBACKS'}{'EVENT'}) { }
1103 0 0 if ($self->{'RESPONSEBUFFER'}{$id}{'COMPLETED'})
1115 0 0 unless defined $timeout
1120 0 0 if ($timeout)
1152 0 0 if ($key eq 'CALLBACK') { }
0 0 elsif ($key eq 'TIMEOUT') { }
0 0 elsif ($lkey eq 'async' and $value == 1) { }
0 0 elsif ($lkey eq 'actionid') { }
1153 0 0 if warnings::enabled('Asterisk::AMI')
1156 0 0 unless defined $callback
1160 0 0 if warnings::enabled('Asterisk::AMI')
1163 0 0 unless defined $timeout
1170 0 0 if warnings::enabled('Asterisk::AMI')
1175 0 0 if (ref $value eq 'ARRAY') { }
1195 0 0 unless $self->{'handle'}
1198 0 0 if ($self->{'idseq'} > $self->{'CONFIG'}{'BUFFERSIZE'})
1215 0 0 unless defined $callback
1216 0 0 unless defined $timeout
1218 0 0 if ($self->{'LOGGEDIN'} or lc($actionhash->{'Action'}) =~ /login|challenge/x) { }
1232 0 0 unless defined $timeout
1235 0 0 if (defined $callback)
1243 0 0 if ($timeout and defined $self->{'CALLBACKS'}{$id})
1266 0 0 unless defined $actionid
1270 0 0 if ($resp->{'COMPLETED'})
1283 0 0 unless defined $actionid
1288 0 0 if ($resp->{'COMPLETED'})
1301 0 0 if (defined $actionid)
1316 0 0 if (defined $actionid)
1318 0 0 if ($resp->{'COMPLETED'})
1347 0 0 unless $self->{'CONFIG'}{'TIMEOUT'}
1355 0 0 if (lc $self->{'CONFIG'}{'AUTHTYPE'} eq 'md5') { }
1364 0 0 if ($self->{'CONFIG'}{'BLOCKING'}) { }
1377 0 0 if ($login->{'GOOD'}) { }
1381 0 0 if $self->{'CONFIG'}{'ON_CONNECT'}
1393 0 0 if ($login->{'COMPLETED'}) { }
1412 0 0 if (%{$challenge;}) { }
1417 0 0 if ($chresp->{'GOOD'}) { }
1427 0 0 if ($chresp->{'COMPLETED'}) { }
1454 0 0 if (%{$challenge;}) { }
1457 0 0 if ($_[1]{'GOOD'}) { }
1471 0 0 if ($_[1]{'COMPLETED'}) { }
1506 0 0 unless defined $timeout
1508 0 0 unless (defined $self->{'EVENTBUFFER'}[0])
1515 0 0 unless defined $timeout
1517 0 0 if ($timeout)
1541 0 0 if ($self and $self->simple_action({'Action', 'Ping'}, $timeout))
1560 0 0 unless ($_[1]{'GOOD'})
1608 0 0 if (defined $_[0]{'tmp_loop'})
1618 0 0 if (not $self->{'SOCKERR'} and $self->{'LOGGEDIN'})
1624 0 0 if ($self->{'handle'})