Branch Coverage

blib/lib/Net/SIP/Simple/Call.pm
Criterion Covered Total %
branch 90 146 61.6


line true false branch
84 35 16 unless ref $ctx
98 13 38 if (my $cb = delete $param->{'cb_cleanup'})
116 43 0 if (my $ctx = delete $self->{'ctx'})
165 0 0 wantarray ? :
184 34 2 unless defined $clear_sdp
185 2 34 if ($clear_sdp)
189 29 7 if %args
193 35 1 unless ($leg)
201 36 0 unless ($param->{'sdp_on_ack'})
211 7 98 if ($errno)
212 1 6 if (not $code or $code != 487) { }
213 1 0 $code ? :
223 4 94 if $packet->is_request
228 66 28 if ($code =~ /^1\d\d/) { }
0 28 elsif (not $code =~ /^2\d\d/) { }
243 0 28 unless ($self->_setup_peer_rtp_socks($packet))
247 0 28 if ($param->{'sdp_on_ack'} and $ack)
262 0 36 $param->{'sip_header'} ? :
265 27 9 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 48 if (not $packet) { }
48 0 elsif ($packet->is_request) { }
517 16 32 if ($method eq 'BYE' or $method eq 'CANCEL') { }
32 0 elsif ($method eq 'ACK' or $method eq 'INVITE') { }
0 0 elsif ($method eq 'OPTIONS') { }
0 0 elsif ($method eq 'NOTIFY') { }
526 16 16 if (my $sdp_peer = eval { do { $packet->sdp_body } }) { }
0 16 elsif ($@) { }
535 16 16 if ($method eq 'INVITE') { }
16 0 elsif ($method eq 'ACK') { }
537 0 16 if ($param->{'clear_sdp'})
548 16 0 unless $resp and UNIVERSAL::isa($resp, 'Net::SIP::Packet')
591 28 16 if (UNIVERSAL::isa($data, 'Net::SIP::Packet')) { }
592 0 28 unless ($sdp_peer = $data->sdp_body)
604 0 31 if ($ls and @$ls and @media != @$ls)
615 1 43 if (not $m->{'port'} or $paddr eq '0.0.0.0' or $paddr eq '::') { }
621 0 43 @socks == 1 ? :
623 9 34 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 35 @media_dtmfxtract ? :
663 0 52 if ($sdp and not UNIVERSAL::isa($sdp, 'Net::SIP::SDP'))
668 48 4 unless ($sdp)
675 13 35 if (my $sdp_peer = $param->{'sdp_peer'}) { }
677 0 13 if ($m->{'proto'} ne 'RTP/AVP')
682 13 0 if ($m->{'media'} eq 'audio')
685 0 13 if $rp->[3]
704 0 35 if $rp->[3]
705 0 35 $rp->[3] && $rp->[0] == 101 ? :
718 0 48 unless my($port, @socks) = create_rtp_sockets($laddr, $m->{'range'})
719 0 48 @socks == 1 ? :
729 0 52 unless ($param->{'media_lsocks'})
736 0 52 if (not $param->{'media_ssocks'} and $param->{'asymetric_rtp'})
744 0 0 if (UNIVERSAL::isa($m, 'ARRAY')) { }
757 0 52 if ($call_on_hold)