| 1 | |||||||||||||||||||||||||||||
| 2 | package VoiceXML::Client::Item::Record; | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use base qw (VoiceXML::Client::Item); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 3 | ▶ | use VoiceXML::Client::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | Copyright (C) 2007,2008 by Pat Deegan. | ||||||||||||||||||||||||||||
| 14 | All rights reserved | ||||||||||||||||||||||||||||
| 15 | http://voicexml.psychogenic.com | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | This library is released under the terms of the GNU GPL version 3, making it available only for | ||||||||||||||||||||||||||||
| 18 | free programs ("free" here being used in the sense of the GPL, see http://www.gnu.org for more details). | ||||||||||||||||||||||||||||
| 19 | Anyone wishing to use this library within a proprietary or otherwise non-GPLed program MUST contact psychogenic.com to | ||||||||||||||||||||||||||||
| 20 | acquire a distinct license for their application. This approach encourages the use of free software | ||||||||||||||||||||||||||||
| 21 | while allowing for proprietary solutions that support further development. | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | This file is part of VoiceXML::Client. | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | VoiceXML::Client is free software: you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 29 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||
| 30 | the Free Software Foundation, either version 3 of the License, or | ||||||||||||||||||||||||||||
| 31 | (at your option) any later version. | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | VoiceXML::Client is distributed in the hope that it will be useful, | ||||||||||||||||||||||||||||
| 34 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||||||||||||||||||
| 35 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||||||||||||||||||||
| 36 | GNU General Public License for more details. | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | You should have received a copy of the GNU General Public License | ||||||||||||||||||||||||||||
| 39 | along with VoiceXML::Client. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | =cut | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 3 | ▶ | use vars qw{ | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 48 | $BeepFrequency | ||||||||||||||||||||||||||||
| 49 | $BeepMilliseconds | ||||||||||||||||||||||||||||
| 50 | $VERSION | ||||||||||||||||||||||||||||
| 51 | 3 | }; | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 3 | $BeepFrequency = 400; | |||||||||||||||||||||||||||
| 54 | 3 | $BeepMilliseconds = 1000; | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 3 | $VERSION = $VoiceXML::Client::Item::VERSION; | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | ▶ | sub init { | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||
| 63 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 0 | ▶ | $self->{'name'} = $self->{'XMLElement'}->attribute('name') || warn "No record name specified"; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'XMLElement'}->attribute('name') || warn('No record name specified')
MC/DC0%0/1
$self->{'XMLElement'}->attribute('name') || warn('No record name specified')
$self->{'XMLElement'}->attribute('name')
Truth table0%0/2
A
A= $self->{'XMLElement'}->attribute('name')
| |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | $self->{'beep'} = $self->{'XMLElement'}->attribute('beep') || 'true'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'XMLElement'}->attribute('beep') || 'true'
MC/DC0%0/1
$self->{'XMLElement'}->attribute('beep') || 'true'
$self->{'XMLElement'}->attribute('beep')
Truth table0%0/2
A
A= $self->{'XMLElement'}->attribute('beep')
| |||||||||||||||||||||||||||||
| 67 | 0 | ▶ | $self->{'maxtime'} = $self->{'XMLElement'}->attribute('maxtime') || '10s'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'XMLElement'}->attribute('maxtime') || '10s'
MC/DC0%0/1
$self->{'XMLElement'}->attribute('maxtime') || '10s'
$self->{'XMLElement'}->attribute('maxtime')
Truth table0%0/2
A
A= $self->{'XMLElement'}->attribute('maxtime')
| |||||||||||||||||||||||||||||
| 68 | 0 | ▶ | $self->{'dtmfterm'} = $self->{'XMLElement'}->attribute('dtmfterm') || 'true'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'XMLElement'}->attribute('dtmfterm') || 'true'
MC/DC0%0/1
$self->{'XMLElement'}->attribute('dtmfterm') || 'true'
$self->{'XMLElement'}->attribute('dtmfterm')
Truth table0%0/2
A
A= $self->{'XMLElement'}->attribute('dtmfterm')
| |||||||||||||||||||||||||||||
| 69 | 0 | ▶ | $self->{'finalsilence'} = $self->{'XMLElement'}->attribute('finalsilence') || '4000ms'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'XMLElement'}->attribute('finalsilence') || '4000ms'
MC/DC0%0/1
$self->{'XMLElement'}->attribute('finalsilence') || '4000ms'
$self->{'XMLElement'}->attribute('finalsilence')
Truth table0%0/2
A
A= $self->{'XMLElement'}->attribute('finalsilence')
| |||||||||||||||||||||||||||||
| 70 | 0 | ▶ | $self->{'type'} = $self->{'XMLElement'}->attribute('type') || 'audio/x-wav'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'XMLElement'}->attribute('type') || 'audio/x-wav'
MC/DC0%0/1
$self->{'XMLElement'}->attribute('type') || 'audio/x-wav'
$self->{'XMLElement'}->attribute('type')
Truth table0%0/2
A
A= $self->{'XMLElement'}->attribute('type')
| |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 0 | return 1; | |||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 0 | ▶ | sub execute { | ||||||||||||||||||||||||||
|
Subroutine
execute: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 80 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 81 | 0 | my $handle = shift; | |||||||||||||||||||||||||||
| 82 | 0 | my $optParams = shift; | |||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 0 | ▶ | unless ($self->{'name'}) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 85 | { | ||||||||||||||||||||||||||||
| 86 | 0 | warn "Record::execute called but no name set?"; | |||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 0 | return $VoiceXML::Client::Flow::Directive{'ABORT'}; | |||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | 0 | ▶ | if ($self->{'beep'} && $self->{'beep'} =~ m/true/i) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"beep"} and $self->{"beep"} =~ /true/i
MC/DC0%0/2
$self->{"beep"} and $self->{"beep"} =~ /true/i
$self->{"beep"}
$self->{"beep"} =~ /true/i
Truth table0%0/3
A and B
A= $self->{"beep"}B= $self->{"beep"} =~ /true/i
| |||||||||||||||||||||||||||||
| 92 | { | ||||||||||||||||||||||||||||
| 93 | 0 | $handle->beep($BeepFrequency, $BeepMilliseconds); | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | 0 | $handle->record($self->{'name'}); | |||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | 0 | chmod 0666, $self->{'name'}; | |||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | 0 | return $self->executeChildren($handle, $optParams); | |||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | 3 | 1; | |||||||||||||||||||||||||||