Branch Coverage

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


line true false branch
67 38 103 if $tls
69 38 103 $proto && $proto eq 'tls' ? :
74 4 137 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 141 if ($dst and not ref $dst)
95 0 0 unless $family
106 0 141 if $sock and $socketpool
110 3 138 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 56 43 $sock->socktype == 2 ? :
162 137 1 unless ($self->{'src'})
163 0 137 unless my $saddr = getsockname $sock
166 0 137 if $host
168 0 138 if (not $dst and my $saddr = getpeername $sock)
194 0 141 if %args
208 123 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 115 74 if ($isrq)
396 58 131 if ($method eq 'INVITE' and $isrq || $code =~ /^2/) { }
1 187 elsif (not $isrq and $code == 405 || $method eq 'OPTIONS' && $code =~ /^2/) { }
403 58 131 if ($need_contact and not my(@a) = $packet->get_header('contact'))
405 42 16 $isrq ? :
410 58 0 $user =~ /([^<>\@\s]+)\@/ ? :
412 46 12 unless $contact =~ /^\w+:/
413 0 58 if $contact =~ /;/
416 59 130 if ($need_allow and not my(@a) = $packet->get_header('allow'))
420 59 130 if ($need_supported and not my(@a) = $packet->get_header('supported'))
426 0 189 if exists $dst->{'proto'} and $dst->{'proto'} ne $self->{'proto'}
427 0 0 $self->{'proto'} eq 'tls' ? :
431 0 189 if $Net::SIP::Leg::DEBUG
452 0 188 if $self->{'socketpool'}->sendto($packet, $dst, $callback)
473 0 204 if $Net::SIP::Leg::DEBUG
520 265 0 if $level > 1
521 128 137 if ($level > 2)
528 0 0 if exists $param->{$_}
533 8 120 if (my $via = ($packet->get_header('via'))[0])
559 191 0 if (@_ > 1) { }
563 0 0 $spec{'family'} ? :
567 81 110 if $spec{'proto'} and $spec{'proto'} ne $self->{'proto'}
569 0 110 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 52 1 unless $parts
621 0 1 $self->{'proto'} eq 'tls' ? :
0 0 $parts == 2 ? :
1 0 $parts == 1 ? :