line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cisco::IPPhone; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Author: Mark Palmer markpalmer@us.ibm.com |
4
|
|
|
|
|
|
|
# Date: 7/2002 |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require 5.005_62; |
7
|
1
|
|
|
1
|
|
918
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
8
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
104
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
require Exporter; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
15
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
16
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# This allows declaration use Cisco::IPPhone ':all'; |
19
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
20
|
|
|
|
|
|
|
# will save memory. |
21
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
) ] ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
our @EXPORT = qw( |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Preloaded methods go here. |
34
|
|
|
|
|
|
|
############# Code Here |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
1
|
|
728
|
use POSIX; |
|
1
|
|
|
|
|
17318
|
|
|
1
|
|
|
|
|
7
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$|=1; # Turn off buffered output |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# Hash Table containing URI options |
41
|
|
|
|
|
|
|
# 7940 phones use Line1 and Line2 |
42
|
|
|
|
|
|
|
# 7960 phones use Line1 through Line6 |
43
|
|
|
|
|
|
|
# 7914 sidecar on 7960 phones use Line7 through Line20 |
44
|
|
|
|
|
|
|
# second 7914 sidecar phones use Line21 through Line34 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# URI Dial:1234 cuases the phone to dial 1234 |
47
|
|
|
|
|
|
|
# URI EditDial:1234 enables the user to edit the dial string 1234 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my %uriKeys = ( 0 => 'Key:KeyPad0', 1 => 'Key:KeyPad1', 2 => 'Key:KeyPad2', |
50
|
|
|
|
|
|
|
3 => 'Key:KeyPad3', 4 => 'Key:KeyPad4', 5 => 'Key:KeyPad5', 6 => 'Key:KeyPad6', |
51
|
|
|
|
|
|
|
7 => 'Key:KeyPad7', 8 => 'Key:KeyPad8', 9 => 'Key:KeyPad9', 10 => 'KeyPadStar', |
52
|
|
|
|
|
|
|
11 => 'Key:KeyPadPound', 12 => 'Key:Soft1', 13 => 'Key:Soft2', |
53
|
|
|
|
|
|
|
14 => 'Key:Soft3', 15 => 'Key:Soft4', 16 => 'Key:VolDwn', 17 => 'Key:VolUp', |
54
|
|
|
|
|
|
|
18 => 'Key:Headset', 19 => 'Key:Speaker', 20 => 'Key:Mute', 21 => 'Key:Info', |
55
|
|
|
|
|
|
|
22 => 'Key:Messages', 23 => 'Key:Services', 24 => 'Key:Directory', |
56
|
|
|
|
|
|
|
25 => 'Key:Settings', 26 => 'Key:NavUp', 27 => 'Key:NavDwn', |
57
|
|
|
|
|
|
|
28 => 'SoftKey:Update', 29 => 'SoftKey:Select', 30 => 'Key:SoftKey:Exit', |
58
|
|
|
|
|
|
|
31 => 'Key:Line1', 32 => 'Key:Line2', |
59
|
|
|
|
|
|
|
33 => 'Key:Line3', 34 => 'Key:Line4', 35 => 'Key:Line5', 36 => 'Key:Line6', |
60
|
|
|
|
|
|
|
37 => 'Key:Line7', 38 => 'Key:Line8', 39 => 'Key:Line9', 40 => 'Key:Line10', |
61
|
|
|
|
|
|
|
41 => 'Key:Line11', 42 => 'Key:Line12', 43 => 'Key:Line13', 44 => 'Key:Line14', |
62
|
|
|
|
|
|
|
45 => 'Key:Line15', 46 => 'Key:Line16', 47 => 'Key:Line17', 48 => 'Key:Line18', |
63
|
|
|
|
|
|
|
49 => 'Key:Line19', 50 => 'Key:Line20', 51 => 'Key:Line21', 52 => 'Key:Line22', |
64
|
|
|
|
|
|
|
53 => 'Key:Line23', 54 => 'Key:Line24', 55 => 'Key:Line25', 56 => 'Key:Line26', |
65
|
|
|
|
|
|
|
57 => 'Key:Line27', 58 => 'Key:Line28', 59 => 'Key:Line29', 60 => 'Key:Line30', |
66
|
|
|
|
|
|
|
61 => 'Key:Line31', 62 => 'Key:Line32', 63 => 'Key:Line33', 64 => 'Key:Line34', |
67
|
|
|
|
|
|
|
65 => 'Init:CallHistory', 66 => 'SoftKey:<<', 67 => 'SoftKey:Cancel' ); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# For use with InputItems |
70
|
|
|
|
|
|
|
my %inputFlags = ( ASCII => 'A', Telephone => 'T', Numeric => 'N', |
71
|
|
|
|
|
|
|
Equation => 'E', Uppercase => 'U', Lowercase => 'L', Password => 'P' ); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Declaration of new object with data types defined and blessed for use |
74
|
|
|
|
|
|
|
sub new { |
75
|
0
|
|
|
0
|
0
|
|
my $package = shift; |
76
|
0
|
|
|
|
|
|
my $this = { xmlobject => [] }; |
77
|
0
|
|
|
|
|
|
return bless($this, $package); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub Print { |
81
|
|
|
|
|
|
|
# Takes no input. Prints the xmlobject array datastructure to the phone |
82
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
83
|
0
|
|
|
|
|
|
${$self->{xmlobject}}[0] = "Content-Type: text/xml\n\n${$self->{xmlobject}}[0]"; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
print @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub Content { |
88
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
89
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
90
|
|
|
|
|
|
|
# Assume Content-Type is text/xml unless otherwise specified |
91
|
0
|
|
|
|
|
|
my $header = ''; |
92
|
|
|
|
|
|
|
|
93
|
0
|
0
|
|
|
|
|
if ($options->{Refresh}) { |
94
|
0
|
|
|
|
|
|
$header .= "refresh: $options->{Refresh};"; |
95
|
0
|
0
|
|
|
|
|
if ($options->{URL}) { |
96
|
0
|
|
|
|
|
|
$header .= " url=$options->{URL}\n"; |
97
|
|
|
|
|
|
|
} else { |
98
|
0
|
|
|
|
|
|
$header .= "\n"; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
} |
101
|
0
|
0
|
|
|
|
|
if ($options->{Location}) { |
102
|
0
|
|
|
|
|
|
$header .= "location: $options->{Location}\n"; |
103
|
|
|
|
|
|
|
} |
104
|
0
|
0
|
|
|
|
|
if ($options->{Date}) { |
105
|
0
|
|
|
|
|
|
$header .= "date: $options->{Date}\n"; |
106
|
|
|
|
|
|
|
} |
107
|
0
|
0
|
|
|
|
|
if ($options->{Expires}) { |
108
|
0
|
|
|
|
|
|
$header .= "expires: $options->{Expires}\n"; |
109
|
|
|
|
|
|
|
} |
110
|
0
|
0
|
|
|
|
|
if ($options->{Cookie}) { |
111
|
0
|
|
|
|
|
|
$header .= "Set-Cookie: $options->{Cookie}\n"; |
112
|
|
|
|
|
|
|
} |
113
|
0
|
0
|
|
|
|
|
if ($options->{Type}) { |
114
|
0
|
|
|
|
|
|
$header .= "Content-Type: $options->{Type}\n\n"; |
115
|
|
|
|
|
|
|
} else { |
116
|
0
|
|
|
|
|
|
$header .= "Content-Type: text/xml\n\n"; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
|
${$self->{xmlobject}}[0] = "${header}${$self->{xmlobject}}[0]"; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
120
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub Content_Noheader { |
124
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
125
|
0
|
|
|
|
|
|
my $result = ''; |
126
|
0
|
|
|
|
|
|
my $line = ''; |
127
|
0
|
0
|
|
|
|
|
if (wantarray) { return @{$self->{xmlobject}} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
foreach $line (@{$self->{xmlobject}}) { |
|
0
|
|
|
|
|
|
|
129
|
0
|
|
|
|
|
|
$result .= $line; |
130
|
|
|
|
|
|
|
} |
131
|
0
|
|
|
|
|
|
return $result; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub Text { |
135
|
|
|
|
|
|
|
# Input: Title, Prompt, Text and optional softkeyitems or menuitems |
136
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
137
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
138
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
139
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Title}\n"; |
|
0
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Prompt}\n"; |
|
0
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Text}\n"; |
|
0
|
|
|
|
|
|
|
142
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "\n"; |
|
0
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
sub Menu { |
147
|
|
|
|
|
|
|
# Takes Title, Prompt and optional softkeyitems or menuitems |
148
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
149
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
150
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
151
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Title}\n"; |
|
0
|
|
|
|
|
|
|
152
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Prompt}\n"; |
|
0
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
# Insert Menu Options using AddMenuItem |
154
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
155
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub MenuItem { |
159
|
|
|
|
|
|
|
# Input: Name and URL (or URI) |
160
|
|
|
|
|
|
|
# A maximum of 99 MenuItem tags are allowed |
161
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
162
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
163
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}," |
|
0
|
|
|
|
|
|
|
164
|
0
|
0
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{IconIndex}\n" if $options->{IconIndex}; |
|
0
|
|
|
|
|
|
|
165
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Name}\n"; |
|
0
|
|
|
|
|
|
|
166
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{URL}\n"; |
|
0
|
|
|
|
|
|
|
167
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
168
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
} |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
sub AddMenuItem { |
172
|
|
|
|
|
|
|
# Input: Name and URL (or URI) |
173
|
|
|
|
|
|
|
# Adds the MenuItem to the Object that called this method |
174
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
175
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
# Pop off the Close Menu Tag |
178
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
180
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}," |
|
0
|
|
|
|
|
|
|
181
|
0
|
0
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{IconIndex}\n" if $options->{IconIndex}; |
|
0
|
|
|
|
|
|
|
182
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Name}\n"; |
|
0
|
|
|
|
|
|
|
183
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{URL}\n"; |
|
0
|
|
|
|
|
|
|
184
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
# Push the Close Menu Tag Back onto the Menu Object |
187
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
# Returns array if called in list context, or returns scalar |
189
|
0
|
0
|
|
|
|
|
if (wantarray) { return @{$self->{xmlobject}} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
190
|
0
|
|
|
|
|
|
return 1; |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
sub AddMenuItemObject { |
194
|
|
|
|
|
|
|
# Input: MenuItem Object |
195
|
|
|
|
|
|
|
# Adds the MenuItem Object to the Object that called this method |
196
|
0
|
|
|
0
|
1
|
|
my $line; |
197
|
0
|
|
|
|
|
|
my $self = shift; |
198
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
# Pop off the Close Menu Tag |
201
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
# Push the MenuItems onto the menu |
204
|
0
|
|
|
|
|
|
foreach $line (@{$options->{MenuItem}->{xmlobject}}) { |
|
0
|
|
|
|
|
|
|
205
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},$line; |
|
0
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
# Push the Close Menu Tag Back onto the Menu Object |
208
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
209
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
sub Input { |
213
|
|
|
|
|
|
|
# Input: Title, Prompt, URL |
214
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
215
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
216
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
217
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Title}\n"; |
|
0
|
|
|
|
|
|
|
218
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Prompt}\n"; |
|
0
|
|
|
|
|
|
|
219
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{URL}\n"; |
|
0
|
|
|
|
|
|
|
220
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "\n"; |
|
0
|
|
|
|
|
|
|
221
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
sub InputItem { |
225
|
|
|
|
|
|
|
# Input: DisplayName, QueryStringParam, DefaultValue, InputFlags |
226
|
|
|
|
|
|
|
# Valid Input Tags: see inputFlags hash defined above |
227
|
|
|
|
|
|
|
|
228
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
229
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
230
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
231
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{DisplayName}\n"; |
|
0
|
|
|
|
|
|
|
232
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{QueryStringParam}\n"; |
|
0
|
|
|
|
|
|
|
233
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{DefaultValue}\n"; |
|
0
|
|
|
|
|
|
|
234
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{InputFlags}\n"; |
|
0
|
|
|
|
|
|
|
235
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
236
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
sub AddInputItem { |
240
|
|
|
|
|
|
|
# Input: DisplayName, QueryStringParam, DefaultValue, InputFlags |
241
|
|
|
|
|
|
|
# Valid Input Tags: see inputFlags hash defined above |
242
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
243
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
# Pop off the Close Menu Tag |
246
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
|
248
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
249
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{DisplayName}\n"; |
|
0
|
|
|
|
|
|
|
250
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{QueryStringParam}\n"; |
|
0
|
|
|
|
|
|
|
251
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{DefaultValue}\n"; |
|
0
|
|
|
|
|
|
|
252
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{InputFlags}\n"; |
|
0
|
|
|
|
|
|
|
253
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
256
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
# Returns array if called in list context or returns scalar in scaler context |
258
|
0
|
0
|
|
|
|
|
if (wantarray) { return @{$self->{xmlobject}} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
259
|
0
|
|
|
|
|
|
return 1; |
260
|
|
|
|
|
|
|
} |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
sub AddInputItemObject { |
263
|
|
|
|
|
|
|
# Input: InputItem Object |
264
|
|
|
|
|
|
|
# Adds the InputItem Object to the Object that called this method |
265
|
0
|
|
|
0
|
1
|
|
my $line; |
266
|
0
|
|
|
|
|
|
my $self = shift; |
267
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
# Pop off the Close Tag |
270
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
# Push the MenuItems onto the menu |
273
|
0
|
|
|
|
|
|
foreach $line (@{$options->{InputItem}->{xmlobject}}) { |
|
0
|
|
|
|
|
|
|
274
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},$line; |
|
0
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
277
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
278
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
} |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
sub SoftKeyItem { |
282
|
|
|
|
|
|
|
# Input: Name, URL (or URI), and Position |
283
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
284
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
285
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
286
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Name}\n"; |
|
0
|
|
|
|
|
|
|
287
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{URL}\n"; |
|
0
|
|
|
|
|
|
|
288
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Position}\n"; |
|
0
|
|
|
|
|
|
|
289
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
290
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
} |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
sub AddSoftKeyItem { |
294
|
|
|
|
|
|
|
# Input: Name and URL (or URI), and Position |
295
|
|
|
|
|
|
|
# Adds the SoftKeyItem Object to the Object that called this method |
296
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
297
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
# Pop off the Close Menu Tag |
300
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
|
302
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
303
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Name}\n"; |
|
0
|
|
|
|
|
|
|
304
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{URL}\n"; |
|
0
|
|
|
|
|
|
|
305
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Position}\n"; |
|
0
|
|
|
|
|
|
|
306
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
# Push the Close Menu Tag Back onto the Menu Object |
309
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
310
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
} |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
sub AddSoftKeyItemObject { |
314
|
|
|
|
|
|
|
# Input: SoftKeyItem Object |
315
|
|
|
|
|
|
|
# Adds the SoftKeyItem Object to the Object that called this method |
316
|
0
|
|
|
0
|
1
|
|
my $line; |
317
|
0
|
|
|
|
|
|
my $self = shift; |
318
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
# Pop off the Close Tag |
321
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
# Push the SoftKeyItems onto the Calling Object |
324
|
0
|
|
|
|
|
|
foreach $line (@{$options->{SoftKeyItem}->{xmlobject}}) { |
|
0
|
|
|
|
|
|
|
325
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},$line; |
|
0
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
328
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
329
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
} |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
sub Directory { |
333
|
|
|
|
|
|
|
# Input: Title and Prompt |
334
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
335
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
336
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
337
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Title}\n"; |
|
0
|
|
|
|
|
|
|
338
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Prompt}\n"; |
|
0
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
# Insert Directory Entries using AddDirectoryEntry |
340
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
} |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
sub DirectoryEntry { |
344
|
|
|
|
|
|
|
# Input: Name and Telephone |
345
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
346
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
347
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
348
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Name}\n"; |
|
0
|
|
|
|
|
|
|
349
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, "$options->{Telephone}\n"; |
|
0
|
|
|
|
|
|
|
350
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
351
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
sub AddDirectoryEntry { |
355
|
|
|
|
|
|
|
# Input: Name and URL (or URI) |
356
|
|
|
|
|
|
|
# Adds the DirectoryEntry to the Object that called this method |
357
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
358
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
# Pop off the Close Tag |
361
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
|
363
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
364
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Name}\n"; |
|
0
|
|
|
|
|
|
|
365
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Telephone}\n"; |
|
0
|
|
|
|
|
|
|
366
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
369
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
# Returns array if called in list context, or returns scalar |
372
|
0
|
0
|
|
|
|
|
if (wantarray) { return @{$self->{xmlobject}} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
373
|
0
|
|
|
|
|
|
return 1; |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
sub AddDirectoryEntryObject { |
377
|
|
|
|
|
|
|
# Input: DirectoryEntry Object |
378
|
|
|
|
|
|
|
# Adds the Directory Entry Object to the Object that called this method |
379
|
0
|
|
|
0
|
1
|
|
my $line; |
380
|
0
|
|
|
|
|
|
my $self = shift; |
381
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
# Pop off the Close Tag |
384
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
# Push the Directory Entries onto the Calling Object |
387
|
0
|
|
|
|
|
|
foreach $line (@{$options->{DirectoryEntry}->{xmlobject}}) { |
|
0
|
|
|
|
|
|
|
388
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},$line; |
|
0
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
} |
390
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
391
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
392
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
} |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
sub Image { |
396
|
|
|
|
|
|
|
# Input: Title,Prompt,LocationX,LocationY,Width,Height,Depth,Data |
397
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
398
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
399
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
400
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Title}\n"; |
|
0
|
|
|
|
|
|
|
401
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Prompt}\n"; |
|
0
|
|
|
|
|
|
|
402
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{LocationX}\n"; |
|
0
|
|
|
|
|
|
|
403
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{LocationY}\n"; |
|
0
|
|
|
|
|
|
|
404
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Width}\n"; |
|
0
|
|
|
|
|
|
|
405
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Height}\n"; |
|
0
|
|
|
|
|
|
|
406
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Depth}\n"; |
|
0
|
|
|
|
|
|
|
407
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Data}\n"; |
|
0
|
|
|
|
|
|
|
408
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
409
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
} |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
sub GraphicMenu { |
413
|
|
|
|
|
|
|
# Input: Title,Prompt,LocationX,LocationY,Width,Height,Depth,Data |
414
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
415
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
416
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
417
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Title}\n"; |
|
0
|
|
|
|
|
|
|
418
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Prompt}\n"; |
|
0
|
|
|
|
|
|
|
419
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{LocationX}\n"; |
|
0
|
|
|
|
|
|
|
420
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{LocationY}\n"; |
|
0
|
|
|
|
|
|
|
421
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Width}\n"; |
|
0
|
|
|
|
|
|
|
422
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Height}\n"; |
|
0
|
|
|
|
|
|
|
423
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Depth}\n"; |
|
0
|
|
|
|
|
|
|
424
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Data}\n"; |
|
0
|
|
|
|
|
|
|
425
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
426
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
} |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
sub IconMenu { |
430
|
|
|
|
|
|
|
# Takes Title, Prompt and optional softkeyitems or menuitems |
431
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
432
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
433
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
434
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Title}\n"; |
|
0
|
|
|
|
|
|
|
435
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Prompt}\n"; |
|
0
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
# Insert Menu Options using AddMenuItem |
437
|
|
|
|
|
|
|
# Insert SoftKey Options using AddSoftKeyItem |
438
|
|
|
|
|
|
|
# Insert Icon Options using AddIconItem |
439
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
440
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
} |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
sub IconItem { |
444
|
|
|
|
|
|
|
# Input: Index, Height, Width, Depth, Data |
445
|
|
|
|
|
|
|
# Build IconItem Object |
446
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
447
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
448
|
|
|
|
|
|
|
|
449
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
450
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Index}\n"; |
|
0
|
|
|
|
|
|
|
451
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Height}\n"; |
|
0
|
|
|
|
|
|
|
452
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Width}\n"; |
|
0
|
|
|
|
|
|
|
453
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Depth}\n"; |
|
0
|
|
|
|
|
|
|
454
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Data}\n"; |
|
0
|
|
|
|
|
|
|
455
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
|
457
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
} |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
sub AddIconItem { |
461
|
|
|
|
|
|
|
# Input: Index, Height, Width, Depth, Data |
462
|
|
|
|
|
|
|
# Adds the IconItem Object to the IconMenu Object that called this method |
463
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
464
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
# Pop off the Close IconMenu Tag |
467
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
|
469
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
470
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Index}\n"; |
|
0
|
|
|
|
|
|
|
471
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Height}\n"; |
|
0
|
|
|
|
|
|
|
472
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Width}\n"; |
|
0
|
|
|
|
|
|
|
473
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Depth}\n"; |
|
0
|
|
|
|
|
|
|
474
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"$options->{Data}\n"; |
|
0
|
|
|
|
|
|
|
475
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
# Push the Close IconMenu Tag Back onto the Menu Object |
478
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
479
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
} |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
sub AddIconItemObject { |
483
|
|
|
|
|
|
|
# Input: IconItem Object |
484
|
|
|
|
|
|
|
# Adds the IconItem Object to the Object that called this method |
485
|
0
|
|
|
0
|
1
|
|
my $line; |
486
|
0
|
|
|
|
|
|
my $self = shift; |
487
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
488
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
# Pop off the Close Tag |
490
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
# Push the Icon Items onto the Calling Object |
493
|
0
|
|
|
|
|
|
foreach $line (@{$options->{IconItem}->{xmlobject}}) { |
|
0
|
|
|
|
|
|
|
494
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},$line; |
|
0
|
|
|
|
|
|
|
495
|
|
|
|
|
|
|
} |
496
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
497
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
498
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
} |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
sub Execute { |
502
|
|
|
|
|
|
|
# Input: None |
503
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
504
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
# Insert Execute Items using AddExecuteItem |
506
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
507
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
} |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
sub AddExecuteItem { |
511
|
|
|
|
|
|
|
# Input: URL to be executed (can have up to 3 items in one execute object) |
512
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
513
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
# Pop off the Close Tag |
516
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
|
518
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"{ExecuteItem}\"/>\n"; |
|
0
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
521
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
# Returns array if called in list context, or returns scalar |
524
|
0
|
0
|
|
|
|
|
if (wantarray) { return @{$self->{xmlobject}} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
525
|
0
|
|
|
|
|
|
return 1; |
526
|
|
|
|
|
|
|
} |
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
sub AddExecuteItemObject { |
529
|
|
|
|
|
|
|
# Input: ExecuteItem Object |
530
|
|
|
|
|
|
|
# Adds the Execute Item Object to the Object that called this method |
531
|
0
|
|
|
0
|
1
|
|
my $line; |
532
|
0
|
|
|
|
|
|
my $self = shift; |
533
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
# Pop off the Close Tag |
536
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
|
538
|
|
|
|
|
|
|
# Push the Directory Entries onto the Calling Object |
539
|
0
|
|
|
|
|
|
foreach $line (@{$options->{ExecuteItem}->{xmlobject}}) { |
|
0
|
|
|
|
|
|
|
540
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},$line; |
|
0
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
} |
542
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
543
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
544
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
} |
546
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
sub Response { |
548
|
|
|
|
|
|
|
# Input: None |
549
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
550
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
# Insert Response Items using AddResponseItem |
552
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"\n"; |
|
0
|
|
|
|
|
|
|
553
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
} |
555
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
sub ResponseItem { |
557
|
|
|
|
|
|
|
# Input: URL to be executed (can have up to 3 items in one execute object) |
558
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
559
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
560
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"{Status}\" Data=\"$options->{Data}\" URL=\"$options->{URL}\"/>\n"; |
|
0
|
|
|
|
|
|
|
561
|
|
|
|
|
|
|
# Returns array if called in list context, or returns scalar |
562
|
0
|
0
|
|
|
|
|
if (wantarray) { return @{$self->{xmlobject}} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
563
|
0
|
|
|
|
|
|
return 1; |
564
|
|
|
|
|
|
|
} |
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
sub AddResponseItem { |
567
|
|
|
|
|
|
|
# Input: URL to be executed (can have up to 3 items in one execute object) |
568
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
569
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
# Pop off the Close Tag |
572
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
|
574
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"{Status}\" Data=\"$options->{Data}\" URL=\"$options->{URL}\"/>\n"; |
|
0
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
|
576
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
577
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
# Returns array if called in list context, or returns scalar |
580
|
0
|
0
|
|
|
|
|
if (wantarray) { return @{$self->{xmlobject}} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
581
|
0
|
|
|
|
|
|
return 1; |
582
|
|
|
|
|
|
|
} |
583
|
|
|
|
|
|
|
|
584
|
|
|
|
|
|
|
sub AddResponseItemObject { |
585
|
|
|
|
|
|
|
# Input: ResponseItem Object |
586
|
|
|
|
|
|
|
# Adds the Response Item Object to the Object that called this method |
587
|
0
|
|
|
0
|
1
|
|
my $line; |
588
|
0
|
|
|
|
|
|
my $self = shift; |
589
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
590
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
# Pop off the Close Tag |
592
|
0
|
|
|
|
|
|
my $lastline = pop @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
# Push the Directory Entries onto the Calling Object |
595
|
0
|
|
|
|
|
|
foreach $line (@{$options->{ResponseItem}->{xmlobject}}) { |
|
0
|
|
|
|
|
|
|
596
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},$line; |
|
0
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
} |
598
|
|
|
|
|
|
|
# Push the Close Tag Back onto the Calling Object |
599
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}}, $lastline; |
|
0
|
|
|
|
|
|
|
600
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
} |
602
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
# Possible error codes: |
604
|
|
|
|
|
|
|
# Error 1 = Error parsing CiscoIPPhoneExecute object |
605
|
|
|
|
|
|
|
# Error 2 = Error framing CiscoIPPhoneResponse object |
606
|
|
|
|
|
|
|
# Error 3 = Internal file error |
607
|
|
|
|
|
|
|
# Error 4 = Authentication error |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
sub Error { |
610
|
|
|
|
|
|
|
# USE " for double quotes on phone |
611
|
|
|
|
|
|
|
# Input: Number representing error number |
612
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
613
|
0
|
0
|
|
|
|
|
my $options = shift if (@_); |
614
|
0
|
|
|
|
|
|
push @{$self->{xmlobject}},"{Number}\"/>\n"; |
|
0
|
|
|
|
|
|
|
615
|
0
|
|
|
|
|
|
return @{$self->{xmlobject}}; |
|
0
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
} |
617
|
|
|
|
|
|
|
|
618
|
|
|
|
|
|
|
sub Date { |
619
|
0
|
|
|
0
|
0
|
|
my ($sec, $min, $hour, $mday, $mon, $year); |
620
|
0
|
|
|
|
|
|
($sec,$min,$hour,$mday,$mon,$year) = localtime(time); |
621
|
0
|
|
|
|
|
|
my $date = POSIX::strftime("%Y%m%e",$sec, $min, $hour, $mday, $mon, $year); |
622
|
0
|
|
|
|
|
|
$date =~ s/\s/0/; |
623
|
0
|
|
|
|
|
|
return $date; |
624
|
|
|
|
|
|
|
} |
625
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
############# End Code |
627
|
|
|
|
|
|
|
|
628
|
|
|
|
|
|
|
1; |
629
|
|
|
|
|
|
|
__END__ |