BYOC trunk failover dropping INVITEs with SIP 503 after keepalive timeout

Pushed the quarterly failover test to the Ohio BYOC pool last Tuesday. Primary carrier’s Bandwidth, secondary’s a Twilio SIP trunk. Switched the trunk group priority in the admin console, flipped the failover logic to manual override, and started pumping test calls through flow fl-6612-jkr. Architect’s running v2024.4.2. First thirty calls bridged fine. Then the secondary trunk started rejecting INVITEs with a SIP 503 Service Unavailable. Console shows the registration state stays Registered, but the keepalive packets are timing out after exactly 45 seconds. SIP signaling is locked to port 5061 with TLS. Codec list is set to G.711ulaw, G.729, and OPUS. Bandwidth usually negotiates on G.711, but Twilio’s pushing OPUS first and the trunk object seems to drop the SDP answer.

Checked the raw SIP trace in the debug logs. The initial REGISTER hits the Twilio edge node without a hitch. Status code 200 OK comes back with a 60-second expires header. Keepalives are firing every 15 seconds. Around minute two, the secondary carrier starts dropping the OPTIONS pings. Genesys keeps retrying the INVITE, hits the 503, and the call object times out after three retries. Flow just routes to the voicemail action.

Trunk utilization dashboard shows zero active sessions on the secondary pool, but the SIP registration status stubbornly stays green. Restarted the trunk object, cleared the SIP cache, even swapped the outbound routing rule to force a fresh dial pattern. Same 503 behavior. Bandwidth support says their side’s clean, Twilio’s ticket is still pending. Console throws a TRUNK_SIP_NEGOTIATION_FAILURE right before the drop.

INVITE sip:8005550199@twilio-sip-edge.com SIP/2.0
Via: SIP/2.0/TLS 10.0.4.12:5061;branch=z9hG4bK-7721
Contact: <sip:genesys-outbound@10.0.4.12:5061;transport=tls>
Content-Type: application/sdp
Content-Length: 284

v=0
o=- 12345 67890 IN IP4 10.0.4.12
s=-
c=IN IP4 10.0.4.12
m=audio 5061 UDP/TLS/RTP/SAVPF 8 9 101
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 OPUS/48000/2

Twilio’s rejecting the SDP on the a=rtpmap line. SDP answer never comes back. Trunk just hangs there until the timeout. Failover logic should be routing to the next carrier automatically, but it’s stuck retrying the same 503. Adjusted the keepalive interval to 30 seconds, bumped the retry limit to 5. Didn’t change a thing. SIP trace shows the OPTIONS packet hitting the carrier edge, then radio silence. Console keeps logging the same TRUNK_SIP_NEGOTIATION_FAILURE every 12 seconds. Flow just sits there waiting for a media path that never materializes. SIP trace stops updating after the third retry attempt.