Using H.323 to test legacy voicemail systems

I was asked to develop a script that can dial in through H.323 a voicemail system that needs improved monitoring. (The device dies mysteriously and offers very little over snmp). The idea is to call the number and see if the answer answers it. The voicemail system will ring or not answer if there is a problem.

My problem is that I don't know anything about H.323 or the available libraries. (Perl is the language of choice in my company, but for something so specific, I could probably get away with python or using some binary programs.)

I found a dark rabbit hole when I was looking for H.323. I don’t know C or want to run pbx as a client, I found open sources, but there is no "call ()" function. I do not have cycles to learn each of them.

(If it weren’t for work, I would hook some python lines and use Twilio to do all the heavy lifting.)

I think I need some guidance on how to solve the problem.

thank

+5
source share
2 answers

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.

:

#!/usr/bin/env perl

$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 , .

+3

SIP Testing, SIP-. SIPp , ,

**EDIT:**

Yate , , , . -, .

+1

All Articles