Skip to content

Implement Native e164.org ENUM Resolution for Outbound Call Routing #28

Description

@thorsager

DESCRIPTION

Summary

We need to implement native support for e164.org ENUM (Telephone Number Mapping) resolution within the outbound routing engine of our custom SIP-based PBX. This feature will allow the PBX to translate dialed E.164 phone numbers into Internet-routable SIP URIs via a fast DNS query, bypassing standard PSTN carrier networks and facilitating free end-to-end VoIP peering.


Architectural Implementation Workflow

  1. Normalization: The PBX dial-plan engine intercepts an outbound call and converts the target number into a fully-qualified E.164 string (e.g., +12025550143).
  2. String Reversal & Formatting: - Strip the leading +.
    • Reverse the digit string.
    • Separate every digit with a dot.
    • Append the e164.org zone.
    • Example string: 3.4.1.0.5.5.5.2.0.2.1.e164.org
  3. DNS Core Resolution: Perform an asynchronous DNS query for standard NAPTR (Naming Authority Pointer) records against the generated domain.
  4. Regex Execution & Routing Hand-off:
    • If the DNS query yields a valid SIP NAPTR record, parse the application regex to construct the target SIP URI (e.g., sip:reception@sip.example.com).
    • Rewrite the outbound INVITE request destination to this SIP URI.
    • Dispatch the call entirely over IP (via standard SIP/TLS core routing).
  5. Failover handling: If the domain returns NXDOMAIN, times out, or contains no usable SIP URIs, fall back immediately and transparently to the next priority wholesale PSTN gateway trunk in the dial plan.

Configuration Specifications

Administrators must be able to manage this feature via the PBX management dashboard/API:

  • Enable ENUM Lookup: Global Boolean switch.
  • Registry Base Domain: Text field defaulting to e164.org (allowing flexibility to test other trees like e164.arpa).
  • Lookup Timeout Multiplier: Timeout constraint in milliseconds (suggested default: 350ms) to safeguard Post-Dial Delay (PDD) from degraded DNS infrastructure.

Relevant Technical Standards & References

1. Official RFC Specifications

2. Ecosystem Documentation

  • e164.org Architecture Registry: The public community repository engine mapping E.164 paths natively to public Voice-over-IP endpoints.
  • RFC 3761 (Obsolete but relevant): Legacy framework definition often referenced by older open-source VoIP components (e.g., early Asterisk/ResIP_Nodes modules) utilizing ENUM logic.

Definition of Done (DoD)

  • Core DNS utility successfully transforms E.164 formatted extensions into fully compliant reversed DNS query zones.
  • Intercept component queries NAPTR structures and successfully processes regex syntax maps to deliver structural SIP targets.
  • Dial-plan failover gracefully catches network latency or non-existent DNS targets, instantly redirecting the call to default SIP carrier trunks without session termination.
  • Integration tests verify outbound SIP INVITE targets the matched domain rather than the default PSTN gateway trunk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions