To place H.323 test calls, you cannot beat ohphone:
(sleep 30; echo q) | ohphone -s Default -n -u from_user to_user@gateway > /tmp/output.$$
You can usually find ohphone as a package in your Linux distribution:
apt-get install ohphone
The source can be found on voxgratia
. While it is older, it still works great.
, - perl script errno.
:
$delay=$ARGV[0];
if(! $delay) { $delay = 10; }
$from=$ARGV[1];
if(! $from) { $from = "default_from_user"; }
$to=$ARGV[2];
if(! $to) { $to = "default_to_user"; }
$gateway=$ARGV[3];
if(! $gateway) { $gateway = "127.0.0.1"; }
print "Running: (sleep $delay; echo q ) | (ohphone -s Default -n -u $from $to\@$gateway)|\n";
open(IN,"(sleep $delay; echo q ) | (ohphone -s Default -n -u $from $to\@$gateway)|");
my $call_started=false;
my $call_completed=false;
my @results;
my $skip=1;
while($line=<IN>) {
if($line=~/Listening interfaces/) {
$skip=0;
next;
}
if($skip) {
next;
}
if($line=~/^Could not open sound device/) {
next;
}
chomp($line);
push(@results,$line);
if($line=~/was busy$/) {
print "$to: Called party busy\n";
exit 1;
}
if($line=~/^Call with .* completed, duration (.*)$/) {
print "$to: Completed duration $1 call.\n";
exit 0;
}
if($line=~/has cleared the call, duration (.*)$/) {
print "$to: Completed duration $1 call.\n";
exit 0;
}
if($line=~/^Call with .* completed$/) {
print "$to: No call duration.\n";
exit 2;
}
}
close(IN);
$result=join("\n",@results);
print "$ARGV[0]: Unknown results:\n$result\n";
exit 255;
script , .