forked from ari4java/ari4java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloAriWorld.java
More file actions
45 lines (35 loc) · 1.17 KB
/
HelloAriWorld.java
File metadata and controls
45 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Hello ARI World!
*/
package helloworld;
import ch.loway.oss.ari4java.ARI;
import ch.loway.oss.ari4java.AriFactory;
import ch.loway.oss.ari4java.AriVersion;
import ch.loway.oss.ari4java.generated.AsteriskInfo;
import ch.loway.oss.ari4java.generated.Channel;
import java.util.List;
/**
* This is a sample printig current system information.
*
* @author lenz
*/
public class HelloAriWorld {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Hello ARI world!");
try {
ARI ari = AriFactory.nettyHttp(
"http://10.10.5.41:8088/",
"ari4java", "yothere",
AriVersion.ARI_1_5_0);
AsteriskInfo info = ari.asterisk().getInfo("");
List<Channel> channels = ari.channels().list();
System.out.println("There are " + channels.size() + " active channels now.");
System.out.println( "System up since " + info.getStatus().getStartup_time() );
} catch (Throwable t) {
t.printStackTrace();
}
}
}