Branch Coverage

blib/lib/Net/SIP/Simple/Call.pm
Criterion Covered Total %
branch 91 146 62.3


line true false branch
84 35 18 unless ref $ctx
98 13 40 if (my $cb = delete $param->{'cb_cleanup'})
116 45 0 if (my $ctx = delete $self->{'ctx'})
165 0 0 wantarray ? :
184 34 4 unless defined $clear_sdp
185 4 34 if ($clear_sdp)
189 31 7 if %args
193 35 3 unless ($leg)
201 38 0 unless ($param->{'sdp_on_ack'})
211 7 101 if ($errno)
212 1 6 if (not $code or $code != 487) { }
213 1 0 $code ? :
223 6 95 if $packet->is_request
228 65 30 if ($code =~ /^1\d\d/) { }
0 30 elsif (not $code =~ /^2\d\d/) { }
243 0 30 unless ($self->_setup_peer_rtp_socks($packet))
247 0 30 if ($param->{'sdp_on_ack'} and $ack)
262 0 38 $param->{'sip_header'} ? :
265 27 11 if ($param->{'cb_final'} == \$stopvar)
270 0 27 if ($param->{'ring_time'}) { }
280 0 0 if ($code =~ /^2\d\d/)
292 0 0 unless ($stopvar)
333 0 6 if ($code and $code =~ /^1\d\d/)
373 0 27 if ($code and $code =~ /^1\d\d/)
409 0 0 if ($code and $code =~ /^1\d\d/)
413 0 0 $error ? :
451 6 6 if ($m eq 'rfc2833') { }
6 0 elsif ($m eq 'audio') { }
461 12 0 if defined $type
463 0 12 unless %payload_type
468 48 0 if (/[\dA-D*#]/) { }
469 36 12 if (defined $lastev)
471 0 36 $lastev eq $_ ? :
488 0 12 if (my $cb_final = $args{'cb_final'}) { }
511 0 54 if (not $packet) { }
54 0 elsif ($packet->is_request) { }
517 18 36 if ($method eq 'BYE' or $method eq 'CANCEL') { }
36 0 elsif ($method eq 'ACK' or $method eq 'INVITE') { }
0 0 elsif ($method eq 'OPTIONS') { }
0 0 elsif ($method eq 'NOTIFY') { }
526 18 18 if (my $sdp_peer = eval { do { $packet->sdp_body } }) { }
0 18 elsif ($@) { }
535 18 18 if ($method eq 'INVITE') { }
18 0 elsif ($method eq 'ACK') { }
537 0 18 if ($param->{'clear_sdp'})
548 18 0 unless $resp and UNIVERSAL::isa($resp, 'Net::SIP::Packet')
591 30 18 if (UNIVERSAL::isa($data, 'Net::SIP::Packet')) { }
592 0 30 unless ($sdp_peer = $data->sdp_body)
604 0 33 if ($ls and @$ls and @media != @$ls)
615 1 47 if (not $m->{'port'} or $paddr eq '0.0.0.0' or $paddr eq '::') { }
621 0 47 @socks == 1 ? :
623 9 38 if ($m->{'media'} eq 'audio' and $param->{'cb_dtmf'})
628 0 18 unless my $type = $mt{$_}
631 9 9 if $_ eq 'audio'
634 9 18 unless $l->[0] eq 'a'
635 9 9 unless my($type, $name) = $l->[1] =~ /^rtpmap:(\d+)\s+(\S+)/
636 0 9 unless my $pname = $rmap{$name}
639 9 0 if %pargs
644 9 39 @media_dtmfxtract ? :
663 0 56 if ($sdp and not UNIVERSAL::isa($sdp, 'Net::SIP::SDP'))
668 52 4 unless ($sdp)
675 15 37 if (my $sdp_peer = $param->{'sdp_peer'}) { }
677 0 15 if ($m->{'proto'} ne 'RTP/AVP')
682 15 0 if ($m->{'media'} eq 'audio')
685 0 15 if $rp->[3]
704 0 37 if $rp->[3]
705 0 37 $rp->[3] && $rp->[0] == 101 ? :
718 0 52 unless my($port, @socks) = create_rtp_sockets($laddr, $m->{'range'})
719 0 52 @socks == 1 ? :
729 0 56 unless ($param->{'media_lsocks'})
736 0 56 if (not $param->{'media_ssocks'} and $param->{'asymetric_rtp'})
744 0 0 if (UNIVERSAL::isa($m, 'ARRAY')) { }
757 1 55 if ($call_on_hold)