V
V
Vladimir Sachkov2018-12-05 09:08:18
Java
Vladimir Sachkov, 2018-12-05 09:08:18

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

1 answer(s)
R
roswell, 2018-12-06
@J3alenok

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 question

Ask a Question

731 491 924 answers to any question