Page 1 of 1

How to get the return data with Perl API ?

Posted: Sun Jul 25, 2010 9:12 am
by 200120022003
I have the code :
if (Mtik::login($mtik_host,$mtik_username,$mtik_password))
{
my %operands;
$operands{'numbers'} = '=stats';
my($retval,@results) = Mtik::mtik_cmd("/queue/simple/print", \%operands);
foreach (@results) {
  print "$_";
}
Mtik::logout;
}
Perl return :
HASH(0x84ddad0)
Can you help me ? Thank you !

Re: How to get the return data with Perl API ?

Posted: Sun Jul 25, 2010 10:26 am
by 200120022003
I solved the problem refer to mtik_tty.pl.

Thank you !
if (Mtik::login($mtik_host,$mtik_username,$mtik_password))
{
my @cmd = ("/queue/simple/print", "=stats");
my($retval,@results) = Mtik::raw_talk(\@cmd);
foreach my $result (@results) {
print ">>> $result\n";
}
Mtik::logout;
}