Alex Villacís Lasso
2012-Oct-19 17:31 UTC
[asterisk-users] Tell apart between network disruption and asterisk restart via AMI
I have a program that connects to the Asterisk Manager Interface through port 5038 on a remote machine. Suppose I get a TCP disconnection on my program. The program will then attempt to reconnect to the AMI and will eventually succeed. Is there a way to check whether the disconnection was caused by a network disruption, or an Astersk restart/crash? In other words, is the Asterisk process I contacted now the same as the one I was connected before, or is it a different one? The reason I want to know is that I have a cache of information that is costly to parse (scales linearly with the number of extensions) and I want to know how to realize that the information is now stale.
Jim Dickenson
2012-Oct-19 17:44 UTC
[asterisk-users] Tell apart between network disruption and asterisk restart via AMI
From AMI you can get uptime. If the uptime is short likely Asterisk restarted. -- Jim Dickenson mailto:dickenson at cfmc.com CfMC http://www.cfmc.com/ On Oct 19, 2012, at 10:31 AM, Alex Villac??s Lasso wrote:> I have a program that connects to the Asterisk Manager Interface through port 5038 on a remote machine. Suppose I get a TCP disconnection on my program. The program will then attempt to reconnect to the AMI and will eventually succeed. Is there a way to check whether the disconnection was caused by a network disruption, or an Astersk restart/crash? In other words, is the Asterisk process I contacted now the same as the one I was connected before, or is it a different one? The reason I want to know is that I have a cache of information that is costly to parse (scales linearly with the number of extensions) and I want to know how to realize that the information is now stale. > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Christopher Harrington
2012-Oct-19 17:59 UTC
[asterisk-users] Tell apart between network disruption and asterisk restart via AMI
On Fri, Oct 19, 2012 at 12:31 PM, Alex Villac??s Lasso < a_villacis at palosanto.com> wrote:> I have a program that connects to the Asterisk Manager Interface through > port 5038 on a remote machine. Suppose I get a TCP disconnection on my > program. The program will then attempt to reconnect to the AMI and will > eventually succeed. Is there a way to check whether the disconnection was > caused by a network disruption, or an Astersk restart/crash? In other > words, is the Asterisk process I contacted now the same as the one I was > connected before, or is it a different one? The reason I want to know is > that I have a cache of information that is costly to parse (scales linearly > with the number of extensions) and I want to know how to realize that the > information is now stale. > >In the CLI, you can run `core show settings` which will tell you the startup time of the server. -- -Chris Harrington ACSDi Office: 763.559.5800 Mobile Phone: 612.326.4248 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20121019/d6ea4c3f/attachment.htm>