我正在學習有關連接到星號的perl中的Asterisk :: AMI模塊。在運行以下程序時,我無法連接到星號。任何人都可以給我解決方案來解決這個問題?Asterisk :: AMI模塊
use Asterisk::AMI;
my $astman = Asterisk::AMI->new(PeerAddr => '127.0.0.1', #Remote host address
PeerPort => '5038', #Remote host port
#AMI is available on TCP port 5038 if you enable it in manager.conf.
Username => 'admin', #Username to access the AMI
Secret => 'supersecret' #Secret used to connect to AMI
);
die "Unable to connect to asterisk" unless ($astman);
my $action = $astman->({ Action => 'Command',
Command => 'sip show peers'
});
print $action;
在此先感謝。
我們正在嘗試啓動一個電話堆棧交換站點,如果您有興趣,請考慮提交:[StackExchange Telephony Beta](http://area51.stackexchange.com/proposals/12932/telephony?referrer=t19aZKsEkDYFK9yUPwMC_g2) – Jacinda 2011-06-03 16:08:36