Skip to content

Commit 7b1a60d

Browse files
committed
update readme - restructure and new release
1 parent 8807070 commit 7b1a60d

File tree

1 file changed

+39
-125
lines changed

1 file changed

+39
-125
lines changed

README.md

Lines changed: 39 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
ari4java
2-
========
1+
# ari4java
32

43
The Asterisk REST Interface (ARI) bindings for Java.
54

65
[![Download](https://api.bintray.com/packages/ari4java/maven/ari4java/images/download.png)](https://bintray.com/ari4java/maven/ari4java/_latestVersion)
76

8-
Description
9-
-----------
7+
## Description
108

119
ARI is an interface available on Asterisk 11+ that lets you write applications
1210
that run externally and control call flow through REST calls while receiving
@@ -16,68 +14,53 @@ In order to support different versions of the API, what we do is we maintain con
1614
for each version of the API, but we also have general interfaces that are used to work with objects
1715
across different versions.
1816

19-
**Getting started?**
20-
21-
* Start from the "Hello ARI World" tutorial at https://github.com/l3nz/ari4java/blob/master/docs/HELLOWORLD.md
22-
* Read our FAQs at https://github.com/l3nz/ari4java/blob/master/docs/FAQ.md
23-
* Want to run a ready-made Asterisk image? This will make your life easier when developing! get
24-
yours from https://github.com/l3nz/whaleware/tree/master/examples/asterisk-load-test
25-
26-
27-
Using the library
28-
=================
17+
## Using the library
2918

3019
If you use Gradle (or any tool using Maven dependencies) you can simply declare the lib as:
31-
32-
repositories {
33-
maven {
34-
url "https://dl.bintray.com/ari4java/maven"
35-
}
36-
mavenCentral()
37-
jcenter()
20+
```
21+
repositories {
22+
maven {
23+
url "https://dl.bintray.com/ari4java/maven"
3824
}
39-
40-
dependencies {
41-
compile 'ch.loway.oss.ari4java:ari4java:0.7.0'
42-
}
43-
25+
mavenCentral()
26+
jcenter()
27+
}
28+
29+
dependencies {
30+
compile 'ch.loway.oss.ari4java:ari4java:0.8.0'
31+
}
32+
```
4433
This will download the package and all required dependencies.
4534
*The 1st repo declaration is temporary as we sort out moving from a private repo to an organization*
4635

47-
Building
48-
========
49-
50-
The code here is partially hand-written and partially generated out of Swagger definitions.
36+
### Getting started?
5137

52-
* "src/main/java" contains Java code to be released (manually and automatically generated).
53-
* "src/main/generated" Are all automatically generated classes, they should not be hand-edited.
54-
* "src/test/java/" contains test cases for "src/main/java"
55-
* "codegen/" is a gradle sub-project that generates code in "src/main/generated"
38+
- Start from the ["Hello ARI World"](https://github.com/l3nz/ari4java/blob/master/docs/HELLOWORLD.md) tutorial at
39+
- Read our [FAQs](https://github.com/l3nz/ari4java/blob/master/docs/FAQ.md)
40+
- Check out more detailed [USAGE](https://github.com/l3nz/ari4java/blob/master/docs/USAGE.md)
41+
- Want to run a ready-made Asterisk image? This will make your life easier when developing! get
42+
yours from https://github.com/l3nz/whaleware/tree/master/examples/asterisk-load-test
5643

44+
## Building
45+
The code here is partially hand-written and partially generated out of Swagger definitions.
5746

58-
Testing and packaging
59-
---------------------
47+
### Folders:
48+
- "src/main/java" contains Java code to be released (manually and automatically generated).
49+
- "src/main/generated" Are all automatically generated classes, they should not be hand-edited.
50+
- "src/test/java/" contains test cases for "src/main/java"
51+
- "codegen/" is a gradle sub-project that generates code in "src/main/generated"
6052

53+
### Build and test
6154
The easiest way to build is simply using the Gradle Wrapper script supplied.
55+
```
56+
./gradlew clean build
57+
```
58+
This will generate, compile, test and package the current version.
59+
You'll find the resulting jar file under the `build/libs` folder.
6260

63-
./gradlew clean build
64-
65-
This will compile, test and package the current version.
66-
You'll find the resulting jar file under 'build/libs'.
67-
68-
Running
69-
-------
70-
71-
The project requires:
72-
73-
- jackson-core-2.9.6
74-
- jackson-databind-2.9.6
75-
- jackson-annotations-2.9.6
76-
- netty-all-4.0.25-Final
77-
78-
Status
79-
------
61+
## Status
8062

63+
* 19.12.23 - Rel 0.8.0. :exclamation: **!! BREAKING CHANGES !!** API Actions signatures only contain manditory params and returns a Request object which follows the builder/factory pattern
8164
* 19.12.22 - Rel 0.7.0. Treat `fields` as `fields` not `variables` in body parameters; fix `ActionRecordings.getStoredFile()` for `byte[]` & add `ARI.mailboxes()`
8265
* 19.11.07 - Rel 0.6.1. Codegen bug fixes for object and rebuild with latest ARI api docs
8366
* 19.10.13 - Rel 0.6.0. Project restructure and include all past and present versions of ARI
@@ -105,90 +88,21 @@ Status
10588
* 13.10.18 - Auto-generates all classes and compiles them.
10689

10790

108-
Using
109-
-----
110-
111-
To use the Netty.io HTTP+WS implementation, include netty-all-4.0.12.Final.jar or newer in your classpath.
112-
113-
To initialize:
114-
115-
ARI ari = new ARI();
116-
NettyHttpClient hc = new NettyHttpClient();
117-
hc.initialize("http://my-pbx-ip:8088/", "admin", "admin");
118-
ari.setHttpClient(hc);
119-
ari.setWsClient(hc);
120-
ari.setVersion(AriVersion.ARI_0_0_1);
121-
122-
or make your life easier by using the convenience method supplied in AriFactory.
123-
124-
Sample synchronous call:
125-
126-
ActionApplications ac = ari.getActionImpl(ActionApplications.class);
127-
List<? extends Application> alist = ac.list();
128-
129-
Sample asynchronous call:
130-
131-
ActionAsterisk aa = ari.getActionImpl(ActionAsterisk.class);
132-
aa.getGlobalVar("AMPMGRPASS", new AriCallback<Variable>() {
133-
@Override
134-
public void onSuccess(Variable result) {
135-
// Let's do something with the returned value
136-
}
137-
@Override
138-
public void onFailure(RestException e) {
139-
e.printStackTrace();
140-
}
141-
});
142-
143-
Sample WebSocket connection, waiting for events on hello and goodbye apps:
144-
145-
ActionEvents ae = ari.getActionImpl(ActionEvents.class);
146-
ae.eventWebsocket("hello,goodbye", new AriCallback<Message>() {
147-
@Override
148-
public void onSuccess(Message result) {
149-
// Let's do something with the event
150-
}
151-
@Override
152-
public void onFailure(RestException e) {
153-
e.printStackTrace();
154-
}
155-
});
156-
Thread.sleep(5000); // Wait 5 seconds for events
157-
ari.closeAction(ae); // Now close the websocket
158-
159-
The Message object in the code above will be one of the message subtypes,
160-
you will have to introspect to find out which.
161-
162-
To be done
163-
----------
164-
165-
* Parameters that could be multiple are handled as only one item. I would like to have
166-
both ways, so that you do not have to create a List in the very common case that
167-
you need to pass only one parameter - see https://github.com/l3nz/ari4java/issues/10
168-
* Misc open bugs here: https://github.com/l3nz/ari4java/issues?q=is%3Aopen
169-
170-
171-
Useful links
172-
------------
173-
91+
## Useful links
17492
* Asterisk REST Interface wiki: https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573
17593
* Asterisk 16 ARI docs: https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+ARI
17694
* Asterisk-app-dev archives: http://lists.digium.com/pipermail/asterisk-app-dev/
17795

17896

179-
Similar & Interesting projects
180-
------------------------------
181-
97+
## Similar & Interesting projects
18298
* AstAryPy - a Python library - https://github.com/asterisk/ast-ari-py
18399
* AsterNET.ARI - C# / .NET - https://github.com/skrusty/AsterNET.ARI
184100
* node-ari-client - JavaScript (node) - https://github.com/asterisk/node-ari-client
185101
* phpari - PHP - http://www.phpari.org/
186102
* asterisk-ari-client - Ruby - https://github.com/svoboda-jan/asterisk-ari
187103

188104

189-
Licensing
190-
---------
191-
105+
## Licensing
192106
The library is released under the GNU LGPL (see LICENSE file).
193107
Files under codegen-data come from the Asterisk project and are licensed under the GPLv2 (see LICENSE.asterisk file therein).
194108
They are only used to build the classes and are not distribuited in any form with Ari4Java.

0 commit comments

Comments
 (0)