[Asterisk-cvs] asterisk/agi agi-test.agi,1.1,1.2
markster at lists.digium.com
markster at lists.digium.com
Fri Jan 9 08:41:20 CST 2004
Update of /usr/cvsroot/asterisk/agi
In directory mongoose.digium.com:/tmp/cvs-serv1617/agi
Modified Files:
agi-test.agi
Log Message:
Perl cleanups
Index: agi-test.agi
===================================================================
RCS file: /usr/cvsroot/asterisk/agi/agi-test.agi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- agi-test.agi 31 Jul 2001 13:34:45 -0000 1.1
+++ agi-test.agi 9 Jan 2004 14:33:03 -0000 1.2
@@ -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 @@
}
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 @@
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";
More information about the svn-commits
mailing list