« blib/lib/SignalWire/Agents/Skills/Builtin/SwmlTransfer.pm
↑ Summary
blib/lib/SignalWire/Agents/DataMap.pm »
| 1 | package SignalWire::Agents::Relay::Action; | ||||||||||||||||||||||||||||
| 2 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | # Base Action class for long-running RELAY operations. | ||||||||||||||||||||||||||||
| 7 | # Tracks control_id, completion state, and supports blocking wait. | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 4 | has 'control_id' => ( is => 'ro', required => 1 ); | |||||||||||||||||||||||||||
| 10 | 15 | ▶ | has 'call_id' => ( is => 'ro', default => sub { '' } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 15 | ▶ | has 'node_id' => ( is => 'ro', default => sub { '' } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 17 | ▶ | has 'state' => ( is => 'rw', default => sub { 'created' } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 17 | ▶ | has 'completed' => ( is => 'rw', default => sub { 0 } ); # boolean | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 17 | ▶ | has 'result' => ( is => 'rw', default => sub { undef } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 17 | ▶ | has 'events' => ( is => 'rw', default => sub { [] } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 17 | ▶ | has 'payload' => ( is => 'rw', default => sub { {} } ); # latest event payload | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 17 | ▶ | has '_on_completed' => ( is => 'rw', default => sub { undef } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 17 | ▶ | has '_client' => ( is => 'rw', default => sub { undef } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # Register on_completed callback | ||||||||||||||||||||||||||||
| 22 | 3 | ▶ | sub on_completed { | ||||||||||||||||||||||||||
|
Subroutine
on_completed: called CC=4 SCAR=14.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 23 | 3 | my ($self, $cb) = @_; | |||||||||||||||||||||||||||
| 24 | 3 | ▶ | if ($cb) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | 3 | $self->_on_completed($cb); | |||||||||||||||||||||||||||
| 26 | # If already done, fire immediately | ||||||||||||||||||||||||||||
| 27 | 3 | ▶ | if ($self->completed) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 1 | eval { $cb->($self) }; | |||||||||||||||||||||||||||
| 29 | 1 | ▶ | warn "on_completed callback error: $@" if $@; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | 3 | return $self; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | 0 | return $self->_on_completed; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | # Check if the action is done | ||||||||||||||||||||||||||||
| 37 | 4 | ▶ | sub is_done { | ||||||||||||||||||||||||||
|
Subroutine
is_done: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 38 | 4 | my ($self) = @_; | |||||||||||||||||||||||||||
| 39 | 4 | return $self->completed; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | # Blocking wait using select() polling loop | ||||||||||||||||||||||||||||
| 43 | 1 | ▶ | sub wait { | ||||||||||||||||||||||||||
|
Subroutine
wait: called CC=4 SCAR=15.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 44 | 1 | my ($self, %opts) = @_; | |||||||||||||||||||||||||||
| 45 | 1 | ▶ | my $timeout = $opts{timeout} || 30; | ||||||||||||||||||||||||||
|
Condition50%1/2
$opts{'timeout'} || 30
MC/DC0%0/1
$opts{'timeout'} || 30
$opts{'timeout'}
Truth table50%1/2
A
A= $opts{'timeout'}
| |||||||||||||||||||||||||||||
| 46 | 1 | my $start = time(); | |||||||||||||||||||||||||||
| 47 | 1 | ▶ | while (!$self->completed && (time() - $start) < $timeout) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $self->completed and time - $start < $timeout
MC/DC0%0/2
not $self->completed and time - $start < $timeout
not $self->completed
time - $start < $timeout
Truth table33%1/3
not(A) and B
A= not $self->completedB= time - $start < $timeout
| |||||||||||||||||||||||||||||
| 48 | 0 | select(undef, undef, undef, 0.1); # sleep 100ms | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | 1 | return $self->result; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | # Called by event dispatch when an event is received for this action | ||||||||||||||||||||||||||||
| 54 | 0 | ▶ | sub _handle_event { | ||||||||||||||||||||||||||
|
Subroutine
_handle_event: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 55 | 0 | my ($self, $event) = @_; | |||||||||||||||||||||||||||
| 56 | 0 | push @{$self->events}, $event; | |||||||||||||||||||||||||||
| 57 | 0 | ▶ | $self->payload($event->params // {}); | ||||||||||||||||||||||||||
|
Condition0%0/2
$event->params // {}
MC/DC0%0/1
$event->params // {}
$event->params
Truth table0%0/2
A
A= $event->params
| |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 0 | ▶ | my $state = $event->can('state') ? $event->state : ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | 0 | ▶ | $self->state($state) if $state; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | # Mark the action as completed with a result | ||||||||||||||||||||||||||||
| 64 | 7 | ▶ | sub _resolve { | ||||||||||||||||||||||||||
|
Subroutine
_resolve: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||
| 65 | 7 | my ($self, $result) = @_; | |||||||||||||||||||||||||||
| 66 | 7 | ▶ | return if $self->completed; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | 6 | $self->completed(1); | |||||||||||||||||||||||||||
| 68 | 6 | $self->result($result); | |||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 6 | ▶ | if (my $cb = $self->_on_completed) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 71 | 2 | eval { $cb->($self) }; | |||||||||||||||||||||||||||
| 72 | 2 | ▶ | warn "on_completed callback error: $@" if $@; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | # Send a sub-command on this action (e.g., play.stop, record.pause) | ||||||||||||||||||||||||||||
| 77 | 0 | ▶ | sub _execute_subcommand { | ||||||||||||||||||||||||||
|
Subroutine
_execute_subcommand: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 78 | 0 | my ($self, $method) = @_; | |||||||||||||||||||||||||||
| 79 | 0 | my $client = $self->_client; | |||||||||||||||||||||||||||
| 80 | 0 | ▶ | return unless $client; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 81 | 0 | return $client->execute($method, { | |||||||||||||||||||||||||||
| 82 | node_id => $self->node_id, | ||||||||||||||||||||||||||||
| 83 | call_id => $self->call_id, | ||||||||||||||||||||||||||||
| 84 | control_id => $self->control_id, | ||||||||||||||||||||||||||||
| 85 | }); | ||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | # Stop the action | ||||||||||||||||||||||||||||
| 89 | 0 | ▶ | sub stop { | ||||||||||||||||||||||||||
|
Subroutine
stop: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 90 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 91 | 0 | ▶ | return if $self->completed; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 92 | 0 | return $self->_execute_subcommand($self->_stop_method); | |||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | # Override in subclasses | ||||||||||||||||||||||||||||
| 96 | 0 | ▶ | sub _stop_method { return '' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | # --- PlayAction --- | ||||||||||||||||||||||||||||
| 99 | package SignalWire::Agents::Relay::Action::Play; | ||||||||||||||||||||||||||||
| 100 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 101 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | 1 | ▶ | sub _stop_method { 'calling.play.stop' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | 0 | ▶ | sub pause { | ||||||||||||||||||||||||||
|
Subroutine
pause: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 106 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 107 | 0 | return $self->_execute_subcommand('calling.play.pause'); | |||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | 0 | ▶ | sub resume { | ||||||||||||||||||||||||||
|
Subroutine
resume: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 111 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 112 | 0 | return $self->_execute_subcommand('calling.play.resume'); | |||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | 0 | ▶ | sub volume { | ||||||||||||||||||||||||||
|
Subroutine
volume: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 116 | 0 | my ($self, $vol) = @_; | |||||||||||||||||||||||||||
| 117 | 0 | my $client = $self->_client; | |||||||||||||||||||||||||||
| 118 | 0 | ▶ | return unless $client; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 119 | 0 | return $client->execute('calling.play.volume', { | |||||||||||||||||||||||||||
| 120 | node_id => $self->node_id, | ||||||||||||||||||||||||||||
| 121 | call_id => $self->call_id, | ||||||||||||||||||||||||||||
| 122 | control_id => $self->control_id, | ||||||||||||||||||||||||||||
| 123 | volume => $vol, | ||||||||||||||||||||||||||||
| 124 | }); | ||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | # --- RecordAction --- | ||||||||||||||||||||||||||||
| 128 | package SignalWire::Agents::Relay::Action::Record; | ||||||||||||||||||||||||||||
| 129 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 130 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | 1 | ▶ | sub _stop_method { 'calling.record.stop' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | 0 | ▶ | sub pause { | ||||||||||||||||||||||||||
|
Subroutine
pause: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 135 | 0 | my ($self, %opts) = @_; | |||||||||||||||||||||||||||
| 136 | 0 | my $client = $self->_client; | |||||||||||||||||||||||||||
| 137 | 0 | ▶ | return unless $client; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 138 | 0 | my $params = { | |||||||||||||||||||||||||||
| 139 | node_id => $self->node_id, | ||||||||||||||||||||||||||||
| 140 | call_id => $self->call_id, | ||||||||||||||||||||||||||||
| 141 | control_id => $self->control_id, | ||||||||||||||||||||||||||||
| 142 | }; | ||||||||||||||||||||||||||||
| 143 | 0 | ▶ | $params->{behavior} = $opts{behavior} if $opts{behavior}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 144 | 0 | return $client->execute('calling.record.pause', $params); | |||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | 0 | ▶ | sub resume { | ||||||||||||||||||||||||||
|
Subroutine
resume: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 148 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 149 | 0 | return $self->_execute_subcommand('calling.record.resume'); | |||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||
| 152 | # Result accessors | ||||||||||||||||||||||||||||
| 153 | 0 | ▶ | sub url { $_[0]->payload->{url} // '' } | ||||||||||||||||||||||||||
|
Subroutine
url: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0]->payload->{"url"} // ""
MC/DC0%0/1
$_[0]->payload->{"url"} // ""
$_[0]->payload->{"url"}
Truth table0%0/2
A
A= $_[0]->payload->{"url"}
| |||||||||||||||||||||||||||||
| 154 | 0 | ▶ | sub duration { $_[0]->payload->{duration} // 0 } | ||||||||||||||||||||||||||
|
Subroutine
duration: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0]->payload->{"duration"} // 0
MC/DC0%0/1
$_[0]->payload->{"duration"} // 0
$_[0]->payload->{"duration"}
Truth table0%0/2
A
A= $_[0]->payload->{"duration"}
| |||||||||||||||||||||||||||||
| 155 | 0 | ▶ | sub size { $_[0]->payload->{size} // 0 } | ||||||||||||||||||||||||||
|
Subroutine
size: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0]->payload->{"size"} // 0
MC/DC0%0/1
$_[0]->payload->{"size"} // 0
$_[0]->payload->{"size"}
Truth table0%0/2
A
A= $_[0]->payload->{"size"}
| |||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||
| 157 | # --- DetectAction --- | ||||||||||||||||||||||||||||
| 158 | package SignalWire::Agents::Relay::Action::Detect; | ||||||||||||||||||||||||||||
| 159 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 160 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||
| 162 | 1 | ▶ | sub _stop_method { 'calling.detect.stop' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||
| 164 | 0 | ▶ | sub detect_result { $_[0]->payload->{detect} // {} } | ||||||||||||||||||||||||||
|
Subroutine
detect_result: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0]->payload->{"detect"} // {}
MC/DC0%0/1
$_[0]->payload->{"detect"} // {}
$_[0]->payload->{"detect"}
Truth table0%0/2
A
A= $_[0]->payload->{"detect"}
| |||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||
| 166 | # --- CollectAction --- | ||||||||||||||||||||||||||||
| 167 | package SignalWire::Agents::Relay::Action::Collect; | ||||||||||||||||||||||||||||
| 168 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 169 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | 1 | ▶ | sub _stop_method { 'calling.collect.stop' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||
| 173 | 0 | ▶ | sub start_input_timers { | ||||||||||||||||||||||||||
|
Subroutine
start_input_timers: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 174 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 175 | 0 | return $self->_execute_subcommand('calling.collect.start_input_timers'); | |||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 0 | ▶ | sub collect_result { $_[0]->payload->{result} // {} } | ||||||||||||||||||||||||||
|
Subroutine
collect_result: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0]->payload->{"result"} // {}
MC/DC0%0/1
$_[0]->payload->{"result"} // {}
$_[0]->payload->{"result"}
Truth table0%0/2
A
A= $_[0]->payload->{"result"}
| |||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | # Override event handling: for play_and_collect, ignore play events | ||||||||||||||||||||||||||||
| 181 | 1 | ▶ | sub _handle_event { | ||||||||||||||||||||||||||
|
Subroutine
_handle_event: called CC=2 SCAR=7.6
| |||||||||||||||||||||||||||||
| 182 | 1 | my ($self, $event) = @_; | |||||||||||||||||||||||||||
| 183 | # If this is a play_and_collect action, only resolve on collect events | ||||||||||||||||||||||||||||
| 184 | 1 | ▶ | if ($event->event_type eq 'calling.call.play') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 185 | # Ignore play events for collect actions (play_and_collect gotcha) | ||||||||||||||||||||||||||||
| 186 | 1 | return; | |||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||
| 188 | 0 | $self->SUPER::_handle_event($event); | |||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | # --- FaxAction --- | ||||||||||||||||||||||||||||
| 192 | package SignalWire::Agents::Relay::Action::Fax; | ||||||||||||||||||||||||||||
| 193 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 194 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | 0 | ▶ | has '_fax_type' => ( is => 'ro', default => sub { 'send' } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | 2 | ▶ | sub _stop_method { | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 199 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||
| 200 | 2 | ▶ | return $self->_fax_type eq 'receive' | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 201 | ? 'calling.receive_fax.stop' | ||||||||||||||||||||||||||||
| 202 | : 'calling.send_fax.stop'; | ||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||
| 205 | 0 | ▶ | sub fax_result { $_[0]->payload->{fax} // {} } | ||||||||||||||||||||||||||
|
Subroutine
fax_result: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0]->payload->{"fax"} // {}
MC/DC0%0/1
$_[0]->payload->{"fax"} // {}
$_[0]->payload->{"fax"}
Truth table0%0/2
A
A= $_[0]->payload->{"fax"}
| |||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||
| 207 | # --- TapAction --- | ||||||||||||||||||||||||||||
| 208 | package SignalWire::Agents::Relay::Action::Tap; | ||||||||||||||||||||||||||||
| 209 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 210 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||
| 212 | 1 | ▶ | sub _stop_method { 'calling.tap.stop' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||
| 214 | # --- StreamAction --- | ||||||||||||||||||||||||||||
| 215 | package SignalWire::Agents::Relay::Action::Stream; | ||||||||||||||||||||||||||||
| 216 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 217 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | 1 | ▶ | sub _stop_method { 'calling.stream.stop' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||
| 221 | # --- PayAction --- | ||||||||||||||||||||||||||||
| 222 | package SignalWire::Agents::Relay::Action::Pay; | ||||||||||||||||||||||||||||
| 223 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 224 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | 1 | ▶ | sub _stop_method { 'calling.pay.stop' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||
| 228 | 0 | ▶ | sub pay_result { $_[0]->payload->{result} // {} } | ||||||||||||||||||||||||||
|
Subroutine
pay_result: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0]->payload->{"result"} // {}
MC/DC0%0/1
$_[0]->payload->{"result"} // {}
$_[0]->payload->{"result"}
Truth table0%0/2
A
A= $_[0]->payload->{"result"}
| |||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||
| 230 | # --- TranscribeAction --- | ||||||||||||||||||||||||||||
| 231 | package SignalWire::Agents::Relay::Action::Transcribe; | ||||||||||||||||||||||||||||
| 232 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 233 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||
| 235 | 1 | ▶ | sub _stop_method { 'calling.transcribe.stop' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||
| 237 | # --- AIAction --- | ||||||||||||||||||||||||||||
| 238 | package SignalWire::Agents::Relay::Action::AI; | ||||||||||||||||||||||||||||
| 239 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 240 | 4 | extends 'SignalWire::Agents::Relay::Action'; | |||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||
| 242 | 1 | ▶ | sub _stop_method { 'calling.ai.stop' } | ||||||||||||||||||||||||||
|
Subroutine
_stop_method: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||
| 244 | 4 | 1; | |||||||||||||||||||||||||||