[Asterisk-java-devel] ARI support in asterisk 2.0
Brought to you by:
srt
From: Martin D. <md...@du...> - 2015-04-17 00:15:09
|
I have done a little bit of exploratory work with ARI4Java. It is an excellent library, but several things stood out. * ARI is tough in a multi-threaded environment * Just like AMI, it is event driven and gives you a lot of control. The downside, is that you have to orchestrate a large number of events. This can be overcome, but is a consideration especially at high-volume. All of the examples on the Digium github site ( https://github.com/asterisk/ari-examples) use Python and Javascript libraries that handle much of the plumbing of catching different events. * ARI uses multiple TCP connections * Part of the challenge is not only to manage which event goes with which event flow across threads, but also across an arbitrary number of connections. ARI4Java uses Netty which has an interesting solution for this, however, grizzly may also fit. There my be other libraries as well that could do this sort of thing, but I have looked at those two in depth. * ARI is still changing quickly * The ARI API is already at version 1.7. So this is a moving target. They provide Swagger bindings for there services which is helpful. However, getting Swagger-codegen up and running is trickier than you would think from the Swagger website. * ARI is an Application API * ARI seems designed to allow you to create your own dialplan applications. Most of their examples at conferences have been around creating your own voice-mail application, or call queue application. This is a pretty powerful concept. In an ideal world, opening up this kind of API should lead to the development of "shareable" modules that could be plugged into asterisk without the need to learn C or the headaches of ABI compatibility. To make a long story short. It is still easier to do most things in AGI. It is still easier to get asterisk events from AMI. But if you want something small, composible and low-level, ARI might be a better choice. Regards, Martin |