my $ssh = Net::OpenSSH->new($host, "user"=>$user, "passwd"=>$pass);
$ssh->error and die "Couldn't establish connection: ". $ssh->error;
my @output = $ssh->capture('control call dial $receiver');
$ssh->error and warn "Couldn't make the call: ". $ssh->error;
print "line: $_" for (@output);
sleep(1);
my @output = $ssh->capture('control call hangup -a');
$ssh->error and warn "Couldn't hangup: ". $ssh->error;
print "line: $_" for (@output);
####
line:
line: ok,00
line:
line: ok,00
####
$ control call dial *receiver*
ok,00
CS,23,1,Dialing
$ control call hangup -a
ok,00
CS,23,1,Terminated
$