Skip to content

Message type always null on ari.getWebsocketQueue() call #100

@sbodmer

Description

@sbodmer

For asterisk 15+ the message find in the queue produced by a call to ari.getWebsocketQueue() will always return null in the message types.

Note: The ari.getWebsocketQueue() call wil also fire an unsupported exception, so I have to add a new method ari.getWebsocketQueue(String) which will call the correct supported underlying method

public MessageQueue getWebsocketQueue(String app) throws ARIException {

        if ( liveActionEvent != null ) {
            throw new ARIException( "Websocket already present" );
        }

        final MessageQueue q = new MessageQueue();
        //--- The eventWebsocket(String, Callback) is not supported by Asterisk 13.19+
        //--- so call the one with the subscribeAll parameter which is supported
        events().eventWebsocket( app, true, new AriCallback<Message>() {

            @Override
            public void onSuccess(Message result) {
                q.queue( result );
            }

            @Override
            public void onFailure(RestException e) {
                q.queueError("Err:" + e.getMessage());
            }
        });

        return q;

    }

A submitted a pull request to add this new method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions