Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] Sip.Builder(String) drops SIP destinations with an explicit port when the scheme is omitted

Aperta
#982 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
api

Direzione di ricerca

Start at the Sip.Builder(String) constructor in the twiml voice package and trace how the string is parsed into a URI before toXml() serializes it. Reproduce with [email protected]:5060 and confirm the output is <Sip/>. Done when that value serializes as <Sip>[email protected]:5060</Sip> and the existing sip: cases still pass. Ask the maintainers whether a scheme-less address should be prefixed with sip: or kept as given, since the issue leaves that open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

type: bug
Describe the bug

Our call-routing integration accepts a SIP destination in the form user@host:port, without a sip: scheme. When this value is passed to Sip.Builder(String), the Twilio Java SDK silently drops it during TwiML serialization. The generated <Sip> element is empty, so the destination is lost before Twilio receives the request.

Code snippet
import com.twilio.twiml.TwiMLException;
import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.voice.Dial;
import com.twilio.twiml.voice.Sip;

public class Main {
    public static void main(String[] args) throws TwiMLException {
        Sip sip = new Sip.Builder("[email protected]:5060").build();
        Dial dial = new Dial.Builder().sip(sip).build();
        VoiceResponse response = new VoiceResponse.Builder().dial(dial).build();

        System.out.println(response.toXml());
    }
}
Actual behavior

The generated TwiML contains an empty SIP noun:

<Response><Dial><Sip/></Dial></Response>

No SDK error is reported.

Expected behavior

The SDK should preserve this supported destination in the TwiML body:

<Sip>[email protected]:5060</Sip>
twilio-java version

13.0.2

Java version

OpenJDK 21.0.7

Logs or error messages

The SDK does not report an error.

Additional context

The Twilio SDK appears to parse the value as a generic Java URI. The explicit port causes the parser to treat the preceding text as a URI scheme; it rejects the @ and the SDK serializes a null URI as <Sip/>.

Adding sip: makes the SDK preserve the destination, but our integration accepts the address without that prefix.

Lingua principale
Java
Stelle
529
Fork
452
Merge medio
1h 14m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di twilio/twilio-java

Tutte le issue di twilio/twilio-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.