Branch Coverage

blib/lib/Net/SIP/Endpoint/Context.pm
Criterion Covered Total %
branch 65 104 62.5


line true false branch
64 0 53 @_ == 1 ? :
73 18 35 $self->{'incoming'} ? :
75 0 53 if (my $tag = $param->{'tag'}) { }
114 0 0 $self->{'incoming'} ? :
133 0 6 unless my(@trans) = @{$self->{'_transactions'};}
134 0 6 if (my $pkt = $filter{'request'})
135 0 0 unless @trans = grep({$pkt == $_->{'request'};} @trans)
137 6 0 if (my $method = $filter{'method'})
138 0 6 unless @trans = grep({$method eq $_->{'request'}->method;} @trans)
160 48 65 if (ref $method) { }
176 2 63 $self->{'incoming'} ? :
177 65 0 unless ($uri)
181 8 57 if $uri =~ /<(\S+)>$/
196 0 65 $self->{'contact'} ? :
204 0 113 if $self->{'route'}
206 0 0 if ($rsp40x and $self->{'auth'} and $request->authorize($rsp40x, $self->{'auth'}))
251 45 0 unless $error
256 0 0 if ($tr->{'tid'} eq $tid) { }
258 0 0 if (my $cb = $tr->{'callback'})
292 138 56 if (not $tr and $t->{'tid'} eq $tid and $method eq $t->{'request'}->method) { }
298 1 138 unless ($tr)
310 0 138 unless ($leg->check_via($response))
324 9 129 if ($method eq 'INVITE' and $code >= 300)
332 65 73 if ($code =~ /^1\d\d/)
337 65 0 if ($method eq 'INVITE')
344 3 70 if ($code == 401 or $code == 407)
347 3 0 if ($auth and $r->authorize($response, $auth)) { }
367 33 37 if ($method eq 'CANCEL' or $method eq 'BYE')
372 27 6 if $method eq 'BYE'
377 0 0 if ($self->{'method'} ne 'INVITE' and $code >= 200 && $code < 300 || $code >= 400)
382 30 7 if ($code =~ /^2\d\d/) { }
0 7 elsif ($code == 300 or $code == 301) { }
0 7 elsif ($code == 302) { }
0 7 elsif ($code == 305) { }
385 30 0 if ($method eq 'INVITE') { }
393 0 30 if (not $self->{'remote_contact'} and my(@route) = $response->get_header('record-route'))
400 30 0 if (my $contact = $response->get_header('contact'))
401 0 30 if $contact =~ /<(\w+:[^>\s]+)>/
411 28 2 unless $self->{'incoming'}
437 0 0 if $contact =~ /<(\w+:[^>\s]+)>/
478 37 20 defined $self->{'_cseq_incoming'} ? :
479 0 57 if (defined $self->{'_cseq_incoming'} and $cseq_num < $self->{'_cseq_incoming'})
488 37 20 if (my $trans = $self->{'_last_transreq'}) { }
490 0 37 if ($last_cseq eq $cseq)
501 21 36 if ($method eq 'ACK' or $method eq 'CANCEL') { }
503 0 21 if (defined $self->{'_cseq_incoming'} and $cseq_num != $self->{'_cseq_incoming'})
510 0 36 if (defined $self->{'_cseq_incoming'} and $cseq_num == $self->{'_cseq_incoming'})
526 0 20 if ($ctx_is_new and $method eq 'INVITE' and my(@route) = $request->get_header('record-route'))
536 21 36 unless ($param->{'tag'})
544 18 39 if ($method eq 'BYE' or $method eq 'CANCEL')
553 3 15 if ($method eq 'CANCEL')
567 21 18 if ($method eq 'INVITE')