| 1 | package Google::Voice::Call; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Mojo::Base -base; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||
| 8 | 1 | __PACKAGE__->attr([qw/ from to rnr_se ua /]); | |||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||
| 10 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 11 | 0 | my $self = bless {}, shift; | |||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | 0 | $self->from(shift); | |||||||||||||||||||||||||||||||
| 14 | 0 | $self->to(shift); | |||||||||||||||||||||||||||||||
| 15 | 0 | $self->rnr_se(shift); | |||||||||||||||||||||||||||||||
| 16 | 0 | $self->ua(shift); | |||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | 0 | return $self; | |||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub cancel { | ||||||||||||||||||||||||||||||
|
Subroutine
cancel: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||
| 22 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 23 | 0 | my ($from, $to) = @_; | |||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||
| 25 | 0 | my $json = $self->ua->post( | |||||||||||||||||||||||||||||||
| 26 | 'https://www.google.com/voice/call/cancel/' => form => { | ||||||||||||||||||||||||||||||||
| 27 | forwardingNumber => undef, | ||||||||||||||||||||||||||||||||
| 28 | outgoingNumber => undef, | ||||||||||||||||||||||||||||||||
| 29 | cancelType => 'C2C', | ||||||||||||||||||||||||||||||||
| 30 | _rnr_se => $self->rnr_se | ||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||
| 32 | )->res->json; | ||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | $@ = $json->{data}->{code} and return unless $json->{ok}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/5
$json->{'ok'} || ($@ = $json->{'data'}{'code'}) && (return)
$@ = $json->{"data"}{"code"} and return
MC/DC0%0/2
$json->{'ok'} || ($@ = $json->{'data'}{'code'}) && (return)
$json->{'ok'}
$@ = $json->{"data"}{"code"}
Truth table0%0/3
A || B
A= $json->{'ok'}B= $@ = $json->{"data"}{"code"}
| |||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | 0 | return $json->{ok}; | |||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||
| 39 | 1 | 1; | |||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||
| 41 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||
| 43 | Google::Voice::Call | ||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||
| 45 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||
| 47 | Object representing active phone call | ||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | =head1 ATTRIBUTES | ||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||
| 51 | =head2 from | ||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||
| 53 | Calling from phone number | ||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||
| 55 | =head2 to | ||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||
| 57 | Calling to phone number | ||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | =head1 METHODS | ||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||
| 61 | =head2 new | ||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||
| 63 | =head2 cancel | ||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||
| 65 | Cancel connected phone call | ||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||
| 67 | =cut | ||||||||||||||||||||||||||||||||