mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 03:48:02 +00:00
Perl cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1911 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
|
use strict;
|
||||||
|
|
||||||
$|=1;
|
$|=1;
|
||||||
|
|
||||||
|
# Setup some variables
|
||||||
|
my %AGI; my $tests = 0; my $fail = 0; my $pass = 0;
|
||||||
|
|
||||||
while(<STDIN>) {
|
while(<STDIN>) {
|
||||||
chomp;
|
chomp;
|
||||||
last unless length($_);
|
last unless length($_);
|
||||||
@@ -9,7 +15,7 @@ while(<STDIN>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print STDERR "AGI Environment Dump:\n";
|
print STDERR "AGI Environment Dump:\n";
|
||||||
foreach $i (sort keys %AGI) {
|
foreach my $i (sort keys %AGI) {
|
||||||
print STDERR " -- $i = $AGI{$i}\n";
|
print STDERR " -- $i = $AGI{$i}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,38 +41,38 @@ sub checkresult {
|
|||||||
|
|
||||||
print STDERR "1. Testing 'sendfile'...";
|
print STDERR "1. Testing 'sendfile'...";
|
||||||
print "STREAM FILE beep \"\"\n";
|
print "STREAM FILE beep \"\"\n";
|
||||||
$result = <STDIN>;
|
my $result = <STDIN>;
|
||||||
checkresult($result);
|
&checkresult($result);
|
||||||
|
|
||||||
print STDERR "2. Testing 'sendtext'...";
|
print STDERR "2. Testing 'sendtext'...";
|
||||||
print "SEND TEXT \"hello world\"\n";
|
print "SEND TEXT \"hello world\"\n";
|
||||||
$result = <STDIN>;
|
my $result = <STDIN>;
|
||||||
checkresult($result);
|
&checkresult($result);
|
||||||
|
|
||||||
print STDERR "3. Testing 'sendimage'...";
|
print STDERR "3. Testing 'sendimage'...";
|
||||||
print "SEND IMAGE asterisk-image\n";
|
print "SEND IMAGE asterisk-image\n";
|
||||||
$result = <STDIN>;
|
my $result = <STDIN>;
|
||||||
checkresult($result);
|
&checkresult($result);
|
||||||
|
|
||||||
print STDERR "4. Testing 'saynumber'...";
|
print STDERR "4. Testing 'saynumber'...";
|
||||||
print "SAY NUMBER 192837465 \"\"\n";
|
print "SAY NUMBER 192837465 \"\"\n";
|
||||||
$result = <STDIN>;
|
my $result = <STDIN>;
|
||||||
checkresult($result);
|
&checkresult($result);
|
||||||
|
|
||||||
print STDERR "5. Testing 'waitdtmf'...";
|
print STDERR "5. Testing 'waitdtmf'...";
|
||||||
print "WAIT FOR DIGIT 1000\n";
|
print "WAIT FOR DIGIT 1000\n";
|
||||||
$result = <STDIN>;
|
my $result = <STDIN>;
|
||||||
checkresult($result);
|
&checkresult($result);
|
||||||
|
|
||||||
print STDERR "6. Testing 'record'...";
|
print STDERR "6. Testing 'record'...";
|
||||||
print "RECORD FILE testagi gsm 1234 3000\n";
|
print "RECORD FILE testagi gsm 1234 3000\n";
|
||||||
$result = <STDIN>;
|
my $result = <STDIN>;
|
||||||
checkresult($result);
|
&checkresult($result);
|
||||||
|
|
||||||
print STDERR "6a. Testing 'record' playback...";
|
print STDERR "6a. Testing 'record' playback...";
|
||||||
print "STREAM FILE testagi \"\"\n";
|
print "STREAM FILE testagi \"\"\n";
|
||||||
$result = <STDIN>;
|
my $result = <STDIN>;
|
||||||
checkresult($result);
|
&checkresult($result);
|
||||||
|
|
||||||
print STDERR "================== Complete ======================\n";
|
print STDERR "================== Complete ======================\n";
|
||||||
print STDERR "$tests tests completed, $pass passed, $fail failed\n";
|
print STDERR "$tests tests completed, $pass passed, $fail failed\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user