Skip to content

feat: complete V3.5 SipConfiguration attributes for API 2026-04-16#51

Open
Fivell wants to merge 6 commits intomainfrom
feat/incoming-auth-credentials
Open

feat: complete V3.5 SipConfiguration attributes for API 2026-04-16#51
Fivell wants to merge 6 commits intomainfrom
feat/incoming-auth-credentials

Conversation

@Fivell
Copy link
Copy Markdown
Member

@Fivell Fivell commented Apr 30, 2026

Summary

Completes the V3.5 (2026-04-16) SipConfiguration attribute set. Mirrors the Ruby reference PR #80.

5 writable attributes (missed during the original 2026-04-16 rollout)

These exist on the server form (apps/v3_api/app/forms/v3_5/voice_in_configuration/sip_form.rb), are exercised in the server's voice_in_trunks_controller_spec.rb, and are listed in the public 2026-04-16 changelog, but were absent from both this SDK and the public Postman collection. Per project source-of-truth ranking (server > rspec > Postman), server is authoritative — added all five:

Java field Wire Type
enabledSipRegistration enabled_sip_registration Boolean
useDidInRuri use_did_in_ruri Boolean
networkProtocolPriority network_protocol_priority NetworkProtocolPriority enum
diversionInjectMode diversion_inject_mode DiversionInjectMode enum
cnamLookup cnam_lookup Boolean

Two new enums added:

  • DiversionInjectModenone, did_number
  • NetworkProtocolPriorityforce_ipv4, force_ipv6, any, prefer_ipv4, prefer_ipv6

2 read-only attributes

Server-generated, returned only when enabledSipRegistration: true:

  • incomingAuthUsername
  • incomingAuthPassword

The API rejects writes (400 Param not allowed). Both fields are annotated with @JsonProperty(access = JsonProperty.Access.WRITE_ONLY), which in Jackson's terminology means "deserialize from JSON, never serialize back to JSON" — exactly the read-only-on-write semantics required.

Misc

  • Bumped to 4.0.1 in build.gradle.kts.

Test plan

  • ./gradlew test — passes
  • New tests:
    • Deserialize a SIP configuration response with all 5 writable + 2 read-only fields populated; assert getters return correct values.
    • Serialize a SipConfiguration that has the 2 read-only fields populated (simulating round-trip after a GET); assert the resulting JSON does NOT include incoming_auth_username / incoming_auth_password. This is the regression-prevention test for the read-only contract.
  • CI green
  • After merge: tag 4.0.1, JitPack auto-builds, publish GitHub Release

Fivell added 6 commits April 30, 2026 13:29
Bring the Java SipConfiguration in line with the V3.5 server form.
Splits into two pieces:

1. Five writable V3.5 attributes that were missed during the original
   2026-04-16 rollout (declared on the server form, exercised in the
   server's request specs, but absent from both the SDK and the
   public Postman collection):
   - enabledSipRegistration (Boolean) -- enables SIP registration;
     the server then generates incoming_auth_* credentials and
     rejects a non-blank port.
   - useDidInRuri (Boolean) -- DID number in R-URI; requires SIP
     registration enabled.
   - networkProtocolPriority (enum) --
     force_ipv4 | force_ipv6 | any | prefer_ipv4 | prefer_ipv6.
   - diversionInjectMode (enum) -- none | did_number.
   - cnamLookup (Boolean) -- enables CNAM resolution.

2. Two read-only attributes returned when SIP registration is
   enabled:
   - incomingAuthUsername
   - incomingAuthPassword

   Both are server-generated and only present in responses; the API
   returns 400 Param not allowed if a client tries to write them.
   Annotated with @JsonProperty(access = WRITE_ONLY) so Jackson
   deserializes them from server responses but never echoes them
   back when serializing the configuration to a request body.

Bump to 4.0.1.
Sandbox testing confirmed that when enabled_sip_registration is true,
both 'host' and 'port' must be blank (server returns 422 otherwise).
And when disabling sip_registration on an existing trunk, the same
PATCH must also set 'host' to a non-blank value and 'use_did_in_ruri'
to false.
Captured wire shape from sandbox: when enabled_sip_registration is true,
host/port/username come back as null. Drop the misleading
host='example.com' from the test fixtures and reflect the real
read-shape.
The 2026-04-16 server returns six new keys on every SIP configuration
response: network_protocol_priority, enabled_sip_registration,
use_did_in_ruri, diversion_relay_policy, diversion_inject_mode,
cnam_lookup, incoming_auth_username, incoming_auth_password.

Patch every existing voice_in_trunks SIP-response fixture to include
the V3.5 default shape captured against the live sandbox API.
Demonstrates user-facing usage of the new V3.5 SIP-configuration
attributes by setting them in the SIP create-with-rerouting test and
updating the matching request fixture.
- create-with-rerouting: send use_did_in_ruri=false (documents field;
  server returns 422 if true without enabled_sip_registration).
  Align response fixture diversion_relay_policy=as_is and
  cnam_lookup=true to match what the request sends.
- New testCreateWithEnabledSipRegistrationReturnsPopulatedIncomingAuthCredentials:
  asserts that when SDK sends enabled_sip_registration=true, the response
  surfaces server-generated incoming_auth_username and
  incoming_auth_password as populated (not null).
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant