Skip to content

Commit 1e9b613

Browse files
authored
feat: Add missing Conversation event types and endpoints (#573)
* feat: Add missing Conversation event types * feat: Add StreamPayload.Builder * feat: Add talk/stream endpoints to Conversations * fix: Update Call length_timer maximum * chore: Set 8.19 release date * Remove talk & stream overload deprecations * Add audio:record:done event * Add rtc:status event * Show pulse in README
1 parent a36e8ef commit 1e9b613

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2498
-157
lines changed

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
# [8.19.0] - 2025-03-12
6+
- Increased maximum call length validation in Voice API
7+
- Added start / stop text-to-speech and audio stream endpoints to Conversation API
8+
- Exposed `StreamPayload` in Voice API and added Builder
9+
- Added builder and custom headers for `MemberChannel` in Conversation API
10+
- Added support for the following event types in Conversation API:
11+
- `audio:dtmf`
12+
- `audio:record:done`
13+
- `audio:speaking:off`
14+
- `audio:speaking:on`
15+
- `member:media`
16+
- `rtc:answer`
17+
- `rtc:answered`
18+
- `rtc:ringing`
19+
- `rtc:status`
20+
- `rtc:transfer`
21+
- `sip:amd_machine`
22+
- `sip:answered`
23+
- `sip:machine`
24+
- `sip:ringing`
25+
526
# [8.18.0] - 2025-03-05
627
- Added MMS Text, File and Content outbound message types
728
- Added `getFileName` and `getFileCaption` to `com.vonage.client.messages.InboundMessage`

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
![CodeQL](https://github.com/Vonage/vonage-java-sdk/actions/workflows/codeql.yml/badge.svg)
77
[![codecov](https://codecov.io/gh/vonage/vonage-java-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/vonage/vonage-java-sdk)
88
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Vonage/vonage-java-sdk/badge)](https://scorecard.dev/viewer/?uri=github.com/Vonage/vonage-java-sdk)
9-
![SLOC](https://sloc.xyz/github/vonage/vonage-java-sdk??)
9+
![SLOC](https://sloc.xyz/github/vonage/vonage-java-sdk)
1010
[![Snyk](https://snyk.io/test/github/vonage/vonage-java-sdk/badge.svg)](https://snyk.io/test/github/vonage/vonage-java-sdk)
1111
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
1212
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE.txt)
13-
<!---[![Pulse](https://img.shields.io/github/commit-activity/m/vonage/vonage-java-sdk)](https://github.com/vonage/vonage-java-sdk/pulse)-->
13+
[![Pulse](https://img.shields.io/github/commit-activity/m/vonage/vonage-java-sdk)](https://github.com/vonage/vonage-java-sdk/pulse)
1414

1515
<img src="https://developer.nexmo.com/assets/images/Vonage_Nexmo.svg" height="48px" alt="Nexmo is now known as Vonage" />
1616

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.vonage</groupId>
77
<artifactId>server-sdk</artifactId>
8-
<version>8.18.0</version>
8+
<version>8.19.0</version>
99

1010
<name>Vonage Java Server SDK</name>
1111
<description>Java client for Vonage APIs</description>

src/main/java/com/vonage/client/HttpWrapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
public class HttpWrapper {
3838
private static final String
3939
CLIENT_NAME = "vonage-java-sdk",
40-
CLIENT_VERSION = "8.18.0",
40+
CLIENT_VERSION = "8.19.0",
4141
JAVA_VERSION = System.getProperty("java.version"),
4242
USER_AGENT = String.format("%s/%s java/%s", CLIENT_NAME, CLIENT_VERSION, JAVA_VERSION);
4343

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2025 Vonage
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.vonage.client.conversations;
17+
18+
/**
19+
* Base class for Audio Speaking events.
20+
*
21+
* @since 8.19.0
22+
*/
23+
abstract class AbstractAudioSpeakingEvent extends AbstractChannelEvent<AbstractChannelEvent.Body> {
24+
AbstractAudioSpeakingEvent() {}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2025 Vonage
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.vonage.client.conversations;
17+
18+
import com.fasterxml.jackson.annotation.JsonIgnore;
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.vonage.client.voice.CallDirection;
21+
22+
/**
23+
* Base class for answered and ringing events.
24+
*
25+
* @since 8.19.0
26+
*/
27+
abstract class AbstractCallEvent extends AbstractChannelEvent<AbstractCallEvent.Body> {
28+
AbstractCallEvent() {}
29+
30+
/**
31+
* The main body container for SIP answered / ringing events.
32+
*/
33+
static class Body extends AbstractChannelEvent.Body {
34+
@JsonProperty("direction") CallDirection direction;
35+
}
36+
37+
/**
38+
* The call direction, either {@linkplain CallDirection#INBOUND} or {@linkplain CallDirection#OUTBOUND}.
39+
*
40+
* @return The call direction as an enum, or {@code null} if absent in the response.
41+
*/
42+
@JsonIgnore
43+
public CallDirection getDirection() {
44+
return body != null ? body.direction : null;
45+
}
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* Copyright 2025 Vonage
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.vonage.client.conversations;
17+
18+
import com.fasterxml.jackson.annotation.JsonIgnore;
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.vonage.client.JsonableBaseObject;
21+
22+
/**
23+
* Base class for events with the {@code channel} field.
24+
*
25+
* @since 8.19.0
26+
*/
27+
abstract class AbstractChannelEvent<B extends AbstractChannelEvent.Body> extends EventWithBody<B> {
28+
AbstractChannelEvent() {}
29+
30+
@SuppressWarnings("unchecked")
31+
AbstractChannelEvent(Builder<?, ?, ?> builder) {
32+
super((Event.Builder<? extends EventWithBody<? extends B>, ?>) builder);
33+
}
34+
35+
/**
36+
* The main body container for events with a {@linkplain MemberChannel}.
37+
*/
38+
static class Body extends JsonableBaseObject {
39+
@JsonProperty("channel") MemberChannel channel;
40+
41+
Body() {}
42+
43+
Body(Builder<?, ?, ?> builder) {
44+
channel = builder.channel;
45+
}
46+
}
47+
48+
/**
49+
* The {@code channel} field.
50+
*
51+
* @return The channel object, or {@code null} if absent.
52+
*/
53+
@JsonIgnore
54+
public MemberChannel getChannel() {
55+
return body != null ? body.channel : null;
56+
}
57+
58+
@SuppressWarnings("unchecked")
59+
static abstract class Builder<E extends AbstractChannelEvent<? extends T>, T extends AbstractChannelEvent.Body, B extends Builder<? extends E, ? extends T, ? extends B>> extends EventWithBody.Builder<E, B> {
60+
private MemberChannel channel;
61+
62+
Builder(EventType type) {
63+
super(type);
64+
}
65+
66+
/**
67+
* Sets the channel for the event.
68+
*
69+
* @param channel The channel for the event.
70+
*
71+
* @return This builder.
72+
*/
73+
public B channel(MemberChannel channel) {
74+
this.channel = channel;
75+
return (B) this;
76+
}
77+
}
78+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright 2025 Vonage
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.vonage.client.conversations;
17+
18+
import com.fasterxml.jackson.annotation.JsonIgnore;
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
21+
/**
22+
* Base class for SIP machine detection events.
23+
*
24+
* @since 8.19.0
25+
*/
26+
abstract class AbstractSipMachineEvent extends AbstractChannelEvent<AbstractSipMachineEvent.Body> {
27+
AbstractSipMachineEvent() {}
28+
29+
/**
30+
* The main body container for SIP machine detection events.
31+
*/
32+
static class Body extends AbstractChannelEvent.Body {
33+
@JsonProperty("type") String type;
34+
@JsonProperty("confidence") Integer confidence;
35+
}
36+
37+
/**
38+
* The {@code type} field in the body.
39+
*
40+
* @return The machine detection type as a string, or {@code null} if absent.
41+
*/
42+
@JsonIgnore
43+
public String getBodyType() {
44+
return body != null ? body.type : null;
45+
}
46+
47+
/**
48+
* The {@code confidence} field in the body.
49+
*
50+
* @return The machine detection confidence as an integer, or {@code null} if absent.
51+
*/
52+
@JsonIgnore
53+
public Integer getConfidence() {
54+
return body != null ? body.confidence : null;
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Copyright 2025 Vonage
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.vonage.client.conversations;
17+
18+
import com.fasterxml.jackson.annotation.JsonIgnore;
19+
20+
/**
21+
* Represents an {@link EventType#AUDIO_DTMF} event.
22+
*
23+
* @since 8.19.0
24+
*/
25+
public final class AudioDtmfEvent extends AbstractChannelEvent<AudioDtmfEventBody> {
26+
27+
AudioDtmfEvent() {}
28+
29+
private AudioDtmfEvent(Builder builder) {
30+
super(builder);
31+
body = new AudioDtmfEventBody(builder);
32+
}
33+
34+
/**
35+
* DTMF digits for the event.
36+
*
37+
* @return The DTMF digits as a string.
38+
*/
39+
@JsonIgnore
40+
public String getDigits() {
41+
return body != null ? body.digits : null;
42+
}
43+
44+
/**
45+
* Sequence number for the event.
46+
*
47+
* @return The DTMF sequence as an integer, or {@code null} if unspecified / unknown.
48+
*/
49+
@JsonIgnore
50+
public Integer getDtmfSeq() {
51+
return body != null ? body.dtmfSeq : null;
52+
}
53+
54+
/**
55+
* Entry point for constructing an instance of this class.
56+
*
57+
* @return A new Builder.
58+
*/
59+
public static Builder builder() {
60+
return new Builder();
61+
}
62+
63+
/**
64+
* Builder for setting the Audio DTMF event parameters.
65+
*/
66+
public static final class Builder extends AbstractChannelEvent.Builder<AudioDtmfEvent, AudioDtmfEventBody, Builder> {
67+
String digits;
68+
Integer dtmfSeq;
69+
70+
Builder() {
71+
super(EventType.AUDIO_DTMF);
72+
}
73+
74+
/**
75+
* Set the digits for the event.
76+
*
77+
* @param digits The digits for the event.
78+
*
79+
* @return This builder.
80+
*/
81+
public Builder digits(String digits) {
82+
this.digits = digits;
83+
return this;
84+
}
85+
86+
/**
87+
* Set the DTMF sequence for the event.
88+
*
89+
* @param dtmfSeq The DTMF sequence for the event.
90+
*
91+
* @return This builder.
92+
*/
93+
public Builder dtmfSeq(int dtmfSeq) {
94+
this.dtmfSeq = dtmfSeq;
95+
return this;
96+
}
97+
98+
@Override
99+
public AudioDtmfEvent build() {
100+
return new AudioDtmfEvent(this);
101+
}
102+
}
103+
}

0 commit comments

Comments
 (0)