[asterisk-users] AMI check if connection is alive
Matt Riddell
lists at venturevoip.com
Mon May 16 20:18:40 CDT 2011
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)
More information about the asterisk-users
mailing list