Answer the question
In order to leave comments, you need to log in
Permanent connection to Asterisk PBX?
The essence of the question is how to keep a permanent connection with ASterisk PBX via java console. I have a code that executes my Action and I get a response, but the program is executed 1 time. How to implement a permanent connection (connection) clambered the Internet did not find anything worthwhile or missed it. Thanks in advance for your help.
Answer the question
In order to leave comments, you need to log in
More or less like this
Executors.newScheduledThreadPool(1).schedule(() -> {
if (managerConnection != null) {
managerConnection.sendAction(new PingAction());
}
}, 30, TimeUnit.SECONDS);
By the way, managerConnection.logoff() above in the code is a completely superfluous thing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question