[BUG] Sip.Builder(String) drops SIP destinations with an explicit port when the scheme is omitted
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 529
- Forks
- 453
- Avg merge
- 1h 14m
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from twilio/twilio-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
twilio/twilio-java#976 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
twilio/twilio-java#975 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
twilio/twilio-java#960 ·
-
MessageIntent is not supported in the Java SDKMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
twilio/twilio-java#950 · 2 comments ·
-
Jackson 3 supportPossibly taken @manisha1997 claimed this 233 days ago. Open
twilio/twilio-java#938 · 2 comments · 10 reactions · 2 assignees ·
All issues in twilio/twilio-java
Similar issues
-
enhancement good first issue
Difficulty 2/5 Half a day Newbie friendliness 66/100
apache/fineract-consumer-facing#175 ·
Maintainers usually reply within 1 day
-
[BUG] 订单:会员凭订单号即可取消其他会员的待付款订单(取消接口不校验订单归属)Possibly taken @dadiyang claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
macrozheng/mall#1016 ·
-
[Bug] The producer summary counts an unreported client version as a second version and warns about a version mixPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
apache/rocketmq-dashboard#6110 ·
Maintainers usually reply within 4 days
-
Feature:Resolution
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
intellij-elixir/intellij-elixir#4396 ·
Maintainers usually reply within 1 day
-
Python 3.15 supportPossibly taken @amnesiaof claimed this today. OpenL: python L: python:uv
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dependabot/dependabot-core#16524 · 1 comment ·
Maintainers usually reply within 1 day