Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d886f39
Cleanup name
piotrooo Dec 8, 2023
bb52c6f
Not encode nulls
piotrooo Dec 10, 2023
1d98984
Add test to LoginAction
piotrooo Dec 11, 2023
c41596d
Add test to LoginAction
piotrooo Dec 12, 2023
2be7d31
Refactor CoreSettingsAction
piotrooo Dec 12, 2023
3f14d65
Refactor CommandAction
piotrooo Dec 12, 2023
513da9d
Refactor CoreStatusAction
piotrooo Dec 15, 2023
b47342a
Refactor LogoffAction
piotrooo Dec 15, 2023
995724c
Refactor LogoffAction - cleanup
piotrooo Dec 15, 2023
427e9f7
Refactor EventsAction
piotrooo Dec 15, 2023
1eb7c86
Refactor ListCommandsAction
piotrooo Dec 15, 2023
34e8a67
Refactor ListCommandsAction - cleanup
piotrooo Dec 15, 2023
59789ea
Add helper method
piotrooo Dec 16, 2023
d849ee8
Cleanup
piotrooo Dec 17, 2023
4f3fcac
Add helper method
piotrooo Dec 17, 2023
239461e
Refactor ListCategoriesAction
piotrooo Dec 17, 2023
3733604
Refactor CreateConfigAction
piotrooo Dec 18, 2023
9f3fa19
Refactor UpdateConfigAction
piotrooo Dec 23, 2023
557c2e4
Repackage actions to api package
piotrooo Dec 23, 2023
61791f7
Refactor GetConfigJsonAction
piotrooo Dec 23, 2023
5818a28
Refactor coders on top of jackson-databind
piotrooo Dec 26, 2023
a507b5f
Refactor PingAction
piotrooo Dec 27, 2023
7f645d2
Refactor DbPutAction
piotrooo Dec 27, 2023
57accd8
Refactor DbDelAction
piotrooo Dec 27, 2023
a44157b
Cleanup
piotrooo Dec 27, 2023
6b360a7
Refactor DbDelTreeAction
piotrooo Dec 27, 2023
962d553
Make line in update config delete nullable
piotrooo Dec 27, 2023
4f67a18
Refactor QueueAddAction
piotrooo Dec 27, 2023
eca119b
Cleanup
piotrooo Dec 28, 2023
e6d2e85
Refactor DbGetAction and cleanup response events
piotrooo Dec 30, 2023
bbc921c
Fix falling tests
piotrooo Oct 19, 2025
c1dca6c
Fix falling tests
piotrooo Oct 19, 2025
8de3ccf
Cleanup
piotrooo Oct 19, 2025
e76eb4d
Cleanup
piotrooo Oct 19, 2025
47e4a33
Cleanup
piotrooo Oct 19, 2025
e527b9f
Cleanup
piotrooo Oct 19, 2025
61a2ce0
Cleanup
piotrooo Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
filter-by-commitish: true
commitish: master
commitish: main
template: |
## What's Changed

Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17, 21 ]
java:
- 17
- 21
steps:
- name: Check out code
uses: actions/checkout@v4.1.1
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3.13.0
uses: actions/setup-java@v5.0.0
with:
distribution: temurin
java-version: ${{ matrix.java }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5.0.0

- name: Build
uses: gradle/gradle-build-action@v2.9.0
with:
arguments: build
run: ./gradlew build
6 changes: 3 additions & 3 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ permissions:
jobs:
update_release_draft:
permissions:
contents: write # for release-drafter to create a GitHub release
contents: write # To create a GitHub Release
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5.25.0
- uses: release-drafter/release-drafter@v6.1.0
with:
config-name: release-drafter-master.yml
config-name: release-drafter-main.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ build/
/.metadata/
/.packages
/.dart_tool/
out/
35 changes: 21 additions & 14 deletions asterisk-java-ami/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,29 @@ repositories {
dependencies {
implementation project(':asterisk-java-core')

implementation 'org.apache.commons:commons-lang3:3.14.0'

testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testImplementation 'org.mockito:mockito-core:5.7.0'
testImplementation 'ch.qos.logback:logback-classic:1.4.11' //todo remove

testImplementation platform('org.testcontainers:testcontainers-bom:1.19.3')
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.testcontainers:testcontainers'
implementation libs.apache.commons.codec
implementation libs.apache.commons.lang3

testImplementation libs.assertj.core
testImplementation libs.jsonassert
testImplementation libs.junit.jupiter
testImplementation libs.mockito.core
testImplementation libs.slf4j.simple

testImplementation platform(libs.testcontainers.bom)
testImplementation('org.testcontainers:testcontainers-junit-jupiter') {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
}
testImplementation('org.testcontainers:testcontainers') {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
}

//todo only for testing framework
testImplementation 'io.netty:netty-codec:4.1.101.Final'
testImplementation 'io.netty:netty-handler:4.1.101.Final'
testImplementation 'io.netty:netty-transport:4.1.101.Final'
testImplementation 'org.awaitility:awaitility:4.2.0'
testImplementation libs.netty.codec
testImplementation libs.netty.handler
testImplementation libs.netty.transport

testRuntimeOnly libs.junit.platform.launcher
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package org.asteriskjava.ami.action.annotation;

import org.asteriskjava.ami.action.ManagerAction;
import org.asteriskjava.ami.action.response.ManagerActionResponse;
import org.asteriskjava.ami.action.api.ManagerAction;
import org.asteriskjava.ami.action.api.response.ManagerActionResponse;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2004-2023 Asterisk Java contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.asteriskjava.ami.action.annotation;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* @author Piotr Olaszewski
* @since 4.0.0
*/
@Target(TYPE)
@Retention(RUNTIME)
public @interface GeneratedEvents {
Event[] value();

@interface Event {
Class<?> value();

String name();

boolean complete() default false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.asteriskjava.ami.action;
package org.asteriskjava.ami.action.api;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.asteriskjava.core.databind.annotation.AsteriskName;
Expand All @@ -32,9 +32,9 @@ public abstract class AbstractManagerAction implements ManagerAction {
@Serial
private static final long serialVersionUID = -7667827187378395689L;

@AsteriskName("ActionID")
private String actionId;

@AsteriskName("ActionID")
public String getActionId() {
return actionId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.asteriskjava.ami.action;
package org.asteriskjava.ami.action.api;

/**
* Digest algorithms to use in the challenge.
*
* @author Piotr Olaszewski
* @see ChallengeAction
* @since 4.0.0
*/
public enum AuthType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.asteriskjava.ami.action;
package org.asteriskjava.ami.action.api;

import org.asteriskjava.ami.action.annotation.ExpectedResponse;
import org.asteriskjava.ami.action.response.ChallengeManagerActionResponse;
import org.asteriskjava.ami.action.api.response.ChallengeActionResponse;

import java.io.Serial;

/**
* The {@link ChallengeAction} requests a challenge from the server to use when logging in using challenge/response.
* Sending this action to the Asterisk server results in a {@link ChallengeManagerActionResponse} being received from the server.
* Sending this action to the Asterisk server results in a {@link ChallengeActionResponse} being received from the server.
* <p>
* Supported Asterisk versions:
* <ul>
Expand All @@ -32,10 +32,9 @@
*
* @author Stefan Reuter
* @author Piotr Olaszewski
* @see ChallengeManagerActionResponse
* @since 1.0.0
*/
@ExpectedResponse(ChallengeManagerActionResponse.class)
@ExpectedResponse(ChallengeActionResponse.class)
public class ChallengeAction extends AbstractManagerAction {
@Serial
private static final long serialVersionUID = 7240516124871953971L;
Expand All @@ -47,16 +46,10 @@ public String getAction() {
return "Challenge";
}

/**
* Asterisk argument: {@code AuthType}.
*/
public AuthType getAuthType() {
return authType;
}

/**
* Sets Asterisk argument: {@code AuthType}.
*/
public void setAuthType(AuthType authType) {
this.authType = authType;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright 2004-2023 Asterisk Java contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.asteriskjava.ami.action.api;

import org.asteriskjava.ami.action.annotation.ExpectedResponse;
import org.asteriskjava.ami.action.api.response.CommandActionResponse;

import java.io.Serial;

/**
* The CommandAction sends a command line interface (CLI) command to the Asterisk server.
* <p>
* For a list of supported commands type {@code help} on Asterisk's command line.
* <p>
* In response to a CommandAction you will receive a {@link CommandActionResponse} that contains the CLI output.
* <p>
* Supported Asterisk versions:
* <ul>
* <li>18 - <a href="https://docs.asterisk.org/Asterisk_18_Documentation/API_Documentation/AMI_Actions/Command/">Command</a></li>
* <li>20 - <a href="https://docs.asterisk.org/Asterisk_20_Documentation/API_Documentation/AMI_Actions/Command/">Command</a></li>
* </ul>
* <p>
* Example:
* <pre>
* CommandAction commandAction = new CommandAction("iax2 show peers");
* CommandResponse response = (send);
* for (String line : response.getResult()) {
* System.out.println(line);
* }
* </pre>
*
* @author Stefan Reuter
* @since 1.0.0
*/
@ExpectedResponse(CommandActionResponse.class)
public class CommandAction extends AbstractManagerAction {
@Serial
private static final long serialVersionUID = 4753117770471622025L;

private String command;

public CommandAction() {
}

public CommandAction(String command) {
this.command = command;
}

@Override
public String getAction() {
return "Command";
}

public String getCommand() {
return command;
}

public void setCommand(String command) {
this.command = command;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2004-2023 Asterisk Java contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.asteriskjava.ami.action.api;

import org.asteriskjava.ami.action.annotation.ExpectedResponse;
import org.asteriskjava.ami.action.api.response.CoreSettingsActionResponse;

import java.io.Serial;

/**
* The {@link CoreSettingsActionResponse} requests a settings summary from the server. The settings include the version,
* system name, and various system limits.
* <p>
* Supported Asterisk versions:
* <ul>
* <li>18 - <a href="https://docs.asterisk.org/Asterisk_18_Documentation/API_Documentation/AMI_Actions/CoreSettings/">CoreSettings</a></li>
* <li>20 - <a href="https://docs.asterisk.org/Asterisk_20_Documentation/API_Documentation/AMI_Actions/CoreSettings/">CoreSettings</a></li>
* </ul>
*
* @author Stefan Reuter
* @since 1.0.0
*/
@ExpectedResponse(CoreSettingsActionResponse.class)
public class CoreSettingsAction extends AbstractManagerAction {
@Serial
private static final long serialVersionUID = 1L;

@Override
public String getAction() {
return "CoreSettings";
}
}
Loading