No such application 'Stasis'

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’

Do I have to configure Stasis related stuff?

Regards
Hans

Is the app_stasis module loaded?

These stasis modules are loaded

res_stasis.so Stasis application support 13 Running core
res_stasis_answer.so Stasis application answer support 1 Running core
res_stasis_playback.so Stasis application playback support 2 Running core
res_stasis_recording.so Stasis application recording support 3 Running core
res_stasis_snoop.so Stasis application snoop support 1 Running core

The app_stasis module is where the dialplan application is. If it’s not loaded, then the Stasis application won’t exist.

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.

Yes you are right, stupid to provide a file path on my local machine …

I have an event handler now. The funny thing is, the channel status is always ‘down’ during the whole call process (dial, answer).

Success Event: ChannelStateChange
Channel status: Down
Channel id: 1654259980.14
Success Event: Dial
Channel status: Down
Channel id: 1654259980.14
Success Event: ChannelVarset
Channel status: Down
Channel id: 1654259980.14
Success Event: StasisStart
Channel status: Down
Channel id: 1654259980.14
Success Event: ChannelHangupRequest
Channel status: Down
Channel id: 1654259980.14
Success Event: StasisEnd
Channel status: Down
Channel id: 1654259980.14
Success Event: ChannelVarset
Channel status: Down
Channel id: 1654259980.14
Success Event: ChannelDestroyed
Channel status: Down
Channel id: 1654259980.14

It’s unlikely you be down, instead you’re probably outputting stale local data for the channel.

I could make it work :smiley:

I play the sound after the event StasisStart now.

if(event.getType().equals(“StasisStart”)) {
ari.channels().play(channel.getId(), “sound:research-and-development”).execute();