New to ARI4Java - build version vs ARI version

I’m trying to build a java application to initiate a phone call using the ARI interface, however, I’m facing two issues:-

  1. When I set the ARI version to 1.9.0 I get the following response when creating a bridge
ch.loway.oss.ari4java.tools.RestException: Decoding JSON: Method availble from ...
 at [Source: {"id":"a4j-bridge1","technology":"holding_bridge","bridge_type":"holding","bridge_class":"stasis","creator":"Stasis","name":"myBridge","channels":[],"video_mode":"talker"}; line: 1, column: 163] (through reference chain: ch.loway.oss.ari4java.generated.ari_1_9_0.models.Bridge_impl_ari_1_9_0["video_mode"])
  1. When I change the ARI version to 2.0.0, 3.0.0 or 4.0.0 I get the exception
Exception in thread "main" java.lang.UnsupportedOperationException: Method availble from ...
	at ch.loway.oss.ari4java.generated.ari_2_0_0.actions.ActionEvents_impl_ari_2_0_0.eventWebsocket(ActionEvents_impl_ari_2_0_0.java:100)
	at ch.loway.oss.ari4java.ARI.getWebsocketQueue(ARI.java:454)

Could someone please help point me in the right direction as I’m unclear how to proceed. I’ve provided more details of the environment and code I’m using below.

The versions I’m using are as follows:-

* Asterisk version 13.18_cert2 
* ARI4Java built with version 0.3.4 - the github docs state "16.01.30 - Added support for ARI 1.9.0 - release 0.3.4" - https://github.com/l3nz/ari4java.  I changed the app_version attribute in the gradle build script to '0.3.4' and called the gradle build task to generate the jar.
* ARI 1.9.0 - according to the github docs 1.9.0 is the correct version of ARI to use.

I’ve provided an excerpt of the code I’m using to connect which is derived from the ConnectAndDial class:-


        ari = ARI.build( ASTERISK_ADDRESS, APP_NAME,
                ASTERISK_USER, ASTERISK_PASS,
                AriVersion.ARI_1_9_0);

        List<Bridge> bridges = ari.bridges().list();

        b = ari.bridges().create("holding", "a4j-bridge1", "myBridge");
            
        MessageQueue mq = ari.getWebsocketQueue();

        String dummy = "";

        // the dummy phone number has been provided here
        Channel chan = ari.channels().originate("SIP/+1999999999@mycontext", "", "mycontext", 1, dummy, dummy, dummy, dummy, 10000, Collections.EMPTY_MAP, dummy, dummy, dummy);

        Message m = mq.dequeueMax( 100, 20 );

            if (message instanceof StasisStart) {
                StasisStart event = (StasisStart) message;
                System.out.println("Channel found: " + event.getChannel().getId() + " State:" + event.getChannel().getState());

                ari.bridges().addChannel(b.getId(), event.getChannel().getId(), "");
            }

Any help you can provide would be greatly appreciated.

Thanks…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.