On 17/05/11 3:25 AM, vip killa wrote:> I'm using a perl daemon i wrote to connect to AMI and perform actions.
> The daemon connects to asterisk via AMI at start up. Is there anyway to
> check if the AMI connection is still alive, for example every 2 seconds.
> if the connection is not alive, re-connect to AMI? Also, does AMI
> timeout after a certain amount of time of not sending commands?
Send an "Action: Ping\r\n\r\n" command. You should receive a
response.
Run a timer on it and if you don't get a response reconnect.
--
Cheers,
Matt Riddell
_______________________________________________
http://www.venturevoip.com/news.php (Daily Asterisk News)
http://www.venturevoip.com/exchange.php (Full ITSP Solution)
http://www.venturevoip.com/cc.php (Call Centre Solutions)