aboutsummaryrefslogtreecommitdiffstats
path: root/agi
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-09 14:33:03 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-09 14:33:03 +0000
commita7a8fd15e7a721c5851b4b7c572a008b7c220042 (patch)
treea64cc714fb5c8aa6839d070a592d5dbf9a6b4ad8 /agi
parentd45296081d485346e34a2c4b3da5279328b13c7c (diff)
Perl cleanups
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1911 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'agi')
-rwxr-xr-xagi/agi-test.agi36
1 files changed, 21 insertions, 15 deletions
diff --git a/agi/agi-test.agi b/agi/agi-test.agi
index 3d9b5dc3a..4fc36eda8 100755
--- a/agi/agi-test.agi
+++ b/agi/agi-test.agi
@@ -1,5 +1,11 @@
#!/usr/bin/perl
+use strict;
+
$|=1;
+
+# Setup some variables
+my %AGI; my $tests = 0; my $fail = 0; my $pass = 0;
+
while(<STDIN>) {
chomp;
last unless length($_);
@@ -9,7 +15,7 @@ while(<STDIN>) {
}
print STDERR "AGI Environment Dump:\n";
-foreach $i (sort keys %AGI) {
+foreach my $i (sort keys %AGI) {
print STDERR " -- $i = $AGI{$i}\n";
}
@@ -35,38 +41,38 @@ sub checkresult {
print STDERR "1. Testing 'sendfile'...";
print "STREAM FILE beep \"\"\n";
-$result = <STDIN>;
-checkresult($result);
+my $result = <STDIN>;
+&checkresult($result);
print STDERR "2. Testing 'sendtext'...";
print "SEND TEXT \"hello world\"\n";
-$result = <STDIN>;
-checkresult($result);
+my $result = <STDIN>;
+&checkresult($result);
print STDERR "3. Testing 'sendimage'...";
print "SEND IMAGE asterisk-image\n";
-$result = <STDIN>;
-checkresult($result);
+my $result = <STDIN>;
+&checkresult($result);
print STDERR "4. Testing 'saynumber'...";
print "SAY NUMBER 192837465 \"\"\n";
-$result = <STDIN>;
-checkresult($result);
+my $result = <STDIN>;
+&checkresult($result);
print STDERR "5. Testing 'waitdtmf'...";
print "WAIT FOR DIGIT 1000\n";
-$result = <STDIN>;
-checkresult($result);
+my $result = <STDIN>;
+&checkresult($result);
print STDERR "6. Testing 'record'...";
print "RECORD FILE testagi gsm 1234 3000\n";
-$result = <STDIN>;
-checkresult($result);
+my $result = <STDIN>;
+&checkresult($result);
print STDERR "6a. Testing 'record' playback...";
print "STREAM FILE testagi \"\"\n";
-$result = <STDIN>;
-checkresult($result);
+my $result = <STDIN>;
+&checkresult($result);
print STDERR "================== Complete ======================\n";
print STDERR "$tests tests completed, $pass passed, $fail failed\n";