[BUG] Sip.Builder(String) drops SIP destinations with an explicit port when the scheme is omitted
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
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
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
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di twilio/twilio-java
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
twilio/twilio-java#976 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
twilio/twilio-java#975 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
twilio/twilio-java#960 ·
-
MessageIntent is not supported in the Java SDKForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
twilio/twilio-java#950 · 2 commenti ·
-
Jackson 3 supportForse già presa @manisha1997 l’ha presa 238 giorni fa. Aperta
twilio/twilio-java#938 · 2 commenti · 10 reazioni · 2 assegnatari ·
Tutte le issue di twilio/twilio-java
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
MCModderAnchor/TACZ#758 ·
-
agent-java community triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
elastic/apm-agent-java#4594 ·
I maintainer di solito rispondono entro 1 giorno
-
area/plugin good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kestra-io/plugin-soda#137 ·
-
area/plugin good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kestra-io/plugin-aws#816 ·
I maintainer di solito rispondono entro 2 giorni
-
area/plugin good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
kestra-io/plugin-kestra#200 ·
I maintainer di solito rispondono entro 1 giorno