Branch Coverage

blib/lib/Net/SIP/Leg.pm
Criterion Covered Total %
branch 93 166 56.0


line true false branch
67 38 105 if $tls
69 38 105 $proto && $proto eq 'tls' ? :
74 4 139 if (my $addr = delete $args{'addr'})
77 4 0 unless ($family)
79 0 1 if $port and $port_a and $port != $port_a
81 0 4 if $port_a
84 0 4 unless defined $port
93 0 143 if ($dst and not ref $dst)
95 0 0 unless $family
106 0 143 if $sock and $socketpool
110 3 140 if (not $sock) { }
114 0 3 unless ($src)
116 0 0 unless $dst
117 0 0 unless my $srcip = laddr4dst($dst->{'addr'})
127 0 3 unless ip_is_v46($src->{'addr'})
133 0 3 $proto eq 'tls' ? :
135 0 3 if ($proto eq 'tcp' or $proto eq 'tls') { }
0 3 elsif ($dst) { }
147 0 3 $src->{'port'} ? :
150 3 0 if $sock = INETSOCK(%sockargs, 'LocalPort', $port)
153 0 3 unless $sock
159 58 43 $sock->socktype == 2 ? :
162 139 1 unless ($self->{'src'})
163 0 139 unless my $saddr = getsockname $sock
166 0 139 if $host
168 0 140 if (not $dst and my $saddr = getpeername $sock)
194 0 143 if %args
208 131 82 $self->{'proto'} eq 'udp' ? :
223 0 7 if ($packet->is_response) { }
228 0 0 if (not $$vref)
241 6 1 if not $maxf or $maxf > 70
243 0 7 if ($maxf <= 0)
253 0 7 if $uri =~ /^<(.*)>/
256 0 7 if ($uri eq $self->{'contact'}) { }
260 0 0 unless (@route)
266 0 0 if $uri =~ /^<(.*)>/
272 1 6 if (@route)
274 1 0 if $route =~ /^<(.*)>/
276 1 0 if (sip_uri_eq($route, $self->{'contact'}))
282 1 6 if (defined $remove_route)
285 1 1 if $$rr-- == 0
291 7 0 if $packet->method ne 'REGISTER'
313 7 0 if ($packet->is_request)
316 7 0 if (my(@via) = $packet->get_header('via'))
322 0 7 unless defined $param->{'branch'}
323 0 7 if (substr($param->{'branch'}, 0, length $branch) eq $branch)
337 7 0 if ($packet->method ne 'REGISTER')
339 0 7 unless (($rr) = $packet->get_header('record-route') and sip_uri_eq($rr, $self->{'contact'}))
346 1 6 if (my(@route) = $packet->get_header('route'))
348 1 0 if $route =~ /^<(.*)>/
350 0 1 if (sip_uri_eq($route, $self->{'contact'}))
355 0 0 if $$rr-- == 0
380 117 78 if ($isrq)
396 61 134 if ($method eq 'INVITE' and $isrq || $code =~ /^2/) { }
1 192 elsif (not $isrq and $code == 405 || $method eq 'OPTIONS' && $code =~ /^2/) { }
403 61 134 if ($need_contact and not my(@a) = $packet->get_header('contact'))
405 43 18 $isrq ? :
410 61 0 $user =~ /([^<>\@\s]+)\@/ ? :
412 45 16 unless $contact =~ /^\w+:/
413 0 61 if $contact =~ /;/
416 62 133 if ($need_allow and not my(@a) = $packet->get_header('allow'))
420 62 133 if ($need_supported and not my(@a) = $packet->get_header('supported'))
426 0 195 if exists $dst->{'proto'} and $dst->{'proto'} ne $self->{'proto'}
427 0 0 $self->{'proto'} eq 'tls' ? :
431 0 195 if $Net::SIP::Leg::DEBUG
452 0 194 if $self->{'socketpool'}->sendto($packet, $dst, $callback)
473 0 209 if $Net::SIP::Leg::DEBUG
520 268 0 if $level > 1
521 130 138 if ($level > 2)
528 0 0 if exists $param->{$_}
533 8 122 if (my $via = ($packet->get_header('via'))[0])
559 199 0 if (@_ > 1) { }
563 0 0 $spec{'family'} ? :
567 85 114 if $spec{'proto'} and $spec{'proto'} ne $self->{'proto'}
569 0 114 if $spec{'family'} and $self->{'src'} and $self->{'src'}{'family'} != $spec{'family'}
589 2 0 if $args->{'addr'} and $args->{'addr'} ne $self->{'src'}{'addr'} and $args->{'addr'} ne $self->{'src'}{'host'}
590 0 0 if $args->{'port'} and $args->{'port'} != $self->{'src'}{'port'}
591 0 0 if $args->{'proto'} and $args->{'proto'} ne $self->{'proto'}
592 0 0 if $args->{'sub'} and not invoke_callback($args->{'sub'}, $self)
618 56 1 unless $parts
621 0 1 $self->{'proto'} eq 'tls' ? :
0 0 $parts == 2 ? :
1 0 $parts == 1 ? :