twilio / twilio/twilio-java

TwiML `<ConversationRelay>` emits 4 attributes in lowercase instead of documented camelCase

Open Beginner friendly
#975 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
527
Forks
453
Avg merge
10h 59m
Merged PRs (30d)
6

Description

Summary

ConversationRelay serializes four attributes in all-lowercase, but the ConversationRelay TwiML docs document them in camelCase. XML attributes are case-sensitive, so these are silently ignored by the TwiML parser — the setting appears to apply but has no effect, with no error surfaced.

Affected attributes

src/main/java/com/twilio/twiml/voice/ConversationRelay.java:

Line Emitted Documented
165 backgroundnoisereduction backgroundNoiseReduction
168 speechtimeout speechTimeout
171 deepgramsmartformat deepgramSmartFormat
174 ignorebackchannel ignoreBackchannel

Every other attribute in the same class is correct camelCase (ttsLanguage, transcriptionProvider, speechModel, interruptSensitivity, …), and Gather.java:261 correctly emits speechTimeout for the same concept.

Reproduction
String xml = new VoiceResponse.Builder()
        .connect(new Connect.Builder()
                .conversationRelay(new ConversationRelay.Builder()
                        .url("wss://example.com/ws")
                        .speechtimeout("2000")
                        .build())
                .build())
        .build()
        .toXml();

Produces <ConversationRelay url="wss://example.com/ws" speechtimeout="2000"/>; expected speechTimeout="2000".

Impact

Observed in production: a speechtimeout="2000" setting had no effect on end-of-speech reporting. Measured delay from end of caller speech to the prompt WebSocket frame across four utterances in one call was 0.45s / 0.61s / 0.95s / 1.17; all well under the configured 2000ms, consistent with the attribute being dropped and the default auto applying.

The failure is silent, which makes it costly: the config looks applied in code review and in the generated TwiML, and only careful timing analysis reveals it isn't.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/main/java/com/twilio/twiml/voice/ConversationRelay.java at lines 165, 168, 171, and 174, then run the provided VoiceResponse reproduction to inspect the generated XML. Update the four emitted attribute names to match the documented camelCase forms and verify the output uses backgroundNoiseReduction, speechTimeout, deepgramSmartFormat, and ignoreBackchannel.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.