IOSOR Learn
Detect SIP REFER Transfer Loops on Inbound DID Routes
Audit inbound SIP trunk REFER handling to prevent transfer loops that cause call drops or one-way audio before routing production traffic across carrier partners.
Lead Telecom & Routing Architect · Lausanne, CH
Operators must verify that inbound SIP REFER transfers terminate cleanly without re-inviting the original call leg back into the same trunk group, which creates signaling loops and media loss. This audit gates partner selection for loop-free failover paths by confirming each carrier honors Refer-To headers with distinct Call-ID and Via branches.
Capture Baseline SIP Dialog Flow
Record a full INVITE→REFER→NOTIFY sequence on a test DID using tcpdump or SIPp. Confirm the initial INVITE carries a unique Call-ID and the REFER's Refer-To header references a target URI outside the inbound trunk's IP range. Any REFER that mirrors the original Call-ID or Via branch signals a loop risk. Set a 500ms NOTIFY timeout threshold; verify DLR webhook receipt within 2s of REFER completion. Edge case: delayed NOTIFYs exceeding 5s indicate SBC buffering loops.
Validate Refer-To Header Rewriting Rules
Inspect SBC or proxy configs for Refer-To rewriting: the target URI must replace the inbound trunk's domain with the egress carrier's domain. Carriers that preserve the original Request-URI in Refer-To cause hairpin loops. Document each partner's rewrite behavior in a comparison matrix. During pre-flight verification, validate that automatic failover thresholds trigger deterministic rerouting without duplicating outbound segments or exhausting retry backoff budgets under peak regional load. Edge case: 404 responses on rewritten URIs indicate domain mapping failures.
Test Transfer Depth and Max-Forwards Decrement
Initiate chained transfers (A→B→C→D) across two carrier hops. Verify Max-Forwards decrements at each hop and that no hop re-injects the call into a previously visited trunk group. Capture SIP 483 Too Many Hops responses as loop evidence. Set max transfer depth to 5 hops; alert if Max-Forwards remains unchanged after 3 hops. Edge case: loops where Max-Forwards is reset by intermediate proxies.
Correlate Media Path with Signaling Path
Use RTP timestamps and SSRC values to confirm media follows the signaled path. A loop often shows duplicate SSRC streams arriving from the same ingress IP. Flag any partner where media and signaling paths diverge after REFER.
Automate Regression Checks in CI/CD
Embed SIPp scenarios that simulate REFER transfers into nightly pipeline runs. Alert on new 483 responses, duplicate Call-IDs, or media SSRC collisions. Store pcaps for forensic comparison when a partner changes SBC firmware.
Start with IOSOR
Compare verified partner routes for inbound DID REFER handling using the route comparison tool to select loop-free failover paths. Cross-reference findings with DID Inbound SIP Failover Capacity Check, DID Inbound SIP Header Enrichment Audit, and DID Inbound SIP TLS Certificate Rotation Gate.
IOSOR takeaway
Record a full INVITE→REFER→NOTIFY sequence on a test DID using tcpdump or SIPp. Store pcaps for forensic comparison when a partner changes SBC firmware (/tools/brief · DLR / webhook).
Was this guide helpful?
Related guides
- Audit Outbound Trunk Portability Before You Commit a Number Cutover
Verify outbound trunk portability, carrier handoff and failover for every prospective voice or SIP route before you commit a DID number cutover.
- DID Provisioning Latency vs Activation SLA: Compare Before You Commit
Check whether a number provider's claimed provisioning turnaround really meets your activation SLA: measure order-to-live latency, confirm refund terms, then compare verified routes.
- Number Porting Window Cutover Readiness: Verify Routes Before You Switch
Before scheduling a DID port, confirm carrier acceptance, route provisioning, and failover readiness so cutover does not drop calls or drift billing.












