Re: [Asterisk-java-users] Manager API logged off automatically
Brought to you by:
srt
From: Stefan R. <sr...@re...> - 2005-07-16 19:44:13
|
> Before I continue, I should mention that I'm using the 0.10 release and > asterisk 1.0.9 - in case that throws up any flags. Also, I am running the > manager API from a remote machine at the moment. Thats fine, same here :) > The Manager API gets logged off in under 10 minutes. It seems to be pretty > consistent at 7 minutes, but I can't get an exact snapshot of the time. The only difference to my setup might be that I have constant traffic on my ManagerConnection due to SIP and IAX peer, registry, whatever events. That doesn't seem to be the case with you as there is no activity in log between 2005-07-16 09:21:33,828 and 2005-07-16 09:31:04,062. Maybe there is some kind of networking device between you and the Asterisk server (a firewall?) that kills the connection. What you can do is to send PingActions to Asterisk to generate this traffic. I attached an example of such a PingThread that might be useful for you. Use it as follows: c = new ManagerConnectionFactory().getManagerConnection(...); c.login(); PingThread pingThread = new PingThread(c); pingThread.start(); [...] pingThread.die(); c.logoff(); > On the same topic, there is another issue that presents itself when the > manager is in this state. When I send a subsequent action, the Manager will > reconnect, but the action will always timeout. I've set the timeout value > on the action to an arbitrarily high amount. However, the action will > always time out when sent in this state. Hmmmmm lets see if the PingThread solves your problem and if not dive into this issue as well. =Stefan |