I am new to Asterisk and have started to write an application which uses the ARI.
As a Java Developer I use the framework ari4java.
My prototype code is:
ARI ari = ARI.build(asteriskUrl, asteriskApp, user, password, AriVersion.ARI_6_0_0);
String endpoint = “PJSIP/” + “44448888”;
this.channel = ari.channels().originate(endpoint).setApp(asteriskApp).execute();
ari.channels().play(channel.getId(), “C:\audio\0b09418f-f2cc-4da0-9fad-0d71c2b1e1b6.wav”);
The softphone rings, I click answer and there is the following line in the Asterisk log:
WARNING[14479]: ari/resource_channels.c:1032 ari_originate_dial: No such application ‘Stasis’
Ok I loaded the module and now it works.
The audio file is not played, but the call is not terminated and no warning in the log.
The audio file is an issue of its own i guess …
I have no experience with ari4java, but ARI itself is asynchronous. This means that until the channel has entered the ARI application you can’t play a sound file to it. You also can’t play a sound file on your local hard drive, only files stored with Asterisk.